Browse Source

三院需求

LAPTOP-KB9HII50\70708 2 years ago
parent
commit
04fc92b60e

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/team/service/TeamService.java

@ -87,7 +87,7 @@ public class TeamService {
            if(StringUtils.isNotBlank(info)){
                String sql = " SELECT t.id,t.dept_name deptName,t.recommend_doctor recommendDoctor,t.recommend_doctor_name recommendDoctorName,d.photo,d.job_title_name jobTitleName" +
                        " from base_team t LEFT JOIN base_team_relation r on t.id = r.team_id and r.admin_team_id= " + adminTeamId+
                        " LEFT JOIN base_doctor d on t.recommend_doctor = t.id " +
                        " LEFT JOIN base_doctor d on t.recommend_doctor = d.id " +
                        " WHERE t.del=1 and t.recommend='1' ORDER BY r.id desc LIMIT 3";
                List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
                json.put("doctorList",mapList);

+ 11 - 1
svr/svr-internet-hospital-job/pom.xml

@ -74,7 +74,17 @@
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>base-service</artifactId>
            <version>${project.parent.version}</version>
            <version>${version.wlyy-common}</version>
            <exclusions>
                <exclusion>
                    <groupId>xalan</groupId>
                    <artifactId>xalan</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.his.hesb</groupId>
                    <artifactId>mqSdk</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>

+ 54 - 54
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/config/async/AsyncConfig.java

@ -1,54 +1,54 @@
package com.yihu.jw.config.async;
import org.apache.tomcat.util.threads.ThreadPoolExecutor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
/**
 * Created by chenweida on 2016.10.18.
 * 启用多綫程
 */
@Configuration
@EnableAsync
public class AsyncConfig {
    /**
     * 如果池中的实际线程数小于corePoolSize,无论是否其中有空闲的线程,都会给新的任务产生新的线程
     */
    private int corePoolSize = 5;
    /**
     * 如果池中的线程数=maximumPoolSize,则有空闲线程使用空闲线程,否则新任务放入queueCapacity.
     * 设定 比 系统native thread个数要大的话,会优先抛出Java.lang.OutOfMemoryError: unable to create new native thread
     */
    private int maxPoolSize = 10;
    /**
     * 缓冲队列大小
     */
    private int queueCapacity = 100;
    /**
     * 线程池维护线程所允许的空闲时间  秒
     */
    private int keepAliveSeconds = 300;
    @Bean
    public Executor wlyyExecutor() {
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        executor.setCorePoolSize(corePoolSize);
        executor.setMaxPoolSize(maxPoolSize);
        executor.setQueueCapacity(queueCapacity);
        executor.setKeepAliveSeconds(keepAliveSeconds);
        /** Reject策略预定义有四种:
         (1)ThreadPoolExecutor.AbortPolicy策略,是默认的策略,处理程序遭到拒绝将抛出运行时 RejectedExecutionException。
         (2)ThreadPoolExecutor.CallerRunsPolicy策略 ,调用者的线程会执行该任务,如果执行器已关闭,则丢弃.
         (3)ThreadPoolExecutor.DiscardPolicy策略,不能执行的任务将被丢弃.
         (4)ThreadPoolExecutor.DiscardOldestPolicy策略,如果执行程序尚未关闭,则位于工作队列头部的任务将被删除,然后重试执行程序(如果再次失败,则重复此过程).
         */
        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
        executor.initialize();
        return executor;
    }
}
//package com.yihu.jw.config.async;
//
//import org.apache.tomcat.util.threads.ThreadPoolExecutor;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.scheduling.annotation.EnableAsync;
//import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
//
//import java.util.concurrent.Executor;
//
///**
// * Created by chenweida on 2016.10.18.
// * 启用多綫程
// */
//@Configuration
//@EnableAsync
//public class AsyncConfig {
//    /**
//     * 如果池中的实际线程数小于corePoolSize,无论是否其中有空闲的线程,都会给新的任务产生新的线程
//     */
//    private int corePoolSize = 5;
//    /**
//     * 如果池中的线程数=maximumPoolSize,则有空闲线程使用空闲线程,否则新任务放入queueCapacity.
//     * 设定 比 系统native thread个数要大的话,会优先抛出Java.lang.OutOfMemoryError: unable to create new native thread
//     */
//    private int maxPoolSize = 10;
//    /**
//     * 缓冲队列大小
//     */
//    private int queueCapacity = 100;
//
//    /**
//     * 线程池维护线程所允许的空闲时间  秒
//     */
//    private int keepAliveSeconds = 300;
//
//    @Bean
//    public Executor wlyyExecutor() {
//        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
//        executor.setCorePoolSize(corePoolSize);
//        executor.setMaxPoolSize(maxPoolSize);
//        executor.setQueueCapacity(queueCapacity);
//        executor.setKeepAliveSeconds(keepAliveSeconds);
//        /** Reject策略预定义有四种:
//         (1)ThreadPoolExecutor.AbortPolicy策略,是默认的策略,处理程序遭到拒绝将抛出运行时 RejectedExecutionException。
//         (2)ThreadPoolExecutor.CallerRunsPolicy策略 ,调用者的线程会执行该任务,如果执行器已关闭,则丢弃.
//         (3)ThreadPoolExecutor.DiscardPolicy策略,不能执行的任务将被丢弃.
//         (4)ThreadPoolExecutor.DiscardOldestPolicy策略,如果执行程序尚未关闭,则位于工作队列头部的任务将被删除,然后重试执行程序(如果再次失败,则重复此过程).
//         */
//        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
//        executor.initialize();
//        return executor;
//    }
//}

+ 10 - 3
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/event/ApplicationEvent.java

@ -1,9 +1,7 @@
package com.yihu.jw.event;
import com.yihu.jw.job.DataUploadJob;
import com.yihu.jw.job.PrescriptionOverdueJob;
import com.yihu.jw.job.PrescriptionStatusUpdateJob;
import com.yihu.jw.job.QuartzHelper;
import com.yihu.jw.job.im.ImOnlineGuidanceJob;
import com.yihu.jw.util.SystemConf;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -28,6 +26,15 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
    public void onApplicationEvent(ContextRefreshedEvent ContextRefreshedEvent) {
        try {
            //im定时任务 每分钟一次
            if (!quartzHelper.isExistJob("im_online_guidance_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("im_online_guidance_job");
                quartzHelper.addJob(ImOnlineGuidanceJob.class, trigger, "im_online_guidance_job", new HashMap<>());
                logger.info("im_online_guidance_job success");
            } else {
                logger.info("im_online_guidance_job exist");
            }
//=================中山医院发布启动======================================================
//            //互联网医院处方状态更新job
//            if (!quartzHelper.isExistJob("prescriptionStatus_update_job")) {

+ 35 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/im/ImOnlineGuidanceJob.java

@ -0,0 +1,35 @@
package com.yihu.jw.job.im;
import com.yihu.jw.service.im.ImJobService;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
 * im在线导诊定时任务
 * Created by yeshijie on 2023/4/28.
 */
@DisallowConcurrentExecution
public class ImOnlineGuidanceJob implements Job {
    private static final Logger logger = LoggerFactory.getLogger(ImOnlineGuidanceJob.class);
    @Autowired
    private ImJobService imJobService;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        try {
            logger.info("onlineGuidance job start...");
            imJobService.onlineGuidance("18");
            imJobService.onlineGuidance("26");
            logger.info("onlineGuidance job end.");
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}

+ 41 - 1
svr/svr-internet-hospital-job/src/main/resources/application.yml

@ -501,7 +501,47 @@ im:
fastDFS:
  fastdfs_file_url: http://10.172.0.61:8888/
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
  url: https://www.xmtyw.cn/wlyytest/
wechat:
  id: xm_zjxl_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
  ids: xm_zjxl_wx
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: JKZL
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk
jobs:
  schedule: 0 */1 * * * ?
---
spring:
  profiles: mlwTest
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://172.26.0.114:3306/base?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: root
    password: 4D^tK%!4
hlwyyEntrance:
  url: http://localhost:10023
demo:
  flag: true
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://172.26.0.153:3000/
  data_base_name: im
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
wlyy:
  url: https://www.xmtyw.cn/wlyytest/
wechat:
  id: xm_zjxl_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle

+ 7 - 0
svr/svr-internet-hospital-job/src/main/resources/bootstrap.yml

@ -84,3 +84,10 @@ spring:
    config:
      uri: ${wlyy.pring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: mlwTest
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://172.26.0.153:1221}
      label: ${wlyy.spring.config.label:master}

+ 2 - 0
svr/svr-internet-hospital-job/src/main/resources/system.properties

@ -17,6 +17,8 @@ data_ykupload_job=0 0 0 * * ?
unsettled_prescription_notice_job=0 */1 * * * ?
pay_status_notice_job=0 */1 * * * ?
im_online_guidance_job=0 */1 * * * ?
CSTXJOB=0 */1 * * * ?
#-------------------------\u773C\u79D1\u533B\u9662end-----------------------------#
#-------------------------\u76D1\u7BA1\u5E73\u53F0\u901A\u7528\u533B\u9662-----------------------------#