瀏覽代碼

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

 Conflicts:
	common/common-entity/sql记录
liubing 3 年之前
父節點
當前提交
81193875a4
共有 22 個文件被更改,包括 930 次插入79 次删除
  1. 115 0
      business/es-service/src/main/java/com/yihu/jw/es/service/yqfk/YqfkService.java
  2. 14 0
      common/common-entity/sql记录
  3. 6 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  4. 9 0
      gateway/ag-basic/src/main/resources/bootstrap.yml
  5. 33 0
      server/svr-authentication/src/main/resources/application.yml
  6. 8 0
      server/svr-authentication/src/main/resources/bootstrap.yml
  7. 15 0
      server/svr-configuration/src/main/resources/bootstrap.yml
  8. 48 1
      svr/svr-base/src/main/resources/application.yml
  9. 9 1
      svr/svr-base/src/main/resources/bootstrap.yml
  10. 11 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/sign/SignEndpoint.java
  11. 47 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/statistics/DetectionPlatformEndpoint.java
  12. 83 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/sign/ServicePackageService.java
  13. 52 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/DetectionPlatformService.java
  14. 5 0
      svr/svr-cloud-device/pom.xml
  15. 21 0
      svr/svr-cloud-device/src/main/java/com/yihu/jw/care/config/WebSocketConfig.java
  16. 84 0
      svr/svr-cloud-device/src/main/java/com/yihu/jw/care/endpoint/SocketClientTest.java
  17. 103 0
      svr/svr-cloud-device/src/main/java/com/yihu/jw/care/endpoint/SocketServerTest.java
  18. 151 0
      svr/svr-cloud-device/src/main/java/com/yihu/jw/care/endpoint/WebSocketServer.java
  19. 25 0
      svr/svr-cloud-device/src/main/java/com/yihu/jw/care/endpoint/YunXinIotController.java
  20. 16 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  21. 67 76
      svr/svr-internet-hospital/src/main/resources/application.yml
  22. 8 0
      svr/svr-internet-hospital/src/main/resources/bootstrap.yml

+ 115 - 0
business/es-service/src/main/java/com/yihu/jw/es/service/yqfk/YqfkService.java

@ -0,0 +1,115 @@
package com.yihu.jw.es.service.yqfk;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 *
 * 卫建局疫情防控
 *
 * Created by wangzhinan on 2020/08/21
 */
@Service
public class YqfkService {
    private Logger logger = LoggerFactory.getLogger(YqfkService.class);
    @Autowired
    private JdbcTemplate jdbcTemplate;
    /**
     * 疫情防控头部总数统计
     * @param startTime
     * @param endTime
     * @return
     */
    public JSONObject yqfkStatisticsHead(String startTime,String endTime){
        JSONObject object = new JSONObject();
        String sql = "select COUNT(1) as confirmedTotal from MID_CDC_CASE_INFO where ";
        object.put("confirmed","");//现有确诊
        object.put("newHome","");//新增本土
        object.put("newAsymptomatic","");//新增无症状;
        object.put("confirmedTotal","");//累计确诊
        object.put("cureTotal","");//累计治愈
        object.put("deathTotal","");//累计死亡
        return object;
    }
    public JSONObject yqfkStatisticsTail(String startTime,String endTime){
        JSONObject object = new JSONObject();
        JSONObject MjObject = new JSONObject();//在厦密接
        MjObject.put("zyTotal","");//正转运
        MjObject.put("jdTotal","");//在酒店/已采核酸
        MjObject.put("dlsTotal","");//待落实
        MjObject.put("total","");//总计
        JSONObject CmObject = new JSONObject();//在厦次密
        CmObject.put("zyTotal","");//正转运
        CmObject.put("jdTotal","");//在酒店/已采核酸
        CmObject.put("dlsTotal","");//待落实
        CmObject.put("total","");//总计
        JSONObject ybObject = new JSONObject();//在厦一般接触者
        ybObject.put("zyTotal","");//正转运
        ybObject.put("jdTotal","");//在酒店/已采核酸
        ybObject.put("dlsTotal","");//待落实
        ybObject.put("total","");//总计
        object.put("MjObject",MjObject);
        object.put("CmObject", CmObject);
        object.put("ybObject",ybObject);
        return object;
    }
    public  List<Map<String, Object>> confirmedList(){
        String confirmedListSql = "select PATIENT_ID as \"patientId\",PATIENT_NAME as \"patientName\",PATIENT_SEX as \"patientSex\",PATIENT_AGE as \"patientAge\",DIAG_TIME as \"diagTime\" from MID_CDC_CASE_INFO ";
        List<Map<String, Object>> confirmedList = jdbcTemplate.queryForList(confirmedListSql);
        if (confirmedList!=null&&confirmedList.size()!=0){
            for (Map<String,Object> map:confirmedList){
                String patientId = map.get("patientId").toString();
                //密接人数计算
                String mjTotalSql = "select count(1) as total from MID_CDC_CCC_INFO where PATIENT_ID='"+patientId+"'";
                List<Map<String, Object>> mjList = jdbcTemplate.queryForList(mjTotalSql);
                Integer mjTotal = 0;//密接人数
                if (mjList!=null&&mjList.size()!=0){
                    mjTotal = Integer.parseInt(mjList.get(0).get("total").toString());
                }
                map.put("mjTotal",mjTotal);
                //次密接人数计算
                String cmjTotalSql = "select count(1) as total from MID_CDC_CCC_SED_INFO where PATIENT_ID='"+patientId+"'";
                List<Map<String, Object>> cmjList = jdbcTemplate.queryForList(cmjTotalSql);
                Integer cmjTotal = 0;//密接人数
                if (cmjList!=null&&cmjList.size()!=0){
                    cmjTotal = Integer.parseInt(cmjList.get(0).get("total").toString());
                }
                map.put("cmjTotal",cmjTotal);
                //一般接触人数计算
                String ybmjTotalSql = "select count(1) as total from MID_KEYNOTE_CROWD_INFO where PATIENT_ID='"+patientId+"'";
                List<Map<String, Object>> ybmjList = jdbcTemplate.queryForList(ybmjTotalSql);
                Integer ybmjTotal = 0;//密接人数
                if (ybmjList!=null&&ybmjList.size()!=0){
                    ybmjTotal = Integer.parseInt(ybmjList.get(0).get("total").toString());
                }
                map.put("ybmjTotal",ybmjTotal);
            }
        }
        return confirmedList;
    }
}

+ 14 - 0
common/common-entity/sql记录

@ -1295,6 +1295,20 @@ CREATE TABLE base_patient_out_bed (
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建日期 即起床时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='患者离床时间';
-- 20210819 skj 导入居民签约数据 (未执行)
CREATE TABLE `base_patient_add` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `idcard` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '身份证号',
  `mobile` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `doc_mobile` varchar(50) NOT NULL COMMENT '医生手机号',
  `start` varchar(255) DEFAULT NULL COMMENT '签约开始时间',
  `end` varchar(255) DEFAULT NULL COMMENT '签约结束时间',
  `service_package` varchar(255) DEFAULT NULL COMMENT '服务包',
  `team_code` varchar(255) DEFAULT NULL COMMENT '签约团队code',
  `del` int(1) DEFAULT '1' COMMENT '1有效  0失效',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- 20210819
alter table wlyy_devices add COLUMN device_type TINYINT(2) default null COMMENT '设备种类 0健康设备 1安防设备';
alter table wlyy_patient_device add COLUMN device_type TINYINT(2) default null COMMENT '设备种类 0健康设备 1安防设备';

+ 6 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -1494,6 +1494,12 @@ public class BaseHospitalRequestMapping {
        public static final String findDeptHomepageBanner = "/findDeptHomepageBanner";
        public static final String updateDeptHomepageBanner = "/updateDeptHomepageBanner";
        public static final String delDeptHomepageBanner = "/delDeptHomepageBanner";
        //疫情防控
        public static final String confirmedList = "/confirmedList";//确诊列表
        public static final String yqfkStatisticsHead = "/yqfkStatisticsHead";//头部确诊数量
        public static final String yqfkStatisticsTail = "/yqfkStatisticsTail";//密接数量统计
    }
    /**

+ 9 - 0
gateway/ag-basic/src/main/resources/bootstrap.yml

@ -152,4 +152,13 @@ spring:
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://192.168.250.39:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: yqfk
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:master}

+ 33 - 0
server/svr-authentication/src/main/resources/application.yml

@ -538,6 +538,39 @@ spring:
    password: Kb6wKDQP1W4
iHealth:
  user-info-uri: http://www.xmtyw.cn/wlyy/iHealth/userInfo
zhongshanHospital:
  user-info-uri: http://laptop-u738dn2p:10023/mqsdk/getUserInfoByOpenid
fastDFS:
  fastdfs_file_url: http://192.168.120.103:6002
wlyy:
  url: http://www.xmtyw.cn/wlyy/
testPattern: #文件服务器上传配置 0本地,1.I健康,2.内网调用
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wechat:
  id: xm_hcyy_wx  # base库中,wx_wechat 的id字段
im:
  im_list_get: http://127.0.0.1:3000/
kick:
    eachOther: 1 #互踢 1开通 0关闭
---
spring:
  profiles: yqfk
  datasource:
    url: jdbc:mysql://10.90.32.3:22042/base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true&useSSL=false
    username: jkzl_root
    password: jkzlehr@2020%
  redis:
    host: 127.0.0.1 # Redis server host.
    port: 6380 # Redis server port.
    password: Kb6wKDQP1W4
iHealth:
  user-info-uri: http://www.xmtyw.cn/wlyy/iHealth/userInfo
zhongshanHospital:

+ 8 - 0
server/svr-authentication/src/main/resources/bootstrap.yml

@ -154,4 +154,12 @@ spring:
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://192.168.250.39:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: yqfk
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:master}

+ 15 - 0
server/svr-configuration/src/main/resources/bootstrap.yml

@ -227,6 +227,21 @@ spring:
---
spring:
  profiles: hcyyProd
##git配置
  cloud:
    config:
      failFast: true #启动快速失败 即链接不到配置服务就启动失败
      server:
        git:
          uri: ${wlyy.spring.config.git.uri:http://127.0.0.1:3001/jkzl/wlyy2.0.config.git}
          basedir: /data/wlyy2.0/wlyy2.0.config
          username: jkzl
          password: jkzl
        default-label: ${wlyy.spring.config.git.label:master}
---
spring:
  profiles: yqfk
##git配置
  cloud:
    config:

+ 48 - 1
svr/svr-base/src/main/resources/application.yml

@ -687,4 +687,51 @@ testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
im:
  im_list_get: http://10.9.1.247:3000/
  im_list_get: http://10.9.1.247:3000/
---
spring:
  profiles: hcyyProd
  datasource:
    url: jdbc:mysql://192.168.120.103:6001/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: wlyy
    password: 2oEq3Kf7@zjxl
  elasticsearch:
    cluster-name: jkzl #集群名 默认elasticsearch
    cluster-nodes: 192.168.120.103:6005 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    client-transport-sniff: false
    jest:
      uris: http://192.168.120.103:6006
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://59.61.92.90:9103
    user: jkzl
    password: jkzlehr
  redis:
    host: 192.168.120.103 # Redis server host.
    port: 6007 # Redis server port.
    password: Kb6wKDQP1W4
fastDFS:
  fastdfs_file_url: http://192.168.120.103:6004/
demo:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
pay:
  flag: false
wlyy:
  url: http://ehr.yihu.com/wlyy/
wechat:
  id: xm_hcyy_wx
  url: https://zhyzh.gongshu.gov.cn/
  flag: false
testPattern: #文件服务器上传配置 0本地,1.I健康,2.内网调用
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
im:
  im_list_get: http://127.0.0.1:3000/

+ 9 - 1
svr/svr-base/src/main/resources/bootstrap.yml

@ -117,4 +117,12 @@ spring:
  cloud:
    config:
      uri: ${wlyy-spring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy-spring.config.label:jwdev}
      label: ${wlyy-spring.config.label:jwdev}
---
spring:
  profiles: hcyyProd
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://192.168.250.39:1221}
      label: ${wlyy.spring.config.label:master}

+ 11 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/sign/SignEndpoint.java

@ -48,6 +48,17 @@ public class SignEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private ServicePackageService servicePackageService;
    @PostMapping(value = "addPatientSignList")
    @ApiOperation(value = "添加签约数据")
    public Envelop addPatientSignList () throws Exception {
        try{
            servicePackageService.addPatientSignList();
            return success("添加成功");
        }catch (Exception e){
            return failedListEnvelopException2(e);
        }
    }
    @GetMapping(value = "findSignOrg")
    @ApiOperation(value = "查找签约机构")
    public ListEnvelop findSignOrg (

+ 47 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/statistics/DetectionPlatformEndpoint.java

@ -0,0 +1,47 @@
package com.yihu.jw.care.endpoint.statistics;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.service.statistics.DetectionPlatformService;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/***
 * @ClassName: DetectionPlatformEndpoint
 * @Description: 社区云照护平台--物联网健康监测展示平台
 * @Auther: shi kejing
 * @Date: 2021/8/20 9:28
 */
@RestController
@RequestMapping(value = "open/platform")
@Api(value = "物联网健康监测展示平台v1.0.0", description = "物联网健康监测展示平台v1.0.0", tags = {"物联网健康监测展示平台v1.0.0"})
public class DetectionPlatformEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private DetectionPlatformService platformService;
    @GetMapping(value = "statisticsTotalAmount")
    @ApiOperation(value = "统计总数")
    public PageEnvelop statisticsTotalAmount(
            @ApiParam(name="page",value = "page") @RequestParam(required = true) int page,
            @ApiParam(name="size",value = "size") @RequestParam(required = true) int size,
            @ApiParam(name="type",value = "type=1(健康监测)   type=2(安防检测)") @RequestParam(required = true) int type) {
        try {
            return platformService.getHealthMonitoringListNew(page,size,type);
        } catch (Exception e) {
            return failedPageEnvelopException2(e);
        }
    }
}

+ 83 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/sign/ServicePackageService.java

@ -36,6 +36,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@ -82,6 +83,88 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
    @Autowired
    private DictService dictService;
    public void addPatientSignList(){
        String lableCode = "0";
        //根据idcard/mobile导入居民信息
        String sql = "SELECT p.idcard,p.id,p.`name`,d.id AS doctor,d.name AS doctorName,pa.start,pa.end,pa.service_package AS servicePackage,pa.team_code AS teamCode FROM base_patient_add pa,base_patient p,base_doctor d WHERE d.mobile = pa.mobile AND d.del = 1 AND pa.del = 1 AND p.del =1 AND p.idcard = pa.idcard OR p.mobile = pa.mobile group by p.id ";
        List<Map<String , Object>> mapList = jdbcTemplate.queryForList(sql);
        ServicePackageSignRecordDO signRecordDO = new ServicePackageSignRecordDO();
        String patientId = "";
        String patientName = "";
        String doctorId = "";
        String doctorName = "";
        String idcard = "";
        String signId = "";
        for (int i=0;i<mapList.size();i++){
            try {
                patientId = (String) mapList.get(i).get("id");
                patientName = (String) mapList.get(i).get("name");
                doctorId = (String) mapList.get(i).get("doctor");
                doctorName = (String) mapList.get(i).get("doctorName");
                idcard = (String) mapList.get(i).get("idcard");
                List<ServicePackageSignRecordDO> signRecordDOs = servicePackageSignRecordDao.findByStatusAndPatient(1,patientId);
                if (signRecordDOs.size() == 0) {
                    signRecordDO.setPatient(patientId);
                    signRecordDO.setName(patientName);
                    signRecordDO.setSignDoctor(doctorId);
                    signRecordDO.setSignDoctorName(doctorName);
                    if (StringUtils.isNotBlank((String) mapList.get(i).get("start"))){
                        signRecordDO.setStartTime((Date) mapList.get(i).get("start"));
                    }else {
                        signRecordDO.setStartTime(new Date());
                    }
                    if (StringUtils.isNotBlank((String) mapList.get(i).get("end"))){
                        signRecordDO.setEndTime((Date) mapList.get(i).get("end"));
                    }else {
                        signRecordDO.setEndTime(new Date(System.currentTimeMillis() + 365*24*60*60*1000));
                    }
                    signRecordDO.setStatus(1);
                    servicePackageSignRecordDao.save(signRecordDO);
                    ServicePackageRecordDO packageRecordDO = new ServicePackageRecordDO();
                    packageRecordDO.setPatient(patientId);
                    packageRecordDO.setCreateTime(new Date());
                    packageRecordDO.setSignId(signRecordDO.getId());
                    packageRecordDO.setServicePackageId((String) mapList.get(i).get("servicePackage"));
                    packageRecordDO.setTeamCode((String) mapList.get(i).get("teamCode"));
                    servicePackageRecordDao.save(packageRecordDO);
                    //建档状态
                    ArchiveDO archiveDO = new ArchiveDO();
                    archiveDO.setCreateTime(new Date());
                    archiveDO.setArchiveOperatorName(doctorName);
                    archiveDO.setPatient(patientId);
                    archiveDO.setSickName(patientName);
                    archiveDO.setIdcard(idcard);
                    archiveDO.setSignStatus(1);
                    archiveDao.save(archiveDO);
                    //居民标签
                    WlyyPatientLabelDO patientLabelDO = new WlyyPatientLabelDO();
                    patientLabelDO.setCzrq(new Date());
                    patientLabelDO.setLabelType("1");
                    patientLabelDO.setPatient((String) mapList.get(i).get("patient"));
                    patientLabelDO.setLabelCode(lableCode);
                    patientLabelDO.setLabelName(dictService.fingByNameAndCode(ConstantUtil.DICT_SERVICE_TYPE,lableCode));
                    patientLabelDao.save(patientLabelDO);
                    //修改base_patient_add里面的del,状态修改成0
                }else {
                    logger.info("居民已签约,patient:"+patientId);
                }
            }catch (Exception e){
                logger.info(e.getMessage());
            }
        }
    }
    /**
     * 查找签约机构
     * @param patient

+ 52 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/DetectionPlatformService.java

@ -0,0 +1,52 @@
package com.yihu.jw.care.service.statistics;
import com.yihu.jw.restmodel.web.PageEnvelop;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/***
 * @ClassName: DetectionPlatformService
 * @Description:
 * @Auther: shi kejing
 * @Date: 2021/8/20 9:39
 */
@Service
public class DetectionPlatformService  {
    Logger logger = LoggerFactory.getLogger(DetectionPlatformService.class);
    @Autowired
    private JdbcTemplate jdbcTemplate;
    public PageEnvelop getHealthMonitoringListNew(Integer page, Integer pageSize, Integer type){
        page = page>0?page-1:0;
        if (type == 1) {
            String sql = " SELECT id,user,`name`,'健康监测' as serve_desc,czrq,value1,value2,value3,value4,value5,value6,value7,type \n" +
                    "FROM wlyy_patient_health_index WHERE del = 1 AND type < 3 ORDER BY czrq ";
            String countSql = "select count(id) from ("+sql+")A ";
            long count = jdbcTemplate.queryForObject(countSql,long.class);
            sql +=" limit "+page*pageSize+","+pageSize;
            List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
            return PageEnvelop.getSuccessListWithPage("查询成功",list,page,pageSize,count);
        }else {
            String sql = " select  '22' as 'OrderType',ord.id,ord.patient,p.name,ord.serve_desc,DATE_FORMAT(ord.create_time,'%Y-%m-%d %H:%i:%S') create_time,ord.`status` \n" +
                    "from base_security_monitoring_order ord INNER JOIN base_patient p on ord.patient = p.id order by create_time desc ";
            String countSql = "select count(id) from ("+sql+")A ";
            long count = jdbcTemplate.queryForObject(countSql,long.class);
            sql +=" limit "+page*pageSize+","+pageSize;
            List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
            return PageEnvelop.getSuccessListWithPage("查询成功",list,page,pageSize,count);
        }
    }
}

+ 5 - 0
svr/svr-cloud-device/pom.xml

@ -16,6 +16,11 @@
    <version>${parent.version}</version>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-websocket</artifactId>
        </dependency>
        <!-- 支持Tomcat启动 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>

+ 21 - 0
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/config/WebSocketConfig.java

@ -0,0 +1,21 @@
package com.yihu.jw.care.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
/***
 * @ClassName: WebSocketConfig
 * @Description: 开启WebSocket支持
 * @Auther: shi kejing
 * @Date: 2021/8/20 14:17
 */
@Configuration
public class WebSocketConfig {
    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }
}

+ 84 - 0
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/endpoint/SocketClientTest.java

@ -0,0 +1,84 @@
package com.yihu.jw.care.endpoint;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.Socket;
/***
 * @ClassName: SocketTest
 * @Description: scoket客户端
 * @Auther: shi kejing
 * @Date: 2021/8/20 11:00
 */
public class SocketClientTest {
    public static void main(String[] args) {
        SocketClientTest client=new SocketClientTest();
        client.startAction();
    }
    void readSocketInfo(BufferedReader reader){
        new Thread(new MyRuns(reader)).start();
    }
    class MyRuns implements Runnable{
        BufferedReader reader;
        public MyRuns(BufferedReader reader) {
            super();
            this.reader = reader;
        }
        public void run() {
            try {
                String lineString="";
                while( (lineString = reader.readLine())!=null ){
                    System.out.println(lineString);
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
    public void startAction(){
        Socket socket=null;
        BufferedReader reader=null;
        BufferedWriter writer=null;
        BufferedReader reader2=null;
        try {
            socket=new Socket("172.26.0.107", 9112);
            reader = new BufferedReader(new InputStreamReader(System.in));
            reader2=new BufferedReader(new InputStreamReader(socket.getInputStream()));
            writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
            readSocketInfo(reader2);
            String lineString="";
            while(!(lineString=reader.readLine()).equals("exit")){
                writer.write(lineString+"\n");
                writer.flush();
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (reader!=null) {
                    reader.close();
                }
                if (writer!=null) {
                    writer.close();
                }
                if (socket!=null) {
                    socket.close();
                }
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        }
    }
}

+ 103 - 0
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/endpoint/SocketServerTest.java

@ -0,0 +1,103 @@
package com.yihu.jw.care.endpoint;
import com.tencentcloudapi.oceanus.v20190422.models.SystemResourceItem;
import com.yihu.jw.entity.util.SystemConfEntity;
import jdk.internal.cmm.SystemResourcePressureImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.convert.Property;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.ServerSocket;
import java.net.Socket;
/***
 * @ClassName: SocketServerTest
 * @Description: socket服务器端
 * @Auther: shi kejing
 * @Date: 2021/8/20 11:04
 */
@Component
public class SocketServerTest {
    private final static Logger logger = LoggerFactory.getLogger(SocketServerTest.class);
    public static void main(String[] args) {
        SocketServerTest st = new SocketServerTest();
        st.startAction();
    }
//    @PostConstruct
    public void startAction(){
        logger.info("服务端服务启动监听:");
        ServerSocket serverSocket=null;
        try {
            serverSocket=new ServerSocket(9112);  //端口号
            logger.info("服务端服务启动监听:");
            //通过死循环开启长连接,开启线程去处理消息
            while(true){
                Socket socket=serverSocket.accept();
                new Thread(new SocketServerTest.MyRuns(socket)).start();
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (serverSocket!=null) {
                    serverSocket.close();
                }
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        }
    }
    class MyRuns implements Runnable{
        Socket socket;
        BufferedReader reader;
        BufferedWriter writer;
        public MyRuns(Socket socket) {
            super();
            this.socket = socket;
        }
        public void run() {
            try {
                reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));//读取客户端消息
                writer=new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));//向客户端写消息
                String lineString=""; //服务器接受到的消息
                while(!(lineString=reader.readLine()).equals("bye")){
                    logger.info("收到来自客户端的发送的消息是:" + lineString);
                    writer.write("服务器返回:"+lineString+"\n");
                    writer.flush();
                }
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                try {
                    if (reader!=null) {
                        reader.close();
                    }
                    if (writer!=null) {
                        writer.close();
                    }
                    if (socket!=null) {
                        socket.close();
                    }
                } catch (Exception e2) {
                    e2.printStackTrace();
                }
            }
        }
    }
}

+ 151 - 0
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/endpoint/WebSocketServer.java

@ -0,0 +1,151 @@
package com.yihu.jw.care.endpoint;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import javax.websocket.*;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
import java.io.IOException;
import java.util.concurrent.ConcurrentHashMap;
import com.alibaba.fastjson.JSON;
/***
 * @ClassName: WebSocketServer
 * @Description:
 * @Auther: shi kejing
 * @Date: 2021/8/20 14:20
 */
@ServerEndpoint("/")
@Component
public class WebSocketServer {
    private final static Logger log = LoggerFactory.getLogger(WebSocketServer.class);
    /**静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。*/
    private static int onlineCount = 0;
    /**concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。*/
    private static ConcurrentHashMap<String,WebSocketServer> webSocketMap = new ConcurrentHashMap<>();
    /**与某个客户端的连接会话,需要通过它来给客户端发送数据*/
    private Session session;
    /**接收userId*/
    private String userId="ijk";
    /**
     * 连接建立成功调用的方法*/
    @OnOpen
    public void onOpen(Session session,@PathParam("userId") String userId) {
        userId="ijk";
        log.info("userId = "+userId);
        this.session = session;
        this.userId=userId;
        if(webSocketMap.containsKey(userId)){
            webSocketMap.remove(userId);
            webSocketMap.put(userId,this);
            //加入set中
        }else{
            webSocketMap.put(userId,this);
            //加入set中
            addOnlineCount();
            //在线数加1
        }
        log.info("用户连接:"+userId+",当前在线人数为:" + getOnlineCount());
        try {
            sendMessage("连接成功");
        } catch (IOException e) {
            log.error("用户:"+userId+",网络异常!!!!!!");
        }
    }
    /**
     * 连接关闭调用的方法
     */
    @OnClose
    public void onClose() {
        if(webSocketMap.containsKey(userId)){
            webSocketMap.remove(userId);
            //从set中删除
            subOnlineCount();
        }
        log.info("用户退出:"+userId+",当前在线人数为:" + getOnlineCount());
    }
    /**
     * 收到客户端消息后调用的方法
     *
     * @param message 客户端发送过来的消息*/
    @OnMessage
    public void onMessage(String message, Session session) {
        log.info("用户消息:"+userId+",报文:"+message);
        //可以群发消息
        //消息保存到数据库、redis
        if(StringUtils.isNotBlank(message)){
            try {
                //解析发送的报文
                JSONObject jsonObject = JSON.parseObject(message);
                //追加发送人(防止串改)
                jsonObject.put("fromUserId",this.userId);
                String toUserId=jsonObject.getString("toUserId");
                //传送给对应toUserId用户的websocket
                if(StringUtils.isNotBlank(toUserId)&&webSocketMap.containsKey(toUserId)){
                    webSocketMap.get(toUserId).sendMessage(jsonObject.toJSONString());
                }else{
                    log.error("请求的userId:"+toUserId+"不在该服务器上");
                    //否则不在这个服务器上,发送到mysql或者redis
                }
            }catch (Exception e){
                e.printStackTrace();
            }
        }
    }
    /**
     *
     * @param session
     * @param error
     */
    @OnError
    public void onError(Session session, Throwable error) {
        log.error("用户错误:"+this.userId+",原因:"+error.getMessage());
        error.printStackTrace();
    }
    /**
     * 实现服务器主动推送
     */
    public void sendMessage(String message) throws IOException {
        this.session.getBasicRemote().sendText(message);
    }
    /**
     * 发送自定义消息
     * */
    public static void sendInfo(String message,@PathParam("userId") String userId) throws IOException {
        log.info("发送消息到:"+userId+",报文:"+message);
        if(StringUtils.isNotBlank(userId)&&webSocketMap.containsKey(userId)){
            webSocketMap.get(userId).sendMessage(message);
        }else{
            log.error("用户"+userId+",不在线!");
        }
    }
    public static synchronized int getOnlineCount() {
        return onlineCount;
    }
    public static synchronized void addOnlineCount() {
        WebSocketServer.onlineCount++;
    }
    public static synchronized void subOnlineCount() {
        WebSocketServer.onlineCount--;
    }
}

+ 25 - 0
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/endpoint/YunXinIotController.java

@ -0,0 +1,25 @@
package com.yihu.jw.care.endpoint;
import com.yihu.jw.care.common.BaseController;
import io.swagger.annotations.Api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.PostConstruct;
/***
 * @ClassName: YunXinIotController
 * @Description: 云芯 智能拐杖
 * @Auther: shi kejing
 * @Date: 2021/8/20 10:06
 */
@RestController
@RequestMapping(value = "yunxin/device")
@Api(value = "云芯 智能拐杖", description = "云芯 智能拐杖", tags = {"云芯 智能拐杖"})
public class YunXinIotController extends BaseController {
    private final static Logger LOGGER = LoggerFactory.getLogger(YunXinIotController.class);
}

+ 16 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -26,6 +26,7 @@ import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO;
import com.yihu.jw.es.service.StatisticsEsService;
import com.yihu.jw.es.service.yqfk.YqfkService;
import com.yihu.jw.file_upload.FileUploadService;
import com.yihu.jw.hospital.dao.consult.KnowledgeArticleUserDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
@ -230,7 +231,9 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @Autowired
    private TasyNatService tasyNatService;
    @Autowired
    private WxTemplateConfigDao wxTemplateConfigDao;
    private YqfkService yqfkService;
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDoctorByHospitalAndDiseaseAndDept)
    @ApiOperation(value = "根据疾病名称,热门部门查询医生", notes = "根据疾病名称,热门部门查询医生")
@ -2563,4 +2566,16 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            return failedMixEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.confirmedList)
    @ApiOperation(value = "确诊列表", notes = "确诊列表")
    public ListEnvelop confirmedList(){
        try {
            return success(yqfkService.confirmedList());
        } catch (Exception e){
            return  failedListEnvelopException(e);
        }
    }
}

+ 67 - 76
svr/svr-internet-hospital/src/main/resources/application.yml

@ -961,53 +961,36 @@ express:
  sf_code: WH000102
  sf_check_word: TGUQASFNAZyjt9112
---
spring:
  profiles: hcyyprod
  profiles: dsyy
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://172.26.0.114/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: root
    password: jkzlehr
#  elasticsearch:
#    cluster-name: jkzl #集群名 默认elasticsearch
#    cluster-nodes: 172.26.0.115:9300,172.26.0.115:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
#    client-transport-sniff: false
#    jest:
#      uris: http://172.26.0.112:9200,http://172.26.0.112:9200
#      connection-timeout: 60000 # Connection timeout in milliseconds.
#      multi-threaded: true # Enable connection requests from multiple execution threads.
    url: jdbc:mysql://127.0.0.1:3306/base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true&useSSL=false
    username: wlyy
    password: 2oEq3Kf7@zjxl
  activemq:
    broker-url: tcp://172.26.0.116:61616
    user: admin
    password: admin
  redis:
    host: 172.26.0.253 # Redis server host.
    port: 6379 # Redis server port.
#    password: jkzl_ehr
#  zipkin:
#    base-url: http://localhost:9411 #日志追踪的地址
    host: 127.0.0.1 # Redis server host.
    port: 6380 # Redis server port.
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
fast-dfs:
  tracker-server: 172.26.0.110:22122 #服务器地址
# 短信发送地址
jw:
  smsUrl: http://svr-base:10020/sms_gateway/send
myFamily:
  qrCodeFailurTime: 2
wechat:
  id: xm_zsyy_wx  # base库中,wx_wechat 的id字段
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage
# 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
myFamily:
  qrCodeFailurTime: 2
demo:
  flag: true
#支付支付
pay:
  flag: true
hospital:
@ -1020,67 +1003,74 @@ im:
  im_list_get: http://172.26.0.105:3000/
  data_base_name: im_internet_hospital
es:
  pwflag: 1 # 1需要密码,2不需要密码
  index:
    Statistics: hlw_quota_test
  type:
    Statistics: hlw_quota_test
  host:  http://172.26.0.112:9200
  tHost: 172.26.0.112:9300
  host:  http://172.26.0.55:9000
  tHost: 172.26.0.55:9300
  clusterName: jkzl
  securityUser: elastic:elastic
  securityUser: lion:jkzlehr
  user: lion
  password: jkzlehr
# 上传文件临时路径配置
FileTempPath:
  upload_temp_path : /var/local/temp
  image_path : /var/local/upload/images
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://ehr.yihu.com/wlyy/
qywx:
  url: 2
  id: 2
  id: 1
express:
  sf_url: https://mrds-admin.sf-express.com:443
  sf_code: JKZL
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk
  sf_url: http://mrds-admin-ci.sit.sf-express.com:45478
  sf_code: HD000001
  sf_check_word: AAAABBBBCCCCDDDD
---
---
spring:
  profiles: dsyy
  profiles: hcyyProd
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://127.0.0.1:3306/base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true&useSSL=false
    url: jdbc:mysql://192.168.120.103:6001/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: wlyy
    password: 2oEq3Kf7@zjxl
  activemq:
    broker-url: tcp://172.26.0.116:61616
    user: admin
    password: admin
    broker-url: tcp://59.61.92.90:9103
    user: jkzl
    password: jkzlehr
  redis:
    host: 127.0.0.1 # Redis server host.
    port: 6380 # Redis server port.
    host: 192.168.120.103 # Redis server host.
    port: 6007 # Redis server port.
    password: Kb6wKDQP1W4
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
  fastdfs_file_url: https://hlwyy.xmzsh.com/fastdfs/
fast-dfs:
  tracker-server: 172.26.0.110:22122 #服务器地址
  tracker-server: 192.168.120.103:6002 #服务器地址
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage
  id: xm_hcyy_wx  # base库中,wx_wechat 的id字段  # todo 待配置
  flag: true #演示环境  true走Mysql数据库  false走Oracle
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage # 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP
  clientId: EwC0iRSrcP #todo 待配置
myFamily:
  qrCodeFailurTime: 2
  qrCodeFailurTime: 2 # mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: true
  flag: true #支付支付
pay:
  flag: true
@ -1091,60 +1081,62 @@ hospital:
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://172.26.0.105:3000/
  data_base_name: im_internet_hospital
  im_list_get: http://127.0.0.1:3000/
  data_base_name: im
es:
  pwflag: 1 # 1需要密码,2不需要密码
  index:
    Statistics: hlw_quota_test
    Statistics: hlw_quota_prod
  type:
    Statistics: hlw_quota_test
  host:  http://172.26.0.55:9000
  tHost: 172.26.0.55:9300
    Statistics: hlw_quota_prod
  host:  http://192.168.120.103:6005
  tHost: 192.168.120.103:6006
  securityUser: elastic:elastic
  clusterName: jkzl
  securityUser: lion:jkzlehr
  user: lion
  password: jkzlehr
FileTempPath:
FileTempPath: # 上传文件临时路径配置
  upload_temp_path : /var/local/temp
  image_path : /var/local/upload/images
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
testPattern:
testPattern: #文件服务器上传配置 0本地,1.I健康,2.内网调用
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://ehr.yihu.com/wlyy/
  url: http://www.xmtyw.cn/wlyytest/
qywx:
  url: 2
  id: 1
  url: https://hlwyy.xmzsh.com/hlwyy
  id: zsyy
express:
  sf_url: http://mrds-admin-ci.sit.sf-express.com:45478
  sf_code: HD000001
  sf_check_word: AAAABBBBCCCCDDDD
  sf_url: https://mrds-admin.sf-express.com:443
  sf_code: WH000102
  sf_check_word: TGUQASFNAZyjt9112
---
spring:
  profiles: hcyyProd
  profiles: yqfk
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://192.168.120.103:6001/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: wlyy
    password: 2oEq3Kf7@zjxl
    url: jdbc:mysql://10.90.32.3:22042/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: jkzl_root
    password: jkzlehr@2020%
  activemq:
    broker-url: tcp://59.61.92.90:9103
    user: jkzl
    password: jkzlehr
  redis:
    host: 192.168.120.103 # Redis server host.
    port: 6007 # Redis server port.
    host: 127.0.0.1 # Redis server host.
    port: 6380 # Redis server port.
    password: Kb6wKDQP1W4
fastDFS:
  fastdfs_file_url: https://hlwyy.xmzsh.com/fastdfs/
@ -1214,4 +1206,3 @@ express:

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

@ -112,4 +112,12 @@ spring:
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://192.168.250.39:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: yqfk
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:master}