Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

wujunjie 7 years ago
parent
commit
c82e4ce860
28 changed files with 1067 additions and 614 deletions
  1. 32 59
      patient-co/patient-co-statistics/src/main/resources/application.yml
  2. 19 3
      patient-co/patient-co-wlyy-job/pom.xml
  3. 24 13
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/redis/HealthAricleListener.java
  4. 90 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/activemq/StartListener.java
  5. 70 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/config/ActiveMQConfig.java
  6. 0 35
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/config/RedisConfig.java
  7. 93 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/config/es/ElasticFactory.java
  8. 49 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/config/es/ElastricSearchSave.java
  9. 0 10
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/redis/RedisQueueListener.java
  10. 28 14
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/redis/RedisThread.java
  11. 125 0
      patient-co/patient-co-wlyy-job/src/main/resources/application-dev.yml
  12. 118 0
      patient-co/patient-co-wlyy-job/src/main/resources/application-devtest.yml
  13. 125 0
      patient-co/patient-co-wlyy-job/src/main/resources/application-prod.yml
  14. 122 0
      patient-co/patient-co-wlyy-job/src/main/resources/application-test.yml
  15. 1 412
      patient-co/patient-co-wlyy-job/src/main/resources/application.yml
  16. 23 5
      patient-co/patient-co-wlyy/pom.xml
  17. 59 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/ActiveMQConfig.java
  18. 0 31
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/ActiveMQProduceConfig.java
  19. 0 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/es/ElasticFactory.java
  20. 0 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/es/ElastricSearchSave.java
  21. 20 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcEduArticleController.java
  22. 6 4
      patient-co/patient-co-wlyy/src/main/resources/application-dev.yml
  23. 6 3
      patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml
  24. 6 3
      patient-co/patient-co-wlyy/src/main/resources/application-local.yml
  25. 6 3
      patient-co/patient-co-wlyy/src/main/resources/application-localtest.yml
  26. 6 3
      patient-co/patient-co-wlyy/src/main/resources/application-prod.yml
  27. 7 4
      patient-co/patient-co-wlyy/src/main/resources/application-test.yml
  28. 32 3
      pom.xml

+ 32 - 59
patient-co/patient-co-statistics/src/main/resources/application.yml

@ -130,12 +130,6 @@ spring:
    host: 172.19.103.88
    port: 6379 # Redis server port.
fv:
  jdbc:
    driver: com.mysql.jdbc.Driver
    url: jdbc:mysql://172.19.103.85/data_for_stats?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
    username: luofaqiang
    password: luofaqiang
---
spring:
@ -163,13 +157,6 @@ spring:
    cron : 0 5 0 * * ?
    jobId : FOLLOWUP_PLAN_JOB
fv:
  jdbc:
    driver: com.mysql.jdbc.Driver
    url: jdbc:mysql://172.17.110.160/fv?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
    username: ssgg
    password: ssgg
systemConfig:
  msg_push_server: http://127.0.0.1:3000
@ -180,34 +167,27 @@ spring:
  datasource:
    primaryReadWrite:
      url: jdbc:mysql://59.61.92.90:8079/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      url: jdbc:mysql://10.59.22.7:3306/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: wlyy
      password: jkzlehr@123
    primaryRead:
      url: jdbc:mysql://59.61.92.90:8079/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      url: jdbc:mysql://10.59.22.7:3306/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: wlyy
      password: jkzlehr@123
    im: #im库:
      url: jdbc:mysql://59.61.92.90:8079/im?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      url: jdbc:mysql://10.59.22.7:3306/im?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: im
      password: im!)123
  redis:
    host: 192.168.120.14 # Redis server host.
    host: 10.95.22.142 # Redis server host.
    port: 6380 # Redis server port.
    password: jkzl_ehr
    password: jkzlehr
  followupMessage:
    cron : 0 5 0 * * ?
    jobId : FOLLOWUP_PLAN_JOB
fv:
  jdbc:
    driver: com.mysql.jdbc.Driver
    url: jdbc:mysql://59.61.92.90:8082/fv?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
    username: wlyy
    password: jkzlehr@123
systemConfig:
  msg_push_server: http://127.0.0.1:3000
@ -257,38 +237,31 @@ systemConfig:
---
  spring:
    profiles: lxx
    datasource:
      primaryReadWrite: #只读库 主库
        url: jdbc:mysql://172.19.103.77/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
        username: root
        password: 123456
      primaryRead: #只读库 从库
        url: jdbc:mysql://172.19.103.77/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
        username: root
        password: 123456
      im: #im库
        url: jdbc:mysql://172.19.103.77/ichat?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
        username: root
        password: 123456
    redis:
      host: 172.19.103.88  # Redis server host.
      port: 6379 # Redis server port.
    followupMessage:
      cron : 0 5 0 * * ?
      jobId : FOLLOWUP_PLAN_JOB
  fv:
    jdbc:
      driver: com.mysql.jdbc.Driver
      url: jdbc:mysql://172.19.103.77/fv?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: root
      password: 123456
spring:
  profiles: prod-bak
  datasource:
    primaryReadWrite:
      url: jdbc:mysql://10.59.22.7:3306/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: wlyy
      password: jkzlehr@123
    primaryRead:
      url: jdbc:mysql://10.59.22.7:3306/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: wlyy
      password: jkzlehr@123
    im: #im库:
      url: jdbc:mysql://10.59.22.7:3306/im?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: im
      password: im!)123
  systemConfig:
    msg_push_server: http://172.19.103.76:3000
  redis:
    host: 192.168.120.14 # Redis server host.
    port: 6380 # Redis server port.
    password: jkzl_ehr
  followupMessage:
    cron : 0 5 0 * * ?
    jobId : FOLLOWUP_PLAN_JOB
systemConfig:
  msg_push_server: http://127.0.0.1:3000

+ 19 - 3
patient-co/patient-co-wlyy-job/pom.xml

@ -129,12 +129,28 @@
            <groupId>org.springframework</groupId>
            <artifactId>spring-jms</artifactId>
        </dependency>
        <!-- spring end -->
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-all</artifactId>
            <artifactId>activemq-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-spring</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-broker</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-jaas</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-camel</artifactId>
        </dependency>
        <!-- spring end -->
        <!--Swagger start -->
        <dependency>
            <groupId>io.springfox</groupId>

+ 24 - 13
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/redis/HealthAricleListener.java

@ -1,4 +1,4 @@
package com.yihu.wlyy.redis;
package com.yihu.wlyy.activemq;
import com.yihu.es.entity.HealthEduArticlePatient;
import com.yihu.wlyy.entity.patient.Patient;
@ -9,23 +9,28 @@ import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.ImUtill;
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
import java.util.List;
/**
 * Created by chenweida on 2017/9/8.
 * 监听消费
 * Created by chenweida on 2017/9/9.
 * 健康教育文章监听
 */
@Component
public class HealthAricleListener implements RedisQueueListener<String> {
    private Logger logger = LoggerFactory.getLogger(HealthAricleListener.class);
public class HealthArtListener implements MessageListener {
    private Logger logger = LoggerFactory.getLogger(HealthArtListener.class);
    @Autowired
    private WeiXinOpenIdUtils weiXinOpenIdUtils;
    @Autowired
@ -38,13 +43,20 @@ public class HealthAricleListener implements RedisQueueListener<String> {
    private WeiXinAccessTokenUtils weiXinAccessTokenUtils;
    @Override
    public void onMessage(String message) {
        HealthEduArticlePatient healthEduArticlePatient = (HealthEduArticlePatient) net.sf.json.JSONObject.toBean(net.sf.json.JSONObject.fromObject(message), HealthEduArticlePatient.class);
        //保存到ES中
    public void onMessage(Message message) {
        try {
            TextMessage textMessage = (TextMessage) message;
            JSONObject jo = JSONObject.fromObject(textMessage.getText());
            logger.info(jo.toString());
        //发送IM消息
            //返回服务器表示消息消费成功
            message.acknowledge();
        } catch (JMSException e) {
            e.printStackTrace();
        }
    }
    //发送到IM和
    private void sendWxTemplateAndIM(List<HealthEduArticlePatient> healthEduArticlePatients, Integer sendType) {
        String endMsg = "";//"为了您的健康," + doctor.getName() + "医生给您发送了一篇患教文章,请仔细查阅,如有问题,可随时咨询医生。";
@ -61,7 +73,7 @@ public class HealthAricleListener implements RedisQueueListener<String> {
                    }
                }
                // 推送消息给微信端
                JSONObject json = new JSONObject();
                org.json.JSONObject json = new org.json.JSONObject();
                json.put("first", patient.getName() + ",您好! " + one.getSendName() + "医生给您发来了一篇患教文章");
                json.put("toUser", patient.getCode());
                json.put("article", one.getId() + "");
@ -81,7 +93,7 @@ public class HealthAricleListener implements RedisQueueListener<String> {
                JSONArray jsonArray = weiXinOpenIdUtils.getAgentOpenId(patient.getCode(), patient.getOpenid());
                if (jsonArray != null && jsonArray.length() > 0) {
                    for (int i = 0; i < jsonArray.length(); i++) {
                        JSONObject j = jsonArray.getJSONObject(i);
                        org.json.JSONObject j = jsonArray.getJSONObject(i);
                        Patient member = (Patient) j.get("member");
                        json.remove("toUser");
                        json.put("toUser", member.getCode());
@ -101,5 +113,4 @@ public class HealthAricleListener implements RedisQueueListener<String> {
            }
        });
    }
}

+ 90 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/activemq/StartListener.java

@ -0,0 +1,90 @@
package com.yihu.wlyy.activemq;
import com.yihu.wlyy.util.SpringUtil;
import org.apache.activemq.ActiveMQSession;
import org.apache.activemq.command.ActiveMQQueue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jms.connection.CachingConnectionFactory;
import org.springframework.jms.listener.DefaultMessageListenerContainer;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.jms.MessageListener;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by chenweida on 2017/9/9.
 */
@Component
public class StartListener {
    private static Map<String, DefaultMessageListenerContainer> holder = new HashMap<String, DefaultMessageListenerContainer>();
    private Logger logger = LoggerFactory.getLogger(StartListener.class);
    @Value("${activemq.queue.healtHarticleQueue}")
    private String healtHarticleQueue;
    @Value("${activemq.consumers.count}")
    private Integer count;
    @Autowired
    private HealthArtListener healthArtListener;
    @Autowired
    private CachingConnectionFactory cachingConnectionFactory;
    @PostConstruct
    public void startListener() {
        startHealthArticQueueListener();
    }
    /**
     * 启动健康教育消费
     */
    private void startHealthArticQueueListener() {
        try {
            //启动监听
            startReceiverByQueueName(healthArtListener, healtHarticleQueue);
            logger.info("start HealthArtListener success");
        } catch (Exception e) {
            logger.error("start HealthArtListener error");
        }
    }
    /**
     * 启动
     *
     * @param receiver
     * @param queueName
     */
    private void startReceiverByQueueName(MessageListener receiver, String queueName) {
        if (holder.get(queueName) != null) {
            return;
        }
        ActiveMQQueue destination = new ActiveMQQueue(queueName);
        DefaultMessageListenerContainer listenerContainer = new DefaultMessageListenerContainer();
        // 监听容器属性的配置
        listenerContainer.setConnectionFactory(cachingConnectionFactory);
        // 设置目的地
        listenerContainer.setDestination(destination);
        // 设置监听器
        listenerContainer.setMessageListener(receiver);
        // 设置消费者集群数
        int consumers = count;
        listenerContainer.setConcurrentConsumers(2);
        listenerContainer.setMaxConcurrentConsumers(consumers);
        // 设置监听队列还是主题 默认是队列
        listenerContainer.setPubSubNoLocal(false);
        // listenerContainer.setAcceptMessagesWhileStopping(true);
        // 设置应答模式 默认是4
        listenerContainer.setSessionAcknowledgeMode(ActiveMQSession.INDIVIDUAL_ACKNOWLEDGE);
        // 设置是否启动事物 默认不开启
        listenerContainer.setSessionTransacted(false);
        // 将监听容器保存在holder中
        holder.put(queueName, listenerContainer);
        listenerContainer.initialize();
        // 启动监听
        listenerContainer.start();
    }
}

+ 70 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/config/ActiveMQConfig.java

@ -0,0 +1,70 @@
package com.yihu.wlyy.config;
import com.yihu.wlyy.activemq.HealthArtListener;
import com.yihu.wlyy.util.SpringUtil;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.ActiveMQSession;
import org.apache.activemq.command.ActiveMQQueue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.jms.annotation.EnableJms;
import org.springframework.jms.connection.CachingConnectionFactory;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.listener.DefaultMessageListenerContainer;
import javax.annotation.PostConstruct;
import javax.jms.MessageListener;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by chenweida on 2017/9/9.
 * 生产者配置
 */
@EnableJms
@Configuration
public class ActiveMQConfig {
   @Value("${activemq.username}")
    private String username;
    @Value("${activemq.password}")
    private String password;
    @Value("${activemq.url}")
    private String url;
    @Bean
    public ActiveMQConnectionFactory activeMQConnectionFactory() {
        ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory(username, password, url);
        //设置异步发送
        activeMQConnectionFactory.setUseAsyncSend(true);
        return activeMQConnectionFactory;
    }
    /**
     * 缓存session链接
     *
     * @return
     */
    @Bean
    @Primary
    public CachingConnectionFactory CachingConnectionFactory() {
        CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory();
        //目标ConnectionFactory对应真实的可以产生JMS Connection的ConnectionFactory
        cachingConnectionFactory.setTargetConnectionFactory(activeMQConnectionFactory());
        //Session缓存数量,这里属性也可以直接在这里配置
        cachingConnectionFactory.setSessionCacheSize(100);
        return cachingConnectionFactory;
    }
    @Bean
    public JmsTemplate jmsTemplate() {
        JmsTemplate jmsTemplate = new JmsTemplate();
        jmsTemplate.setConnectionFactory(CachingConnectionFactory());
        return jmsTemplate;
    }
}

+ 0 - 35
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/config/RedisConfig.java

@ -1,35 +0,0 @@
package com.yihu.wlyy.config;
import com.yihu.wlyy.redis.RedisQueueListener;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.listener.PatternTopic;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
import org.springframework.data.redis.listener.adapter.MessageListenerAdapter;
import org.springframework.stereotype.Component;
/**
 * Created by chenweida on 2017/9/8.
 */
@Component
public class RedisConfig {
    private String channelName = "healthArticleChannel";
    @Bean
    RedisMessageListenerContainer containerHealthArticleChannel(RedisConnectionFactory connectionFactory,
                                                                MessageListenerAdapter listenerAdapter) {
        RedisMessageListenerContainer container = new RedisMessageListenerContainer();
        container.setConnectionFactory(connectionFactory);
        container.addMessageListener(listenerAdapter, new PatternTopic(channelName));//注册监听器
        return container;
    }
    //添加消息监听
    @Bean(name = "listenerAdapterHealthArticleChannel")
    MessageListenerAdapter listenerAdapterHealthArticleChannel(RedisQueueListener receiver) {
        return new MessageListenerAdapter(receiver, "onMessage");
    }
}

+ 93 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/config/es/ElasticFactory.java

@ -0,0 +1,93 @@
package com.yihu.wlyy.config.es;
import io.searchbox.client.JestClient;
import io.searchbox.client.JestClientFactory;
import io.searchbox.client.config.HttpClientConfig;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import javax.annotation.PostConstruct;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.concurrent.TimeUnit;
/**
 * Created by chenweida on 2017/6/5.
 */
@Component
public class ElasticFactory {
    private static JestClientFactory factory = null;
    @Value("${es.host}")
    private String esHost;
    @Value("${es.port}")
    private String port;
    @Value("${es.tPort}")
    private String tPort;
    @Value("${es.clusterName}")
    private String clusterName;
//-----------------------------------jestClient----------------------------------------
    /**
     * @param "http://localhost:9200"
     * @return
     */
    @PostConstruct
    public JestClient getJestClient() {
        synchronized (ElasticFactory.class) {
            if (factory == null) {
                //初始化链接
                init();
            }
        }
        return factory.getObject();
    }
    /**
     * 初始化链接
     */
    public synchronized void init() {
        // Construct a new Jest client according to configuration via factory
        factory = new JestClientFactory();
        factory.setHttpClientConfig(new HttpClientConfig
                .Builder("http://" + esHost + ":" + port)
                .multiThreaded(true)
                .maxTotalConnection(50)// 最大链接
                .maxConnectionIdleTime(120, TimeUnit.SECONDS)//链接等待时间
                .connTimeout(30000)
                .discoveryEnabled(true)
                .readTimeout(30000)//30秒
                .build());//得到链接
    }
    //-----------------------------------TransportClient----------------------------------------
    private Client transportClient;
    public Client getTransportClient() {
        try {
            initTranClient();
            return transportClient;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    private synchronized void initTranClient() throws UnknownHostException {
        if (transportClient == null) {
            Settings settings = Settings.settingsBuilder()
                    .put("client.transport.sniff", true)//开启嗅探功能
                    .put("cluster.name", StringUtils.isEmpty(clusterName) ? "jkzl" : clusterName)//默认集群名字是jkzl
                    .build();
            transportClient = TransportClient.builder().settings(settings).build()
                    .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(esHost), Integer.valueOf(tPort)));
        }
    }
}

+ 49 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/config/es/ElastricSearchSave.java

@ -0,0 +1,49 @@
package com.yihu.wlyy.config.es;
import io.searchbox.client.JestClient;
import io.searchbox.core.Bulk;
import io.searchbox.core.BulkResult;
import io.searchbox.core.Index;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import java.util.List;
;
/**
 * Created by chenweida on 2017/6/2.
 */
@Component
@Scope("prototype")
public class ElastricSearchSave {
    private Logger logger = LoggerFactory.getLogger(ElastricSearchSave.class);
    @Autowired
    private ElasticFactory elasticFactory;
    public Boolean save(List  sms,String esIndex,String esType) {
        try {
            //得到链接
            JestClient jestClient = elasticFactory.getJestClient();
            Bulk.Builder bulk = new Bulk.Builder().defaultIndex(esIndex).defaultType(esType);
            for (Object obj : sms) {
                Index index = new Index.Builder(obj).build();
                bulk.addAction(index);
            }
            BulkResult br = jestClient.execute(bulk.build());
            logger.info("save data count:" + sms.size());
            logger.info("save flag:" + br.isSucceeded());
            return br.isSucceeded();
        } catch (Exception e) {
            e.printStackTrace();
            logger.error(" save error :" + e.getMessage());
        }
        return null;
    }
}

+ 0 - 10
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/redis/RedisQueueListener.java

@ -1,10 +0,0 @@
package com.yihu.wlyy.redis;
/**
 * Created by chenweida on 2017/9/8.
 * redis 队列监听
 */
public interface RedisQueueListener<T> {
    void onMessage(T value);
}

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

@ -34,40 +34,54 @@ public class RedisThread implements Runnable {
    private PrescriptionService prescriptionService;
    @Autowired
    private PushMsgTask pushMsgTask;
    //redis链接池
    private JedisPool pool;
    @Override
    public void run() {
        String key = SystemConf.getInstance().getSystemProperties().getProperty("redis_prescription_title");
        JedisPoolConfig poolConfig = new JedisPoolConfig();
        poolConfig.setMaxIdle(8);
        poolConfig.setMaxTotal(8);
        poolConfig.setMaxWaitMillis(-1);
        poolConfig.setMinIdle(1);
        JedisPool pool = null;
        if(StringUtils.isNotBlank(password)){
            pool = new JedisPool(poolConfig,host,port,100000,password);
        }else {
            pool = new JedisPool(poolConfig,host,port,100000);
        }
        //初始化链接池
        initPool();
        while (true){
            try {
                Jedis jedis = pool.getResource();
                String message = jedis.rpop(key);
                if(StringUtils.isEmpty(message)){
                    Thread.sleep(1000L);//如果没有读取到记录,等待1秒
                    sleep(1000L);//如果没有读取到记录,等待1秒
                }else {
                    redisMessage(message);
                }
            }catch (Exception e){
                e.printStackTrace();
                logger.info(e.getMessage());
                sleep(5000L);
                initPool();
            }
        }
    }
    public void sleep(Long time){
        try {
            Thread.sleep(time);
        }catch (Exception e){
            logger.error(e.getMessage());
        }
    }
    public void initPool(){
        JedisPoolConfig poolConfig = new JedisPoolConfig();
        poolConfig.setMaxIdle(8);
        poolConfig.setMaxTotal(8);
        poolConfig.setMaxWaitMillis(-1);
        poolConfig.setMinIdle(1);
        if(StringUtils.isNotBlank(password)){
            pool = new JedisPool(poolConfig,host,port,100000,password);
        }else {
            pool = new JedisPool(poolConfig,host,port,100000);
        }
    }
    public void redisMessage(String message){
        logger.info("redis_onMessage...:"+message);
        //this.unsubscribe();

+ 125 - 0
patient-co/patient-co-wlyy-job/src/main/resources/application-dev.yml

@ -0,0 +1,125 @@
##开发的配置
spring:
  profiles: dev
  datasource:
    wlyy:
      url: jdbc:mysql://172.19.103.77/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: root
      password: 123456
    health:
      url: jdbc:mysql://172.19.103.77/device?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: root
      password: 123456
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
#    password: jkzl_ehr
channel:
  redis:
    host: 59.61.92.90  # Redis server host.
    port: 9054 # Redis server port.
    password: jkzlehr
server:
  server_url: http://weixin.xmtyw.cn/wlyy-dev/
im:
  im_list_get: http://172.19.103.88:3000/
  data_base_name: ichat
wechat:
  appId: wxd03f859efdf0873d
  appSecret: 2935b54b53a957d9516c920a544f2537
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fweixin.xmtyw.cn%2fwlyy-dev
  accId: gh_ffd64560fb21
  message:
   ##医生追加建议提醒 --签约邀请
   doctor_invitel_template: TLWrBtNE2kBJaFCdVzDOOnQC8N2TtRY9ZxEzwZXQcR0
   #咨询回复
   template_consult_notice: qSOW0DBxO3qEBm4ucG0Ial0jxsOyD7_f2TFK5e-mQEc
   #签约成功
   template_sign_success: hDWV_sknKlhxhOwR5h68OCXbAhRpcgnx9INrT8BybE8
   #签约失败
   template_sign_failed: ezgttXE7rG4rAboQK2ituG1dKq4PeyCj3LxGJWO_vOA
   #健康指导提醒
   template_health_notice: 128RCfyCHi22jW8PZzo7vabKMsA3SBv5VeHaDPr2Bhw
   #解约提醒
   template_termination:  LrrzHjnIF67ww5uQUvSiv3_pVKJiIK4ZE3fKrvsT0AE
   #预约成功
   template_appoint_success:  Bo2yqNczSU9zkg4wXoouv9tSeefZ6TziggWL3dTXPYE
   #预约取消
   template_appoint_failed:  pErTBTdweIdrNRf_1Oo62YtQC0aHwPvtLaCzw44JzCQ
   #缴费提醒
   template_expenses_remind:  BkTGJ8S18qZ3DfaptAXnZznAk8RJjx9v93og5vyO0bs
   #健康教育
   template_healthy_article: LA7erINJ0CSsG2G_ZCrgsDaX3krhsI4qg_NSHEyL_l4
   #医生变更
   template_doctor_change:  TNIDMjduVKgVL4-k71umYLpHROvFB8K6mmm8aZC_EH8
   #问卷调查
   template_doctor_survey:  IjQvzBy0PLeft2kN9mdBhACXPE9I_jyJywJ6B-JRxsY
   #审核结果通知
   template_doctor_audit:  OFyLUeBW3r9trWw-i6pbB1sPSTD4J2recCv_mc-gKxA
   #服务结果通知
   template_doctor_service:  ezr5RlX0nvh7bGU9aVsGDMJbjKDp1uMKP-AGGYXwI5g
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/
  yihu_OpenPlatform_appId: 9000276
  yihu_OpenPlatform_secret: OKC8BS1KGXTDE9GPP1EO4VYLUXF8DJ7QUP72H613ZXA
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
message:
  messageServerUrl: http://10.0.1.3:8080/OpenPlatform/cgiBin/1.0/smsgw/smsSendWS/send
  messageAppId: 9000286
  messageSecret: NW63YK778QPRUD2A6K5SNF7LYRQ888BWOVD6R4FG2VF
images:
  path: /var/local/upload/images
  renew_path: /usr/local/apache-tomcat-8.0.26/webapps/wlyy/images/renew.png
  sign_path: /usr/local/apache-tomcat-8.0.26/webapps/wlyy/images/familycontract.png
sign:
  check_upload: http://172.19.103.87:8011/wlyy_service
quartz:
  name: schedulerFactoryBean_dev
ylzpay:
  onepayApi: http://120.42.37.94:1301/onepay-web/
  onepayAppId: 1BGKM1UHM03P7B2CA8C000005626EB0E
  onepayAppSecret: 1BGKM1UHM03I7B2CA8C00000AB682E9A
express:
  sf_url: http://218.17.248.244:11080/bsp-oisp/sfexpressService
#  sf_url: https://bsp-ois.sit.sf-express.com:9443/bsp-ois/sfexpressServic
  sf_code: SDDF
  sf_check_word: ttzlgGyOQu4L
#消息队列
activemq:
  username: admin
  password: admin
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_dev  #健康文章推送
  consumers:
    count: 10 #消费者集群数
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient_dev
  type:
    HealthEduArticlePatient: health_edu_article_patient_dev
  host: 172.19.103.68
  port: 9200
  tPort: 9300
  clusterName: jkzl

+ 118 - 0
patient-co/patient-co-wlyy-job/src/main/resources/application-devtest.yml

@ -0,0 +1,118 @@
##开发连测试用这个版本的配置
spring:
  profiles: devtest
  datasource:
    wlyy:
      url: jdbc:mysql://172.19.103.85/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: linzhou
      password: linzhou
    health:
      url: jdbc:mysql://172.19.103.85/device?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: linzhou
      password: linzhou
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
    password:
channel:
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
    password: jkzl_ehr
server:
  server_url: http://ehr.yihu.com/wlyy/
im:
  im_list_get: http://172.19.103.88:3000/
  data_base_name: im_new
wechat:
  appId: wx1f129f7b51701428
  appSecret: 988f005d8309ed1795939e0f042431fb
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fehr.yihu.com%2fwlyy
  accId: gh_ffd64560fb21
  message:
    ##医生追加建议提醒 --签约邀请
    doctor_invitel_template:  uXdBJVbrhKG-WLaCG4s8C4SXSr2kknQ94vKFt-3rIiA
    #咨询回复
    template_consult_notice: dr4QNyFoRvVsf8uWxXMC1dRyjwnbUuJwJ21vBLhf18
    #签约成功
    template_sign_success: VYGj8OUKj6FH4i4_nZS2UAHurJxQHx-7_OBPILIdB8s
    #签约失败
    template_sign_failed: m221Jrkm0UUY00ExTCpQNTB8t_1U_V4LR9Bg8BgH9-o
    #健康指导提醒
    template_health_notice: 5Nts8lA_at9Cd1JuTK-qDxx95lchpcmUfPTEwYDgXYQ
    #解约提醒
    template_termination:  qZm1NwSueAsbHaOf9DrnLoSj0X5gZuh9W7aDYzLWNds
    #预约成功
    template_appoint_success:  vU5x2tGyk1zUngBrEqMfnFqqMa6M8J98w8k5MCSUYM
    #预约取消
    template_appoint_failed:  r-bVEKgXVyl8O96saoJXlLd7DX1zW7fXA4a0PZHxiQM
    #缴费提醒
    template_expenses_remind:  pZby4Mz3H5angmjGTuvXzo9lwlaVfEiqORwI8soI-5E
    #健康教育
    template_healthy_article: aO_qqk5nAXaGXhsikPVLNelqzwlrp1LTPfIQ1qRMpxo
    #医生变更
    template_doctor_change:  V5h0F84t972kUzQvWy8qYrgdaYGJVj10pFeFVl19Nb8
    #问卷调查
    template_doctor_survey:  OqQXrb-e43_TJpq_70_K_y6vYJgY5mpjFYY4c5RWFP4
    #审核结果通知
    template_doctor_audit:  lCtOgJgL1tBJbAytqN7cn-FgCH_Usg99FENEy2TrC08
    #服务结果通知
    template_doctor_service: i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/
  yihu_OpenPlatform_appId: 9000276
  yihu_OpenPlatform_secret: OKC8BS1KGXTDE9GPP1EO4VYLUXF8DJ7QUP72H613ZXA
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
images:
  path: /var/local/upload/images
  renew_path: /usr/local/apache-tomcat-8.0.36/webapps/wlyy/images/renew.png
  sign_path: /usr/local/apache-tomcat-8.0.36/webapps/wlyy/images/familycontract.png
sign:
  check_upload: http://172.19.103.85:8011/wlyy_service
quartz:
  name: schedulerFactoryBean_test_dev
express:
  sf_url: http://218.17.248.244:11080/bsp-oisp/sfexpressService
#  sf_url: https://bsp-ois.sit.sf-express.com:9443/bsp-ois/sfexpressServic
  sf_code: SDDF
  sf_check_word: ttzlgGyOQu4L
#消息队列
activemq:
  username: admin
  password: admin
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_devtest  #健康文章推送
  consumers:
    count: 10 #消费者集群数
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient_dev
  type:
    HealthEduArticlePatient: health_edu_article_patient_dev
  host: 172.19.103.68
  port: 9200
  tPort: 9300
  clusterName: jkzl

+ 125 - 0
patient-co/patient-co-wlyy-job/src/main/resources/application-prod.yml

@ -0,0 +1,125 @@
##正式的配置
spring:
  profiles: prod
  datasource:
    wlyy:
      url: jdbc:mysql://59.61.92.90:8079/wlyy?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: wlyy
      password: jkzlehr@123
    health:
      url: jdbc:mysql://59.61.92.90:8079/device?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
#      username: wlyy
#      password: jkzlehr@321465
      username: wlyy
      password: jkzlehr@123
  redis:
    host: 27.155.101.77 # Redis server host.
    port: 6380 # Redis server port.
    password: jkzl_ehr
channel:
  redis:
    host: 10.95.22.142 # Redis server host.
    port: 6380 # Redis server port.
    password: jkzlehr
server:
  server_url: http://www.xmtyw.cn/wlyy/
im:
  im_list_get: http://120.41.253.95:3000/
  data_base_name: im
wechat:
  appId: wxad04e9c4c5255acf
  appSecret: ae77c48ccf1af5d07069f5153d1ac8d3
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fwww.xmtyw.cn%2fwlyy
  accId: gh_ffd64560fb21
  message:
   ##医生追加建议提醒 --签约邀请
   doctor_invitel_template: MQn79bx1ofb6hekhmRIuqLU7KjySJQzaBzrimgqVrzA
   #咨询回复
   template_consult_notice: 0mF_vHj-ILx8EH8DwzmAi7LqzjqYiU9IrSRRmziTZyc
   #签约成功
   template_sign_success: 0D2vYZVRzFz15p9Y_pkZ1DKutDq8UOsks79FXUKS0tA
   #签约失败
   template_sign_failed: My2VNERjJt4NXR4Ibh42pdrP6B6ka8rQxZeWinQh99s
   #健康指导提醒
   template_health_notice: uv31ES_VCmq3tBYtyGmEQvIwU_zh9LDhF3bFpbIUt5g
   #解约提醒
   template_termination:  C0tdXtA_8k-Cy4a1EkzQuI877vqaqAtRkc-e_Gsd7sk
   #预约成功
   template_appoint_success:  FY3Pqa66tHIE1Fv-irbFBPOh5cYP71fkOzfZKH4S-Fo
   #预约取消
   template_appoint_failed:  tldWEb9AN7p_RoHoD8ml0GxWW3V1V_mpEEhp2v6p56s
   #缴费提醒
   template_expenses_remind:  AcrlihhoGbm22A8cdFFDQ4u38ptRw0aiIPf-aGvNxMM
   #健康教育
   template_healthy_article: a5-ZGf-IUUULsuRNoHWQiBMU6pSYhLgPPqV67SjdLRo
   #医生变更
   template_doctor_change:  dtzSHImbPKfwcrjWlJEjAw3lGlvrLjsobSOE8g4adZA
   #问卷调查
   template_doctor_survey:  8ZWKJmoJ7VR7Uk4YS7aa0Z94QzCkxsyTW6R4CHhUJII
   #审核结果通知
   template_doctor_audit:  egrX5Larpkv8opQW67_hwsZoT0OHwwUpE1v7HeU_Jnw
   #服务结果通知
   template_doctor_service:  xhi1LEudiZwJfZylOHuZNo8EiA73GtSshPQv5XOt9Lk
yihu:
  yihu_OpenPlatform_url: http://api.yihu.com.cn/OpenPlatform/cgiBin/1.0/
  yihu_OpenPlatform_appId: 9000276
  yihu_OpenPlatform_secret: 2JGL19AH3JS55MQY6ZOFJE1JZJ1OF23GWV67MCDQV74
fastDFS:
  fastdfs_file_url: http://www.xmtyw.cn/
images:
  path: /var/local/upload/images
  renew_path: /usr/local/tomcat8/webapps/wlyy/images/renew.png
  sign_path: /usr/local/tomcat8/webapps/wlyy/images/familycontract.png
sign:
  check_upload: http://59.61.92.90:8072/wlyy_service
quartz:
  name: schedulerFactoryBeanWlyy
ylzpay:
#  onepayApi: https://xmhealth.ylzpay.com:8080/
  onepayApi: http://xmhealth.ylzpay.com:8070/
  onepayAppId: 1BLF5SEGN00087165F0A000027362BE5
  onepayAppSecret: 1BLF5SCBO01V3E78A8C00000F3A0FFE7
express:
  sf_url: http://218.17.248.244:11080/bsp-oisp/sfexpressService
#  sf_url: https://bsp-ois.sit.sf-express.com:9443/bsp-ois/sfexpressServic
  sf_code: SDDF
  sf_check_word: ttzlgGyOQu4L
#消息队列
activemq:
  username: admin
  password: admin
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_dev  #健康文章推送
  consumers:
    count: 10 #消费者集群数
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient_dev
  type:
    HealthEduArticlePatient: health_edu_article_patient_dev
  host: 172.19.103.68
  port: 9200
  tPort: 9300
  clusterName: jkzl

+ 122 - 0
patient-co/patient-co-wlyy-job/src/main/resources/application-test.yml

@ -0,0 +1,122 @@
#测试的配置
spring:
  profiles: test
  datasource:
    wlyy:
      url: jdbc:mysql://172.17.110.160/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: ssgg
      password: ssgg
    health:
      url: jdbc:mysql://172.17.110.160/device?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: ssgg
      password: ssgg
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
#    password: jkzl_ehr
channel:
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
    password:
server:
  server_url: http://ehr.yihu.com/wlyy/
im:
  im_list_get: http://172.19.103.88:3000/
  data_base_name: im_new
wechat:
  appId: wx1f129f7b51701428
  appSecret: 988f005d8309ed1795939e0f042431fb
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fehr.yihu.com%2fwlyy
  accId: gh_ffd64560fb21
  message:
   ##医生追加建议提醒 --签约邀请
   doctor_invitel_template: uXdBJVbrhKG-WLaCG4s8C4SXSr2kknQ94vKFt-3rIiA
   #咨询回复
   template_consult_notice: dr4QNyFoRvVsf8uWxXMC1dRyjwnbUuJwJ21vBLhf18
   #签约成功
   template_sign_success: VYGj8OUKj6FH4i4_nZS2UAHurJxQHx-7_OBPILIdB8s
   #签约失败
   template_sign_failed: m221Jrkm0UUY00ExTCpQNTB8t_1U_V4LR9Bg8BgH9-o
   #健康指导提醒
   template_health_notice: 5Nts8lA_at9Cd1JuTK-qDxx95lchpcmUfPTEwYDgXYQ
   #解约提醒
   template_termination:  qZm1NwSueAsbHaOf9DrnLoSj0X5gZuh9W7aDYzLWNds
   #预约成功
   template_appoint_success:  vU5x2tGyk1zUngBrEqMfnFqqMa6M8J98w8k5MCSUYM
   #预约取消
   template_appoint_failed:  r-bVEKgXVyl8O96saoJXlLd7DX1zW7fXA4a0PZHxiQM
   #缴费提醒
   template_expenses_remind:  pZby4Mz3H5angmjGTuvXzo9lwlaVfEiqORwI8soI-5E
   #健康教育
   template_healthy_article: aO_qqk5nAXaGXhsikPVLNelqzwlrp1LTPfIQ1qRMpxo
   #医生变更
   template_doctor_change:  V5h0F84t972kUzQvWy8qYrgdaYGJVj10pFeFVl19Nb8
   #问卷调查
   template_doctor_survey:  OqQXrb-e43_TJpq_70_K_y6vYJgY5mpjFYY4c5RWFP4
   #审核结果通知
   template_doctor_audit:  lCtOgJgL1tBJbAytqN7cn-FgCH_Usg99FENEy2TrC08
   #服务结果通知
   template_doctor_service:  i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/
  yihu_OpenPlatform_appId: 9000276
  yihu_OpenPlatform_secret: OKC8BS1KGXTDE9GPP1EO4VYLUXF8DJ7QUP72H613ZXA
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
images:
  path: /var/local/upload/images
  renew_path: /usr/local/apache-tomcat-8.0.36/webapps/wlyy/images/renew.png
  sign_path: /usr/local/apache-tomcat-8.0.36/webapps/wlyy/images/familycontract.png
sign:
  check_upload: http://172.19.103.85:8011/wlyy_service
quartz:
  name: schedulerFactoryBean_test
ylzpay:
  onepayApi: http://120.42.37.94:1301/onepay-web/
  onepayAppId: 1BGKM1UHM03P7B2CA8C000005626EB0E
  onepayAppSecret: 1BGKM1UHM03I7B2CA8C00000AB682E9A
express:
  sf_url: http://218.17.248.244:11080/bsp-oisp/sfexpressService
#  sf_url: https://bsp-ois.sit.sf-express.com:9443/bsp-ois/sfexpressServic
  sf_code: SDDF
  sf_check_word: ttzlgGyOQu4L
#消息队列
activemq:
  username: admin
  password: admin
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_dev  #健康文章推送
  consumers:
    count: 10 #消费者集群数
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient_dev
  type:
    HealthEduArticlePatient: health_edu_article_patient_dev
  host: 172.19.103.68
  port: 9200
  tPort: 9300
  clusterName: jkzl

+ 1 - 412
patient-co/patient-co-wlyy-job/src/main/resources/application.yml

@ -1,5 +1,5 @@
server:
  port: 8080
  port: 8081
  context-path: /wlyy-job
spring:
@ -75,414 +75,3 @@ security:
  basic:
    username: jkzl
    password: jkzlehr
---
##测试的配置
spring:
  profiles: test
  datasource:
    wlyy:
      url: jdbc:mysql://172.17.110.160/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: ssgg
      password: ssgg
    health:
      url: jdbc:mysql://172.17.110.160/device?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: ssgg
      password: ssgg
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
#    password: jkzl_ehr
channel:
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
    password:
server:
  server_url: http://ehr.yihu.com/wlyy/
im:
  im_list_get: http://172.19.103.88:3000/
  data_base_name: im_new
wechat:
  appId: wx1f129f7b51701428
  appSecret: 988f005d8309ed1795939e0f042431fb
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fehr.yihu.com%2fwlyy
  accId: gh_ffd64560fb21
  message:
   ##医生追加建议提醒 --签约邀请
   doctor_invitel_template: uXdBJVbrhKG-WLaCG4s8C4SXSr2kknQ94vKFt-3rIiA
   #咨询回复
   template_consult_notice: dr4QNyFoRvVsf8uWxXMC1dRyjwnbUuJwJ21vBLhf18
   #签约成功
   template_sign_success: VYGj8OUKj6FH4i4_nZS2UAHurJxQHx-7_OBPILIdB8s
   #签约失败
   template_sign_failed: m221Jrkm0UUY00ExTCpQNTB8t_1U_V4LR9Bg8BgH9-o
   #健康指导提醒
   template_health_notice: 5Nts8lA_at9Cd1JuTK-qDxx95lchpcmUfPTEwYDgXYQ
   #解约提醒
   template_termination:  qZm1NwSueAsbHaOf9DrnLoSj0X5gZuh9W7aDYzLWNds
   #预约成功
   template_appoint_success:  vU5x2tGyk1zUngBrEqMfnFqqMa6M8J98w8k5MCSUYM
   #预约取消
   template_appoint_failed:  r-bVEKgXVyl8O96saoJXlLd7DX1zW7fXA4a0PZHxiQM
   #缴费提醒
   template_expenses_remind:  pZby4Mz3H5angmjGTuvXzo9lwlaVfEiqORwI8soI-5E
   #健康教育
   template_healthy_article: aO_qqk5nAXaGXhsikPVLNelqzwlrp1LTPfIQ1qRMpxo
   #医生变更
   template_doctor_change:  V5h0F84t972kUzQvWy8qYrgdaYGJVj10pFeFVl19Nb8
   #问卷调查
   template_doctor_survey:  OqQXrb-e43_TJpq_70_K_y6vYJgY5mpjFYY4c5RWFP4
   #审核结果通知
   template_doctor_audit:  lCtOgJgL1tBJbAytqN7cn-FgCH_Usg99FENEy2TrC08
   #服务结果通知
   template_doctor_service:  i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/
  yihu_OpenPlatform_appId: 9000276
  yihu_OpenPlatform_secret: OKC8BS1KGXTDE9GPP1EO4VYLUXF8DJ7QUP72H613ZXA
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
images:
  path: /var/local/upload/images
  renew_path: /usr/local/apache-tomcat-8.0.36/webapps/wlyy/images/renew.png
  sign_path: /usr/local/apache-tomcat-8.0.36/webapps/wlyy/images/familycontract.png
sign:
  check_upload: http://172.19.103.85:8011/wlyy_service
quartz:
  name: schedulerFactoryBean_test
ylzpay:
  onepayApi: http://120.42.37.94:1301/onepay-web/
  onepayAppId: 1BGKM1UHM03P7B2CA8C000005626EB0E
  onepayAppSecret: 1BGKM1UHM03I7B2CA8C00000AB682E9A
express:
  sf_url: http://218.17.248.244:11080/bsp-oisp/sfexpressService
#  sf_url: https://bsp-ois.sit.sf-express.com:9443/bsp-ois/sfexpressServic
  sf_code: SDDF
  sf_check_word: ttzlgGyOQu4L
---
##正式的配置
spring:
  profiles: prod
  datasource:
    wlyy:
      url: jdbc:mysql://59.61.92.90:8079/wlyy?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: wlyy
      password: jkzlehr@123
    health:
      url: jdbc:mysql://59.61.92.90:8079/device?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
#      username: wlyy
#      password: jkzlehr@321465
      username: wlyy
      password: jkzlehr@123
  redis:
    host: 27.155.101.77 # Redis server host.
    port: 6380 # Redis server port.
    password: jkzl_ehr
channel:
  redis:
    host: 10.95.22.142 # Redis server host.
    port: 6380 # Redis server port.
    password: jkzlehr
server:
  server_url: http://www.xmtyw.cn/wlyy/
im:
  im_list_get: http://120.41.253.95:3000/
  data_base_name: im
wechat:
  appId: wxad04e9c4c5255acf
  appSecret: ae77c48ccf1af5d07069f5153d1ac8d3
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fwww.xmtyw.cn%2fwlyy
  accId: gh_ffd64560fb21
  message:
   ##医生追加建议提醒 --签约邀请
   doctor_invitel_template: MQn79bx1ofb6hekhmRIuqLU7KjySJQzaBzrimgqVrzA
   #咨询回复
   template_consult_notice: 0mF_vHj-ILx8EH8DwzmAi7LqzjqYiU9IrSRRmziTZyc
   #签约成功
   template_sign_success: 0D2vYZVRzFz15p9Y_pkZ1DKutDq8UOsks79FXUKS0tA
   #签约失败
   template_sign_failed: My2VNERjJt4NXR4Ibh42pdrP6B6ka8rQxZeWinQh99s
   #健康指导提醒
   template_health_notice: uv31ES_VCmq3tBYtyGmEQvIwU_zh9LDhF3bFpbIUt5g
   #解约提醒
   template_termination:  C0tdXtA_8k-Cy4a1EkzQuI877vqaqAtRkc-e_Gsd7sk
   #预约成功
   template_appoint_success:  FY3Pqa66tHIE1Fv-irbFBPOh5cYP71fkOzfZKH4S-Fo
   #预约取消
   template_appoint_failed:  tldWEb9AN7p_RoHoD8ml0GxWW3V1V_mpEEhp2v6p56s
   #缴费提醒
   template_expenses_remind:  AcrlihhoGbm22A8cdFFDQ4u38ptRw0aiIPf-aGvNxMM
   #健康教育
   template_healthy_article: a5-ZGf-IUUULsuRNoHWQiBMU6pSYhLgPPqV67SjdLRo
   #医生变更
   template_doctor_change:  dtzSHImbPKfwcrjWlJEjAw3lGlvrLjsobSOE8g4adZA
   #问卷调查
   template_doctor_survey:  8ZWKJmoJ7VR7Uk4YS7aa0Z94QzCkxsyTW6R4CHhUJII
   #审核结果通知
   template_doctor_audit:  egrX5Larpkv8opQW67_hwsZoT0OHwwUpE1v7HeU_Jnw
   #服务结果通知
   template_doctor_service:  xhi1LEudiZwJfZylOHuZNo8EiA73GtSshPQv5XOt9Lk
yihu:
  yihu_OpenPlatform_url: http://api.yihu.com.cn/OpenPlatform/cgiBin/1.0/
  yihu_OpenPlatform_appId: 9000276
  yihu_OpenPlatform_secret: 2JGL19AH3JS55MQY6ZOFJE1JZJ1OF23GWV67MCDQV74
fastDFS:
  fastdfs_file_url: http://www.xmtyw.cn/
images:
  path: /var/local/upload/images
  renew_path: /usr/local/tomcat8/webapps/wlyy/images/renew.png
  sign_path: /usr/local/tomcat8/webapps/wlyy/images/familycontract.png
sign:
  check_upload: http://59.61.92.90:8072/wlyy_service
quartz:
  name: schedulerFactoryBeanWlyy
ylzpay:
#  onepayApi: https://xmhealth.ylzpay.com:8080/
  onepayApi: http://xmhealth.ylzpay.com:8070/
  onepayAppId: 1BLF5SEGN00087165F0A000027362BE5
  onepayAppSecret: 1BLF5SCBO01V3E78A8C00000F3A0FFE7
express:
  sf_url: http://218.17.248.244:11080/bsp-oisp/sfexpressService
#  sf_url: https://bsp-ois.sit.sf-express.com:9443/bsp-ois/sfexpressServic
  sf_code: SDDF
  sf_check_word: ttzlgGyOQu4L
---
##开发的配置
spring:
  profiles: dev
  datasource:
    wlyy:
      url: jdbc:mysql://172.19.103.77/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: root
      password: 123456
    health:
      url: jdbc:mysql://172.19.103.77/device?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: root
      password: 123456
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
#    password: jkzl_ehr
channel:
  redis:
    host: 59.61.92.90  # Redis server host.
    port: 9054 # Redis server port.
    password: jkzlehr
server:
  server_url: http://weixin.xmtyw.cn/wlyy-dev/
im:
  im_list_get: http://172.19.103.88:3000/
  data_base_name: ichat
wechat:
  appId: wxd03f859efdf0873d
  appSecret: 2935b54b53a957d9516c920a544f2537
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fweixin.xmtyw.cn%2fwlyy-dev
  accId: gh_ffd64560fb21
  message:
   ##医生追加建议提醒 --签约邀请
   doctor_invitel_template: TLWrBtNE2kBJaFCdVzDOOnQC8N2TtRY9ZxEzwZXQcR0
   #咨询回复
   template_consult_notice: qSOW0DBxO3qEBm4ucG0Ial0jxsOyD7_f2TFK5e-mQEc
   #签约成功
   template_sign_success: hDWV_sknKlhxhOwR5h68OCXbAhRpcgnx9INrT8BybE8
   #签约失败
   template_sign_failed: ezgttXE7rG4rAboQK2ituG1dKq4PeyCj3LxGJWO_vOA
   #健康指导提醒
   template_health_notice: 128RCfyCHi22jW8PZzo7vabKMsA3SBv5VeHaDPr2Bhw
   #解约提醒
   template_termination:  LrrzHjnIF67ww5uQUvSiv3_pVKJiIK4ZE3fKrvsT0AE
   #预约成功
   template_appoint_success:  Bo2yqNczSU9zkg4wXoouv9tSeefZ6TziggWL3dTXPYE
   #预约取消
   template_appoint_failed:  pErTBTdweIdrNRf_1Oo62YtQC0aHwPvtLaCzw44JzCQ
   #缴费提醒
   template_expenses_remind:  BkTGJ8S18qZ3DfaptAXnZznAk8RJjx9v93og5vyO0bs
   #健康教育
   template_healthy_article: LA7erINJ0CSsG2G_ZCrgsDaX3krhsI4qg_NSHEyL_l4
   #医生变更
   template_doctor_change:  TNIDMjduVKgVL4-k71umYLpHROvFB8K6mmm8aZC_EH8
   #问卷调查
   template_doctor_survey:  IjQvzBy0PLeft2kN9mdBhACXPE9I_jyJywJ6B-JRxsY
   #审核结果通知
   template_doctor_audit:  OFyLUeBW3r9trWw-i6pbB1sPSTD4J2recCv_mc-gKxA
   #服务结果通知
   template_doctor_service:  ezr5RlX0nvh7bGU9aVsGDMJbjKDp1uMKP-AGGYXwI5g
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/
  yihu_OpenPlatform_appId: 9000276
  yihu_OpenPlatform_secret: OKC8BS1KGXTDE9GPP1EO4VYLUXF8DJ7QUP72H613ZXA
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
message:
  messageServerUrl: http://10.0.1.3:8080/OpenPlatform/cgiBin/1.0/smsgw/smsSendWS/send
  messageAppId: 9000286
  messageSecret: NW63YK778QPRUD2A6K5SNF7LYRQ888BWOVD6R4FG2VF
images:
  path: /var/local/upload/images
  renew_path: /usr/local/apache-tomcat-8.0.26/webapps/wlyy/images/renew.png
  sign_path: /usr/local/apache-tomcat-8.0.26/webapps/wlyy/images/familycontract.png
sign:
  check_upload: http://172.19.103.87:8011/wlyy_service
quartz:
  name: schedulerFactoryBean_dev
ylzpay:
  onepayApi: http://120.42.37.94:1301/onepay-web/
  onepayAppId: 1BGKM1UHM03P7B2CA8C000005626EB0E
  onepayAppSecret: 1BGKM1UHM03I7B2CA8C00000AB682E9A
express:
  sf_url: http://218.17.248.244:11080/bsp-oisp/sfexpressService
#  sf_url: https://bsp-ois.sit.sf-express.com:9443/bsp-ois/sfexpressServic
  sf_code: SDDF
  sf_check_word: ttzlgGyOQu4L
---
##开发连测试用这个版本的配置
spring:
  profiles: dev_test
  datasource:
    wlyy:
      url: jdbc:mysql://172.19.103.85/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: linzhou
      password: linzhou
    health:
      url: jdbc:mysql://172.19.103.85/device?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: linzhou
      password: linzhou
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
    password:
channel:
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
    password: jkzl_ehr
server:
  server_url: http://ehr.yihu.com/wlyy/
im:
  im_list_get: http://172.19.103.88:3000/
  data_base_name: im_new
wechat:
  appId: wx1f129f7b51701428
  appSecret: 988f005d8309ed1795939e0f042431fb
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fehr.yihu.com%2fwlyy
  accId: gh_ffd64560fb21
  message:
    ##医生追加建议提醒 --签约邀请
    doctor_invitel_template:  uXdBJVbrhKG-WLaCG4s8C4SXSr2kknQ94vKFt-3rIiA
    #咨询回复
    template_consult_notice: dr4QNyFoRvVsf8uWxXMC1dRyjwnbUuJwJ21vBLhf18
    #签约成功
    template_sign_success: VYGj8OUKj6FH4i4_nZS2UAHurJxQHx-7_OBPILIdB8s
    #签约失败
    template_sign_failed: m221Jrkm0UUY00ExTCpQNTB8t_1U_V4LR9Bg8BgH9-o
    #健康指导提醒
    template_health_notice: 5Nts8lA_at9Cd1JuTK-qDxx95lchpcmUfPTEwYDgXYQ
    #解约提醒
    template_termination:  qZm1NwSueAsbHaOf9DrnLoSj0X5gZuh9W7aDYzLWNds
    #预约成功
    template_appoint_success:  vU5x2tGyk1zUngBrEqMfnFqqMa6M8J98w8k5MCSUYM
    #预约取消
    template_appoint_failed:  r-bVEKgXVyl8O96saoJXlLd7DX1zW7fXA4a0PZHxiQM
    #缴费提醒
    template_expenses_remind:  pZby4Mz3H5angmjGTuvXzo9lwlaVfEiqORwI8soI-5E
    #健康教育
    template_healthy_article: aO_qqk5nAXaGXhsikPVLNelqzwlrp1LTPfIQ1qRMpxo
    #医生变更
    template_doctor_change:  V5h0F84t972kUzQvWy8qYrgdaYGJVj10pFeFVl19Nb8
    #问卷调查
    template_doctor_survey:  OqQXrb-e43_TJpq_70_K_y6vYJgY5mpjFYY4c5RWFP4
    #审核结果通知
    template_doctor_audit:  lCtOgJgL1tBJbAytqN7cn-FgCH_Usg99FENEy2TrC08
    #服务结果通知
    template_doctor_service: i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/
  yihu_OpenPlatform_appId: 9000276
  yihu_OpenPlatform_secret: OKC8BS1KGXTDE9GPP1EO4VYLUXF8DJ7QUP72H613ZXA
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
images:
  path: /var/local/upload/images
  renew_path: /usr/local/apache-tomcat-8.0.36/webapps/wlyy/images/renew.png
  sign_path: /usr/local/apache-tomcat-8.0.36/webapps/wlyy/images/familycontract.png
sign:
  check_upload: http://172.19.103.85:8011/wlyy_service
quartz:
  name: schedulerFactoryBean_test_dev
express:
  sf_url: http://218.17.248.244:11080/bsp-oisp/sfexpressService
#  sf_url: https://bsp-ois.sit.sf-express.com:9443/bsp-ois/sfexpressServic
  sf_code: SDDF
  sf_check_word: ttzlgGyOQu4L

+ 23 - 5
patient-co/patient-co-wlyy/pom.xml

@ -130,17 +130,35 @@
            <groupId>org.springframework</groupId>
            <artifactId>spring-jms</artifactId>
        </dependency>
        <!--<dependency>-->
            <!--<groupId>org.apache.activemq</groupId>-->
            <!--<artifactId>activemq-all</artifactId>-->
        <!--</dependency>-->
        <!-- spring end -->
        <!--activemq start-->
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-spring</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-broker</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-jaas</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-camel</artifactId>
        </dependency>
        <!--activemq end-->
        <!--Swagger start -->
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
        </dependency>
        <!--activemq start-->
        <dependency>
            <groupId>io.springfox</groupId>

+ 59 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/ActiveMQConfig.java

@ -0,0 +1,59 @@
package com.yihu.wlyy.config;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.context.annotation.Profile;
import org.springframework.jms.annotation.EnableJms;
import org.springframework.jms.connection.CachingConnectionFactory;
import org.springframework.jms.core.JmsTemplate;
/**
 * Created by chenweida on 2017/9/9.
 * 生产者配置
 */
@EnableJms
@Configuration
@Profile({"dev", "devtest", "prod", "test"})
public class ActiveMQConfig {
    @Value("${activemq.username}")
    private String username;
    @Value("${activemq.password}")
    private String password;
    @Value("${activemq.url}")
    private String url;
    @Bean
    public ActiveMQConnectionFactory activeMQConnectionFactory() {
        ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory(username, password, url);
        //设置异步发送
        activeMQConnectionFactory.setUseAsyncSend(true);
        return activeMQConnectionFactory;
    }
    /**
     * 缓存session链接
     *
     * @return
     */
    @Bean
    @Primary
    public CachingConnectionFactory CachingConnectionFactory() {
        CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory();
        //目标ConnectionFactory对应真实的可以产生JMS Connection的ConnectionFactory
        cachingConnectionFactory.setTargetConnectionFactory(activeMQConnectionFactory());
        //Session缓存数量,这里属性也可以直接在这里配置
        cachingConnectionFactory.setSessionCacheSize(100);
        return cachingConnectionFactory;
    }
    @Bean
    public JmsTemplate jmsTemplate() {
        JmsTemplate jmsTemplate = new JmsTemplate();
        jmsTemplate.setConnectionFactory( CachingConnectionFactory());
        return jmsTemplate;
    }
}

+ 0 - 31
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/ActiveMQProduceConfig.java

@ -1,31 +0,0 @@
//package com.yihu.wlyy.config;
//
//import org.apache.activemq.ActiveMQConnectionFactory;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.jms.annotation.EnableJms;
//
///**
// * Created by chenweida on 2017/9/9.
// * 生产者配置
// */
//@EnableJms
//@Configuration
//public class ActiveMQProduceConfig {
//    @Value("${activemq.username}")
//    private String username;
//    @Value("${activemq.password}")
//    private String password;
//    @Value("${activemq.url}")
//    private String url;
//
//    @Bean
//    public ActiveMQConnectionFactory activeMQConnectionFactory() {
//        ActiveMQConnectionFactory activeMQConnectionFactory =
//                new ActiveMQConnectionFactory(username, password, url);
////                        "tcp://192.168.0.100:61616");
//
//        return activeMQConnectionFactory;
//    }
//}

+ 0 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/es/ElasticFactory.java

@ -1,6 +1,5 @@
package com.yihu.wlyy.config.es;
import com.google.common.util.concurrent.MoreExecutors;
import io.searchbox.client.JestClient;
import io.searchbox.client.JestClientFactory;
import io.searchbox.client.config.HttpClientConfig;

+ 0 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/es/ElastricSearchSave.java

@ -4,15 +4,12 @@ import io.searchbox.client.JestClient;
import io.searchbox.core.Bulk;
import io.searchbox.core.BulkResult;
import io.searchbox.core.Index;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
;

+ 20 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcEduArticleController.java

@ -22,14 +22,21 @@ import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.MediaType;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.MessageCreator;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;
import javax.jms.TextMessage;
import java.util.*;
/**
@ -54,9 +61,10 @@ public class GcEduArticleController extends WeixinBaseController {
    private GcEduArticleService gcEduArticleService;
    @Autowired
    private StringRedisTemplate redisTemplate;
    private String channelName = "healthArticleChannel";
    @Autowired
    private JmsTemplate jmsTemplate;
    @Value("${activemq.queue.healtHarticleQueue}")
    private String channelName;
    /**
     * @param doctorCode
@ -139,7 +147,6 @@ public class GcEduArticleController extends WeixinBaseController {
                //发送任务到redis
                sender(healthEduArticlePatients);
            }).start();
            System.out.println("结束");
            return new BaseResultModel();
        } catch (Exception e) {
            return new BaseResultModel(BaseResultModel.statusEm.opera_error.getCode(), BaseResultModel.statusEm.opera_error.getMessage() + ":" + e.getMessage());
@ -152,8 +159,16 @@ public class GcEduArticleController extends WeixinBaseController {
     * @param healthEduArticlePatients
     */
    public void sender(List<HealthEduArticlePatient> healthEduArticlePatients) {
        //送到到队列
        healthEduArticlePatients.stream().forEach(one -> {
            redisTemplate.convertAndSend(channelName, net.sf.json.JSONObject.fromObject(one).toString());
            jmsTemplate.send(channelName, new MessageCreator() {
                @Override
                public Message createMessage(Session session) throws JMSException {
                    TextMessage textMessage = session.createTextMessage();
                    textMessage.setText(net.sf.json.JSONObject.fromObject(one).toString());
                    return textMessage;
                }
            });
        });
    }

+ 6 - 4
patient-co/patient-co-wlyy/src/main/resources/application-dev.yml

@ -102,8 +102,10 @@ es:
  port: 9200
  tPort: 9300
  clusterName: jkzl
#消息队列
activemq:
  username:
  password:
  url:
  username: admin
  password: admin
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_dev  #健康文章推送

+ 6 - 3
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -101,7 +101,10 @@ es:
  clusterName: jkzl
#消息队列
activemq:
  username:
  password:
  url:
  username: admin
  password: admin
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_devtest  #健康文章推送

+ 6 - 3
patient-co/patient-co-wlyy/src/main/resources/application-local.yml

@ -103,7 +103,10 @@ es:
  tPort: 9300
  clusterName: jkzl
#消息队列
activemq:
  username:
  password:
  url:
  username: admin
  password: admin
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_local  #健康文章推送

+ 6 - 3
patient-co/patient-co-wlyy/src/main/resources/application-localtest.yml

@ -92,8 +92,11 @@ pushMes:
  redis_prescription_title: redisPrescription
#消息队列
activemq:
  username:
  password:
  url:
  username: admin
  password: admin
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_localtest  #健康文章推送

+ 6 - 3
patient-co/patient-co-wlyy/src/main/resources/application-prod.yml

@ -101,7 +101,10 @@ es:
  tPort: 9300
  clusterName: jkzl
#消息队列
activemq:
  username:
  password:
  url:
  username: admin
  password: admin
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel  #健康文章推送

+ 7 - 4
patient-co/patient-co-wlyy/src/main/resources/application-test.yml

@ -92,13 +92,16 @@ es:
  index:
    HealthEduArticlePatient: health_edu_article_patient_test
  type:
    health_edu_article_patient: health_edu_article_patient_test
    HealthEduArticlePatient: health_edu_article_patient_test
  host: 172.19.103.68
  port: 9200
  tPort: 9300
  clusterName: jkzl
#消息队列
activemq:
  username:
  password:
  url:
  username: admin
  password: admin
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_test  #健康文章推送

+ 32 - 3
pom.xml

@ -192,14 +192,43 @@
                <artifactId>spring-jms</artifactId>
                <version>${version.spring}</version>
            </dependency>
            <!-- spring end -->
            <!--activemq start-->
            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>activemq-all</artifactId>
                <artifactId>activemq-client</artifactId>
                <version>${version.activemq}</version>
            </dependency>
            <!-- spring end -->
            <!--Swagger start -->
            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>activemq-spring</artifactId>
                <version>${version.activemq}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>activemq-broker</artifactId>
                <version>${version.activemq}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>activemq-jaas</artifactId>
                <version>${version.activemq}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>activemq-camel</artifactId>
                <version>${version.activemq}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>activemq-core</artifactId>
                <version>5.7.0</version>
            </dependency>
            <!---activemq end->
            <!-Swagger start -->
            <dependency>
                <groupId>io.springfox</groupId>
                <artifactId>springfox-swagger2</artifactId>