Browse Source

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

Shi Kejing 3 years ago
parent
commit
f4891b2a7b

+ 11 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/lifeCare/LifeCareOrderDO.java

@ -331,6 +331,8 @@ public class LifeCareOrderDO extends UuidIdentityEntityWithOperator {
     */
    private Integer payStatus;//支付状态
    private String doctorPhone;//医生手机信息
    @Column(name = "number")
    public String getNumber() {
        return number;
@ -743,4 +745,13 @@ public class LifeCareOrderDO extends UuidIdentityEntityWithOperator {
    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }
    @Transient
    public String getDoctorPhone() {
        return doctorPhone;
    }
    public void setDoctorPhone(String doctorPhone) {
        this.doctorPhone = doctorPhone;
    }
}

+ 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}

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/security/SecurityMonitoringOrderEndpoint.java

@ -340,7 +340,7 @@ public class SecurityMonitoringOrderEndpoint extends EnvelopRestEndpoint {
                                            @ApiParam(name = "topicItem", value = "专题code,关联security_topic_dict字典", required = false)
                                            @RequestParam(value = "topicItem") String topicItem) {
        try {
            return ObjEnvelop.getSuccess( "查询成功", securityMonitoringOrderService.patientSignTopicInfo(patient,topicItem));
            return ObjEnvelop.getSuccess( "查询成功", securityMonitoringOrderService.patientSignTopicInfo(null,patient,topicItem));
        } catch (Exception e) {
            return failedObjEnvelopException2(e);
        }

+ 6 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/lifeCare/LifeCareOrderService.java

@ -158,6 +158,12 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
        }
        // 获取服务次数
        lifeCareOrderDO.setFeeDetailList(getFeeDetails(id));
        if (StringUtils.isNotBlank(lifeCareOrderDO.getDoctor())){
            BaseDoctorDO doctorDO = doctorDao.findById(lifeCareOrderDO.getDoctor());
            if (null!=doctorDO){
                lifeCareOrderDO.setDoctorPhone(doctorDO.getMobile());
            }
        }
        return lifeCareOrderDO;
    }

+ 17 - 161
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/security/SecurityMonitoringOrderService.java

@ -351,7 +351,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        }
        if (5==orderDO.getOrderSource()){//睡眠带工单
            try {
                JSONObject monitorInfo = patientSignTopicInfo(orderDO.getPatient(),"preventOutOfBed");
                JSONObject monitorInfo = patientSignTopicInfo(null,orderDO.getPatient(),"preventOutOfBed");
                Map<String,Object> tmp = JSONObject.parseObject(objectMapper.writeValueAsString(monitorInfo));
                if ("true".equals( tmp.get("sleepStatus").toString())){
                    Map<String,Object> sleepInfo = (Map<String, Object>) tmp.get("sleepInfo");
@ -1213,157 +1213,17 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        else {
            result.put("fall",false);
        }
        if ((StringUtils.isNotBlank(topicItem)&&"preventLost".equals(topicItem))){
            List<DevicePatientDevice> devicePatientDeviceDos = patientDeviceDao.findByUserAndCategoryCode(patient,"4");
            if (devicePatientDeviceDos.size()==0){
            }
            else {
                DevicePatientDevice device = devicePatientDeviceDos.get(0);
                result.put("deviceSn",device.getDeviceSn());
                try {
                    JSONObject response= patientDeviceService.getAqgDeviceInfo(device.getDeviceSn());
                    if (response!=null){
                        //定位信息
                        if (response.containsKey("last_location")&&response.get("last_location")!=null){
                            JSONObject locationTmp = response.getJSONObject("last_location");
                            Double lon = locationTmp.getJSONArray("coordinates").getDouble(0);
                            Double lat = locationTmp.getJSONArray("coordinates").getDouble(1);
                            JSONObject tmp = gpsUtil.gcj02_To_Bd09(lat,lon);
                            tmp.put("city",response.getString("last_city"));
                            tmp.put("province",response.getString("last_province"));
                            tmp.put("address",response.getString("last_address"));
                            result.put("location",tmp);
                        }
                        //围栏信息
                        if (response.containsKey("fences")&&response.get("fences")!=null){
                            JSONArray fencesArr = response.getJSONArray("fences");
                            JSONArray fencesEnables = new JSONArray();
                            for (int i=0;i<fencesArr.size();i++){
                                JSONObject tmp = fencesArr.getJSONObject(i);
                                if (tmp.getBooleanValue("enable")){//围栏生效
                                    JSONObject fenceTmp = new JSONObject();
                                    fenceTmp.put("fenceNO",tmp.getInteger("seqid").toString());
                                    fenceTmp.put("name",tmp.getString("name"));
                                    JSONArray fenceLocationTmp = tmp.getJSONObject("safe_area").getJSONArray("coordinates").getJSONArray(0);
                                    JSONArray fenceLocation = new JSONArray();
                                    for (int j=0;j<fenceLocationTmp.size();j++){
                                        Double lon = fenceLocationTmp.getJSONArray(j).getDouble(0);
                                        Double lat = fenceLocationTmp.getJSONArray(j).getDouble(1);
                                        JSONObject positionTmp = gpsUtil.gcj02_To_Bd09(lat,lon);
                                        fenceLocation.add(positionTmp);
                                    }
                                    fenceTmp.put("location",fenceLocation);
                                    fenceTmp.put("inFenceStatus",countDistance.isInPolygon(result.getJSONObject("location").getDouble("lon"),result.getJSONObject("location").getDouble("lat"),fenceLocation));
                                    fencesEnables.add(fenceTmp);
                                }
                            }
                            if (fencesEnables.size()>0){
                                result.put("fences",fencesEnables);
                            }
                        }
                    }
                }catch (Exception e){
                    e.printStackTrace();
                    result.put("location",null);
                }
            }
        }
        if ((StringUtils.isNotBlank(topicItem)&&"preventFall".equals(topicItem))){
            List<DevicePatientDevice> devicePatientDeviceDos = patientDeviceDao.findByUserAndCategoryCode(patient,"12");
            if (devicePatientDeviceDos.size()==0){
            }
            else{
                try {
                    DevicePatientDevice deviceDo = devicePatientDeviceDos.get(0);
                    JSONObject monitorUrl = ysDeviceServicel.getDeviceLiveAddress(patient,deviceDo.getDeviceSn(),1,null);
                    result.put("monitorInfoStatus",monitorUrl.getIntValue(ResponseContant.resultFlag));
                    result.put("patientAddress",deviceDo.getSosAddress());
                    if (monitorUrl.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail){
                        result.put("monitorInfo",monitorUrl.getString(ResponseContant.resultMsg));
                    }
                    else {
                        result.put("monitorInfo",monitorUrl.getJSONObject(ResponseContant.resultMsg));
                    }
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
        }
        if ((StringUtils.isNotBlank(topicItem)&&"preventOutOfBed".equals(topicItem))){
            List<DevicePatientDevice> devicePatientDeviceDos = patientDeviceDao.findByUserAndCategoryCode(patient,"13");
            if (devicePatientDeviceDos.size()==0){
            }else {
                DevicePatientDevice deviceDo = devicePatientDeviceDos.get(0);
                JSONObject deviceInfo =  patientDeviceService.getSleepDeviceInfo(deviceDo.getDeviceSn());
                if(deviceInfo.getBooleanValue("success")){
                    result.put("patientAddress",deviceDo.getSosAddress());
                    JSONArray objInfo = deviceInfo.getJSONArray("objs");
                    if (objInfo.size()>0){
                        result.put("sleepStatus",true);
                        JSONObject tmp = objInfo.getJSONObject(0);
                        JSONObject sleepInfo = new JSONObject();
                        sleepInfo.put("online",tmp.getBooleanValue("online"));
                        sleepInfo.put("onbed",tmp.getBooleanValue("onbed"));
                        sleepInfo.put("heartrate",tmp.getString("heartrate"));
                        sleepInfo.put("breathrate",tmp.getString("breathrate"));
                        BasePatientOutBed outBed = outBedDao.findByPatientAndDeviceSnAndStatus(patient,deviceDo.getDeviceSn(),0);
                        if (null!=outBed){
                            String outBedTime = "";
                            Date date = new Date();
                            long millisecondsDiff = date.getTime() - outBed.getCreateTime().getTime();
                            long minutesDiff = millisecondsDiff / TimeUnit.MINUTES.toMillis(1L);
                            long hoursDiff = millisecondsDiff / TimeUnit.HOURS.toMillis(1L);
                            if (hoursDiff > 0L) {
                                outBedTime += String.format("%d小时", hoursDiff);
                            }
                            if (minutesDiff>0){
                                outBedTime +=String.format("%d分钟", minutesDiff);
                            }
                            sleepInfo.put("outBedTime",outBedTime);
                        }else {
                            sleepInfo.put("outBedTime","无");
                        }
                        result.put("sleepInfo",sleepInfo);
                    }
                }else {
                    result.put("sleepStatus",false);
                    result.put("sleepInfo","获取睡眠带数据失败");
                }
            }
            //监控
            devicePatientDeviceDos = patientDeviceDao.findByUserAndCategoryCode(patient,"12");
            if (devicePatientDeviceDos.size()==0){
            }
            else{
                try {
                    DevicePatientDevice deviceDo = devicePatientDeviceDos.get(0);
                    JSONObject monitorUrl = ysDeviceServicel.getDeviceLiveAddress(patient,deviceDo.getDeviceSn(),1,null);
                    result.put("monitorInfoStatus",monitorUrl.getIntValue(ResponseContant.resultFlag));
                    result.put("patientAddress",deviceDo.getSosAddress());
                    if (monitorUrl.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail){
                        result.put("monitorInfo",monitorUrl.getString(ResponseContant.resultMsg));
                    }
                    else {
                        result.put("monitorInfo",monitorUrl.getJSONObject(ResponseContant.resultMsg));
                    }
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
        }
        result = patientSignTopicInfo(result,patient,topicItem);
        return result;
    }
    public JSONObject patientSignTopicInfo(String patient,String topicItem){
        JSONObject result = new JSONObject();
        if ((StringUtils.isNotBlank(topicItem)&&"preventLost".equals(topicItem))){
    public JSONObject patientSignTopicInfo(JSONObject result,String patient,String topicItem){
        if (null==result){
            result = new JSONObject();
        }
        if ("preventLost".equals(topicItem)||StringUtils.isBlank(topicItem)){
            List<DevicePatientDevice> devicePatientDeviceDos = patientDeviceDao.findByUserAndCategoryCode(patient,"4");
            if (devicePatientDeviceDos.size()==0){
            }
            if (devicePatientDeviceDos.size()==0){}
            else {
                DevicePatientDevice device = devicePatientDeviceDos.get(0);
                result.put("deviceSn",device.getDeviceSn());
@ -1415,11 +1275,9 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                }
            }
        }
        if ((StringUtils.isNotBlank(topicItem)&&"preventFall".equals(topicItem))){
        if ("preventFall".equals(topicItem)||StringUtils.isBlank(topicItem)){
            List<DevicePatientDevice> devicePatientDeviceDos = patientDeviceDao.findByUserAndCategoryCode(patient,"12");
            if (devicePatientDeviceDos.size()==0){
            }
            if (devicePatientDeviceDos.size()==0){}
            else{
                try {
                    DevicePatientDevice deviceDo = devicePatientDeviceDos.get(0);
@ -1437,11 +1295,10 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                }
            }
        }
        if ((StringUtils.isNotBlank(topicItem)&&"preventOutOfBed".equals(topicItem))){
        if ("preventOutOfBed".equals(topicItem)||StringUtils.isBlank(topicItem)){
            List<DevicePatientDevice> devicePatientDeviceDos = patientDeviceDao.findByUserAndCategoryCode(patient,"13");
            if (devicePatientDeviceDos.size()==0){
            }else {
            if (devicePatientDeviceDos.size()==0){}
            else {
                DevicePatientDevice deviceDo = devicePatientDeviceDos.get(0);
                JSONObject deviceInfo =  patientDeviceService.getSleepDeviceInfo(deviceDo.getDeviceSn());
                if(deviceInfo.getBooleanValue("success")){
@ -1462,11 +1319,12 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                            long millisecondsDiff = date.getTime() - outBed.getCreateTime().getTime();
                            long minutesDiff = millisecondsDiff / TimeUnit.MINUTES.toMillis(1L);
                            long hoursDiff = millisecondsDiff / TimeUnit.HOURS.toMillis(1L);
                            long minuteFieldDiff = minutesDiff - TimeUnit.HOURS.toMinutes(hoursDiff);
                            if (hoursDiff > 0L) {
                                outBedTime += String.format("%d小时", hoursDiff);
                            }
                            if (minutesDiff>0){
                                outBedTime +=String.format("%d分钟", minutesDiff);
                            if (minuteFieldDiff>0){
                                outBedTime +=String.format("%d分钟", minuteFieldDiff);
                            }
                            sleepInfo.put("outBedTime",outBedTime);
                        }else {
@ -1481,9 +1339,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
            }
            //监控
            devicePatientDeviceDos = patientDeviceDao.findByUserAndCategoryCode(patient,"12");
            if (devicePatientDeviceDos.size()==0){
            }
            if (devicePatientDeviceDos.size()==0){}
            else{
                try {
                    DevicePatientDevice deviceDo = devicePatientDeviceDos.get(0);

+ 2 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/sign/ArchiveService.java

@ -81,7 +81,7 @@ public class ArchiveService extends BaseJpaService<ArchiveDO, ArchiveDao> {
    }
    public PageEnvelop<List<Map<String,Object>>> archiveList(String doctorId, int page, int size,Integer signStatus,String name){
        String sql = " select * from ( SELECT a.create_time,p.idcard,p.mobile,p.name,p.sex,p.id,p.photo,CAST(a.sign_status AS char) sign_status ";
        String sql = " select * from ( SELECT a.create_time,p.openid,p.idcard,p.mobile,p.name,p.sex,p.id,p.photo,CAST(a.sign_status AS char) sign_status ";
        String countSql = "SELECT count(*) from ( ";
        String filters = "from wlyy_archive a,base_patient p " +
@ -97,7 +97,7 @@ public class ArchiveService extends BaseJpaService<ArchiveDO, ArchiveDao> {
        }
        if (signStatus!=null&&signStatus==1){//已签约不按建档查询,只要该居民服务医生就在列表中
            filters+=" UNION " +
                    " SELECT a.create_time,p.idcard,p.mobile,p.name,p.sex,p.id,p.photo,CAST(a.sign_status AS char) sign_status \n" +
                    " SELECT a.create_time,p.openid,p.idcard,p.mobile,p.name,p.sex,p.id,p.photo,CAST(a.sign_status AS char) sign_status \n" +
                    "from wlyy_archive a,base_patient p WHERE  a.patient = p.id and a.sign_status = 1 and EXISTS( " +
                    "SELECT DISTINCT sr.patient from base_service_package_sign_record sr,base_service_package_record r, " +
                    "base_service_package_item i,base_team_member m " +

+ 5 - 7
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/DeviceService.java

@ -557,8 +557,7 @@ public class DeviceService {
                if (devicePatientDeviceDos.size()>0){
                    String patient = devicePatientDeviceDos.get(0).getUser();
                    //更新患者在床状态
                    updatePatientSleepStatus(device,patient,time_begin,bed_status);
                    //12点以后
                    Date bedIn = DateUtil.getDateStart();//入睡时间
                    Calendar today = Calendar.getInstance();
@ -615,10 +614,10 @@ public class DeviceService {
                        }
                    }
                    if ("1".equals(bed_status)){//呼吸 心率检测
                        Integer theshold_breath_h = 100;
                        Integer theshold_breath_l = 50;
                        Integer theshold_heartrate_h = 25;
                        Integer theshold_heartrate_l = 8;
                        Integer theshold_breath_h = 25;
                        Integer theshold_breath_l = 8;
                        Integer theshold_heartrate_h = 100;
                        Integer theshold_heartrate_l = 50;
                        if (StringUtils.isNotBlank(breath)){
                          Integer breath1 = Integer.parseInt(breath);
                          if (breath1>theshold_breath_h||breath1<theshold_breath_l){
@ -719,7 +718,6 @@ public class DeviceService {
                   outBedDao.save(outBed);
                }
                break;
        }
    }

+ 0 - 91
svr/svr-internet-hospital/src/main/resources/application.yml

@ -961,97 +961,6 @@ express:
  sf_code: WH000102
  sf_check_word: TGUQASFNAZyjt9112
---
spring:
  profiles: hcyyprod
  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.
  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 #日志追踪的地址
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字段
  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真实数据
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.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
  clusterName: jkzl
  securityUser: elastic:elastic
# 上传文件临时路径配置
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
qywx:
  url: 2
  id: 2
express:
  sf_url: https://mrds-admin.sf-express.com:443
  sf_code: JKZL
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk
---
---
spring:
  profiles: dsyy
  datasource: