Преглед на файлове

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

LAPTOP-KB9HII50\70708 преди 2 години
родител
ревизия
db81ccb780

+ 53 - 17
business/base-service/src/main/java/com/yihu/jw/healthUpload/service/BaseDoctorHealthUploadService.java

@ -39,6 +39,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
@ -75,6 +76,8 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
    private WxPushLogDao wxPushLogDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    @Value("${wechat.id}")
    private String wechatId;
    /**
     * 新增医生成员关系
@ -211,7 +214,7 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
                            }
                            newConfig.setKeyword2(baseDoctorHealthUploadDO.getDoctorName());
                            newConfig.setKeyword3(DateUtil.getStringDate());
                            newConfig.setUrl("https://www.cityihealth.com/hlwyy/healthMonitoring/#/health/commit?id=" + baseDoctorHealthUploadDO.getId() + "&docCode=" + baseDoctorHealthUploadDO.getDoctorId() + "");
                            newConfig.setUrl("https://ehr.yihu.com/hlwyy/healthMonitoring/#/health/commit?id=" + baseDoctorHealthUploadDO.getId() + "&docCode=" + baseDoctorHealthUploadDO.getDoctorId() + "");
                            WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById("xm_mlwyy_wx");
                            logger.info("=======setUrl========" + newConfig.getUrl());
                            weixinMessagePushUtils.putWxMsg(wxAccessTokenDO.getAccessToken(), doctorDO.getOpenid(), newConfig);
@ -385,7 +388,15 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
     * @return
     */
    public JSONObject selectHealthByRole(String dept, int level, String doctorId) {
        String nowDate = DateUtil.getStringDateShort();
        Date startDate = DateUtil.strToDateLong(nowDate + " 00:00:00'");
        Date endDate = DateUtil.strToDateLong(nowDate + " 23:59:59'");
        BaseDoctorHealthUploadDO healthUploadDO = new BaseDoctorHealthUploadDO();
        List<BaseDoctorHealthUploadDO> healthUploadDOList = baseDoctorHealthUploadDao.selectHealthUploadInfoByDoctorIdAndStartAndEnd(doctorId,startDate,endDate);
        if (healthUploadDOList!=null&&healthUploadDOList.size()!=0){
            healthUploadDO = healthUploadDOList.get(0);
        }
        //今日本人提交
        String benrenSql = "select count(1) as total from base_doctor_health_upload where consumer='" + doctorId + "' and consumer in(doctor_id) and  create_time >='" + nowDate + " 00:00:00' and create_time<='" + nowDate + " 23:59:59'";
        //今日提交
@ -396,16 +407,21 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
        String benrenshangbaoSql = "select count(1) as total from base_doctor_health_upload where consumer='" + doctorId + "' and consumer in(doctor_id)";
        String doctorSql = "";
        String sql = "";
        String yichangSql = "";
        if (level == 1) {
            //总人次
            doctorSql = " select COUNT(1) as \"total\" from base_doctor d where d.del=1 ";
            //今日上报人次
            sql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from base_doctor_health_upload d where 1=1 and d.create_time >='" + nowDate + " 00:00:00' and d.create_time<='" + nowDate + " 23:59:59'";
            sql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from base_doctor_health_upload d where 1=1 and d.create_time >='" + nowDate + " 00:00:00' and d.create_time<='" + nowDate + " 23:59:59' ";
            //今日异常人次
            yichangSql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from base_doctor_health_upload d where 1=1 and d.create_time >='" + nowDate + " 00:00:00' and d.create_time<='" + nowDate + " 23:59:59' and (d.health_code in(2,3) OR CAST(d.temperature as DECIMAL)>=37.3 OR  d.is_symptoms=1 OR d.is_epidemic=1)";
        } else if (level == 2) {
            //总人次
            doctorSql = " select COUNT(1) as \"total\" from base_doctor d where d.del=1 and id IN (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 )";
            //今日上报人次
            sql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from base_doctor_health_upload d where 1=1 and doctor_id in (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 ) and d.create_time >='" + nowDate + " 00:00:00' and d.create_time<='" + nowDate + " 23:59:59'";
            //今日异常人次
            yichangSql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from base_doctor_health_upload d where 1=1 and doctor_id in (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 ) and d.create_time >='" + nowDate + " 00:00:00' and d.create_time<='" + nowDate + " 23:59:59' and (d.health_code in(2,3) OR CAST(d.temperature as DECIMAL)>=37.3 OR  d.is_symptoms=1 OR d.is_epidemic=1)";
        }
        //今日提交
        int personTotal = 0;
@ -419,6 +435,8 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
        int sqlTotal = 0;
        //今日未上报人次
        int notUploadTotal = 0;
        //
        int yichangTotal = 0;
        Map<String, Object> personMap = jdbcTemplate.queryForMap(personSql);
        if (personMap != null) {
            if (personMap.get("total") != null) {
@ -460,6 +478,13 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
            }
        }
        Map<String, Object> yichangMap = jdbcTemplate.queryForMap(yichangSql);
        if (yichangMap != null) {
            if (yichangMap.get("total") != null) {
                yichangTotal = Integer.parseInt(yichangMap.get("total").toString());
            }
        }
        JSONObject object = new JSONObject();
        object.put("personTotal", personTotal);//今日上报人数
@ -469,6 +494,8 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
        object.put("sqlTotal", sqlTotal);//今日上报人数
        object.put("notUploadTotal", doctorTotal - sqlTotal);//今日未上报人数
        object.put("benrenTotal", benrenTotal);//今日本人提交
        object.put("healthUploadDO",healthUploadDO);
        object.put("yichangTotal",yichangTotal);//今日异常
        return object;
    }
@ -1145,12 +1172,20 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
                            isOutsideName = "否";
                        }
                        String isNucleateName = "";
                        if (object.getString("isNucleate").equalsIgnoreCase("1")) {
                            isNucleateName = "未做";
                        } else if (object.getString("isNucleate").equalsIgnoreCase("2")) {
                            isNucleateName = "已做(院内)";
                        } else if (object.getString("isNucleate").equalsIgnoreCase("3")) {
                            isNucleateName = "已做(院外)";
                        if (wechatId.equalsIgnoreCase("xm_zjxl_wx")){
                            if (object.getString("isNucleate").equalsIgnoreCase("1")) {
                                isNucleateName = "未做";
                            } else if (object.getString("isNucleate").equalsIgnoreCase("2")) {
                                isNucleateName = "已做";
                            }
                        }else {
                            if (object.getString("isNucleate").equalsIgnoreCase("1")) {
                                isNucleateName = "未做";
                            } else if (object.getString("isNucleate").equalsIgnoreCase("2")) {
                                isNucleateName = "已做(院内)";
                            } else if (object.getString("isNucleate").equalsIgnoreCase("3")) {
                                isNucleateName = "已做(院外)";
                            }
                        }
                        String isOutsideHighName = "";
                        if (object.getString("isOutsideHigh").equalsIgnoreCase("1")) {
@ -1271,14 +1306,6 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
        if (StringUtils.isNotBlank(key)) {
            sql += " AND (h.dept_name like '%" + key + "%' OR d.name like '%" + key + "%' OR d.expertise like '%" + key + "%') ";
        }
        if (flag!=null){
            if (flag==1){
                sql += " and d.id IN (select d.doctor_id from base_doctor_health_upload d1 where 1=1 and (d1.health_code in(2,3) OR CAST(d1.temperature as DECIMAL)>=37.3 OR  d1.is_symptoms=1 OR d1.is_epidemic=1) and d1.create_time >='"+DateUtil.getStringDateShort()+" 00:00:00"+"' and d1.create_time <='"+DateUtil.getStringDateShort()+" 23:59:59"+"')";
            }
        }
        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, params);
        for (Map<String,Object> map:list){
            String id = map.get("id").toString();
@ -1286,7 +1313,16 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
            Date endTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 23:59:59");
            List<BaseDoctorHealthUploadDO> healthUploadDOS = baseDoctorHealthUploadDao.selectHealthUploadInfoByDoctorIdAndStartAndEnd(id,startTime,endTime);
            if (healthUploadDOS!=null&&healthUploadDOS.size()!=0){
                map.put("healthUpload",healthUploadDOS.get(0));
                BaseDoctorHealthUploadDO healthUploadDO = healthUploadDOS.get(0);
                String healthStateName = "";
                if (healthUploadDO.getHealthCode()==2 ||healthUploadDO.getHealthCode()==3||Double.parseDouble(healthUploadDO.getTemperature())>=37.3
                        || healthUploadDO.getIsSymptoms()==1 || healthUploadDO.getIsEpidemic()==1) {
                    healthStateName = "异常";
                } else {
                    healthStateName = "正常";
                }
                map.put("healthStateName",healthStateName);
                map.put("healthUpload",healthUploadDO);
            }else {
                map.put("healthUpload",null);
            }

+ 17 - 13
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -3175,6 +3175,7 @@ public class EntranceService {
                            ylzMedicalRelationDO.setItemCount(resultJSON.getString("cfxms0"));
                            ylzMedicalRelationDO.setTotalAmount(resultJSON.getString("bcfyze"));
                            ylzMedicalRelationDO.setPreCharges(resultJSON.getString("bcfyze"));
                            ylzMedicalRelationDO.setBcwkje(resultJSON.getString("bcwkje"));
                            ylzMedicalRelationDO.setPersonAccount("0");
                            ylzMedicalRelationDO.setDataSource("53");
                            ylzMedicalRelationDO.setBalance(cardFee+"");
@ -3200,18 +3201,19 @@ public class EntranceService {
                                ylzMedicalRelationDO.setMedicalState(Integer.parseInt(outpatientDO.getMedicalState()));
                            }
                            ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
                            if (resultJSON.get("zdlist")!=null){
                                Object json = new JSONTokener(resultJSON.getString("zdlist")).nextValue();
                            if (resultJSON.get("zdlists")!=null){
                                Object json = new JSONTokener(resultJSON.getString("zdlists")).nextValue();
                                if(json instanceof net.sf.json.JSONObject){
                                    net.sf.json.JSONObject icdJSON = (net.sf.json.JSONObject)json;
                                    net.sf.json.JSONObject icdJson = icdJSON.getJSONObject("zdlist");
                                    YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
                                    ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
                                    ylzMedicalIcdDO.setDel(1);
                                    ylzMedicalIcdDO.setCreateTime(new Date());
                                    ylzMedicalIcdDO.setDiseaseType(icdJSON.getString("zdlx"));
                                    ylzMedicalIcdDO.setDiseaseCodeIcd10(icdJSON.getString("zdbm"));
                                    ylzMedicalIcdDO.setDiseaseNameIcd10(icdJSON.getString("zdmc"));
                                    ylzMedicalIcdDO.setDiseaseOrder(icdJSON.getString("zdxh"));
                                    ylzMedicalIcdDO.setDiseaseType(icdJson.getString("zdlx"));
                                    ylzMedicalIcdDO.setDiseaseCodeIcd10(icdJson.getString("zdbm"));
                                    ylzMedicalIcdDO.setDiseaseNameIcd10(icdJson.getString("zdmc"));
                                    ylzMedicalIcdDO.setDiseaseOrder(icdJson.getString("zdxh"));
                                    ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
                                    icdDOList.add(ylzMedicalIcdDO);
                                } else if (json instanceof JSONArray) {
@ -3329,6 +3331,7 @@ public class EntranceService {
                            ylzMedicalRelationDO.setItemCount(resultJSON.getString("cfxms0"));
                            ylzMedicalRelationDO.setTotalAmount(resultJSON.getString("bcfyze"));
                            ylzMedicalRelationDO.setPreCharges(resultJSON.getString("bcfyze"));
                            ylzMedicalRelationDO.setBcwkje(resultJSON.getString("bcwkje"));
                            ylzMedicalRelationDO.setDataSource("53");
                            ylzMedicalRelationDO.setPreCount(resultJSON.getString("cfxms0"));
                            ylzMedicalRelationDO.setBalance(cardFee+"");
@ -3363,18 +3366,19 @@ public class EntranceService {
                            ylzMedicalIcdDO.setDiseaseOrder("01");
                            ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
                            icdDOList.add(ylzMedicalIcdDO);*/
                            if (resultJSON.get("zdlist")!=null){
                                Object json = new JSONTokener(resultJSON.getString("zdlist")).nextValue();
                            if (resultJSON.get("zdlists")!=null){
                                Object json = new JSONTokener(resultJSON.getString("zdlists")).nextValue();
                                if(json instanceof net.sf.json.JSONObject){
                                    net.sf.json.JSONObject icdJSON = (net.sf.json.JSONObject)json;
                                    net.sf.json.JSONObject icdJson = icdJSON.getJSONObject("zdlist");
                                    YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
                                    ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
                                    ylzMedicalIcdDO.setDel(1);
                                    ylzMedicalIcdDO.setCreateTime(new Date());
                                    ylzMedicalIcdDO.setDiseaseType(icdJSON.getString("zdlx"));
                                    ylzMedicalIcdDO.setDiseaseCodeIcd10(icdJSON.getString("zdbm"));
                                    ylzMedicalIcdDO.setDiseaseNameIcd10(icdJSON.getString("zdmc"));
                                    ylzMedicalIcdDO.setDiseaseOrder(icdJSON.getString("zdxh"));
                                    ylzMedicalIcdDO.setDiseaseType(icdJson.getString("zdlx"));
                                    ylzMedicalIcdDO.setDiseaseCodeIcd10(icdJson.getString("zdbm"));
                                    ylzMedicalIcdDO.setDiseaseNameIcd10(icdJson.getString("zdmc"));
                                    ylzMedicalIcdDO.setDiseaseOrder(icdJson.getString("zdxh"));
                                    ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
                                    icdDOList.add(ylzMedicalIcdDO);
                                } else if (json instanceof JSONArray) {
@ -3387,7 +3391,7 @@ public class EntranceService {
                                        ylzMedicalIcdDO.setCreateTime(new Date());
                                        ylzMedicalIcdDO.setDiseaseType(icdObject.getString("zdlx"));
                                        ylzMedicalIcdDO.setDiseaseCodeIcd10(icdObject.getString("zdbm"));
                                        ylzMedicalIcdDO.setDiseaseNameIcd10(icdObject.getString("bqzdms"));
                                        ylzMedicalIcdDO.setDiseaseNameIcd10(icdObject.getString("zdmc"));
                                        ylzMedicalIcdDO.setDiseaseOrder(icdObject.getString("zdxh"));
                                        ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
                                        icdDOList.add(ylzMedicalIcdDO);

+ 8 - 1
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -1949,9 +1949,10 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(code);
        YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByOutpatient(code);
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(ylzMedicalRelationDO.getId());
        BigDecimal b1 = new BigDecimal(ylzMedicalRelationDO.getTotalAmount());//总金额
        BigDecimal b1 = new BigDecimal(ylzMedicalRelationDO.getBcwkje());//总金额
        BigDecimal b2 = new BigDecimal(ylzMedicalRelationDO.getPersonAccount());//个人账户
        BigDecimal b3 = new BigDecimal(ylzMedicalRelationDO.getMedicalPrice());//医保总金额
        Double fee = b1.subtract(b2).subtract(b3).doubleValue();
        if (businessOrderDO!=null){
            BasePatientDO patientDO = patientDao.findById(businessOrderDO.getPatient());
@ -1970,6 +1971,10 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                return "无需线上支付";
            }
            BigDecimal balance = c.subtract(b);
            if (balance.doubleValue()<=0){
                return "无需线上支付";
            }
            businessOrderDO.setPayPrice(balance.doubleValue());
            businessOrderDO.setPayType(4);
            businessOrderDO.setHistoryOrder(businessOrderDO.getOrderNo());
@ -1980,6 +1985,8 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
            if (patientWechatDos!=null&&patientWechatDos.size()!=0){
                BasePatientWechatDo patientWechatDo = patientWechatDos.get(0);
                openId = patientWechatDo.getOpenid();
            }else {
                throw new Exception("请关注“厦门大学附属中山医院”公众号,点击互联网医院-在线诊室进行结算!");
            }
            String price = businessOrderDO.getPayPrice().toString();
            String notifyUrl = hospitalSysDictDO.getDictCode();

+ 9 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/healthCare/YlzMedicalRelationDO.java

@ -92,6 +92,7 @@ public class YlzMedicalRelationDO extends UuidIdentityEntity {
    private String balance;//预交金余额
    private String medicalPrice;//医保基金总额
    private Date settleDate;//his结算时间
    private String bcwkje;//本次未扣费用
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name="settle_date")
@ -730,4 +731,12 @@ public class YlzMedicalRelationDO extends UuidIdentityEntity {
    public void setCollector(String collector) {
        this.collector = collector;
    }
    public String getBcwkje() {
        return bcwkje;
    }
    public void setBcwkje(String bcwkje) {
        this.bcwkje = bcwkje;
    }
}

+ 11 - 0
gateway/ag-basic/src/main/resources/application.yml

@ -338,3 +338,14 @@ spring:
     host: 59.61.92.90
     port: 9054
     password: jkzlehr
---
spring:
  profiles: ZjxlProd
  datasource:
    url: jdbc:mysql://172.26.0.13:3306/base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true&useSSL=false
    username: root
    password: jkzlehr
  redis:
    host: 172.26.0.253 # Redis server host.
    port: 6379 # Redis server port.

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

@ -177,4 +177,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: ZjxlProd
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:master}

+ 44 - 1
server/svr-authentication/src/main/java/com/yihu/jw/security/core/userdetails/jdbc/WlyyUserDetailsService.java

@ -1,5 +1,6 @@
package com.yihu.jw.security.core.userdetails.jdbc;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.login.BaseLoginLogDO;
@ -18,6 +19,7 @@ import com.yihu.jw.security.model.WlyyUserSimple;
import com.yihu.jw.security.service.HcyyService;
import com.yihu.jw.security.utils.IdCardUtil;
import com.yihu.jw.security.utils.ImUtil;
import com.yihu.jw.util.common.StringUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.utils.security.MD5;
@ -44,6 +46,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import javax.sql.DataSource;
import java.io.IOException;
import java.security.KeyPair;
import java.sql.Timestamp;
import java.util.*;
@ -87,6 +90,8 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
    private Integer reflashFailedCountTime;//将失败次数重置为0 ,以分钟计算
    @Value("${user.tryLoginTimes}")
    private Integer tryLoginTimes;//失败重试次数
    @Value("${wechat.id}")
    private String wxId;//微信id
    @Value("${iHealth.user-info-uri}")
    private String iHealthUserInfoUrl;//失败重试次数
@ -274,7 +279,23 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
                        logger.error("将i健康居民微信openid数据同步到互联网医院居民微信关联表失败:" + e.getMessage());
                        return users;
                    }
                    if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                        logger.info("获取中山医院openid:=====");
                        try {
                            this.getJdbcTemplate().update(PATIENT_INSERT_WEHCAT,
                                    new Object[]{
                                            UUID.randomUUID().toString(),
                                            wxId,
                                            patient.getString("code"),
                                            getZsyyOpenid(idcard),
                                            new Date()
                                    }
                            );
                        }catch (Exception e){
                            logger.error("将i健康居民转为中山医院openid数据同步到互联网医院居民微信关联表失败:" + e.getMessage());
                            return users;
                        }
                    }
                    WlyyUserDetails user = new WlyyUserDetails();
                    user.setName(patient.getString("name"));
                    user.setPassword(patient.getString("password"));
@ -823,6 +844,28 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
        return openid;
    }
    /**
     * 获取i健康用户登录openid型
     *
     * @return
     */
    public String getZsyyOpenid(String idcard) throws IOException {
        String openid = "";
        String url = "https://wx.xmzsh.com/interface/queryOpenIdByIdCard.htm";
        JSONObject object = new JSONObject();
        object.put("idCard",idcard);
        String response = httpClientUtil.sendPost(url,object.toJSONString());
        logger.info("获取中山医院openid:"+response);
        if (StringUtils.isNotBlank(response)){
            JSONObject jsonObject = JSONObject.parseObject(response);
            if (jsonObject.getString("respCode").equalsIgnoreCase("00")){
                JSONObject respEntityJson = jsonObject.getJSONObject("respEntity");
                openid = respEntityJson.getString("openId");
            }
        }
        return openid;
    }
    /**
     * 获取用户登录的clientId
     *

+ 5 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -157,6 +157,8 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    private BaseDoctorDao doctorDao;
    @Value("${wechat.id}")
    private String wechatId;
    @Value("${wechat.id}")
    private String wxId;//微信id
    @Value("${kick.eachOther}")
    private String kickEachOther;
    @Autowired
@ -392,6 +394,9 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                    logger.info("gengxin进入"+wechatId);
                    userDetailsService.updateOpenIdAndWechatId(openid,wlyyUserSimple.getId(),wechatId);
                }
                if (wxId.equalsIgnoreCase("xm_zsyy_wx")&&wechatId.equalsIgnoreCase("xm_ihealth_wx")){
                    userDetailsService.updateOpenIdAndWechatId(userDetailsService.getZsyyOpenid(wlyyUserSimple.getIdcard()),wlyyUserSimple.getId(),wxId);
                }
            }else if (!StringUtils.isEmpty(openid) && !"undefined".equalsIgnoreCase(openid) && ("2".equals(loginType))) {
                if (wechatId.equalsIgnoreCase("xm_mlwyy_wx")){
                    logger.info("gengxin进入"+openid);

+ 35 - 1
server/svr-authentication/src/main/resources/application.yml

@ -657,4 +657,38 @@ wechat:
im:
  im_list_get: http://172.26.0.105:3000/
kick:
    eachOther: 0
    eachOther: 0
---
spring:
  profiles: ZjxlProd
  datasource:
    url: jdbc:mysql://172.26.0.13:3306/base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true&useSSL=false
    username: root
    password: jkzlehr
  redis:
    host: 172.26.0.253 # Redis server host.
    port: 6379 # Redis server port.
## i健康用户信息接口,开放出来给互联网医院登录同步用户信息用
iHealth:
  user-info-uri: http://ehr.yihu.com/wlyy/iHealth/userInfo
zhongshanHospital:
  user-info-uri: http://laptop-u738dn2p:10023/mqsdk/getUserInfoByOpenid
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
wlyy:
  url: http://www.xmtyw.cn/wlyy/
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wechat:
  id: xm_zsyy_wx  # base库中,wx_wechat 的id字段
im:
  im_list_get: http://172.26.0.105:3000/
kick:
  ##互踢 1开通 0关闭
  eachOther: 0

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

@ -176,6 +176,14 @@ spring:
---
spring:
  profiles: jwZnygProd
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: ZjxlProd
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://127.0.0.1:1221}

+ 56 - 0
svr/svr-base/src/main/resources/application.yml

@ -81,6 +81,13 @@ tencent:
  secretKey: 7xWpsd7KGC3f16vUq0ucARRAcnhKfjX4
wechat:
  url: 1
# 上传文件临时路径配置
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
---
spring:
  profiles: jwdev
@ -831,3 +838,52 @@ testPattern:
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
im:
  im_list_get: http://127.0.0.1:3000/
---
spring:
  profiles: ZjxlProd
  datasource:
    url: jdbc:mysql://172.26.0.13:3306/base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true&useSSL=false
    username: root
    password: jkzlehr
  elasticsearch:
    cluster-name: jkzl #集群名 默认elasticsearch
    cluster-nodes: 172.19.103.45:9300,172.19.103.68:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    client-transport-sniff: false
    jest:
      uris: http://172.19.103.45:9200,http://172.19.103.68:9200
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://172.19.103.87:61616
    user: admin
    password: admin
  redis:
    host: 172.26.0.253 # Redis server host.
    port: 6379 # Redis server port.
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
demo:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
wlyy:
  url: http://ehr.yihu.com/wlyy/
wechat:
  id: hz_yyyzh_wx
  url: https://zhyzh.gongshu.gov.cn/
  flag: false
pay:
  flag: false
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
im:
  im_list_get: http://172.26.0.105:3000/

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

@ -138,6 +138,14 @@ spring:
---
spring:
  profiles: jwZnygProd
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: ZjxlProd
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://127.0.0.1:1221}

+ 48 - 29
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/StatisticsService.java

@ -540,7 +540,7 @@ public class StatisticsService {
        //离线的设备数 超过6小时未受理的预警数  超6小时未响应服务(审核照料发起6小时未接单)
        sqltmp = " select count(distinct pd.device_sn) total ,pd.device_type from wlyy_patient_device pd INNER JOIN wlyy_devices dev on pd.device_sn = dev.device_code " +
                " INNER JOIN base_patient p on pd.user = p.id and pd.del=0 and p.del=1 " +
                "where (dev.contact_status=0 or dev.contact_status is null ) and pd.user "+userfilter;
                "where dev.contact_status=0  and pd.user "+userfilter;
        sqltmp += " group by pd.device_type ";
        List<Map<String,Object>> offlineDevices = jdbcTemplate.queryForList(sqltmp);//离线设备
        Long count = 0l;
@ -2253,7 +2253,7 @@ public class StatisticsService {
        //照护老人  :  签约老人+有设备未签约的
        String sign_OldSql = "SELECT SUM(a.zf_num) AS zf_num FROM ( SELECT count(DISTINCT id) zf_num FROM base_patient WHERE sign_status = 1 AND del = 1 AND id NOT IN (SELECT dict_code from wlyy_hospital_sys_dict WHERE  dict_name = 'jkzl_older')" ;
        sign_OldSql+=" UNION ALL ";
        sign_OldSql += " SELECT COUNT( DISTINCT a.id ) zf_num FROM base_patient a  WHERE a.archive_type = 1 AND a.sign_status = 0 AND register = '1' AND a.del = '1' AND EXISTS ( SELECT 1 FROM wlyy_patient_device pd WHERE pd.USER = a.id AND pd.del = 0 ) ) a";
        sign_OldSql += " SELECT COUNT( DISTINCT a.id ) zf_num FROM base_patient a  WHERE a.archive_type = 1 AND a.sign_status = 0  AND a.del = '1' AND EXISTS ( SELECT 1 FROM wlyy_patient_device pd WHERE pd.USER = a.id AND pd.del = 0 ) ) a";
        //需照护老人 : 未签约 register=1  - 有设备未签约的
        String unSign_oldSql = "SELECT COUNT(*) c from base_patient a WHERE archive_type = 1 and a.register = 1 and (sign_status=0 or sign_status is null ) and del='1' and not EXISTS (select 1 from wlyy_patient_device pd where pd.user = a.id and pd.del=0) ";
@ -3233,7 +3233,8 @@ public class StatisticsService {
                        " AND sr.STATUS = 1  " +
                        " AND r.service_package_id = i.service_package_id  " +
                        " AND r.service_package_id = pack.id  " +
                        " AND i.del = 1  " +
                        " AND i.del = 1 " +
                        " AND p.del = 1  " +
                        " AND sr.`status` = 1  " +
                        " AND CONVERT ( sr.patient USING utf8 ) = p.id  " +
                        " AND r.team_code = t.id  " +
@ -3277,7 +3278,7 @@ public class StatisticsService {
        page = (page - 1) * size;
        String testUserSql = "AND p.id NOT IN (SELECT DISTINCT dict_code FROM wlyy_hospital_sys_dict" +
                " WHERE( dict_name = 'jkzl_child' OR dict_name = 'jkzl_older' OR dict_name = 'jkzl_user') AND dict_code IS NOT NULL ) ";
        sql += "  ORDER BY id limit " + page + "," + size + "";
        sql += "  ORDER BY id DESC limit " + page + "," + size + "";
        sql = sql.replace("<testUserSql>",testUserSql);
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
@ -3712,8 +3713,8 @@ public class StatisticsService {
        if (StringUtils.isNotBlank(name)) nameSql = " AND p.name LIKE '%" + name + "%'";
        if (StringUtils.isNotBlank(deviceSn)) deviceSnSql = " AND pd.device_sn = '" + deviceSn + "'";
        String filter="";
        String sqltmp = " SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE (dict_name = 'jkzl_child' or dict_name = 'jkzl_older' OR dict_name ='jkzl_helper' OR dict_name= 'jkzl_olderRelative' OR dict_name ='jkzl_user') ";
        String filter="AND pd.USER NOT IN ( SELECT DISTINCT dict_code FROM wlyy_hospital_sys_dict WHERE ( dict_name = 'jkzl_user' OR dict_name = 'jkzl_older' ) AND dict_code IS NOT NULL ) ";
        /*String sqltmp = " SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE (dict_name = 'jkzl_child' or dict_name = 'jkzl_older' OR dict_name ='jkzl_helper' OR dict_name= 'jkzl_olderRelative' OR dict_name ='jkzl_user') ";
        List<Map<String,Object>> listtmp =  jdbcTemplate.queryForList(sqltmp);
        if(listtmp.size()>0){
            String orgCodes = String.valueOf(listtmp.get(0).get("orgCodes"));
@ -3721,46 +3722,58 @@ public class StatisticsService {
                orgCodes = orgCodes.replaceAll(",","','");
                filter = " and p.id not in ('"+orgCodes+"') ";
            }
        }
        }*/
        page = page>0?page-1:0;
        String deviceSql = "";
        if ("jk".equals(type)) {
            categoryCodeSql = " AND ( pd.category_code = 1 OR pd.category_code = 2 )";
            categoryCodeSql = " AND pd.device_type = 0 ";
            if (StringUtils.isNotBlank(categoryCode))
                categoryCodeSql = " AND pd.category_code = '" + categoryCode + "'";
            deviceSql = "SELECT DISTINCT  p.id AS patient, pd.id as id,pd.device_name AS deviceName,pd.device_sn AS deviceSn,'健康设备' AS deviceType,p.`name`," +
                    " p.mobile,p.phone,dd.photo,wd.contact_status * 1 AS contactStatus,pd.category_code as categoryCode" +
            deviceSql = "SELECT p.id AS patient,pd.id AS id,pd.device_name AS deviceName,pd.device_sn AS deviceSn,dd.photo,'健康设备' AS deviceType,p.`name`,p.mobile,p.phone,wd.contact_status * 1 AS contactStatus,pd.category_code as categoryCode " +
                    " FROM " +
                    " wlyy_patient_device pd LEFT JOIN base_patient p ON pd.`user` = p.id LEFT JOIN dm_device dd ON pd.category_code = dd.category_code " +
                    " LEFT JOIN wlyy_devices wd ON wd.device_code = pd.device_sn WHERE " +
                    " pd.del = 0 "+filter + nameSql + deviceSnSql + categoryCodeSql + contactStatusSql;
            totalSql = "SELECT count(DISTINCT pd.id) FROM " +
                    " wlyy_patient_device pd LEFT JOIN base_patient p ON pd.`user` = p.id LEFT JOIN dm_device dd ON pd.category_code = dd.category_code " +
                    " LEFT JOIN wlyy_devices wd ON wd.device_code = pd.device_sn WHERE " +
                    " pd.del = 0 " +filter+ nameSql + deviceSnSql + categoryCodeSql + contactStatusSql;
                    " wlyy_patient_device pd " +
                    " INNER JOIN wlyy_devices wd ON pd.device_sn = wd.device_code " +
                    " INNER JOIN base_patient p ON pd.USER = p.id AND pd.del = 0 AND p.del = 1    " +
                    " LEFT JOIN dm_device dd ON pd.category_code = dd.category_code " +
                    "WHERE " +
                    " 1=1 "+filter + nameSql + deviceSnSql + categoryCodeSql + contactStatusSql;
            totalSql = "SELECT count(pd.id) FROM " +
                    " wlyy_patient_device pd " +
                    " INNER JOIN wlyy_devices wd ON pd.device_sn = wd.device_code " +
                    " INNER JOIN base_patient p ON pd.USER = p.id  AND pd.del = 0  AND p.del = 1  " +
                    " LEFT JOIN dm_device dd ON pd.category_code = dd.category_code " +
                    " WHERE " +
                    " 1=1 "+filter + nameSql + deviceSnSql + categoryCodeSql + contactStatusSql;
        }
        if ("af".equals(type) || StringUtils.isBlank(type)) {
            categoryCodeSql = " AND pd.category_code > 2 ";
            categoryCodeSql = " AND pd.device_type = 1 ";
            if (StringUtils.isNotBlank(categoryCode))
                categoryCodeSql = " AND pd.category_code = '" + categoryCode + "'";
            deviceSql = " SELECT DISTINCT  p.id AS patient,pd.id AS id ,pd.device_name AS deviceName,pd.device_sn AS deviceSn,'安防设备' AS deviceType,p.`name`,p.mobile,p.phone,dd.photo,wd.contact_status * 1 AS contactStatus,pd.category_code as categoryCode " +
            deviceSql = "SELECT p.id AS patient,pd.id AS id,pd.device_name AS deviceName,pd.device_sn AS deviceSn,dd.photo,'安防设备' AS deviceType,p.`name`,p.mobile,p.phone,wd.contact_status * 1 AS contactStatus,pd.category_code as categoryCode " +
                    " FROM " +
                    " wlyy_patient_device pd LEFT JOIN base_patient p ON pd.`user` = p.id LEFT JOIN dm_device dd ON pd.category_code = dd.category_code " +
                    " LEFT JOIN wlyy_devices wd ON wd.device_code = pd.device_sn WHERE " +
                    " pd.del = 0 " +filter+nameSql + deviceSnSql + categoryCodeSql + contactStatusSql;
                    " wlyy_patient_device pd " +
                    " INNER JOIN wlyy_devices wd ON pd.device_sn = wd.device_code " +
                    " INNER JOIN base_patient p ON pd.USER = p.id AND pd.del = 0 AND p.del = 1    " +
                    " LEFT JOIN dm_device dd ON pd.category_code = dd.category_code " +
                    "WHERE " +
                    " 1=1 "+filter + nameSql + deviceSnSql + categoryCodeSql + contactStatusSql;
            totalSql = "SELECT count(pd.id) FROM " +
                    " wlyy_patient_device pd " +
                    " INNER JOIN wlyy_devices wd ON pd.device_sn = wd.device_code " +
                    " INNER JOIN base_patient p ON pd.USER = p.id  AND pd.del = 0  AND p.del = 1  " +
                    " LEFT JOIN dm_device dd ON pd.category_code = dd.category_code " +
                    " WHERE " +
                    " 1=1 "+filter + nameSql + deviceSnSql + categoryCodeSql + contactStatusSql;
            totalSql = " SELECT count(DISTINCT pd.id) FROM " +
                    " wlyy_patient_device pd LEFT JOIN base_patient p ON pd.`user` = p.id LEFT JOIN dm_device dd ON pd.category_code = dd.category_code " +
                    " LEFT JOIN wlyy_devices wd ON wd.device_code = pd.device_sn WHERE " +
                    " pd.del = 0 " +filter+nameSql + deviceSnSql + categoryCodeSql + contactStatusSql;
        }
        deviceSql += " GROUP BY id LIMIT " + page*size + "," + size + " ";
        deviceSql += " GROUP BY pd.id LIMIT " + page*size + "," + size + " ";
        List<Map<String, Object>> deviceList = jdbcTemplate.queryForList(deviceSql);
        List<String> list = jdbcTemplate.queryForList(totalSql, String.class);
@ -3820,7 +3833,7 @@ public class StatisticsService {
        //离线设备数量
        String offLineDeviceSql="select count(distinct pd.device_sn) total from wlyy_patient_device pd INNER JOIN wlyy_devices dev on pd.device_sn = dev.device_code " +
                "                 INNER JOIN base_patient p on pd.user = p.id and pd.del=0 and p.del=1 " +
                "                where (dev.contact_status=0 or dev.contact_status is null ) and pd.device_type = "+type+"  AND pd.user NOT IN ("+testUsqlSql+") group by pd.device_type";
                "                where dev.contact_status=0  and pd.device_type = "+type+"  AND pd.user NOT IN ("+testUsqlSql+") group by pd.device_type";
        //设备总数
        String deviceTotalSql = "SELECT count(DISTINCT device_code) FROM wlyy_devices WHERE (device_code IS NOT NULL OR device_code <> '') AND device_type = "+type+"";
@ -3840,8 +3853,13 @@ public class StatisticsService {
                "                INNER JOIN base_patient p on pd.user = p.id and pd.del=0 and p.del=1 " +
                "                where pd.device_type = "+type+"  AND EXISTS(SELECT 1 FROM device_data_push_log pl WHERE pl.device_sn = pd.device_sn "+deviceCategorySql+" AND DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= pl.create_time ) AND pd.user NOT IN ("+testUsqlSql+") group by pd.device_type";
        //设备类型总数
        String deviceCodeTotalSql ="SELECT count(DISTINCT device_code) FROM wlyy_devices WHERE (device_code IS NOT NULL OR device_code <> '') AND category_code = '"+deviceCategory+"'";
        //long start=System.currentTimeMillis();
        List<Integer> total = jdbcTemplate.queryForList(typeTotalSql, Integer.class);
        //long end=System.currentTimeMillis();
        //System.out.println("类型数量运行多少毫秒:" + "=" + (end-start));
        jsonObject.put("typeTotal",total.get(0));
        total = jdbcTemplate.queryForList(offLineDeviceSql,Integer.class);
        jsonObject.put("offLineDevice",total.get(0));
@ -3850,9 +3868,10 @@ public class StatisticsService {
        total = jdbcTemplate.queryForList(lineDeviceSql,Integer.class);
        jsonObject.put("lineDevice",total.get(0));
        total = jdbcTemplate.queryForList(sevenDayUseSql,Integer.class);
        Integer deviceCodeTotal = jdbcTemplate.queryForObject(deviceCodeTotalSql,Integer.class);
        Float num = 0F;
        if (total.size()>0) {
            num= (float)total.get(0)/(float)Integer.parseInt(jsonObject.get("deviceTotal").toString());
            num= (float)total.get(0)/(float)deviceCodeTotal;
        }
        jsonObject.put("sevenDayUse",num*100);
        return jsonObject;

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

@ -1210,5 +1210,90 @@ express:
  sf_code: WH000102
  sf_check_word: TGUQASFNAZyjt9112
---
spring:
  profiles: ZjxlProd
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://172.26.0.13:3306/base?useUnicode:true&amp;characterEncoding=utf-8&amp;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.
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
fast-dfs:
  tracker-server: 172.26.0.110:22122 #服务器地址
wechat:
  id: xm_zjxl_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
myFamily:
  qrCodeFailurTime: 2
# 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.55:9000
  tHost: 172.26.0.55:9300
  clusterName: jkzl
  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
#文件服务器上传配置 0本地,1.I健康,2.内网调用
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: 1
express:
  sf_url: http://mrds-admin-ci.sit.sf-express.com:45478
  sf_code: HD000001
  sf_check_word: AAAABBBBCCCCDDDD

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

@ -117,6 +117,14 @@ spring:
---
spring:
  profiles: yqfk
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: ZjxlProd
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://127.0.0.1:1221}