Browse Source

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

 Conflicts:
	svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/statistics/OpenStatisticsEndpoint.java
吴世龙 2 years ago
parent
commit
d04c53a375
26 changed files with 1033 additions and 304 deletions
  1. 3 1
      business/base-service/src/main/java/com/yihu/jw/hospital/httplog/service/BaseOperateLogService.java
  2. 19 9
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  3. 111 170
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/HcyyEntranceService.java
  4. 52 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java
  5. 17 1
      common/common-entity/sql记录
  6. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java
  7. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/care/visit/BaseVisitDO.java
  8. 97 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/visit/BaseVisitSignDO.java
  9. 39 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/endpoint/EnvelopRestEndpoint.java
  10. 16 5
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  11. 1 1
      server/svr-authentication/src/main/java/com/yihu/jw/security/service/HcyyService.java
  12. 4 1
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/message/BaseServiceNewsDao.java
  13. 13 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/visit/BaseVisitSignDao.java
  14. 33 3
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/statistics/OpenStatisticsEndpoint.java
  15. 75 27
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/third/platForm/PatientInfoPlatFormEndpoint.java
  16. 41 3
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/visit/VisitEndpoint.java
  17. 24 2
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/message/BaseServiceNewsService.java
  18. 97 6
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/StatisticsService.java
  19. 237 5
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/third/PatientInfoPlatFormService.java
  20. 68 1
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/visit/BaseVisitService.java
  21. 1 1
      svr/svr-cloud-job/src/main/java/com/yihu/jw/care/job/device/DeviceLostAssociationJob.java
  22. 17 15
      svr/svr-cloud-job/src/main/java/com/yihu/jw/care/util/DeviceLostMessageUtil.java
  23. 9 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  24. 20 48
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/HcyyPrescriptionCotroller.java
  25. 9 3
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  26. 28 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/YkyyPrescriptionEndpoint.java

+ 3 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/httplog/service/BaseOperateLogService.java

@ -73,7 +73,9 @@ public class BaseOperateLogService extends BaseJpaService<BaseOperateLogDO, Base
            if (doctorMappingDO!=null){
            if (doctorMappingDO!=null){
                baseOperateLogDO.setOperator(doctorMappingDO.getMappingCode());
                baseOperateLogDO.setOperator(doctorMappingDO.getMappingCode());
            }*/
            }*/
            jdbcSqlServer.insertZsSqlserver(baseOperateLogDO);
            if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                jdbcSqlServer.insertZsSqlserver(baseOperateLogDO);
            }
        }catch (Exception e){
        }catch (Exception e){
            e.printStackTrace();
            e.printStackTrace();
        }
        }

+ 19 - 9
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -74,10 +74,7 @@ import com.yihu.jw.hospital.mapping.service.PatientMappingService;
import com.yihu.jw.hospital.message.dao.BaseBannerDoctorDao;
import com.yihu.jw.hospital.message.dao.BaseBannerDoctorDao;
import com.yihu.jw.hospital.message.service.SystemMessageService;
import com.yihu.jw.hospital.message.service.SystemMessageService;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.TnyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.*;
import com.yihu.jw.hospital.prescription.service.useragent.BaseUserAgent;
import com.yihu.jw.hospital.prescription.service.useragent.BaseUserAgent;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.order.BusinessOrderService;
@ -337,6 +334,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private WlyyNatPatientFamilyMemberDao natPatientFamilyMemberDao;
    private WlyyNatPatientFamilyMemberDao natPatientFamilyMemberDao;
    @Autowired
    @Autowired
    private PrescriptionLogDao prescriptionLogDao;
    private PrescriptionLogDao prescriptionLogDao;
    @Autowired
    private HcyyEntranceService hcyyEntranceService;
    public static String entranceUrl = "http://172.16.100.240:10023/xzzx/";
    public static String entranceUrl = "http://172.16.100.240:10023/xzzx/";
    public static String entranceHealthCareUrl = "http://127.0.0.1:10023/healthCare/";
    public static String entranceHealthCareUrl = "http://127.0.0.1:10023/healthCare/";
@ -799,6 +799,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                                vo.setWlyyPrescriptionEmrDO(listEmr.get(0));
                                vo.setWlyyPrescriptionEmrDO(listEmr.get(0));
                            }
                            }
                        }
                        }
                    }else if (wxId.equalsIgnoreCase("xm_hcyy_wx")) {
                        WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO1 = prescriptionEmrDao.findEmrByPrescriptionId(vo.getId());
                        if (wlyyPrescriptionEmrDO1 != null) {
                            vo.setWlyyPrescriptionEmrDO(wlyyPrescriptionEmrDO1);
                        } else {
                            List<WlyyPrescriptionEmrDO> listEmr = hcyyPrescriptionService.selectHistoryEmr(hisPatient,"");
                            if (null!=listEmr&&listEmr.size()>0){
                                vo.setWlyyPrescriptionEmrDO(listEmr.get(0));
                            }
                        }
                    }else {
                    }else {
                        WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO1 = prescriptionEmrDao.findEmrByPrescriptionId(vo.getId());
                        WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO1 = prescriptionEmrDao.findEmrByPrescriptionId(vo.getId());
                        if (wlyyPrescriptionEmrDO1 != null) {
                        if (wlyyPrescriptionEmrDO1 != null) {
@ -9709,7 +9719,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param prescriptionId
     * @param prescriptionId
     * @return
     * @return
     */
     */
    public WlyyPrescriptionCheckDO saveCheck(String operate, String operateName, String reason, Integer status, String prescriptionId, String wxId) {
    public WlyyPrescriptionCheckDO saveCheck(String operate, String operateName, String reason, Integer status, String prescriptionId, String wxId,String ip) {
        WlyyPrescriptionCheckDO prescriptionCheckDO = new WlyyPrescriptionCheckDO();
        WlyyPrescriptionCheckDO prescriptionCheckDO = new WlyyPrescriptionCheckDO();
        prescriptionCheckDO.setCreateTime(new Date());
        prescriptionCheckDO.setCreateTime(new Date());
        prescriptionCheckDO.setOperate(operate);
        prescriptionCheckDO.setOperate(operate);
@ -9970,17 +9980,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        }
                        }
                    }
                    }
                    logger.info("进入处方签名");
                    logger.info("进入处方签名");
                  /*  //处方签名
                    String baseSign=xzyyPrescriptionService.SOF_SignDataWithExtraInfo(wlyyPrescriptionDO);*/
                    //电子病例签名
                    String baseSign=hcyyEntranceService.initiateDataSign(wlyyPrescriptionDO.getId(),2,ip);
                    //同步电子病历
                    //同步电子病历
                    WlyyPrescriptionEmrDO prescriptionEmrDO = prescriptionEmrDao.findEmrByPrescriptionId(prescriptionId);
                    WlyyPrescriptionEmrDO prescriptionEmrDO = prescriptionEmrDao.findEmrByPrescriptionId(prescriptionId);
                    try {
                    try {
                        if (prescriptionEmrDO != null) {
                        if (prescriptionEmrDO != null) {
                            logger.info("电子病历同步");
                            logger.info("电子病历同步");
                            hcyyPrescriptionService.saveEmrToEntrance(prescriptionId,null);
                            hcyyPrescriptionService.saveEmrToEntrance(prescriptionId,baseSign);
                            logger.info("电子病历同步");
                            logger.info("电子病历同步");
                            logger.info("电子病历签名");
                            logger.info("电子病历签名");
                           /* xzyyPrescriptionService.SOF_SignDataWithExtraInfoEmr(wlyyPrescriptionDO);*/
                            hcyyEntranceService.initiateDataSign(wlyyPrescriptionDO.getId(),1,ip);
                        }
                        }
                    }catch (Exception e){
                    }catch (Exception e){
                        e.printStackTrace();
                        e.printStackTrace();

File diff suppressed because it is too large
+ 111 - 170
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/HcyyEntranceService.java


+ 52 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -313,6 +313,58 @@ public class YkyyEntranceService {
        return new JSONArray();
        return new JSONArray();
    }
    }
    /**
     * 获取检验报告列表
     *
     * @param patient
     * @param startDate
     * @param endDate
     * @return
     * @throws Exception
     */
    public JSONArray getSampleByYZ(String patient,String startDate,String endDate) throws Exception {
        JSONObject object = new JSONObject();
        BasePatientDO patientDO = basePatientDao.findById(patient);
        if (patientDO==null){
            throw new Exception("患者信息为空!");
        }
        object.put("idCard",patientDO.getIdcard());
        object.put("startDate",startDate);
        object.put("endDate",endDate);
        String requestUrl = "http://110.80.17.187:8081/api/getSampleByYZ";
        String response = httpClientUtil.postBody(requestUrl,object);
        if (response!=null){
            JSONObject resJson = JSONObject.parseObject(response);
            if (resJson.getString("status").equalsIgnoreCase("200")){
                JSONArray array = resJson.getJSONArray("payload");
                return array;
            }
        }
        return null;
    }
    /**
     * 获取检验报告详情
     *
     * @param reportNo
     * @return
     * @throws Exception
     */
    public JSONObject getSampleDetailByYZ(String reportNo) throws Exception {
        JSONObject object = new JSONObject();
        object.put("reportNo",reportNo);
        String requestUrl = "http://110.80.17.187:8081/api/getSampleDetailByYZ";
        String response = httpClientUtil.postBody(requestUrl,object);
        if (response!=null){
            JSONObject resJson = JSONObject.parseObject(response);
            if (resJson.getString("status").equalsIgnoreCase("200")){
                JSONObject jsonObject = resJson.getJSONObject("payload");
                return jsonObject;
            }
        }
        return null;
    }
    /**
    /**
     * 检查信息明细
     * 检查信息明细
     * @param REPORT_ID
     * @param REPORT_ID

+ 17 - 1
common/common-entity/sql记录

@ -1804,4 +1804,20 @@ CREATE TABLE `base_patient_monitor_data` (
  `create_time` datetime DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  PRIMARY KEY (`id`),
  KEY `idx_patient` (`patient`)
  KEY `idx_patient` (`patient`)
) ENGINE=InnoDB AUTO_INCREMENT=95 DEFAULT CHARSET=utf8mb4 COMMENT='设备监测日志记录表';
) ENGINE=InnoDB AUTO_INCREMENT=95 DEFAULT CHARSET=utf8mb4 COMMENT='设备监测日志记录表';
-- 2022-05-18
CREATE TABLE `base_visit_sign` (
  `id` varchar(50) NOT NULL,
  `visit_id` varchar(50) DEFAULT NULL COMMENT '走访id',
  `type` int(2) DEFAULT NULL COMMENT '签到方式1.定位,2.拍照',
  `doctor` varchar(50) DEFAULT NULL COMMENT '医生',
  `doctor_name` varchar(50) DEFAULT NULL COMMENT '医生姓名',
  `lon` varchar(20) DEFAULT NULL COMMENT '经度',
  `lat` varchar(20) DEFAULT NULL COMMENT '纬度',
  `address` varchar(255) DEFAULT NULL COMMENT '地址',
  `img` varchar(2500) DEFAULT NULL COMMENT '图片地址“,”分割',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `del` int(2) DEFAULT NULL COMMENT '是否删除1为删除,0.为正常',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=257 DEFAULT CHARSET=utf8mb4 COMMENT='日常走访签到';

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java

@ -25,7 +25,7 @@ public abstract class IntegerIdentityEntity implements Serializable {
//==========mysql 环境 id策略 end======================================================
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
//==========Oracle 环境id策略 =========================================================
//   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
/*   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")*/
//==========Oracle 环境id策略 =========================================================
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
    public Integer getId() {
        return id;
        return id;

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/care/visit/BaseVisitDO.java

@ -17,7 +17,7 @@ public class BaseVisitDO extends UuidIdentityEntityWithCreateTime {
    private String patient;
    private String patient;
    private String patientName;
    private String patientName;
    private String type;//类型 1老人日常走访 2老人日常临时走访(管理端直接新增记录没有计划)
    private String type;//类型 1老人日常走访 2老人日常临时走访(管理端直接新增记录没有计划)
    private String status;//状态 0计划中 1 已完成 2计划超时
    private String status;//状态 0计划中 1 已完成 2计划超时 3 已签到
    private Date visitDate;//完成走访时间
    private Date visitDate;//完成走访时间
    private Date visitPlanDate;//计划走访时间
    private Date visitPlanDate;//计划走访时间
    private String doctor;
    private String doctor;

+ 97 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/visit/BaseVisitSignDO.java

@ -0,0 +1,97 @@
package com.yihu.jw.entity.care.visit;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by Bing on 2022/5/18.
 * 日常走访签到表
 */
@Entity
@Table(name = "base_visit_sign")
public class BaseVisitSignDO extends UuidIdentityEntityWithCreateTime {
    private String visitId; //走访id
    private Integer type;  // 签到方式1.定位,2.拍照
    private String doctor; //签到医生
    private String doctorName;
    private String lon; //经度
    private String lat; //纬度
    private String address;//签到地址
    private String img;//图片 多张逗号隔开
    private Integer del; //0无效 1有效
    public String getVisitId() {
        return visitId;
    }
    public void setVisitId(String visitId) {
        this.visitId = visitId;
    }
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    public String getLon() {
        return lon;
    }
    public void setLon(String lon) {
        this.lon = lon;
    }
    public String getLat() {
        return lat;
    }
    public void setLat(String lat) {
        this.lat = lat;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
    public String getImg() {
        return img;
    }
    public void setImg(String img) {
        this.img = img;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 39 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/endpoint/EnvelopRestEndpoint.java

@ -18,6 +18,8 @@ import javax.servlet.http.HttpServletResponse;
import java.beans.PropertyDescriptor;
import java.beans.PropertyDescriptor;
import java.io.IOException;
import java.io.IOException;
import java.lang.reflect.Method;
import java.lang.reflect.Method;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.*;
@ -593,4 +595,41 @@ public abstract class EnvelopRestEndpoint extends Exception {
            return PageEnvelop.getError("系统繁忙,请稍后再试",-10000);
            return PageEnvelop.getError("系统繁忙,请稍后再试",-10000);
        }
        }
    }
    }
    /**
     * 获取用户真实IP地址,不使用request.getRemoteAddr();的原因是有可能用户使用了代理软件方式避免真实IP地址。
     * 可是,如果通过了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP值,究竟哪个才是真正的用户端的真实IP呢?
     * 答案是取X-Forwarded-For中第一个非unknown的有效IP字符串
     * @param request
     * @return
     */
    public String getIpAddress(HttpServletRequest request) {
        String ip = request.getHeader("x-forwarded-for");
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("WL-Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("HTTP_CLIENT_IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("HTTP_X_FORWARDED_FOR");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getRemoteAddr();
            if("127.0.0.1".equals(ip)||"0:0:0:0:0:0:0:1".equals(ip)){
                //根据网卡取本机配置的IP
                InetAddress inet=null;
                try {
                    inet = InetAddress.getLocalHost();
                } catch (UnknownHostException e) {
                    e.printStackTrace();
                }
                ip= inet.getHostAddress();
            }
        }
        return ip;
    }
}
}

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

@ -7,6 +7,7 @@ import com.google.code.kaptcha.util.Config;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.login.BaseLoginLogDO;
import com.yihu.jw.entity.base.login.BaseLoginLogDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.sms.SmsDO;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.entity.util.AesEncryptUtils;
@ -27,11 +28,10 @@ import com.yihu.jw.security.oauth2.provider.WlyyTokenGranter;
import com.yihu.jw.security.oauth2.provider.error.WlyyOAuth2ExceptionTranslator;
import com.yihu.jw.security.oauth2.provider.error.WlyyOAuth2ExceptionTranslator;
import com.yihu.jw.security.service.*;
import com.yihu.jw.security.service.*;
import com.yihu.jw.security.utils.*;
import com.yihu.jw.security.utils.*;
import com.yihu.jw.sms.service.TXYSmsService;
import com.yihu.jw.sms.service.YkyyINSMSService;
import com.yihu.jw.sms.service.ZBSmsService;
import com.yihu.jw.sms.service.ZhongShanSMSService;
import com.yihu.jw.sms.dao.BaseSmsDao;
import com.yihu.jw.sms.service.*;
import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
import com.yihu.jw.util.common.NetworkUtil;
import com.yihu.jw.util.common.StringUtil;
import com.yihu.jw.util.common.StringUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.utils.network.HttpResponse;
import com.yihu.utils.network.HttpResponse;
@ -169,7 +169,8 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    private HttpClientUtil httpClientUtil;
    private HttpClientUtil httpClientUtil;
    @Autowired
    @Autowired
    private HcyyService hcyyService;
    private HcyyService hcyyService;
    @Autowired
    private BaseSmsDao baseSmsDao;
    @PostConstruct
    @PostConstruct
    private void init() {
    private void init() {
@ -834,6 +835,16 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        }else {
        }else {
            //发送短信获取验证码
            //发送短信获取验证码
            String captcha = wlyyRedisVerifyCodeService.getCodeNumber();
            String captcha = wlyyRedisVerifyCodeService.getCodeNumber();
            SmsDO smsDO = new SmsDO();
            smsDO.setCaptcha(captcha);
            smsDO.setClientId(client_id);
            smsDO.setContent("您好,你的手机登录短信验证码是:"+captcha+",5分钟内有效。");
            smsDO.setMobile(username);
            smsDO.setDeadline(DateUtil.getNextMin(new Date(),5));
            HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
            smsDO.setRequestIp(NetworkUtil.getIpAddress(request));
            smsDO.setCreateTime(new Date());
            baseSmsDao.save(smsDO);
            //
            //
            String result =  txySmsService.sendMessage(username,captcha);
            String result =  txySmsService.sendMessage(username,captcha);
            if ("Ok".equals(result)) {
            if ("Ok".equals(result)) {

+ 1 - 1
server/svr-authentication/src/main/java/com/yihu/jw/security/service/HcyyService.java

@ -197,7 +197,7 @@ public class HcyyService {
            jsonObject.put("data",data.toJSONString());
            jsonObject.put("data",data.toJSONString());
            jsonObject.put("businessSerialNo",businessSerialNo);
            jsonObject.put("businessSerialNo",businessSerialNo);
            data.put("accessMode","1");*/
            data.put("accessMode","1");*/
            String jsonObject ="{\\\"token\\\": \\\""+token+"\\\", \\\"data\\\": \\\"{\\\\\\\"clientId\\\\\\\": \\\\\\\""+clientId+"\\\\\\\",\\\\\\\"userType\\\\\\\": \\\\\\\"1\\\\\\\"}\\\",\\\"businessSerialNo\\\": \\\"" + businessSerialNo + "\\\",\\\"accessMode\\\": \\\"1\\\"}";
            String jsonObject ="{\\\"token\\\": \\\""+token+"\\\", \\\"data\\\": \\\"{\\\\\\\"clientId\\\\\\\": \\\\\\\""+clientId+"\\\\\\\",\\\\\\\"userType\\\\\\\": \\\\\\\"1\\\\\\\",\\\\\\\"accessMode\\\\\\\": \\\\\\\"1\\\\\\\"}\\\",\\\"businessSerialNo\\\": \\\"" + businessSerialNo + "\\\",\\\"accessMode\\\": \\\"1\\\"}";
            String result = null;
            String result = null;
            result = XMCA_DCS_UnifiedInterface("获取登录小程序码接口","authorize/wxacode",jsonObject);
            result = XMCA_DCS_UnifiedInterface("获取登录小程序码接口","authorize/wxacode",jsonObject);
            JSONObject rs = new JSONObject();
            JSONObject rs = new JSONObject();

+ 4 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/message/BaseServiceNewsDao.java

@ -1,12 +1,12 @@
package com.yihu.jw.care.dao.message;
package com.yihu.jw.care.dao.message;
import com.yihu.jw.entity.care.device.DevicePatientHealthIndex;
import com.yihu.jw.entity.care.message.BaseServiceNews;
import com.yihu.jw.entity.care.message.BaseServiceNews;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
import java.util.List;
/**
/**
@ -20,4 +20,7 @@ public interface BaseServiceNewsDao extends PagingAndSortingRepository<BaseServi
    @Query("select a from BaseServiceNews a ")
    @Query("select a from BaseServiceNews a ")
    List<BaseServiceNews> findNews(Pageable pageRequest);
    List<BaseServiceNews> findNews(Pageable pageRequest);
    @Query("select a from BaseServiceNews a where a.createTime >= ?1 and a.createTime <= ?2 ")
    List<BaseServiceNews> findNewsByTime(Date beginTime, Date endTime, Pageable pageRequest);
}
}

+ 13 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/visit/BaseVisitSignDao.java

@ -0,0 +1,13 @@
package com.yihu.jw.care.dao.visit;
import com.yihu.jw.entity.care.visit.BaseVisitSignDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Bing on 2022/5/18.
 */
public interface BaseVisitSignDao extends PagingAndSortingRepository<BaseVisitSignDO,String>, JpaSpecificationExecutor<BaseVisitSignDO> {
    BaseVisitSignDO findByVisitId(String visitId);
}

+ 33 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/statistics/OpenStatisticsEndpoint.java

@ -135,6 +135,7 @@ public class OpenStatisticsEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "服务资源v0.7.0")
    @ApiOperation(value = "服务资源v0.7.0")
    public ObjEnvelop ServiceResources() {
    public ObjEnvelop ServiceResources() {
        try {
        try {
            //机构和人员总数
            JSONObject result = statisticsService.serviceResources();
            JSONObject result = statisticsService.serviceResources();
            return success(result);
            return success(result);
        } catch (Exception e) {
        } catch (Exception e) {
@ -142,6 +143,33 @@ public class OpenStatisticsEndpoint extends EnvelopRestEndpoint {
        }
        }
    }
    }
    @GetMapping(value = "getOrgListByPage")
    @ApiOperation(value = "获取机构列表")
    public PageEnvelop getOrgListByPage(@ApiParam(name = "type",value = "类型。1医疗机构,3养老机构,4托育机构,6照料中心") @RequestParam String type,
                                        @ApiParam(name = "page",value = "页码") @RequestParam Integer page,
                                        @ApiParam(name = "pageSize",value = "每页大小") @RequestParam Integer pageSize,
                                        @ApiParam(name = "name",value = "模糊搜索") @RequestParam(name = "name",required = false)String name){
        try {
            return statisticsService.getOrgListByPage(type, page, pageSize,name);
        }catch (Exception e){
            return failedPageEnvelopException2(e);
        }
    }
    @GetMapping(value = "getUserListByPage")
    @ApiOperation(value = "获取人员列表")
    public PageEnvelop getUserListByPage(@ApiParam(name = "type",value = "类型。1医生,2社工,3教师,4助老员") @RequestParam String type,
                                         @ApiParam(name = "page",value = "页码") @RequestParam Integer page,
                                         @ApiParam(name = "pageSize",value = "每页大小") @RequestParam Integer pageSize,
                                         @ApiParam(name = "name",value = "模糊搜索名字") @RequestParam(name = "name",required = false)String name,
                                         @ApiParam(name = "idCard",value = "模糊搜索身份证号") @RequestParam(name = "idCard",required = false)String idCard){
        try {
            return statisticsService.getUserListByPage(type, page, pageSize, name, idCard);
        }catch (Exception e){
            return failedPageEnvelopException2(e);
        }
    }
    @GetMapping(value = "realTimeDataNew")
    @GetMapping(value = "realTimeDataNew")
    @ApiOperation(value = "实时数据v0.7.0")
    @ApiOperation(value = "实时数据v0.7.0")
    public ObjEnvelop realTimeDataNew() {
    public ObjEnvelop realTimeDataNew() {
@ -155,10 +183,12 @@ public class OpenStatisticsEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "getAllDynamics")
    @GetMapping(value = "getAllDynamics")
    @ApiOperation(value = "综合动态v0.7.0")
    @ApiOperation(value = "综合动态v0.7.0")
    public PageEnvelop getAllDynamics(
            @RequestParam(required = true) Integer page, @RequestParam(required = true) Integer size) {
    public PageEnvelop getAllDynamics(@ApiParam @RequestParam Integer page,
                                      @ApiParam @RequestParam Integer size,
                                      @ApiParam(name = "beginTime",value = "开始时间,格式2022-05-19 00:00:00") @RequestParam(name = "beginTime",required = false)String beginTime,
                                      @ApiParam(name = "endTime",value = "结束时间,格式2022-05-19 23:59:59") @RequestParam(name = "endTime",required = false)String endTime) {
        try {
        try {
            return statisticsService.getAllDynamics(page, size);
            return statisticsService.getAllDynamics(page, size,beginTime,endTime);
        } catch (Exception e) {
        } catch (Exception e) {
            return failedPageEnvelopException2(e);
            return failedPageEnvelopException2(e);
        }
        }

+ 75 - 27
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/third/platForm/PatientInfoPlatFormEndpoint.java

@ -13,6 +13,7 @@ import com.yihu.jw.care.service.security.SecurityMonitoringOrderService;
import com.yihu.jw.care.service.third.PatientInfoPlatFormService;
import com.yihu.jw.care.service.third.PatientInfoPlatFormService;
import com.yihu.jw.entity.care.doorCoach.BaseDoorCoachOrderDO;
import com.yihu.jw.entity.care.doorCoach.BaseDoorCoachOrderDO;
import com.yihu.jw.entity.care.lifeCare.LifeCareOrderDO;
import com.yihu.jw.entity.care.lifeCare.LifeCareOrderDO;
import com.yihu.jw.entity.care.message.BaseServiceNews;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
@ -26,6 +27,8 @@ import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
/**
 * Created by Bing on 2021/6/16.
 * Created by Bing on 2021/6/16.
 * 管理端pc端 居民详情大屏
 * 管理端pc端 居民详情大屏
@ -111,17 +114,32 @@ public class PatientInfoPlatFormEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "findNews")
    @GetMapping(value = "findNews")
    @ApiOperation("服务动态")
    @ApiOperation("服务动态")
    public ListEnvelop findNews(@ApiParam(name="page",value = "页面大小",required = false)
                                @RequestParam(value = "page",required = false,defaultValue = "0")Integer page,
                                @ApiParam(name="size",value = "页面大小",required = true)
                                @RequestParam(value = "size")Integer size){
    public ListEnvelop findNews(@ApiParam(name="page",value = "页面大小",required = false) @RequestParam(value = "page",required = false,defaultValue = "0")Integer page,
                                @ApiParam(name="size",value = "页面大小",required = true) @RequestParam(value = "size")Integer size,
                                @ApiParam(name = "beginTime",value = "开始时间,格式2022-05-19 00:00:00") @RequestParam(name = "beginTime",required = false)String beginTime,
                                @ApiParam(name = "endTime",value = "结束时间,格式2022-05-19 23:59:59") @RequestParam(name = "endTime",required = false)String endTime){
        try {
        try {
            return ListEnvelop.getSuccess("查询成功",baseServiceNewsService.findNews(page,size));
            return ListEnvelop.getSuccess("查询成功",baseServiceNewsService.findNews(page,size,beginTime,endTime));
        }catch (Exception e){
        }catch (Exception e){
            return failedListEnvelopException2(e);
            return failedListEnvelopException2(e);
        }
        }
    }
    }
    @GetMapping(value = "findNewsByPage")
    @ApiOperation("服务动态分页")
    public PageEnvelop findNewsByPage(@ApiParam(name="page",value = "页面大小") @RequestParam Integer page,
                                      @ApiParam(name="pageSize",value = "页面大小") @RequestParam Integer pageSize,
                                      @ApiParam(name = "beginTime",value = "开始时间,格式2022-05-19 00:00:00") @RequestParam(name = "beginTime",required = false)String beginTime,
                                      @ApiParam(name = "endTime",value = "结束时间,格式2022-05-19 23:59:59") @RequestParam(name = "endTime",required = false)String endTime){
        try {
            List<BaseServiceNews> news = baseServiceNewsService.findNews(page, pageSize,beginTime,endTime);
            Long count = baseServiceNewsService.findNewsCount(beginTime, endTime);
            return PageEnvelop.getSuccessListWithPage("获取成功",news,page,pageSize,count);
        }catch (Exception e){
            return failedPageEnvelopException2(e);
        }
    }
    @GetMapping(value = "getPatientInfo")
    @GetMapping(value = "getPatientInfo")
    @ApiOperation("获取居民详情页--弃用")
    @ApiOperation("获取居民详情页--弃用")
    public ObjEnvelop getPatientInfo(@ApiParam(name="patient",value = "居民id",required = true)
    public ObjEnvelop getPatientInfo(@ApiParam(name="patient",value = "居民id",required = true)
@ -379,15 +397,13 @@ public class PatientInfoPlatFormEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "getEmergencyWarnOrderListNew")
    @GetMapping(value = "getEmergencyWarnOrderListNew")
    @ApiOperation(value = "安防监测列表 v0.7.0")//        疑似离开安全区域+疑似跌倒
    @ApiOperation(value = "安防监测列表 v0.7.0")//        疑似离开安全区域+疑似跌倒
    public PageEnvelop getEmergencyWarnOrderListNew(@ApiParam(name="page",value = "page")
                                                 @RequestParam(value = "page") Integer page,
                                                    @ApiParam(name="patient",value = "patient")
                                                    @RequestParam(value = "patient",required = false) String patient,
                                                 @ApiParam(name="pageSize",value = "pageSize")
                                                 @RequestParam(value = "pageSize") Integer pageSize
    ){
    public PageEnvelop getEmergencyWarnOrderListNew(@ApiParam(name="page",value = "page") @RequestParam(value = "page") Integer page,
                                                    @ApiParam(name="patient",value = "patient") @RequestParam(value = "patient",required = false) String patient,
                                                    @ApiParam(name="pageSize",value = "pageSize") @RequestParam(value = "pageSize") Integer pageSize,
                                                    @ApiParam(name = "beginTime",value = "开始时间,格式2022-05-19 00:00:00") @RequestParam(name = "beginTime",required = false)String beginTime,
                                                    @ApiParam(name = "endTime",value = "结束时间,格式2022-05-19 23:59:59") @RequestParam(name = "endTime",required = false)String endTime){
        try {
        try {
            return patientInfoPlatFormService.getEmergencyWarnOrderListNew(page,pageSize,patient);
            return patientInfoPlatFormService.getEmergencyWarnOrderListNew(page,pageSize,patient,beginTime,endTime);
        }catch (Exception e){
        }catch (Exception e){
            return failedPageEnvelopException2(e);
            return failedPageEnvelopException2(e);
        }
        }
@ -395,15 +411,13 @@ public class PatientInfoPlatFormEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "getEmergencyWarningListNew")
    @GetMapping(value = "getEmergencyWarningListNew")
    @ApiOperation(value = "紧急预警列表 v0.7.0")//        发起紧急救助
    @ApiOperation(value = "紧急预警列表 v0.7.0")//        发起紧急救助
    public PageEnvelop getEmergencyWarningListNew(@ApiParam(name="page",value = "page")
                                                    @RequestParam(value = "page") Integer page,
                                                  @ApiParam(name="patient",value = "patient")
                                                  @RequestParam(value = "patient",required = false) String patient,
                                                    @ApiParam(name="pageSize",value = "pageSize")
                                                    @RequestParam(value = "pageSize") Integer pageSize
    ){
    public PageEnvelop getEmergencyWarningListNew(@ApiParam(name="page",value = "page") @RequestParam(value = "page") Integer page,
                                                  @ApiParam(name="patient",value = "patient") @RequestParam(value = "patient",required = false) String patient,
                                                  @ApiParam(name="pageSize",value = "pageSize") @RequestParam(value = "pageSize") Integer pageSize,
                                                  @ApiParam(name = "beginTime",value = "开始时间,格式2022-05-19 00:00:00") @RequestParam(name = "beginTime",required = false)String beginTime,
                                                  @ApiParam(name = "endTime",value = "结束时间,格式2022-05-19 23:59:59") @RequestParam(name = "endTime",required = false)String endTime){
        try {
        try {
            return patientInfoPlatFormService.getEmergencyWarningListNew(page,pageSize,patient);
            return patientInfoPlatFormService.getEmergencyWarningListNew(page,pageSize,patient,beginTime,endTime);
        }catch (Exception e){
        }catch (Exception e){
            return failedPageEnvelopException2(e);
            return failedPageEnvelopException2(e);
        }
        }
@ -411,13 +425,12 @@ public class PatientInfoPlatFormEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "getHealthMonitoringListNew")
    @GetMapping(value = "getHealthMonitoringListNew")
    @ApiOperation(value = "健康监测列表 v0.7.0")// 血糖+血压
    @ApiOperation(value = "健康监测列表 v0.7.0")// 血糖+血压
    public PageEnvelop getHealthMonitoringListNew(@ApiParam(name="page",value = "page")
                                                  @RequestParam(value = "page") Integer page,
                                                  @ApiParam(name="pageSize",value = "pageSize")
                                                  @RequestParam(value = "pageSize") Integer pageSize
    ){
    public PageEnvelop getHealthMonitoringListNew(@ApiParam(name="page",value = "page") @RequestParam(value = "page") Integer page,
                                                  @ApiParam(name="pageSize",value = "pageSize") @RequestParam(value = "pageSize") Integer pageSize,
                                                  @ApiParam(name = "beginTime",value = "开始时间,格式2022-05-19 00:00:00") @RequestParam(name = "beginTime",required = false)String beginTime,
                                                  @ApiParam(name = "endTime",value = "结束时间,格式2022-05-19 23:59:59") @RequestParam(name = "endTime",required = false)String endTime){
        try {
        try {
            return patientInfoPlatFormService.getHealthMonitoringListNew(page,pageSize);
            return patientInfoPlatFormService.getHealthMonitoringListNew(page,pageSize,beginTime,endTime);
        }catch (Exception e){
        }catch (Exception e){
            return failedPageEnvelopException2(e);
            return failedPageEnvelopException2(e);
        }
        }
@ -460,4 +473,39 @@ public class PatientInfoPlatFormEndpoint extends EnvelopRestEndpoint {
        }
        }
    }
    }
    @RequestMapping(value = "getWarningCount", method = RequestMethod.GET)
    @ApiOperation(value = "获取预警中的总数")
    public ObjEnvelop getWarningCount(@ApiParam(name="patient",value = "居民id") @RequestParam(value = "patient",required = false) String patient){
        try{
            return patientInfoPlatFormService.getWarningCount(patient);
        }catch (Exception e){
            return failedObjEnvelopException2(e);
        }
    }
    @RequestMapping(value = "getWarningList", method = RequestMethod.GET)
    @ApiOperation(value = "获取紧急预警中的列表")
    public PageEnvelop getWarningList(@ApiParam(name="page",value = "页码") @RequestParam(value = "page") Integer page,
                                      @ApiParam(name="pageSize",value = "每页大小") @RequestParam(value = "pageSize") Integer pageSize,
                                      @ApiParam(name="patient",value = "居民id") @RequestParam(value = "patient",required = false) String patient){
        try{
            return patientInfoPlatFormService.getWarningList(page,pageSize,patient);
        }catch (Exception e){
            return failedPageEnvelopException2(e);
        }
    }
    @RequestMapping(value = "getHealthWarningList", method = RequestMethod.GET)
    @ApiOperation(value = "获取体征预警中的列表")
    public PageEnvelop getHealthWarningList(@ApiParam(name="page",value = "页码") @RequestParam(value = "page") Integer page,
                                            @ApiParam(name="pageSize",value = "每页大小") @RequestParam(value = "pageSize") Integer pageSize,
                                            @ApiParam(name="patient",value = "居民id") @RequestParam(value = "patient",required = false) String patient){
        try{
            return patientInfoPlatFormService.getHealthWarningList(page,pageSize,patient);
        }catch (Exception e){
            return failedPageEnvelopException2(e);
        }
    }
}
}

+ 41 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/visit/VisitEndpoint.java

@ -1,9 +1,12 @@
package com.yihu.jw.care.endpoint.visit;
package com.yihu.jw.care.endpoint.visit;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.aop.ObserverRequired;
import com.yihu.jw.care.aop.ObserverRequired;
import com.yihu.jw.care.service.common.PermissionService;
import com.yihu.jw.care.service.visit.BaseVisitService;
import com.yihu.jw.care.service.visit.BaseVisitService;
import com.yihu.jw.entity.base.team.BaseTeamDO;
import com.yihu.jw.entity.base.team.BaseTeamDO;
import com.yihu.jw.entity.care.visit.BaseVisitDO;
import com.yihu.jw.entity.care.visit.BaseVisitDO;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
@ -13,7 +16,6 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.*;
@ -32,6 +34,9 @@ public class VisitEndpoint extends EnvelopRestEndpoint {
    @Autowired
    @Autowired
    private BaseVisitService baseVisitService;
    private BaseVisitService baseVisitService;
    @Autowired
    private PermissionService permissionService;
    @ApiOperation("获取日常走访列表")
    @ApiOperation("获取日常走访列表")
    @RequestMapping(value = "/getListByDoctor", method = RequestMethod.GET)
    @RequestMapping(value = "/getListByDoctor", method = RequestMethod.GET)
    public ListEnvelop getListByDoctor(@ApiParam(name = "startTime", value = "开始时间", defaultValue = "2021-11-11 00:00:00")
    public ListEnvelop getListByDoctor(@ApiParam(name = "startTime", value = "开始时间", defaultValue = "2021-11-11 00:00:00")
@ -137,7 +142,7 @@ public class VisitEndpoint extends EnvelopRestEndpoint {
        }
        }
    }
    }
    @ApiOperation("直接新增走访--管理员端")
    @ApiOperation("直接新增走访--管理员端--管理员端取消日常走访")
    @RequestMapping(value = "/adminAddVisit",method = RequestMethod.POST)
    @RequestMapping(value = "/adminAddVisit",method = RequestMethod.POST)
    public Envelop adminAddVisit(@ApiParam(name = "doctor", value = "医生id")
    public Envelop adminAddVisit(@ApiParam(name = "doctor", value = "医生id")
                                 @RequestParam(value = "doctor", required = true) String doctor,
                                 @RequestParam(value = "doctor", required = true) String doctor,
@ -154,10 +159,43 @@ public class VisitEndpoint extends EnvelopRestEndpoint {
                                 @ApiParam(name = "lifeConsult", value = "生活咨询")
                                 @ApiParam(name = "lifeConsult", value = "生活咨询")
                                 @RequestParam(value = "lifeConsult", required = false) String lifeConsult) {
                                 @RequestParam(value = "lifeConsult", required = false) String lifeConsult) {
        try {
        try {
            baseVisitService.adminAddVisit(doctor,patient,visitContent,visitImg,deviceMaintenance,health,lifeConsult);
//            baseVisitService.adminAddVisit(doctor,patient,visitContent,visitImg,deviceMaintenance,health,lifeConsult);
            return Envelop.getSuccess("操作成功");
            return Envelop.getSuccess("操作成功");
        } catch (Exception e) {
        } catch (Exception e) {
            return failedException2(e);
            return failedException2(e);
        }
        }
    }
    }
    @PostMapping("signIn")
    @ApiOperation(value = "日常走访签到")
    @ObserverRequired
    public ObjEnvelop signIn(
            @ApiParam(value = "走访id", name = "visitId")
            @RequestParam(value = "visitId", required = true) String visitId,
            @ApiParam(value = "签到方式:1.定位,2.拍照", name = "signWay")
            @RequestParam(value = "signWay", required = true) Integer signWay,
            @ApiParam(value = "签到纬度", name = "signLat")
            @RequestParam(value = "signLat", required = false) String signLat,
            @ApiParam(value = "签到经度", name = "signLon")
            @RequestParam(value = "signLon", required = false) String signLon,
            @ApiParam(value = "签到地址", name = "address")
            @RequestParam(value = "address", required = false) String address,
            @ApiParam(value = "签到照片", name = "signImg")
            @RequestParam(value = "signImg", required = false) String signImg) {
        try {
            String doctorId = permissionService.getUID();
            JSONObject param = new JSONObject();
            param.put("doctorId",doctorId);
            if(permissionService.noPermission(1,param)){
                return ObjEnvelop.getError("该操作没有权限");
            }
            JSONObject result = baseVisitService.signIn(visitId, signWay, signLat,signLon, address,signImg,doctorId);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return ObjEnvelop.getError(result.getString("resultMsg"));
            }
            return ObjEnvelop.getSuccess("操作成功",result.getString(ResponseContant.resultMsg));
        } catch (Exception e) {
            return failedObjEnvelopException2(e);
        }
    }
}
}

+ 24 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/message/BaseServiceNewsService.java

@ -13,6 +13,7 @@ import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.PageRequest;
@ -283,7 +284,7 @@ public class BaseServiceNewsService {
     * @param size
     * @param size
     * @return
     * @return
     */
     */
    public List<BaseServiceNews> findNews(Integer page,Integer size){
    public List<BaseServiceNews> findNews(Integer page,Integer size,String beginTime,String endTime){
        if (null==page){
        if (null==page){
            page=0;
            page=0;
        }
        }
@ -298,7 +299,13 @@ public class BaseServiceNewsService {
        List<BaseServiceNews> result = new ArrayList<>();
        List<BaseServiceNews> result = new ArrayList<>();
        List<BaseServiceNews> list = baseServiceNewsDao.findNews(pageRequest);
        List<BaseServiceNews> list =new ArrayList<>();
        if(StringUtils.isBlank(beginTime) && StringUtils.isBlank(endTime)){
            list = baseServiceNewsDao.findNews(pageRequest);
        }else {
            list = baseServiceNewsDao.findNewsByTime(DateUtil.strToDate(beginTime),DateUtil.strToDate(endTime),pageRequest);
        }
        for (BaseServiceNews tmp:list){
        for (BaseServiceNews tmp:list){
            if (jkzlPatients.contains(tmp.getCode())){
            if (jkzlPatients.contains(tmp.getCode())){
                continue;
                continue;
@ -330,6 +337,21 @@ public class BaseServiceNewsService {
        return result;
        return result;
    }
    }
    /**
     * 获取综合服务的总数
     * @return
     */
    public Long findNewsCount(String beginTime,String endTime){
        String sql = "SELECT COUNT(*) FROM base_service_news\n" +
                "WHERE code NOT IN \n" +
                "(SELECT dict_code from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_child' or dict_name = 'jkzl_older')";
        String timeSql = " ";
        if(StringUtils.isNotBlank(beginTime) && StringUtils.isNotBlank(endTime)){
            timeSql = " and create_time>='"+beginTime+"' and create_time<='"+endTime+"' ";
        }
        return jdbcTemplate.queryForObject(sql+timeSql, Long.class);
    }
    /**
    /**
     * 添加服务动态信息-大屏展示用
     * 添加服务动态信息-大屏展示用
     * @param name
     * @param name

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

@ -329,9 +329,13 @@ public class StatisticsService {
        }
        }
        JSONObject res = new JSONObject();
        JSONObject res = new JSONObject();
        //医疗机构
        String medicalInstitutionSql = "SELECT COUNT(1) FROM base_org WHERE (type = 1 OR type = 2) AND del = 1 " + orgFilter;
        String medicalInstitutionSql = "SELECT COUNT(1) FROM base_org WHERE (type = 1 OR type = 2) AND del = 1 " + orgFilter;
        //养老机构
        String elderlyCarServiceSql = "SELECT COUNT(1) FROM base_org WHERE type = 3 AND del = 1 and code not in ('zdjsylfwyxgszhfgs') " + orgFilter;
        String elderlyCarServiceSql = "SELECT COUNT(1) FROM base_org WHERE type = 3 AND del = 1 and code not in ('zdjsylfwyxgszhfgs') " + orgFilter;
        //托育机构
        String childcareInstitutionsssSql = "SELECT COUNT(1) FROM base_org WHERE type = 4 AND del = 1" + orgFilter;
        String childcareInstitutionsssSql = "SELECT COUNT(1) FROM base_org WHERE type = 4 AND del = 1" + orgFilter;
        //照料中心
        String careCenterNumSql = "SELECT COUNT(1) FROM base_org WHERE type = 6 AND del = 1" + orgFilter;
        String careCenterNumSql = "SELECT COUNT(1) FROM base_org WHERE type = 6 AND del = 1" + orgFilter;
        //社工和教师注册人数
        //社工和教师注册人数
@ -347,18 +351,22 @@ public class StatisticsService {
        for (Map<String, Object> map : list2) {
        for (Map<String, Object> map : list2) {
            String archive_type = map.get("doctor_level").toString();
            String archive_type = map.get("doctor_level").toString();
            Integer num = Integer.valueOf(map.get("c").toString());
            Integer num = Integer.valueOf(map.get("c").toString());
            //医生
            if ("1".equals(archive_type)) {
            if ("1".equals(archive_type)) {
                doctorNum = num;
                doctorNum = num;
                continue;
                continue;
            }
            }
            //社工
            if ("2".equals(archive_type)) {
            if ("2".equals(archive_type)) {
                helperNum = num;
                helperNum = num;
                continue;
                continue;
            }
            }
            //助老员
            if ("4".equals(archive_type)) {
            if ("4".equals(archive_type)) {
                helper4Num = num;
                helper4Num = num;
                continue;
                continue;
            }
            }
            //教师
            if ("3".equals(archive_type)) {
            if ("3".equals(archive_type)) {
                teacherNum = num;
                teacherNum = num;
            }
            }
@ -367,7 +375,7 @@ public class StatisticsService {
        Integer elderlyCarServiceNum = jdbcTemplate.queryForObject(elderlyCarServiceSql, Integer.class);
        Integer elderlyCarServiceNum = jdbcTemplate.queryForObject(elderlyCarServiceSql, Integer.class);
        Integer childcareInstitutionsssNum = jdbcTemplate.queryForObject(childcareInstitutionsssSql, Integer.class);
        Integer childcareInstitutionsssNum = jdbcTemplate.queryForObject(childcareInstitutionsssSql, Integer.class);
        Integer careCenterNum = jdbcTemplate.queryForObject(careCenterNumSql, Integer.class);
        Integer careCenterNum = jdbcTemplate.queryForObject(careCenterNumSql, Integer.class);
        res.put("medicalInstitutionNum", medicalInstitutionNum);             //医疗结构
        res.put("medicalInstitutionNum", medicalInstitutionNum);             //医疗机构
        res.put("elderlyCarServiceNum", elderlyCarServiceNum);               //养老机构
        res.put("elderlyCarServiceNum", elderlyCarServiceNum);               //养老机构
        res.put("childcareInstitutionsssNum", childcareInstitutionsssNum);   //托育机构
        res.put("childcareInstitutionsssNum", childcareInstitutionsssNum);   //托育机构
        res.put("careCenterNum", careCenterNum);   //照料中心
        res.put("careCenterNum", careCenterNum);   //照料中心
@ -378,6 +386,83 @@ public class StatisticsService {
        return res;
        return res;
    }
    }
    /**
     * 获取机构列表
     * @param type 类型。1医疗机构,3养老机构,4托育机构,6照料中心
     * @param page
     * @param pageSize
     * @param name 名字模糊搜索
     * @return
     */
    public PageEnvelop getOrgListByPage(String type,Integer page,Integer pageSize,String name){
        page = page>0?page-1:0;
        String orgFilter = "";
        String sqlOrg = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_org' ";
        List<Map<String, Object>> listOrg = jdbcTemplate.queryForList(sqlOrg);
        if (listOrg.size() > 0) {
            String orgCodes = String.valueOf(listOrg.get(0).get("orgCodes"));
            orgCodes = orgCodes.replaceAll(",", "','");
            orgFilter = " and code not in ('" + orgCodes + "')";
        }
        String typeSql = "";
        if("1".equals(type)){
            typeSql = " and (type = 1 OR type = 2) ";
        }else if("3".equals(type)){
            typeSql = " and type = "+type + " and code not in ('zdjsylfwyxgszhfgs')  ";
        } else {
            typeSql = " and type = "+type;
        }
        if(StringUtils.isNotBlank(name)){
            typeSql = typeSql + " and name like '%"+name+"%' ";
        }
        String sql = "SELECT id,code,name,alias,type,brief,address,photo,intro,mobile FROM base_org WHERE del = 1 "+typeSql+orgFilter;
        String orderSql = " ORDER BY sort limit "+page*pageSize+","+pageSize;
        String countSql = "SELECT count(*) FROM base_org WHERE del = 1 "+typeSql+orgFilter;
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql+orderSql);
        Long count = jdbcTemplate.queryForObject(countSql,Long.class);
        return PageEnvelop.getSuccessListWithPage("获取成功",list,page,pageSize,count);
    }
    /**
     *
     * @param type 类型。1医生,2社工,3教师,4助老员
     * @param page
     * @param pageSize
     * @param name
     * @param idCard
     * @return
     */
    public PageEnvelop getUserListByPage(String type,Integer page,Integer pageSize,String name,String idCard){
        page = page>0?page-1:0;
        String selectSql = "SELECT a.id,a.name,\n" +
                "\tCASE\n" +
                "\t\ta.sex \n" +
                "\t\tWHEN 1 THEN\n" +
                "\t\t'男' \n" +
                "\t\tWHEN 2 THEN\n" +
                "\t\t'女' ELSE a.sex \n" +
                "\tEND AS sex,\n" +
                "\tTIMESTAMPDIFF(YEAR,a.birthday,now()) AS age,\n" +
                "\ta.doctor_level,a.mobile,h.org_name,a.idcard ";
        String countSql = "select count(a.id)";
        String fromSql = " from base_doctor a,base_doctor_hospital h where a.id=h.doctor_code and a.del = '1' and h.del = '1' " +
                " and a.doctor_level is not null and h.org_code not in ( " +
                " SELECT dict_code from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_org'  )  and a.doctor_level="+type+"  ";
        if(StringUtils.isNotBlank(name)){
            fromSql+=" and a.name like '%"+name+"%' ";
        }
        if(StringUtils.isNotBlank(idCard)){
            fromSql+=" and a.idcard like '%"+idCard+"%' ";
        }
        Long count = jdbcTemplate.queryForObject(countSql + fromSql, Long.class);
        fromSql+=" limit "+page*pageSize+","+pageSize;
        List<Map<String, Object>> list = jdbcTemplate.queryForList(selectSql + fromSql);
        return PageEnvelop.getSuccessListWithPage("获取成功",list,page,pageSize,count);
    }
    // v0.7.0实时数据 照护对象、检测设备、紧急救助
    // v0.7.0实时数据 照护对象、检测设备、紧急救助
    public JSONObject realTimeDataNew() throws Exception {
    public JSONObject realTimeDataNew() throws Exception {
        JSONObject res = new JSONObject();
        JSONObject res = new JSONObject();
@ -482,10 +567,16 @@ public class StatisticsService {
        return res;
        return res;
    }
    }
    public PageEnvelop getAllDynamics(Integer page, Integer size) {
    public PageEnvelop getAllDynamics(Integer page, Integer size,String beginTime,String endTime) {
        List result = new ArrayList<>();
        List result = new ArrayList<>();
        Date date = DateUtil.getPreDays(new Date(), -7);
        String dateStr = DateUtil.dateToStrLong(date);
        String dateStr = "";
        if(StringUtils.isBlank(beginTime) && StringUtils.isBlank(endTime)){
            Date date = DateUtil.getPreDays(new Date(), -7);
            dateStr = " and create_time>='" + DateUtil.dateToStrLong(date) +"' ";
        }else {
            dateStr = " and create_time>='" + beginTime+"' and create_time<='"+endTime+"' ";
        }
        String filter = " ";
        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' " +
        String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_child' or dict_name = 'jkzl_older' " +
@ -499,8 +590,8 @@ public class StatisticsService {
            }
            }
        }
        }
        String sql = "select * from base_login_log where login_type<>1 and create_time>='" + dateStr + "' " + filter + " order by create_time desc limit " + (page - 1) * size + "," + size;
        String sqlCount = "select count(id) from base_login_log where login_type<>1 and create_time>='" + dateStr + "' " + filter;
        String sql = "select * from base_login_log where login_type<>1 " + dateStr + filter + " order by create_time desc limit " + (page - 1) * size + "," + size;
        String sqlCount = "select count(id) from base_login_log where login_type<>1 " + dateStr + filter;
        Long count = jdbcTemplate.queryForObject(sqlCount, Long.class);
        Long count = jdbcTemplate.queryForObject(sqlCount, Long.class);
        List<BaseLoginLogDO> loginLogDOs = jdbcTemplate.query(sql, new BeanPropertyRowMapper(BaseLoginLogDO.class));
        List<BaseLoginLogDO> loginLogDOs = jdbcTemplate.query(sql, new BeanPropertyRowMapper(BaseLoginLogDO.class));
        for (BaseLoginLogDO log : loginLogDOs) {
        for (BaseLoginLogDO log : loginLogDOs) {

+ 237 - 5
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/third/PatientInfoPlatFormService.java

@ -29,16 +29,19 @@ import com.yihu.jw.entity.care.securitymonitoring.SecurityMonitoringOrderDO;
import com.yihu.jw.entity.care.sign.CapacityAssessmentRecordDO;
import com.yihu.jw.entity.care.sign.CapacityAssessmentRecordDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.util.common.GpsUtil;
import com.yihu.jw.util.common.GpsUtil;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.LatitudeUtils;
import com.yihu.jw.util.common.LatitudeUtils;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.healthIndex.HealthIndexUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.StringUtils;
import org.json.JSONArray;
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.*;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Collectors;
@ -87,6 +90,8 @@ public class PatientInfoPlatFormService {
    private YsDeviceService ysDeviceService;
    private YsDeviceService ysDeviceService;
    @Autowired
    @Autowired
    private GpsUtil gpsUtil;
    private GpsUtil gpsUtil;
    @Autowired
    private HealthIndexUtil healthIndexUtil;
    /**
    /**
@ -477,7 +482,7 @@ public class PatientInfoPlatFormService {
        return PageEnvelop.getSuccessListWithPage("查询成功",list,page,pageSize,count);
        return PageEnvelop.getSuccessListWithPage("查询成功",list,page,pageSize,count);
    }
    }
    public PageEnvelop getEmergencyWarnOrderListNew(Integer page,Integer pageSize,String patient){
    public PageEnvelop getEmergencyWarnOrderListNew(Integer page,Integer pageSize,String patient,String beginTime,String endTime){
        page = page>0?page-1:0;
        page = page>0?page-1:0;
        String filter =" ";
        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' ";
        String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_child' or dict_name = 'jkzl_older' ";
@ -490,10 +495,13 @@ public class PatientInfoPlatFormService {
        String sql = " select  '22' as 'OrderType',p.archive_type archiveType,p.residential_area residentialArea,ord.id,ord.patient,p.name,ord.serve_desc,DATE_FORMAT(ord.create_time,'%Y-%m-%d %H:%i:%S') create_time," +
        String sql = " select  '22' as 'OrderType',p.archive_type archiveType,p.residential_area residentialArea,ord.id,ord.patient,p.name,ord.serve_desc,DATE_FORMAT(ord.create_time,'%Y-%m-%d %H:%i:%S') create_time," +
                "ord.`status`,case p.sex when 1 then '男' when 2 then '女' else p.sex end as sex,TIMESTAMPDIFF(YEAR,p.birthday,now()) as age \n" +
                "ord.`status`,case p.sex when 1 then '男' when 2 then '女' else p.sex end as sex,TIMESTAMPDIFF(YEAR,p.birthday,now()) as age \n" +
                "from base_security_monitoring_order ord INNER JOIN base_patient p on ord.patient = p.id " ;
                "from base_security_monitoring_order ord INNER JOIN base_patient p on ord.patient = p.id where 1=1 " ;
        if (StringUtils.isNotBlank(patient)){
        if (StringUtils.isNotBlank(patient)){
            sql +=" and ord.patient='"+patient+"' ";
            sql +=" and ord.patient='"+patient+"' ";
        }
        }
        if(StringUtils.isNotBlank(beginTime) && StringUtils.isNotBlank(endTime)){
            sql +=" and ord.create_time>='"+beginTime+"' and ord.create_time<='"+endTime+"' ";
        }
        sql+= filter +" order by create_time desc ";
        sql+= filter +" order by create_time desc ";
        String countSql = "select count(id) from ("+sql+")A ";
        String countSql = "select count(id) from ("+sql+")A ";
        long count = jdbcTemplate.queryForObject(countSql,long.class);
        long count = jdbcTemplate.queryForObject(countSql,long.class);
@ -639,7 +647,7 @@ public class PatientInfoPlatFormService {
        return PageEnvelop.getSuccessListWithPage("查询成功",list,page,pageSize,count);
        return PageEnvelop.getSuccessListWithPage("查询成功",list,page,pageSize,count);
    }
    }
    public PageEnvelop getEmergencyWarningListNew(Integer page,Integer pageSize,String patient){
    public PageEnvelop getEmergencyWarningListNew(Integer page,Integer pageSize,String patient,String beginTime,String endTime){
        page = page>0?page-1:0;
        page = page>0?page-1:0;
        String filter=" ";
        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' ";
        String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_child' or dict_name = 'jkzl_older' ";
@ -657,6 +665,9 @@ public class PatientInfoPlatFormService {
        if (StringUtils.isNotBlank(patient)){
        if (StringUtils.isNotBlank(patient)){
            filter +=" and ord.patient='"+patient+"' ";
            filter +=" and ord.patient='"+patient+"' ";
        }
        }
        if(StringUtils.isNotBlank(beginTime) && StringUtils.isNotBlank(endTime)){
            filter += " and ord.create_time>='"+beginTime+"' and ord.create_time<='"+endTime+"' ";
        }
        sql +=  filter + "  order by create_time desc";
        sql +=  filter + "  order by create_time desc";
        sqlCount  +=filter;
        sqlCount  +=filter;
@ -666,7 +677,7 @@ public class PatientInfoPlatFormService {
        return PageEnvelop.getSuccessListWithPage("查询成功",list,page,pageSize,count);
        return PageEnvelop.getSuccessListWithPage("查询成功",list,page,pageSize,count);
    }
    }
    public PageEnvelop getHealthMonitoringListNew(Integer page,Integer pageSize){
    public PageEnvelop getHealthMonitoringListNew(Integer page,Integer pageSize,String beginTime,String endTime){
        page = page>0?page-1:0;
        page = page>0?page-1:0;
        String filter=" ";
        String filter=" ";
@ -677,9 +688,12 @@ public class PatientInfoPlatFormService {
            orgCodes = orgCodes.replaceAll(",","','");
            orgCodes = orgCodes.replaceAll(",","','");
            filter = " and idx.user not in ('"+orgCodes+"') ";
            filter = " and idx.user not in ('"+orgCodes+"') ";
        }
        }
        if(StringUtils.isNotBlank(beginTime) && StringUtils.isNotBlank(endTime)){
            filter+=" and idx.czrq>='"+beginTime+"' and idx.czrq<='"+endTime+"' ";
        }
        String sql = " SELECT idx.id,idx.user,idx.`name`,p.archive_type archiveType,p.residential_area residentialArea,'健康监测' as serve_desc, " +
        String sql = " SELECT idx.id,idx.user,idx.`name`,p.archive_type archiveType,p.residential_area residentialArea,'健康监测' as serve_desc, " +
                "idx.czrq,value1,value2,value3,value4,value5,value6,value7,type FROM wlyy_patient_health_index idx " +
                "idx.czrq,value1,value2,value3,value4,value5,value6,value7,type,DATE_FORMAT(idx.czrq,'%Y-%m-%d %H:%i:%S') createTime FROM wlyy_patient_health_index idx " +
                " INNER JOIN base_patient p on idx.user = p.id and p.del=1\n" +
                " INNER JOIN base_patient p on idx.user = p.id and p.del=1\n" +
                " WHERE idx.del = 1 AND idx.type < 3 "+filter+" ORDER BY idx.czrq desc ";
                " WHERE idx.del = 1 AND idx.type < 3 "+filter+" ORDER BY idx.czrq desc ";
        String countSql = "select count(id) from ("+sql+")A ";
        String countSql = "select count(id) from ("+sql+")A ";
@ -1039,4 +1053,222 @@ public class PatientInfoPlatFormService {
        return detailInfo;
        return detailInfo;
    }
    }
    /**
     * 获取紧急预警和一般预警中的总数
     * @param patient
     * @return
     */
    public ObjEnvelop getWarningCount(String patient){
        String filter1=" ";
        String filter2=" ";
        String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_child' or dict_name = 'jkzl_older' ";
        List<Map<String,Object>> listtmp =  jdbcTemplate.queryForList(sqltmp);
        if(listtmp.size()>0&&StringUtils.isBlank(patient)){
            String orgCodes = String.valueOf(listtmp.get(0).get("orgCodes"));
            orgCodes = orgCodes.replaceAll(",","','");
            filter1 = " and ord.patient not in ('"+orgCodes+"') ";
            filter2 = " and idx.user not in ('"+orgCodes+"') ";
        }
        //查紧急预警
        Long warningCount = this.getWarningCountByEmergencyAndSecurity(filter1);
        Map<String,Object> map = new HashMap<String,Object>();
        map.put("warningCount",warningCount);
        //查一般预警(体征预警)
        Long healthCount = this.getWarningCountByHealth(filter2);
        map.put("healthCount",healthCount);
        map.put("total",warningCount+healthCount);
        return ObjEnvelop.getSuccess("获取成功",map);
    }
    /**
     * 获取紧急预警中的列表
     * @param page
     * @param pageSize
     * @param patient
     * @return
     */
    public PageEnvelop getWarningList(Integer page,Integer pageSize,String patient){
        page = page>0?page-1:0;
        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' ";
        List<Map<String,Object>> listtmp =  jdbcTemplate.queryForList(sqltmp);
        if(listtmp.size()>0&&StringUtils.isBlank(patient)){
            String orgCodes = String.valueOf(listtmp.get(0).get("orgCodes"));
            orgCodes = orgCodes.replaceAll(",","','");
            filter = " and ord.patient not in ('"+orgCodes+"') ";
        }
        String sql1 = "SELECT\n" +
                "\t'20' AS OrderType,\n" +
                "\tp.archive_type archiveType,\n" +
                "\tp.residential_area residentialArea,\n" +
                "\tord.id,\n" +
                "\tord.patient,\n" +
                "\tp.NAME,\n" +
                "\t'紧急呼叫' AS serve_desc,\n" +
                "\tDATE_FORMAT( ord.create_time, '%Y-%m-%d %H:%i:%S' ) createTime,\n" +
                "\tord.`status`,\n" +
                "CASE\n" +
                "\t\tp.sex \n" +
                "\t\tWHEN 1 THEN\n" +
                "\t\t'男' \n" +
                "\t\tWHEN 2 THEN\n" +
                "\t\t'女' ELSE p.sex \n" +
                "\tEND AS sex,\n" +
                "\tTIMESTAMPDIFF(YEAR,p.birthday,now()) AS age \n" +
                "FROM\n" +
                "\tbase_emergency_assistance_order ord\n" +
                "\tINNER JOIN base_patient p ON ord.patient = p.id \n" +
                "\tAND p.del = 1 \n" +
                "WHERE\n" +
                "\tord.STATUS = 1 "+filter;
        String sql2 = "SELECT\n" +
                "\t\t'22' AS 'OrderType',\n" +
                "\t\tp.archive_type archiveType,\n" +
                "\t\tp.residential_area residentialArea,\n" +
                "\t\tord.id,\n" +
                "\t\tord.patient,\n" +
                "\t\tp.NAME,\n" +
                "\t\tord.serve_desc,\n" +
                "\t\tDATE_FORMAT( ord.create_time, '%Y-%m-%d %H:%i:%S' ) createTime,\n" +
                "\t\tord.`status`,\n" +
                "\tCASE\n" +
                "\t\t\tp.sex \n" +
                "\t\t\tWHEN 1 THEN\n" +
                "\t\t\t'男' \n" +
                "\t\t\tWHEN 2 THEN\n" +
                "\t\t\t'女' ELSE p.sex \n" +
                "\t\tEND AS sex,\n" +
                "\t\tTIMESTAMPDIFF(YEAR,p.birthday,now()) AS age \n" +
                "\tFROM\n" +
                "\t\tbase_security_monitoring_order ord\n" +
                "\t\tINNER JOIN base_patient p ON ord.patient = p.id \n" +
                "\t\twhere ord.status = 1"+filter;
        String sql = "select * FROM (" +
                "\t"+sql1+" UNION "+sql2 +
                "\t) t order by t.createTime desc limit "+page*pageSize+","+pageSize;
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        return PageEnvelop.getSuccessListWithPage("获取成功",list,page,pageSize,this.getWarningCountByEmergencyAndSecurity(filter));
    }
    /**
     * 获取体征预警中的列表
     * @param page
     * @param pageSize
     * @param patient
     * @return
     */
    public PageEnvelop getHealthWarningList(Integer page,Integer pageSize,String patient){
        page = page>0?page-1:0;
        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' ";
        List<Map<String,Object>> listtmp =  jdbcTemplate.queryForList(sqltmp);
        if(listtmp.size()>0){
            String orgCodes = String.valueOf(listtmp.get(0).get("orgCodes"));
            orgCodes = orgCodes.replaceAll(",","','");
            filter = " and idx.user not in ('"+orgCodes+"') ";
        }
        String sql = "SELECT\n" +
                "\t\tidx.id,\n" +
                "\t\tidx.user,\n" +
                "\t\tidx.`name`,idx.type,\n" +
                "\t\tp.archive_type archiveType,\n" +
                "\t\tp.residential_area residentialArea,\n" +
                "\t\t'健康监测' AS serve_desc,\n" +
                "\tTIMESTAMPDIFF(YEAR,p.birthday,now()) AS age, \n" +
                "\t\tidx.czrq,\n" +
                "\t\tvalue1,\n" +
                "\t\tvalue2,\n" +
                "\t\tvalue3,\n" +
                "\t\tvalue4,\n" +
                "\t\tvalue5,\n" +
                "\t\tvalue6,\n" +
                "\t\tvalue7,\n" +
                "\t\ttype,DATE_FORMAT( idx.czrq, '%Y-%m-%d %H:%i:%S' ) createTime, \n" +
                "\tCASE\n" +
                "\t\t\tp.sex \n" +
                "\t\t\tWHEN 1 THEN\n" +
                "\t\t\t'男' \n" +
                "\t\t\tWHEN 2 THEN\n" +
                "\t\t\t'女' ELSE p.sex \n" +
                "\t\tEND AS sex\n" +
                "\tFROM\n" +
                "\t\twlyy_patient_health_index idx\n" +
                "\t\tINNER JOIN base_patient p ON idx.USER = p.id AND p.del = 1 \n" +
                "\tWHERE\n" +
                "\t\tidx.del = 1 \n" +
                "\t\tand idx.status=1 \n" +
                "\t\tAND idx.type < 3 "+filter+" ORDER By idx.czrq DESC limit "+page*pageSize+","+pageSize;
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        if(!ObjectUtils.isEmpty(list)){
            //查体征预警信息,偏高偏低
            for (Map<String, Object> map : list) {
                com.alibaba.fastjson.JSONArray info = healthIndexUtil.verifyHealthIndex(
                        Integer.parseInt(map.get("type").toString()),
                        null==map.get("value1")?"":map.get("value1").toString(),
                        null==map.get("value2")?"":map.get("value2").toString(),
                        null==map.get("value3")?"":map.get("value3").toString());
                //去除正常的值
                Iterator it = info.iterator();
                while (it.hasNext()){
                    JSONObject next = (JSONObject)it.next();
                    if("0".equals(next.getString("error"))){
                        it.remove();
                    }
                }
                map.put("info",info);
            }
        }
        return PageEnvelop.getSuccessListWithPage("获取成功",list,page,pageSize,this.getWarningCountByHealth(filter));
    }
    /**
     * 获取紧急呼救和安防工单正在预警中的总数
     * @param filter
     * @return
     */
    Long getWarningCountByEmergencyAndSecurity(String filter){
        //紧急呼救
        String emergencySql = "SELECT count( ord.id ) warningCount \n" +
                "\tFROM\n" +
                "\t\tbase_emergency_assistance_order ord\n" +
                "\t\tINNER JOIN base_patient p ON ord.patient = p.id and p.del=1  \n" +
                "\tWHERE\n" +
                "\t\t ord.STATUS = 1"+filter;
        //安防监护
        String securitySql = "SELECT count( ord.id ) warningCount \n" +
                "\tFROM\n" +
                "\t\tbase_security_monitoring_order ord\n" +
                "\t\tINNER JOIN base_patient p ON ord.patient = p.id and p.del=1 \n" +
                "\t\tAND ord.STATUS = 1"+filter;
        String sqlCount = "SELECT\n" +
                "\tsum( warningCount ) warningCount\n" +
                "FROM\n" +
                "\t( " + emergencySql + " UNION ALL " + securitySql +
                ") t";
        return jdbcTemplate.queryForObject(sqlCount, Long.class);
    }
    /**
     * 获取一般体征预警中的总数
     * @param filter
     * @return
     */
    Long getWarningCountByHealth(String filter){
        String healthSql = "SELECT\n" +
                "\tcount( idx.id ) \n" +
                "FROM\n" +
                "\twlyy_patient_health_index idx\n" +
                "\tINNER JOIN base_patient p ON idx.USER = p.id AND p.del = 1 \n" +
                "WHERE\n" +
                "\tidx.status = 1 \n" +
                "\tAND idx.del = 1 \n" +
                "\tAND idx.type < 3 \n" + filter;
        return jdbcTemplate.queryForObject(healthSql, Long.class);
    }
}
}

+ 68 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/visit/BaseVisitService.java

@ -1,13 +1,18 @@
package com.yihu.jw.care.service.visit;
package com.yihu.jw.care.service.visit;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.care.dao.visit.BaseVisitDao;
import com.yihu.jw.care.dao.visit.BaseVisitDao;
import com.yihu.jw.care.dao.visit.BaseVisitSignDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.care.visit.BaseVisitDO;
import com.yihu.jw.entity.care.visit.BaseVisitDO;
import com.yihu.jw.entity.care.visit.BaseVisitSignDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.date.DateUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.StringUtils;
@ -31,6 +36,8 @@ public class BaseVisitService {
    private BasePatientDao patientDao;
    private BasePatientDao patientDao;
    @Autowired
    @Autowired
    private BaseDoctorDao doctorDao;
    private BaseDoctorDao doctorDao;
    @Autowired
    private BaseVisitSignDao baseVisitSignDao;
    /**
    /**
     * 获取走访列表-日历
     * 获取走访列表-日历
@ -103,6 +110,9 @@ public class BaseVisitService {
        if("1".equals(visitDO.getStatus())){
        if("1".equals(visitDO.getStatus())){
            return "走访已完成不能删除";
            return "走访已完成不能删除";
        }
        }
        if ("3".equals(visitDO.getStatus())){
            return "走访已签到不能删除";
        }
        baseVisitDao.delete(id);
        baseVisitDao.delete(id);
        return null;
        return null;
    }
    }
@ -190,6 +200,9 @@ public class BaseVisitService {
    public Map<String, String> findVisitDetail(String id){
    public Map<String, String> findVisitDetail(String id){
        Map<String, String> re = new HashMap<>();
        Map<String, String> re = new HashMap<>();
        BaseVisitDO visitDO = baseVisitDao.findOne(id);
        BaseVisitDO visitDO = baseVisitDao.findOne(id);
        if (null==visitDO){
            return null;
        }
        re.put("id", visitDO.getId());
        re.put("id", visitDO.getId());
        re.put("visitDate", DateUtil.dateToStrLong(visitDO.getVisitDate()));
        re.put("visitDate", DateUtil.dateToStrLong(visitDO.getVisitDate()));
        re.put("visitPlanDate", DateUtil.dateToStrLong(visitDO.getVisitPlanDate()));
        re.put("visitPlanDate", DateUtil.dateToStrLong(visitDO.getVisitPlanDate()));
@ -205,6 +218,13 @@ public class BaseVisitService {
        re.put("health",visitDO.getHealth());
        re.put("health",visitDO.getHealth());
        re.put("lifeConsult",visitDO.getLifeConsult());
        re.put("lifeConsult",visitDO.getLifeConsult());
        BaseVisitSignDO visitSignDO = baseVisitSignDao.findByVisitId(visitDO.getId());
        if (null!=visitSignDO){
            re.put("signInfo", JSON.toJSONStringWithDateFormat(visitSignDO,"yyyy-MM-dd HH:mm:ss"));
        }else {
            re.put("signInfo",null);
        }
        BasePatientDO patient = patientDao.findById(visitDO.getPatient());
        BasePatientDO patient = patientDao.findById(visitDO.getPatient());
        if (patient != null) {
        if (patient != null) {
            re.put("idcard", patient.getIdcard());
            re.put("idcard", patient.getIdcard());
@ -215,7 +235,6 @@ public class BaseVisitService {
            re.put("photo", patient.getPhoto());
            re.put("photo", patient.getPhoto());
            re.put("age", IdCardUtil.getAgeByIdcardOrBirthday(patient.getIdcard(),patient.getBirthday())+"");
            re.put("age", IdCardUtil.getAgeByIdcardOrBirthday(patient.getIdcard(),patient.getBirthday())+"");
        }
        }
        return re;
        return re;
    }
    }
@ -256,4 +275,52 @@ public class BaseVisitService {
        }
        }
    }
    }
    /**
     * 日常走访签到
     * @return
     */
    public JSONObject signIn(String visitId,Integer signWay,String signLat,String signLon,String address,String signImg,String doctorId){
        BaseVisitDO visitDO = baseVisitDao.findOne(visitId);
        BaseDoctorDO doctorDO = doctorDao.findById(doctorId);
        JSONObject result = new JSONObject();
        if (null==doctorDO){
            result.put(ResponseContant.resultFlag,ResponseContant.fail);
            result.put(ResponseContant.resultMsg,"当前登录用户不存在无法签到");
            return result;
        }
        if (null==visitDO){
            result.put(ResponseContant.resultFlag,ResponseContant.fail);
            result.put(ResponseContant.resultMsg,"未找到走访计划");
            return result;
        }
        if ("3".equals(visitDO.getStatus())){
            result.put(ResponseContant.resultFlag,ResponseContant.fail);
            result.put(ResponseContant.resultMsg,"已完成签到,无法重复签到");
            return result;
        }
        BaseVisitSignDO signDO = new BaseVisitSignDO();
        signDO.setVisitId(visitId);
        signDO.setDoctor(doctorId);
        signDO.setDoctorName(doctorDO.getName());
        signDO.setDel(1);
        signDO.setType(signWay);
        if (2==signWay){//拍照
            signDO.setImg(signImg);
        } else if (1==signWay) {//定位
            signDO.setAddress(address);
            signDO.setLat(signLat);
            signDO.setLon(signLon);
        }else {
            result.put(ResponseContant.resultFlag,ResponseContant.fail);
            result.put(ResponseContant.resultMsg,"签到方式错误");
            return result;
        }
        baseVisitSignDao.save(signDO);
        visitDO.setStatus("3");
        baseVisitDao.save(visitDO);
        result.put(ResponseContant.resultFlag,ResponseContant.success);
        result.put(ResponseContant.resultMsg,"success");
        return result;
    }
}
}

+ 1 - 1
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/job/device/DeviceLostAssociationJob.java

@ -30,7 +30,7 @@ public class DeviceLostAssociationJob implements Job {
            patientDeviceService.selectAndUpdate();
            patientDeviceService.selectAndUpdate();
            logger.info("DeviceLostAssociationJob end");
            logger.info("DeviceLostAssociationJob end");
        } catch (Exception e) {
        } catch (Exception e) {
            logger.info(e.getMessage());
            logger.info("DeviceLostAssociationJob --ERROR MSG:"+e.getMessage());
            e.printStackTrace();
            e.printStackTrace();
        }
        }
    }
    }

+ 17 - 15
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/util/DeviceLostMessageUtil.java

@ -104,21 +104,22 @@ public class DeviceLostMessageUtil {
                            break;
                            break;
                    }
                    }
                    BasePatientDO patientDO = patientDao.findById(deviceDO.getUser());
                    BasePatientDO patientDO = patientDao.findById(deviceDO.getUser());
                    SystemMessageDO messageDO = new SystemMessageDO();
                    messageDO.setTitle("设备离线通知");
                    messageDO.setType("43");
                    messageDO.setIsRead("0");
                    messageDO.setSender(deviceDO.getUser());
                    messageDO.setSenderName(patientDO.getName());
                    messageDO.setRelationCode(id);
                    messageDO.setReceiver(docTmp.get("id").toString());
                    messageDO.setReceiverName(docTmp.get("name").toString());
                    messageDO.setOver("1");
                    messageDO.setData(deviceName+"离线");
                    messageDO.setDel("1");
                    messageDO.setCreateTime(new Date());
                    messageDO.setSenderPhoto(patientDO.getPhoto());
                    messageDOS.add(messageDO);
                    if (patientDO!=null){
                        SystemMessageDO messageDO = new SystemMessageDO();
                        messageDO.setTitle("设备离线通知");
                        messageDO.setType("43");
                        messageDO.setIsRead("0");
                        messageDO.setSender(deviceDO.getUser());
                        messageDO.setSenderName(patientDO.getName());
                        messageDO.setRelationCode(id);
                        messageDO.setReceiver(docTmp.get("id").toString());
                        messageDO.setReceiverName(docTmp.get("name").toString());
                        messageDO.setOver("1");
                        messageDO.setData(deviceName+"离线");
                        messageDO.setDel("1");
                        messageDO.setCreateTime(new Date());
                        messageDO.setSenderPhoto(patientDO.getPhoto());
                        messageDOS.add(messageDO);
//                    if ("family3".equals(docTmp.get("user").toString())){//设备离线推送给家属
//                    if ("family3".equals(docTmp.get("user").toString())){//设备离线推送给家属
//                        if(null!=docTmp.get("openid")&& StringUtils.isNotBlank(docTmp.get("openid").toString())){
//                        if(null!=docTmp.get("openid")&& StringUtils.isNotBlank(docTmp.get("openid").toString())){
//                            String first = patientDO.getName()+" "+deviceName+"设备疑似离线";
//                            String first = patientDO.getName()+" "+deviceName+"设备疑似离线";
@ -130,6 +131,7 @@ public class DeviceLostMessageUtil {
//                        }
//                        }
//                    }
//                    }
                    }
                }
                }
            }
            }
        }
        }

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

@ -2811,4 +2811,13 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    public ObjEnvelop getChargeDict()throws Exception{
    public ObjEnvelop getChargeDict()throws Exception{
        return ObjEnvelop.getSuccess("ok",hcyyEntranceService.getChargeDict());
        return ObjEnvelop.getSuccess("ok",hcyyEntranceService.getChargeDict());
    }
    }
    @GetMapping(value = "/initiateDataSign")
    @ApiOperation(value = "数据签名", notes = "数据签名")
    public ObjEnvelop initiateDataSign(@ApiParam(name = "prescriptionId", value = "处方id", required = false)
                                           @RequestParam(value = "prescriptionId",required = false)String prescriptionId,
                                       @ApiParam(name = "flag", value = "1处方签名、2病例签名", required = false)
                                       @RequestParam(value = "flag",required = false)Integer flag,HttpServletRequest request)throws Exception{
        return ObjEnvelop.getSuccess("ok",hcyyEntranceService.initiateDataSign(prescriptionId, flag,getIpAddress(request)));
    }
}
}

+ 20 - 48
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/HcyyPrescriptionCotroller.java

@ -6,6 +6,7 @@ import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDiagnosisDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDiagnosisDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.prescription.service.HcyyPrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.HcyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.HcyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.im.service.ImService;
@ -45,6 +46,9 @@ public class HcyyPrescriptionCotroller extends EnvelopRestEndpoint {
    private PrescriptionInfoDao prescriptionInfoDao;
    private PrescriptionInfoDao prescriptionInfoDao;
    @Autowired
    @Autowired
    private ImService imService;
    private ImService imService;
    @Autowired
    private HcyyPrescriptionService hcyyPrescriptionService;
    @GetMapping(value = "/getDeptInfo")
    @GetMapping(value = "/getDeptInfo")
    @ApiOperation(value = "获取部门信息", notes = "获取部门信息")
    @ApiOperation(value = "获取部门信息", notes = "获取部门信息")
@ -572,67 +576,35 @@ public class HcyyPrescriptionCotroller extends EnvelopRestEndpoint {
    /**
    /**
     * 查询历史就诊病历
     * 查询历史就诊病历
     * @param patientId 病人id(必填)
     * @param patientId 病人id(必填)
     * @param eventNo 住院号
     * @param eventNo 病人住院号
     * @return
     * @return
     * @throws Exception
     * @throws Exception
     */
     */
    @GetMapping(value = "/selectEmrInfo")
    @GetMapping(value = "/findHistoryEmr")
    @ApiOperation(value = "查询历史就诊病历", notes = "查询历史就诊病历")
    @ApiOperation(value = "查询历史就诊病历", notes = "查询历史就诊病历")
    public ObjEnvelop findHistoryEmr (@ApiParam(name = "patientId", value = "病人id", required = false)
                                      @RequestParam(value = "patientId",required = false)String patientId,
                                      @ApiParam(name = "eventNo", value = "住院号", required = false)
                                      @RequestParam(value = "eventNo",required = false)String eventNo)throws Exception{
        return ObjEnvelop.getSuccess("ok",hcyyEntranceService.SelectEmrInfo(patientId,eventNo));
    }
    /**
     * 查询历次就诊门诊病历文书
     * @param patientId 病人id(必填)
     * @param eventNo 住院号
     * @return
     * @throws Exception
     */
    @GetMapping(value = "/selectEmrDispRecord")
    @ApiOperation(value = "查询历次就诊门诊病历文书", notes = "查询历次就诊门诊病历文书")
    public ObjEnvelop SelectEmrDispRecord (@ApiParam(name = "templateId", value = "模板id", required = false)
                                               @RequestParam(value = "templateId",required = false)String templateId,
                                        @ApiParam(name = "patientId", value = "病人id", required = false)
                                      @RequestParam(value = "patientId",required = false)String patientId,
                                      @ApiParam(name = "eventNo", value = "住院号", required = false)
                                      @RequestParam(value = "eventNo",required = false)String eventNo)throws Exception{
        return ObjEnvelop.getSuccess("ok",hcyyEntranceService.SelectEmrDispRecord(templateId,patientId,eventNo));
    public ObjEnvelop findHistoryEmr(@ApiParam(name = "patientId", value = "病人id", required = false)
                                     @RequestParam(value = "patientId",required = false)String patientId,
                                     @ApiParam(name = "eventNo", value = "病人住院号", required = false)
                                     @RequestParam(value = "eventNo",required = false)String eventNo)throws Exception{
        return ObjEnvelop.getSuccess("ok",hcyyPrescriptionService.selectHistoryEmr(patientId,eventNo));
    }
    }
    /**
    /**
     * 查询病历文书列表
     * 查询历史就诊病历
     * @param patientId 病人id(必填)
     * @param patientId 病人id(必填)
     * @param eventNo 住院号
     * @param eventNo 病人住院号
     * @return
     * @return
     * @throws Exception
     * @throws Exception
     */
     */
    @GetMapping(value = "/selectEmrList")
    @ApiOperation(value = "查询病历文书列表", notes = "查询病历文书列表")
    public ObjEnvelop SelectEmrList(@ApiParam(name = "patientId", value = "病人id", required = false)
    @GetMapping(value = "/findHistoryEmrRecord")
    @ApiOperation(value = "查询历史就诊病历", notes = "查询历史就诊病历")
    public ObjEnvelop findHistoryEmrRecord(@ApiParam(name = "templateId", value = "模板id", required = false)
                                           @RequestParam(value = "templateId",required = false)String templateId,
                                           @ApiParam(name = "patientId", value = "病人id", required = false)
                                           @RequestParam(value = "patientId",required = false)String patientId,
                                           @RequestParam(value = "patientId",required = false)String patientId,
                                           @ApiParam(name = "eventNo", value = "住院号", required = false)
                                           @ApiParam(name = "eventNo", value = "病人住院号", required = false)
                                           @RequestParam(value = "eventNo",required = false)String eventNo)throws Exception{
                                           @RequestParam(value = "eventNo",required = false)String eventNo)throws Exception{
        return ObjEnvelop.getSuccess("ok",hcyyEntranceService.GetEMRList(patientId,eventNo));
    }
    /**
     * 查询病历文书html信息
     * @param bstrEmrID 文书id号
     *
     * @return
     * @throws Exception
     */
    @GetMapping(value = "/browseSingleEMR")
    @ApiOperation(value = "查询病历文书html信息", notes = "查询病历文书html信息")
    public ObjEnvelop BrowseSingleEMR(@ApiParam(name = "bstrEmrID", value = "文书id号", required = false)
                                    @RequestParam(value = "bstrEmrID",required = false)String bstrEmrID)throws Exception{
        return ObjEnvelop.getSuccess("ok",hcyyEntranceService.BrowseSingleEMR(bstrEmrID));
        return ObjEnvelop.getSuccess("ok",hcyyPrescriptionService.selectHistoryEmrRecord(templateId,patientId,eventNo));
    }
    }
    /**
    /**
     * 合理用药审核
     * 合理用药审核
     * @param patient 病人id
     * @param patient 病人id

+ 9 - 3
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -2397,10 +2397,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "status", value = "0未审核1审核退回2审核通过", required = true)
            @ApiParam(name = "status", value = "0未审核1审核退回2审核通过", required = true)
            @RequestParam(required = true) Integer status,
            @RequestParam(required = true) Integer status,
            @ApiParam(name = "prescriptionId", value = "prescriptionId", required = true)
            @ApiParam(name = "prescriptionId", value = "prescriptionId", required = true)
            @RequestParam(required = true) String prescriptionId) throws Exception {
            @RequestParam(required = true) String prescriptionId,HttpServletRequest request) throws Exception {
        WlyyPrescriptionCheckDO wlyyPrescriptionCheckDO = prescriptionService.saveCheck(operate, operateName, reason, status, prescriptionId, wxId);
        WlyyPrescriptionCheckDO wlyyPrescriptionCheckDO = prescriptionService.saveCheck(operate, operateName, reason, status, prescriptionId, wxId,getIpAddress(request));
        try {
        try {
            WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionService.findPrescriptionDo(prescriptionId);
            WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionService.findPrescriptionDo(prescriptionId);
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(wlyyPrescriptionDO.getOutpatientId());
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(wlyyPrescriptionDO.getOutpatientId());
            if (status == 1) {
            if (status == 1) {
@ -2664,6 +2666,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            String doctorId = getUID();
            String doctorId = getUID();
            if (wxId.equalsIgnoreCase("xm_xzzx_wx")) {
            if (wxId.equalsIgnoreCase("xm_xzzx_wx")) {
                return ObjEnvelop.getSuccess("ok", xzzxEntranceService.selectHistoryEmrFromEntrance(patient, null));
                return ObjEnvelop.getSuccess("ok", xzzxEntranceService.selectHistoryEmrFromEntrance(patient, null));
            } else if (wxId.equalsIgnoreCase("xm_xzzx_wx")) {
                return ObjEnvelop.getSuccess("ok", hcyyPrescriptionService.selectHistoryEmrFromEntrance(patient, null));
            } else {
            } else {
                return ObjEnvelop.getSuccess("ok", prescriptionService.outpatient(patient, doctorId));
                return ObjEnvelop.getSuccess("ok", prescriptionService.outpatient(patient, doctorId));
            }
            }
@ -2696,7 +2700,9 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        try {
        try {
            if (wxId.equalsIgnoreCase("xm_xzzx_wx")) {
            if (wxId.equalsIgnoreCase("xm_xzzx_wx")) {
                return ObjEnvelop.getSuccess("ok", xzzxEntranceService.selectBrowseSingleEMR(opid));
                return ObjEnvelop.getSuccess("ok", xzzxEntranceService.selectBrowseSingleEMR(opid));
            } else {
            }else if (wxId.equalsIgnoreCase("xm_hcyy_wx")) {
                return ObjEnvelop.getSuccess("ok", hcyyPrescriptionService.selectBrowseSingleEMR(opid));
            }  else {
                return ObjEnvelop.getSuccess("ok", prescriptionService.getPatInfoDataXml(opid, recSn));
                return ObjEnvelop.getSuccess("ok", prescriptionService.getPatInfoDataXml(opid, recSn));
            }
            }
        } catch (Exception e) {
        } catch (Exception e) {

+ 28 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/YkyyPrescriptionEndpoint.java

@ -95,6 +95,34 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
        }
        }
    }
    }
    @GetMapping(value = "vlisReportMasterlistNew")
    @ApiOperation(value = "检验信息列表新接口")
    public ListEnvelop vlisReportMasterlistNew(@ApiParam(name = "patient", value = "居民id")
                                            @RequestParam(value = "patient",required = true) String patient,
                                            @ApiParam(name = "startTime", value = "开始时间")
                                            @RequestParam(value = "startTime",required = false) String startTime,
                                            @ApiParam(name = "endTime", value = "结束时间")
                                            @RequestParam(value = "endTime",required = false) String endTime) throws Exception{
        try {
            return success(ykyyEntranceService.getSampleByYZ(patient,startTime,endTime));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @GetMapping(value = "vlisReportMasterDetailNew")
    @ApiOperation(value = "检验信息明细新接口")
    public ObjEnvelop vlisReportMasterDetailNew(@ApiParam(name = "reportNo", value = "报告id")
                                             @RequestParam(value = "reportNo",required = true) String reportNo)throws Exception{
        try {
            return success(ykyyEntranceService.getSampleDetailByYZ(reportNo));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping(value = "vpacsReportDetail")
    @GetMapping(value = "vpacsReportDetail")
    @ApiOperation(value = "检查信息明细")
    @ApiOperation(value = "检查信息明细")
    public ObjEnvelop vpacsReportDetail(@ApiParam(name = "reportId", value = "报告id")
    public ObjEnvelop vpacsReportDetail(@ApiParam(name = "reportId", value = "报告id")