Browse Source

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

wangzhinan 4 years ago
parent
commit
93d591a1c2
22 changed files with 1329 additions and 103 deletions
  1. 1 0
      business/base-service/src/main/java/com/yihu/jw/hospital/drugstore/dao/BaseDrugStoreDao.java
  2. 6 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java
  3. 255 2
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java
  4. 6 5
      business/base-service/src/main/java/com/yihu/jw/hospital/survey/service/SurveyService.java
  5. 3 3
      common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java
  6. 10 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/area/BaseDrugStoreDO.java
  7. 282 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/YkEmrJcsqDO.java
  8. 74 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/YkEmrYzztDO.java
  9. 237 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/YkMsYj01DO.java
  10. 133 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/YkMsYj02DO.java
  11. 3 2
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/survey/WlyySurveyUserAnswerDO.java
  12. 7 6
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/survey/WlyySurveyUserDO.java
  13. 6 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  14. 24 12
      svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserService.java
  15. 113 3
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/YkyyController.java
  16. 1 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/article/ArticleEndpoint.java
  17. 61 3
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  18. 2 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/message/BaseUserMsgController.java
  19. 10 10
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/BasePatientBusinessService.java
  20. 5 4
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/KnowledgeArticleService.java
  21. 72 51
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/WlyyDeviceController.java
  22. 18 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java

+ 1 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/drugstore/dao/BaseDrugStoreDao.java

@ -15,4 +15,5 @@ public interface BaseDrugStoreDao extends PagingAndSortingRepository<BaseDrugSto
    @Query(value = " from  BaseDrugStoreDO  where drugStoreCode =?1 and hospitalCode = ?2 ")
    BaseDrugStoreDO findDrugByNameAndCode(String drugStoreCode,String hospitalCode);
}

+ 6 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java

@ -4,6 +4,7 @@ package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.base.area.BaseDrugStoreDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxWechatDO;
@ -15,6 +16,8 @@ import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionExpressageDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.hospital.consult.dao.HospitalWaitingRoomDao;
import com.yihu.jw.hospital.doctor.dao.PatientRegisterTimeDao;
import com.yihu.jw.hospital.drugstore.dao.BaseDrugStoreDao;
import com.yihu.jw.hospital.drugstore.service.BaseDrugStoreService;
import com.yihu.jw.hospital.mapping.service.PatientMappingService;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
@ -81,6 +84,8 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    private BusinessOrderService businessOrderService;
    @Autowired
    private BaseUserAgent userAgent;
    @Autowired
    private BaseDrugStoreDao baseDrugStoreDao;
    @Value("${demo.flag}")
    private boolean demoFlag;
@ -334,7 +339,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            jsonObject.put("py_code","WSSB12ZS");
            mapList.add(jsonObject);
        }else {
            mapList = ykyyEntranceService.findYkYpxx(chargeCode, null, null, pyKey);
            mapList = ykyyEntranceService.findYkYpxx(chargeCode, null, null, pyKey,groupNo);
        }
        JSONArray array = new JSONArray();
        for (int i=0;i<mapList.size();i++){

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

@ -21,6 +21,7 @@ import com.yihu.jw.entity.base.score.BaseEvaluateScoreDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.entity.hospital.survey.WlyySurveyQuestionDO;
import com.yihu.jw.evaluate.score.dao.BaseEvaluateDao;
import com.yihu.jw.evaluate.score.dao.BaseEvaluateScoreDao;
import com.yihu.jw.hospital.dict.YkDictIcd10Dao;
@ -37,6 +38,7 @@ import com.yihu.jw.restmodel.hospital.prescription.*;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.utils.EntityUtils;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.utils.network.HttpResponse;
@ -69,6 +71,7 @@ public class YkyyEntranceService {
//    private final static String url="http://localhost:10023/ykyy/createSQLQuery";
    private final static String saveUrl="http://192.168.20.55:10023/ykyy/save";
    private final static String orderUrl="http://192.168.20.55:10023/ykyy/outPatientOrder";
    private final static String updateUrl="http://192.168.20.55:10023/ykyy/updateBySql";
@ -1312,7 +1315,7 @@ public class YkyyEntranceService {
     * @param kusl
     * @return
     */
    public JSONArray findYkYpxx(String ypdm,String ypmc,String kusl,String pydm) throws Exception {
    public JSONArray findYkYpxx(String ypdm,String ypmc,String kusl,String pydm ,String hisCode) throws Exception {
        String sql ="SELECT yp.ypxh AS \"ypxh\", yp.ypdm AS \"ypdm\", yp.ypmc AS \"ypmc\", yp.yfgg AS \"yfgg\"," +
                "yp.yfdw AS \"yfdw\"," +
                "yp.yfbz AS \"yfbz\"," +
@ -1332,7 +1335,8 @@ public class YkyyEntranceService {
                "yp.ydyp AS \"ydyp\"," +
                "yp.ypmc2 AS \"ypmc2\"," +
                "yp.gyffmc as \"gyffmc\"," +
                "yp.pzwh as \"pzwh\""+  " FROM " +
                "yp.pzwh as \"pzwh\","+
                "yp.yfsb as \"yfsb\""+" FROM " +
                "V_ZKSG_MZ_YPXX yp where 1=1 ";
        if (StringUtils.isNoneBlank(ypdm)){
            sql+=" and lower(yp.ypdm) like '%"+ypdm.toLowerCase()+"%' ";
@ -1347,6 +1351,9 @@ public class YkyyEntranceService {
        if (StringUtils.isNoneBlank(pydm)){
            sql+=" and lower(yp.pydm) like '%"+pydm.toLowerCase()+"%' ";
        }
        if (StringUtils.isNoneBlank(hisCode)){
            sql+=" and lower(yp.yfsb) like '%"+hisCode.toLowerCase()+"%' ";
        }
        JSONArray array = new JSONArray();
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
@ -2207,6 +2214,252 @@ public class YkyyEntranceService {
            return "推送成功";
        }
    }
    //查询组套项目
    public JSONArray findYzztByGslb(String gslb) throws Exception {
        String sql = "select t.ztmc as\"ztmc\",t.ztid as\"ztid\"," +
                "t.gslb as\"gslb\",t.gsdm as\"gsdm\"," +
                "t.pydm as\"pydm\",t.Mzsy as\"Mzsy\"" +
                "from portal_his.emr_yzzt@ykzxtest t where 1=1";
        if(StringUtils.isNotEmpty(gslb)){
            sql+=" and t.gslb = "+Integer.valueOf(gslb);
            }
        System.out.println(sql);
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("findYzztByGslb:"+sql);
        HttpResponse response = HttpUtils.doGet(jdbcUrl,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        JSONArray array= new JSONArray();
        if (status==200){
            array = rs.getJSONArray("detailModelList");
        }
       return array;
    }
    //根据组套项目id查询组套明细
    public JSONArray findZtmxByid(String ztId) throws Exception{
        String sql = "select t.ztid as \"ztid\",t.xmdm as \"xmdm\"," +
                "t.xmmc as \"xmmc\",t.mrsl as \"mrsl\",t.zxks as \"zxks\"" +
                "from portal_his.emr_ztmx@ykzxtest t where 1=1";
        if (StringUtils.isNotEmpty(ztId)){
            sql += " and t.ztid = '"+ztId+"'";
        }
        System.out.println(sql);
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("findZtmxByid:"+sql);
        HttpResponse response = HttpUtils.doGet(jdbcUrl,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        JSONArray array= new JSONArray();
        if (status==200){
            array = rs.getJSONArray("detailModelList");
        }
        return array;
    }
    //查询诊疗项目视图
    public JSONArray findZlxm(String itemName) throws Exception{
        String sql = "select t.item_code as \"itemCode\",t.item_name as \"itemName\"," +
                "t.price as \"price\",t.total_unit as \"totalUnit\"," +
                "t.zxks as \"zxks\" from VEMR_ORDER_ITEM t where 1=1";
        if (StringUtils.isNotEmpty(itemName)){
            sql+=" and t.ITEM_NAME like '%"+itemName+"%'";
        }
        System.out.println(sql);
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("findZlxm:"+sql);
        HttpResponse response = HttpUtils.doGet(jdbcUrl,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        JSONArray array= new JSONArray();
        if (status==200){
            array = rs.getJSONArray("detailModelList");
        }
        return array;
    }
    //查询诊疗项目明细视图
    public JSONArray findZlxmMx(String zlxmId) throws Exception{
        String sql = "select t.zlxmid as \"zlxmid\",t.fyxh as \"fyxh\",t.fysl \"fysl\"" +
                " from VEMR_ORDER_ITEM_MX t where 1=1";
        if (StringUtils.isNotEmpty(zlxmId)){
            sql+=" and t.zlxmid = '"+zlxmId+"'";
        }
        System.out.println(sql);
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("findZlxmMx:"+sql);
        HttpResponse response = HttpUtils.doGet(jdbcUrl,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        JSONArray array= new JSONArray();
        if (status==200){
            array = rs.getJSONArray("detailModelList");
        }
        return array;
    }
    //his.gy_ylsf明细查询
    public JSONArray findGyYlsf(String fyxh) throws Exception{
        String sql = "select t.xmlx as \"xmlx\",t.fydj as \"fydj\",t.fygb as \"fygb\"" +
                "from portal_his.GY_YLSF@ykzxtest t where 1=1";
        if (StringUtils.isNotEmpty(fyxh)){
            sql+=" and t.fyxh = '"+fyxh+"'";
        }
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("findZlxmMx:"+sql);
        HttpResponse response = HttpUtils.doGet(jdbcUrl,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        JSONArray array= new JSONArray();
        if (status==200){
            array = rs.getJSONArray("detailModelList");
        }
        return array;
    }
    //门诊开单操作
    public String outPatientOrder(String jsonDate,Boolean demoFlag,String doctor,String patient) throws Exception{
        List<YkEmrJcsqDO> surveys = EntityUtils.jsonToList(jsonDate, YkEmrJcsqDO.class);
        DoctorMappingDO doctorMappingDO = new DoctorMappingDO();
        PatientMappingDO patientMappingDO =new PatientMappingDO();
        if (StringUtils.isNotEmpty(doctor)){
            doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
        }
        if(StringUtils.isNotEmpty(patient)){
            patientMappingDO = patientMappingDao.findByPatient(patient);
        }
        BasePatientDO patientDO = basePatientDao.findById(patient);
        PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",patient,"1");
        Integer brxb = 0;
        String brxm = "";
        Date csny =null;
        Integer brnl =0;
        String doctorHis="";
        Integer kdks = 0;
        JSONArray jsonArray = findHisPatient(patientMedicareCardDO.getCode(),demoFlag);
        if(jsonArray!=null&&jsonArray.size()>0){
            //获取居民信息
            JSONObject json = jsonArray.getJSONObject(0);
            brxb = json.getInteger("brxb");
            brxm = json.getString("brxm");
            csny = json.getDate("csny");
            brnl = this.getBrnl(csny);
        }
        //操作医生信息
        JSONArray jsonArray1 = findHisDoctor(doctorMappingDO.getIdcard());
        if(jsonArray1!=null&&jsonArray1.size()>0){
            JSONObject json = jsonArray1.getJSONObject(0);
            doctorHis=json.getString("code");
        }
        // 同一个医生同一个病人,一天一条挂号记录。
        JSONArray ja = fingHlwGhmx(patientMappingDO.getMappingCode(),doctorMappingDO.getMappingCode());
        if (surveys!=null){
            for (YkEmrJcsqDO ykEmrJcsqDO:surveys){
                if (demoFlag){
                    ykEmrJcsqDO.setJjbz(0);
                    ykEmrJcsqDO.setJczt(1);
                    ykEmrJcsqDO.setZfbz(0);
                    ykEmrJcsqDO.setQxbz(0);
                    ykEmrJcsqDO.setBrxb(brxb);
                    ykEmrJcsqDO.setBrxm(brxm);
                    ykEmrJcsqDO.setBrnl(brnl);
                    ykEmrJcsqDO.setKdys(doctorHis);
                    ykEmrJcsqDO.setBrks(114);
                    ykEmrJcsqDO.setTjys(doctorHis);
                }else {
                    ykEmrJcsqDO.setJjbz(0);
                    ykEmrJcsqDO.setJczt(1);
                    ykEmrJcsqDO.setZfbz(0);
                    ykEmrJcsqDO.setQxbz(0);
                    ykEmrJcsqDO.setBrxb(1);
                    ykEmrJcsqDO.setBrxm("测试病人");
                    ykEmrJcsqDO.setBrnl(18);
                    ykEmrJcsqDO.setKdys("测试医生");
                }
            }
            String jsonString = JSONObject.toJSONString(surveys);
            Map<String,Object> params = new HashedMap();
            params.put("json",jsonString);
            params.put("table","ykEmrJcsqDO");
            logger.info("ykEmrJcsqDO:"+jsonString);
            HttpResponse response = HttpUtils.doGet(orderUrl,params);
            String content = response.getContent();
            logger.info("response:"+content);
            JSONObject rs = JSON.parseObject(content);
            Integer status = rs.getInteger("status");
            if (status!=null&&status == 200){
                return rs.toString();
            }else {
                return "failed";
            }
        }else {
            return "failed";
        }
    }
   //查询检查单
   public JSONArray findOrder()throws Exception{
        String sql = "select t.sqdh,t.brid," +
                "t.jzlx,t.brxm,t.brks," +
                "t.brnl,t.kdsj,t.zxks,t.jcxm,t.xmdj," +
             "t.xmdw,t.xmid,t.sqsl from emr_jcsq@ykzxtest t where 1=1";
       Map<String,Object> params = new HashedMap();
       params.put("sql",sql);
       params.put("table","ykEmrJcsqDO");
       logger.info("ykEmrJcsqDO:"+sql);
       HttpResponse response = HttpUtils.doGet(jdbcUrl,params);
       String content = response.getContent();
       logger.info("response:"+content);
       JSONObject rs = JSON.parseObject(content);
       Integer status = rs.getInteger("status");
       JSONArray array= new JSONArray();
       if (status==200){
           array = rs.getJSONArray("detailModelList");
       }
       return array;
   }
   public Integer getBrnl(Date date){
       Calendar cal = Calendar.getInstance();
       if (cal.before(date)) {
           throw new IllegalArgumentException(
                   "The birthDay is before Now.It's unbelievable!");
       }
       int yearNow = cal.get(Calendar.YEAR);
       int monthNow = cal.get(Calendar.MONTH) + 1;
       int dayOfMonthNow = cal.get(Calendar.DAY_OF_MONTH);
       cal.setTime(date);
       int yearBirth = cal.get(Calendar.YEAR);
       int monthBirth = cal.get(Calendar.MONTH) + 1;
       int dayOfMonthBirth = cal.get(Calendar.DAY_OF_MONTH);
       int age = yearNow - yearBirth;
       if (monthNow <= monthBirth) {
           if (monthNow == monthBirth) {
// monthNow==monthBirth
               if (dayOfMonthNow < dayOfMonthBirth) {
                   age--;
               }
           } else {
// monthNow>monthBirth
               age--;
           }
       }
       return age;
   }
}

+ 6 - 5
business/base-service/src/main/java/com/yihu/jw/hospital/survey/service/SurveyService.java

@ -683,7 +683,8 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
    public Boolean saveSurveyAnswer(String suJson,String suaJsons)throws Exception{
        WlyySurveyUserDO surveyUserDO = objectMapper.readValue(suJson,WlyySurveyUserDO.class);
        surveyUserDO.setDate(DateUtil.dateToStr(new Date(),"yyyy-MM-dd"));
        surveyUserDO.setFixDate(DateUtil.dateToStr(new Date(),"yyyy-MM-dd"));
        surveyUserDO.setId(UUID.randomUUID().toString());
        surveyUserDO = surveyUserDao.save(surveyUserDO);
        //删除问题答案
@ -841,8 +842,8 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
                " t.temp_question_code AS \"tempQuestionCode\", " +
                " t.question_type AS \"questionType\", " +
                " t.temp_option_code AS \"tempOptionCode\", " +
                " t.comment AS \"comment\", " +
                " t.content AS \"content\", " +
                " t.user_comment AS \"comment\", " +
                " t.user_content AS \"content\", " +
                " t.patient AS \"patient\"," +
                " t.patient_name AS \"patientName\"," +
                " t.score AS \"score\"," +
@ -851,10 +852,10 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
                " wlyy_survey_user_answer t " +
                " WHERE 1=1";
        if(StringUtils.isNotBlank(comment)){
            sql += " AND t.comment like '%"+comment+"%' ";
            sql += " AND t.user_comment like '%"+comment+"%' ";
        }
        if(StringUtils.isNotBlank(content)){
            sql += " AND t.content  like '%"+content+"%'";
            sql += " AND t.user_content  like '%"+content+"%'";
        }
        if(StringUtils.isNotBlank(tempQuestionCode)){
            sql += " AND t.temp_question_code ='"+tempQuestionCode+"'";

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

@ -19,13 +19,13 @@ public abstract class IntegerIdentityEntity implements Serializable {
    @Id
//==========mysql 环境 id策略======================================================
    @GeneratedValue(generator = "generator")
    /*@GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = "identity")
    @Column(name = "id", unique = true, nullable = false)
    @Column(name = "id", unique = true, nullable = false)*/
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
//   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
        return id;

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/area/BaseDrugStoreDO.java

@ -24,6 +24,16 @@ public class BaseDrugStoreDO extends UuidIdentityEntityWithOperator {
    private String drugStoreCode;
    private String drugStoreName;
    private Integer isDel;
    /*private String hisCode;
    public String getHisCode() {
        return hisCode;
    }
    public void setHisCode(String hisCode) {
        this.hisCode = hisCode;
    }*/
    @Transient
    private double distance ;
    @Transient

+ 282 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/YkEmrJcsqDO.java

@ -0,0 +1,282 @@
package com.yihu.jw.entity.hospital.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.persistence.*;
import java.util.Date;
/**
 * 眼科检查申请单
 *
 * */
//@ApiModel(value = "HlwCf01VO", description = "眼科处方表1数据")
@Entity
@Table(name = "V_EMR_JCSQ")
public class YkEmrJcsqDO {
    private Integer sqdh;//类似主键递增
    private Integer brid;//病人id
    private Integer jzlx;//1默认
    private String jzhm;//门诊号码  病人档案的门诊号码,短信推送该号码给患者,brda查询门诊号码  病人档案的门诊号码,短信推送该号码给患者,brda查询
    private String brxm;//病人姓名
    private Integer brks;//挂号科室
    private Integer brxb;//1男2女
    private Integer brnl;//病人年龄
    private Integer jbbh;//默认0
    private Date kdsj;//取挂号日期
    private String kdys;//开单医生
    private Integer jclx;//默认1
    private Integer jjbz;//默认0
    private Integer jczt;//0新增、1提交、3已执行  我们只管理提交,新增保存在本地
    private Integer zfbz;//0正常  1作废  删除就等于作废
    private Date tjsj;//取挂号日期
    private String tjys;//同上面的kdys
    @Basic
    @Column(name = "BRID")
    public Integer getBrid() {
        return brid;
    }
    public void setBrid(Integer brid) {
        this.brid = brid;
    }
    private Integer zxks;//执行科室VEMR_ORDER_ITEM zxks
    private String jcxm;//项目名称
    private Integer qxbz;//0
    private Integer yjxh;//关联ms_yj01里面的yjxh
    private Integer xmdj;//项目单价
    private String xmdw;//项目单位
    private Integer xmid;//项目id  VEMR_ORDER_ITEM_MX
    private Integer sqsl;//数量
    private Integer jzxh;//就诊序号HLWYS_MZ_JZLS的JZXH对应
    @Basic
    @Id
    @Column(name = "SQDH")
    public Integer getSqdh() {
        return sqdh;
    }
    public void setSqdh(Integer sqdh) {
        this.sqdh = sqdh;
    }
    @Basic
    @Column(name = "JZLX")
    public Integer getJzlx() {
        return jzlx;
    }
    public void setJzlx(Integer jzlx) {
        this.jzlx = jzlx;
    }
    @Basic
    @Column(name = "JZHM")
    public String getJzhm() {
        return jzhm;
    }
    public void setJzhm(String jzhm) {
        this.jzhm = jzhm;
    }
    @Basic
    @Column(name = "BRXM")
    public String getBrxm() {
        return brxm;
    }
    public void setBrxm(String brxm) {
        this.brxm = brxm;
    }
    @Basic
    @Column(name = "BRKS")
    public Integer getBrks() {
        return brks;
    }
    public void setBrks(Integer brks) {
        this.brks = brks;
    }
    @Basic
    @Column(name = "BRXB")
    public Integer getBrxb() {
        return brxb;
    }
    public void setBrxb(Integer brxb) {
        this.brxb = brxb;
    }
    @Basic
    @Column(name = "BRNL")
    public Integer getBrnl() {
        return brnl;
    }
    public void setBrnl(Integer brnl) {
        this.brnl = brnl;
    }
    @Basic
    @Column(name = "JBBH")
    public Integer getJbbh() {
        return jbbh;
    }
    public void setJbbh(Integer jbbh) {
        this.jbbh = jbbh;
    }
    @Basic
    @Column(name = "KDSJ")
    @JsonFormat(pattern = "dd-mm月-yy", timezone = "GMT+08:00")
    public Date getKdsj() {
        return kdsj;
    }
    public void setKdsj(Date kdsj) {
        this.kdsj = kdsj;
    }
    @Basic
    @Column(name = "KDYS")
    public String getKdys() {
        return kdys;
    }
    public void setKdys(String kdys) {
        this.kdys = kdys;
    }
    @Basic
    @Column(name = "JCLX")
    public Integer getJclx() {
        return jclx;
    }
    public void setJclx(Integer jclx) {
        this.jclx = jclx;
    }
    @Basic
    @Column(name = "JJBZ")
    public Integer getJjbz() {
        return jjbz;
    }
    public void setJjbz(Integer jjbz) {
        this.jjbz = jjbz;
    }
    @Basic
    @Column(name = "JCZT")
    public Integer getJczt() {
        return jczt;
    }
    public void setJczt(Integer jczt) {
        this.jczt = jczt;
    }
    @Basic
    @Column(name = "ZFBZ")
    public Integer getZfbz() {
        return zfbz;
    }
    public void setZfbz(Integer zfbz) {
        this.zfbz = zfbz;
    }
    @Basic
    @Column(name = "TJSJ")
    @JsonFormat(pattern = "dd-mm月-yy", timezone = "GMT+08:00")
    public Date getTjsj() {
        return tjsj;
    }
    public void setTjsj(Date tjsj) {
        this.tjsj = tjsj;
    }
    @Basic
    @Column(name = "TJYS")
    public String getTjys() {
        return tjys;
    }
    public void setTjys(String tjys) {
        this.tjys = tjys;
    }
    @Basic
    @Column(name = "ZXKS")
    public Integer getZxks() {
        return zxks;
    }
    public void setZxks(Integer zxks) {
        this.zxks = zxks;
    }
    @Basic
    @Column(name = "JCXM")
    public String getJcxm() {
        return jcxm;
    }
    public void setJcxm(String jcxm) {
        this.jcxm = jcxm;
    }
    @Basic
    @Column(name = "QXBZ")
    public Integer getQxbz() {
        return qxbz;
    }
    public void setQxbz(Integer qxbz) {
        this.qxbz = qxbz;
    }
    @Basic
    @Column(name = "YJXH")
    public Integer getYjxh() {
        return yjxh;
    }
    public void setYjxh(Integer yjxh) {
        this.yjxh = yjxh;
    }
    @Basic
    @Column(name = "XMDJ")
    public Integer getXmdj() {
        return xmdj;
    }
    public void setXmdj(Integer xmdj) {
        this.xmdj = xmdj;
    }
    @Basic
    @Column(name = "XMDW")
    public String getXmdw() {
        return xmdw;
    }
    public void setXmdw(String xmdw) {
        this.xmdw = xmdw;
    }
    @Basic
    @Column(name = "XMID")
    public Integer getXmid() {
        return xmid;
    }
    public void setXmid(Integer xmid) {
        this.xmid = xmid;
    }
    @Basic
    @Column(name = "SQSL")
    public Integer getSqsl() {
        return sqsl;
    }
    public void setSqsl(Integer sqsl) {
        this.sqsl = sqsl;
    }
    @Basic
    @Column(name = "JZXH")
    public Integer getJzxh() {
        return jzxh;
    }
    public void setJzxh(Integer jzxh) {
        this.jzxh = jzxh;
    }
}

+ 74 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/YkEmrYzztDO.java

@ -0,0 +1,74 @@
package com.yihu.jw.entity.hospital.prescription;
import javax.persistence.*;
/**
 * 眼科项目组套
 *
 * */
//@ApiModel(value = "HlwCf01VO", description = "眼科处方表1数据")
@Entity
@Table(name = "emr_yzzt@ykzxtest")
public class YkEmrYzztDO {
    private String ztmc;//	组套名称
    private String ztid;//	关联套组明细字段
    private Integer gslb;//	1个人  2科室   3全院
    private String gsdm;//关联科室
    private String pydm;
    private Integer Mzsy;//	1为门诊组套
    @Basic
    @Id
    @Column(name = "ZTMC")
    public String getZtmc() {
        return ztmc;
    }
    public void setZtmc(String ztmc) {
        this.ztmc = ztmc;
    }
    @Basic
    @Column(name = "ZTID")
    public String getZtid() {
        return ztid;
    }
    public void setZtid(String ztid) {
        this.ztid = ztid;
    }
    @Basic
    @Column(name = "GSLB")
    public Integer getGslb() {
        return gslb;
    }
    public void setGslb(Integer gslb) {
        this.gslb = gslb;
    }
    @Basic
    @Column(name = "GSDM")
    public String getGsdm() {
        return gsdm;
    }
    public void setGsdm(String gsdm) {
        this.gsdm = gsdm;
    }
    @Basic
    @Column(name = "PYDM")
    public String getPydm() {
        return pydm;
    }
    public void setPydm(String pydm) {
        this.pydm = pydm;
    }
    @Basic
    @Column(name = "MZSY")
    public Integer getMzsy() {
        return Mzsy;
    }
    public void setMzsy(Integer mzsy) {
        Mzsy = mzsy;
    }
}

+ 237 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/YkMsYj01DO.java

@ -0,0 +1,237 @@
package com.yihu.jw.entity.hospital.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.persistence.*;
import java.util.Date;
/*
* 检查主表
 */
@Entity
@Table(name = "V_MS_YJ01")
public class YkMsYj01DO {
    private Integer yjxh;//主键
    private Integer MZXH;//0
    private String fphm;//默认空,不为空的时候不能删除或者修改
    private Integer brid;//病人ID
    private String brxm;//病人姓名
    private Date kdrq;//取挂号日期
    private Integer ksdm;//医生科室
    private String ysdm;//VEMR_USER.ygdm 医生表中的员工代码
    private Integer zxks;//	执行科室VEMR_ORDER_ITEM zxks
    private Integer zxpb;//执行判别 默认0
    private Integer zfpb;//	作废判别  0正常  1作废
    private Integer Cfbz;//	默认0
    private Integer jzxh;//	就诊序号HLWYS_MZ_JZLS的JZXH对应
    private Integer djzt;//默认0
    private Integer sqid;//去emr_jcsq里面sqdh
    private Integer qxbz;//取消标准  默认0
    private String xmmc;//项目名称
    private Integer ztbh;//项目id  VEMR_ORDER_ITEM_MX
    private Integer ygsf;//默认0
    private Integer jcbw;//默认0
    private Integer zjflag;//默认1
    private Integer ljlx;//默认0
    @Basic
    @Id
    @Column(name = "YJXH")
    public Integer getYjxh() {
        return yjxh;
    }
    public void setYjxh(Integer yjxh) {
        this.yjxh = yjxh;
    }
    @Basic
    @Column(name = "MZXH")
    public Integer getMZXH() {
        return MZXH;
    }
    public void setMZXH(Integer MZXH) {
        this.MZXH = MZXH;
    }
    @Basic
    @Column(name = "FPHM")
    public String getFphm() {
        return fphm;
    }
    public void setFphm(String fphm) {
        this.fphm = fphm;
    }
    @Basic
    @Column(name = "BRID")
    public Integer getBrid() {
        return brid;
    }
    public void setBrid(Integer brid) {
        this.brid = brid;
    }
    @Basic
    @Column(name = "BRXM")
    public String getBrxm() {
        return brxm;
    }
    public void setBrxm(String brxm) {
        this.brxm = brxm;
    }
    @Basic
    @Column(name = "KDRQ")
    @JsonFormat(pattern = "dd-mm月-yy", timezone = "GMT+08:00")
    public Date getKdrq() {
        return kdrq;
    }
    public void setKdrq(Date kdrq) {
        this.kdrq = kdrq;
    }
    @Basic
    @Column(name = "KSDM")
    public Integer getKsdm() {
        return ksdm;
    }
    public void setKsdm(Integer ksdm) {
        this.ksdm = ksdm;
    }
    @Basic
    @Column(name = "YSDM")
    public String getYsdm() {
        return ysdm;
    }
    public void setYsdm(String ysdm) {
        this.ysdm = ysdm;
    }
    @Basic
    @Column(name = "ZXKS")
    public Integer getZxks() {
        return zxks;
    }
    public void setZxks(Integer zxks) {
        this.zxks = zxks;
    }
    @Basic
    @Column(name = "ZXPB")
    public Integer getZxpb() {
        return zxpb;
    }
    public void setZxpb(Integer zxpb) {
        this.zxpb = zxpb;
    }
    @Basic
    @Column(name = "ZFPB")
    public Integer getZfpb() {
        return zfpb;
    }
    public void setZfpb(Integer zfpb) {
        this.zfpb = zfpb;
    }
    @Basic
    @Column(name = "CFBZ")
    public Integer getCfbz() {
        return Cfbz;
    }
    public void setCfbz(Integer cfbz) {
        Cfbz = cfbz;
    }
    @Basic
    @Column(name = "JZXH")
    public Integer getJzxh() {
        return jzxh;
    }
    public void setJzxh(Integer jzxh) {
        this.jzxh = jzxh;
    }
    @Basic
    @Column(name = "DJZT")
    public Integer getDjzt() {
        return djzt;
    }
    public void setDjzt(Integer djzt) {
        this.djzt = djzt;
    }
    @Basic
    @Column(name = "SQID")
    public Integer getSqid() {
        return sqid;
    }
    public void setSqid(Integer sqid) {
        this.sqid = sqid;
    }
    @Basic
    @Column(name = "QXBZ")
    public Integer getQxbz() {
        return qxbz;
    }
    public void setQxbz(Integer qxbz) {
        this.qxbz = qxbz;
    }
    @Basic
    @Column(name = "XMMC")
    public String getXmmc() {
        return xmmc;
    }
    public void setXmmc(String xmmc) {
        this.xmmc = xmmc;
    }
    @Basic
    @Column(name = "ZTBH")
    public Integer getZtbh() {
        return ztbh;
    }
    public void setZtbh(Integer ztbh) {
        this.ztbh = ztbh;
    }
    @Basic
    @Column(name = "YGSF")
    public Integer getYgsf() {
        return ygsf;
    }
    public void setYgsf(Integer ygsf) {
        this.ygsf = ygsf;
    }
    @Basic
    @Column(name = "JCBW")
    public Integer getJcbw() {
        return jcbw;
    }
    public void setJcbw(Integer jcbw) {
        this.jcbw = jcbw;
    }
    @Basic
    @Column(name = "ZJFLAG")
    public Integer getZjflag() {
        return zjflag;
    }
    public void setZjflag(Integer zjflag) {
        this.zjflag = zjflag;
    }
    @Basic
    @Column(name = "LJLX")
    public Integer getLjlx() {
        return ljlx;
    }
    public void setLjlx(Integer ljlx) {
        this.ljlx = ljlx;
    }
}

+ 133 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/YkMsYj02DO.java

@ -0,0 +1,133 @@
package com.yihu.jw.entity.hospital.prescription;
import javax.persistence.*;
import javax.persistence.criteria.From;
/*
 * 检查明细
 */
@Entity
@Table(name = "V_MS_YJ02")
public class YkMsYj02DO {
    private Integer sbxh;//id
    private Integer yjxh ;//Ms_yi01里的yjxh
    private Integer ylxh;//组套明细里关联VEMR_ORDER_ITEM 里面  ITEM_CODE
    private Integer xmlx;//SELECT XMLX  javax.persistence.criteria.From GY_YLSF Where FYXH =l l_fyxh   查询后结果写入
    private Integer yjxz;//明细第一条是1,其它是0
    private Integer Yldj;//单价  select * from  portal_his.gy_ylsf@YKZXTEST where fyxh = l l_fyxh
    private Integer ylsl;//数量 = 取项目明细 * 医生填的数量  参考截图   fysl
    private Integer hjje;//	合计金额
    private Integer fygb;//SELECT fygb From GY_YLSF Where FYXH =l l_fyxh  查询后结果写入
    private Integer zfbl;//	默认1
    private Integer zxpb;//默认0
    private Integer zjflag;//	默认0
    @Basic
    @Id
    @Column(name = "SBXH")
    public Integer getSbxh() {
        return sbxh;
    }
    public void setSbxh(Integer sbxh) {
        this.sbxh = sbxh;
    }
    @Basic
    @Column(name = "YJXH")
    public Integer getYjxh() {
        return yjxh;
    }
    public void setYjxh(Integer yjxh) {
        this.yjxh = yjxh;
    }
    @Basic
    @Column(name = "YLX")
    public Integer getYlxh() {
        return ylxh;
    }
    public void setYlxh(Integer ylx) {
        this.ylxh = ylxh;
    }
    @Basic
    @Column(name = "XMLX")
    public Integer getXmlx() {
        return xmlx;
    }
    public void setXmlx(Integer xmlx) {
        this.xmlx = xmlx;
    }
    @Basic
    @Column(name = "YJXZ")
    public Integer getYjxz() {
        return yjxz;
    }
    public void setYjxz(Integer yjxz) {
        this.yjxz = yjxz;
    }
    @Basic
    @Column(name = "YLDJ")
    public Integer getYldj() {
        return Yldj;
    }
    public void setYldj(Integer yldj) {
        Yldj = yldj;
    }
    @Basic
    @Column(name = "YLSL")
    public Integer getYlsl() {
        return ylsl;
    }
    public void setYlsl(Integer ylsl) {
        this.ylsl = ylsl;
    }
    @Basic
    @Column(name = "HJJE")
    public Integer getHjje() {
        return hjje;
    }
    public void setHjje(Integer hjje) {
        this.hjje = hjje;
    }
    @Basic
    @Column(name = "FYGB")
    public Integer getFygb() {
        return fygb;
    }
    public void setFygb(Integer fygb) {
        this.fygb = fygb;
    }
    @Basic
    @Column(name = "ZFBL")
    public Integer getZfbl() {
        return zfbl;
    }
    public void setZfbl(Integer zfbl) {
        this.zfbl = zfbl;
    }
    @Basic
    @Column(name = "ZXPB")
    public Integer getZxpb() {
        return zxpb;
    }
    public void setZxpb(Integer zxpb) {
        this.zxpb = zxpb;
    }
    @Basic
    @Column(name = "ZJFLAG")
    public Integer getZjflag() {
        return zjflag;
    }
    public void setZjflag(Integer zjflag) {
        this.zjflag = zjflag;
    }
}

+ 3 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/survey/WlyySurveyUserAnswerDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.hospital.survey;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
@ -65,7 +66,7 @@ public class WlyySurveyUserAnswerDO extends UuidIdentityEntity {
    public void setTempOptionCode(String tempOptionCode) {
        this.tempOptionCode = tempOptionCode;
    }
    @Column(name = "user_content")
    public String getContent() {
        return content;
    }
@ -106,7 +107,7 @@ public class WlyySurveyUserAnswerDO extends UuidIdentityEntity {
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @Column(name = "user_comment")
    public String getComment() {
        return comment;
    }

+ 7 - 6
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/survey/WlyySurveyUserDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.hospital.survey;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
@ -23,7 +24,7 @@ public class WlyySurveyUserDO extends UuidIdentityEntity {
    private String doctor;  //医生
    private String doctorName;//医生名称
    private Integer status;//是否已答(0未答 1已答 2放弃)',
    private String date; //答题时间
    private String fixDate; //答题时间
    private Date endTime;//完成时间(放弃时间)',
    private Date createTime;//调查时间(居民接受时间)',
@ -116,12 +117,12 @@ public class WlyySurveyUserDO extends UuidIdentityEntity {
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    public String getDate() {
        return date;
    @Column(name = "fix_date")
    public String getFixDate() {
        return fixDate;
    }
    public void setDate(String date) {
        this.date = date;
    public void setFixDate(String fixDate) {
        this.fixDate = fixDate;
    }
}

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

@ -1024,6 +1024,12 @@ public class BaseHospitalRequestMapping {
        public static final String guidanceFinishConsult = "guidanceFinishConsult";
        public static final String doctorReplyUpdateYktState = "doctorReplyUpdateYktState";
        public static final String outPatientOrder = "/outPatientOrder";
        public static final String findYzztByGslb = "/findYzztByGslb";
        public static final String findZtmxByid = "/findZtmxByid";
        public static final String findZlxm = "/findZlxm";
        public static final String findZlxmMx = "/findZlxmMx";
    }

+ 24 - 12
svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserService.java

@ -35,6 +35,7 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.io.IOException;
import java.sql.PreparedStatement;
import java.util.*;
import java.util.logging.Logger;
@ -765,14 +766,18 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
                "\t\tbase_role ROLE\n" +
                "\tWHERE\n" +
                "\t\tusr .saas_id = saas. ID\n" +
                "\tAND usr .role_id = ROLE . ID\n" +
                "\tAND (usr . NAME LIKE '%%' OR '' = '%%')\n" +
                "\tAND (saas. ID = '' OR '' = '')\n" +
                "\tAND (usr .role_id = '' OR '' = '')\n" +
                "\tORDER BY\n" +
                "\t\tusr .create_time DESC";
                "\tAND usr .role_id = ROLE . ID\n" ;
                if(!realName.equals(null) && !realName.equals("")){
                    finalSql = finalSql + " and usr . NAME LIKE '%"+realName+"%'";
                }
                if(!saasidValue.equals(null) && !saasidValue.equals("")){
                    finalSql = finalSql + " and saas. id = '"+saasidValue+"'";
                }
                if(!roleIdValue.equals(null) && !roleIdValue.equals("")){
                    finalSql = finalSql + " and usr .role_id = '"+roleIdValue+"'";
                }
                finalSql = finalSql + " ORDER BY usr .create_time DESC";
        Logger.getAnonymousLogger().info("finalSql="+finalSql);
        String sql = finalSql
                .replace("{realName}","%" + realName + "%")
                .replace("{saasid}",saasidValue)
@ -823,10 +828,17 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
                "WHERE " +
                "  usr.saas_id = saas.id " +
                "  AND " +
                "  usr.role_id = role.id " +
                " and (usr.name like '{realName}' or '' ='{realName}') " +
                "  and (saas.id = '{saasid}' or '' = '{saasid}') " +
                "  and ( usr.role_id = '{roleId}' or '' = '{roleId}') ";
                "  usr.role_id = role.id " ;
                if(!realName.equals(null) && !realName.equals("")){
                    countSql = countSql + " and usr . NAME LIKE '%"+realName+"%'";
                }
                if(!saasidValue.equals(null) && !saasidValue.equals("")){
                    countSql = countSql + " and saas. id = '"+saasidValue+"'";
                }
                if(!roleIdValue.equals(null) && !roleIdValue.equals("")){
                    countSql = countSql + " and usr .role_id = '"+roleIdValue+"'";
                }
        Logger.getAnonymousLogger().info("countSql="+countSql);
        String finalCountSql = countSql
                .replace("{realName}", "%" + realName + "%")
                .replace("{saasid}",  saasidValue )

+ 113 - 3
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/YkyyController.java

@ -1,5 +1,7 @@
package com.yihu.jw.entrance.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
@ -10,21 +12,22 @@ import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.EntityUtils;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.utils.network.HttpResponse;
import com.yihu.utils.network.HttpUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.axis.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -237,6 +240,113 @@ public class YkyyController extends EnvelopRestEndpoint {
        result.put("fzCount",prescriptionService.getWaitVideoCount(doctor.getId(),"1","1",wxId));//图文复诊数量
        return success("请求成功",result);
    }
    @GetMapping(value = "/outPatientOrder")
    @ApiOperation(value = "医生开单")
    public ObjEnvelop outPatientOrder(@ApiParam(name = "json", value = "json", required = true)
                                       @RequestParam(value = "json",required = true)String json,
                                              @ApiParam(name = "table", value = "table", required = true)
                                           @RequestParam(value = "table",required = true)String table) throws  Exception{
        List<YkEmrJcsqDO> surveys = EntityUtils.jsonToList(json, YkEmrJcsqDO.class);
        System.out.println(surveys);
        long totalprice=0l;
        ObjEnvelop mixEnvelop = new ObjEnvelop();
        if (surveys!=null){
            for (YkEmrJcsqDO ykEmrJcsqDO:surveys){
                String sqdhSql =" select dqz + 1 as \"total\"  from portal_his.gy_identity_emr@ykzxtest where bmc = 'EMR_JCSQ'";
                List<Map<String,Object>> sqdhList = hibenateUtils.createSQLQuery(sqdhSql);
                Long sqdh = 0L;
                if (sqdhList!=null&&sqdhList.size()!=0){
                    sqdh = Long.parseLong(sqdhList.get(0).get("total").toString());
                    System.out.println("sqdh:"+sqdh);
                    String updatesqdh = "update portal_his.gy_identity_ms@ykzxtest set dqz=dqz+1 where bmc = 'EMR_JCSQ'";
                    hibenateUtils.updateBySql(updatesqdh);
                }
                ykEmrJcsqDO.setSqdh(sqdh.intValue());
                ykEmrJcsqDO.setJclx(1);
                ykEmrJcsqDO.setJjbz(0);
                ykEmrJcsqDO.setJczt(1);
                ykEmrJcsqDO.setZfbz(0);
                ykEmrJcsqDO.setQxbz(0);
                totalprice +=ykEmrJcsqDO.getXmdj()*ykEmrJcsqDO.getSqsl();
                System.out.println("totalprice"+totalprice);
                String yjxhSql =" select dqz + 1 as \"total\"  from portal_his.gy_identity_emr@ykzxtest where bmc = 'MS_YJ01'";
                List<Map<String,Object>> yjxhList = hibenateUtils.createSQLQuery(yjxhSql);
                Long yjxh = 0L;
                if (yjxhList!=null&&yjxhList.size()!=0){
                    yjxh = Long.parseLong(yjxhList.get(0).get("total").toString());
                    System.out.println("yjxh:"+yjxh);
                    String updateyjxh = "update portal_his.gy_identity_ms@ykzxtest set dqz=dqz+1 where bmc = 'MS_YJ01'";
                    hibenateUtils.updateBySql(updateyjxh);
                    ykEmrJcsqDO.setYjxh(yjxh.intValue());
                }
                ykyyEntranceService.save(ykEmrJcsqDO);
                YkMsYj01DO ykMsYj01DO = new YkMsYj01DO();
                ykMsYj01DO.setYjxh(yjxh.intValue());
                ykMsYj01DO.setMZXH(0);
                ykMsYj01DO.setFphm("");
                ykMsYj01DO.setBrid(ykEmrJcsqDO.getBrid());
                ykMsYj01DO.setBrxm(ykEmrJcsqDO.getBrxm());
                ykMsYj01DO.setKdrq(ykEmrJcsqDO.getKdsj());
                ykMsYj01DO.setKsdm(ykEmrJcsqDO.getBrks());
                ykMsYj01DO.setYsdm(ykEmrJcsqDO.getKdys());
                ykMsYj01DO.setZxks(ykEmrJcsqDO.getZxks());
                ykMsYj01DO.setZxpb(0);
                ykMsYj01DO.setZfpb(0);
                ykMsYj01DO.setCfbz(0);
                ykMsYj01DO.setJzxh(ykEmrJcsqDO.getJzxh());
                ykMsYj01DO.setDjzt(0);
                ykMsYj01DO.setSqid(sqdh.intValue());
                ykMsYj01DO.setQxbz(0);
                ykMsYj01DO.setXmmc(ykEmrJcsqDO.getJcxm());
                ykMsYj01DO.setZtbh(ykEmrJcsqDO.getXmid());
                ykMsYj01DO.setYgsf(0);
                ykMsYj01DO.setJcbw(0);
                ykMsYj01DO.setZjflag(1);
                ykMsYj01DO.setLjlx(0);
                System.out.println(ykMsYj01DO);
                ykyyEntranceService.save(ykMsYj01DO);
                String sqlCxzt = "Select t.zlxmid,t.fyxh,t.fysl from VEMR_ORDER_ITEM_MX t where t.zlxmid =' "+ykEmrJcsqDO.getXmid()+"'";
                List<Map<String,Object>> sbxlMap = hibenateUtils.createSQLQuery(sqlCxzt);
                if (sbxlMap.size()>0){
                    int i = 0;
                    for (Map<String,Object> map:sbxlMap){
                        String sbxhSql =" select dqz + 1 as \"total\"  from portal_his.gy_identity_emr@ykzxtest where bmc = 'MS_YJ02'";
                        List<Map<String,Object>> sbxhList = hibenateUtils.createSQLQuery(sbxhSql);
                        Long sbxh = 0L;
                        if (sbxhList!=null&&sbxhList.size()!=0){
                            sbxh = Long.parseLong(sbxhList.get(0).get("total").toString());
                            System.out.println("yjxh:"+yjxh);
                            String updateyjxh = "update portal_his.gy_identity_ms@ykzxtest set dqz=dqz+1 where bmc = 'MS_YJ02'";
                            hibenateUtils.updateBySql(updateyjxh);
                        }
                        YkMsYj02DO ykMsYj02DO = new YkMsYj02DO();
                        ykMsYj02DO.setSbxh(sbxh.intValue());
                        ykMsYj02DO.setYjxh(ykMsYj01DO.getYjxh());
                        ykMsYj02DO.setYlxh(ykEmrJcsqDO.getXmid());
                        Integer sqsl = ykEmrJcsqDO.getSqsl();
                        ykMsYj02DO.setYlsl(Integer.valueOf(map.get("fysl").toString())*sqsl);
                        ykMsYj02DO.setYjxz(i==0?1:0);
                        i++;
                        String fyxhSql ="select t.xmlx as \"xmlx\",t.fydj as \"fydj\",t.fygb as \"fygb\"" +
                                "from portal_his.GY_YLSF@ykzxtest t " +
                                " and t.fyxh = '"+map.get("fyxh").toString()+"'";
                        List<Map<String,Object>> fyxhList = hibenateUtils.createSQLQuery(fyxhSql);
                        if (fyxhList.size()>0){
                            ykMsYj02DO.setXmlx(Integer.valueOf(fyxhList.get(0).get("XMLX").toString()));
                            ykMsYj02DO.setFygb(Integer.valueOf(fyxhList.get(0).get("fygb").toString()));
                            ykMsYj02DO.setYldj(Integer.valueOf(fyxhList.get(0).get("fydj").toString()));
                            ykMsYj02DO.setHjje(ykMsYj02DO.getYldj()*ykMsYj02DO.getYlsl());
                        }
                        System.out.println(ykMsYj02DO);
                        ykyyEntranceService.save(ykMsYj02DO);
                    }
                }
            }
            mixEnvelop.setObj(totalprice);
        }
        return mixEnvelop;
    }
    
}

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/article/ArticleEndpoint.java

@ -263,7 +263,7 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
									 @ApiParam(name = "doctor", value = "医生code")
										 @RequestParam(value = "doctor",required = false)String doctor)throws Exception {
		return success(knowledgeArticleService.setUsed(id,used,doctor));
	}
}
	@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.searchPatientArticle)

+ 61 - 3
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -1,5 +1,6 @@
package com.yihu.jw.hospital.endpoint.consult;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
@ -13,6 +14,7 @@ import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.XzyyPrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
import com.yihu.jw.im.dao.ConsultDao;
import com.yihu.jw.im.service.ImService;
@ -91,6 +93,8 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	private XzyyPrescriptionService xzyyPrescriptionService;
	@Autowired
	private ConsultDao consultDao;
	@Autowired
	private YkyyEntranceService ykyyEntranceService;
	
	@Value("${wechat.id}")
	private String wxId;
@ -913,9 +917,9 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.doctorReplyUpdateYktState)
	@ApiOperation(value = "医生回复修改眼科通状态", notes = "医生回复修改眼科通状态")
	public ObjEnvelop doctorReplyUpdateYktState(@ApiParam(name = "consult", value = "consult")
											@RequestParam(value = "consult", required = true)String consult,
											@ApiParam(name = "doctor", value = "doctor")
											@RequestParam(value = "doctor", required = true)String doctor) {
												@RequestParam(value = "consult", required = true)String consult,
												@ApiParam(name = "doctor", value = "doctor")
												@RequestParam(value = "doctor", required = true)String doctor) {
		Boolean flag =false;
		try {
@ -926,4 +930,58 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		}
		return success(flag);
	}
	@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.outPatientOrder)
	@ApiOperation(value = "线上开检查单", notes = "线上开具检查单")
	public ObjEnvelop ykOlineOrder(@ApiParam(name = "jsondata", value = "jsondata")
												@RequestParam(value = "jsondata", required = true)String jsondata,
								   @ApiParam(name = "doctor", value = "doctor")
								   @RequestParam(value = "doctor", required = true)String doctor,
								   @ApiParam(name = "patient", value = "patient")
									   @RequestParam(value = "patient", required = true)String patient)throws Exception {
		String success= ykyyEntranceService.outPatientOrder(jsondata,false,doctor,patient);
		ObjEnvelop objEnvelop = new ObjEnvelop();
		objEnvelop.setObj(success);
		return objEnvelop;
	}
	@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.findYzztByGslb)
	@ApiOperation(value = "组套项目查询", notes = "组套项目查询")
	public ObjEnvelop findYzztByGslb(@ApiParam(name = "gslb", value = "gslb")
								   @RequestParam(value = "gslb", required = false)String gslb)throws Exception {
		JSONArray array= ykyyEntranceService.findYzztByGslb(gslb);
		ObjEnvelop objEnvelop = new ObjEnvelop();
		objEnvelop.setObj(array);
		return objEnvelop;
	}
	@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.findZtmxByid)
	@ApiOperation(value = "组套项目明细查询", notes = "组套项目明细查询")
	public ObjEnvelop findZtmxByid(@ApiParam(name = "ztId", value = "ztId")
									 @RequestParam(value = "ztId", required = true)String ztId)throws Exception {
		JSONArray array= ykyyEntranceService.findZtmxByid(ztId);
		ObjEnvelop objEnvelop = new ObjEnvelop();
		objEnvelop.setObj(array);
		return objEnvelop;
	}
	@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.findZlxm)
	@ApiOperation(value = "诊疗项目查询", notes = "诊疗项目查询")
	public ObjEnvelop findZlxm(@ApiParam(name = "itemName", value = "itemName")
								   @RequestParam(value = "itemName", required = false)String itemName)throws Exception {
		JSONArray array= ykyyEntranceService.findZlxm(itemName);
		ObjEnvelop objEnvelop = new ObjEnvelop();
		objEnvelop.setObj(array);
		return objEnvelop;
	}
	@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.findZlxmMx)
	@ApiOperation(value = "诊疗项目明细查询", notes = "诊疗项目明细查询")
	public ObjEnvelop findZlxmMx(@ApiParam(name = "zlxmId", value = "zlxmId")
							   @RequestParam(value = "zlxmId", required = true)String zlxmId)throws Exception {
		JSONArray array= ykyyEntranceService.findZlxmMx(zlxmId);
		ObjEnvelop objEnvelop = new ObjEnvelop();
		objEnvelop.setObj(array);
		return objEnvelop;
	}
}

+ 2 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/message/BaseUserMsgController.java

@ -39,6 +39,7 @@ public class BaseUserMsgController extends EnvelopRestEndpoint {
                                   @ApiParam(name = "isDoctor", value = "isDoctor", required = false)
                                       @RequestParam(value = "isDoctor", required = false)Integer  isDoctor){
        String patient = getUID();
        System.out.println("patient"+patient);
        baseUserMsgService.responseMessage(contentId,content,reciverId,patient,isDoctor);
        return success("回复成功" );
    }
@ -54,6 +55,7 @@ public class BaseUserMsgController extends EnvelopRestEndpoint {
                                    @RequestParam(value = "type", required = false)Integer type
                              ){
        String senderId = getUID();
        System.out.println("senderId"+senderId);
        //String senderName = getUNAME();
        baseUserMsgService.leaveMessage(content,reciverId,reciverName,senderId,type);
        return success("留言成功" );

+ 10 - 10
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/BasePatientBusinessService.java

@ -178,7 +178,7 @@ public class BasePatientBusinessService extends BaseJpaService<BasePatientBusine
			knowledgeArticleUserDO.setUsed(used);
			knowledgeArticleUserDO.setRelationCode(id);
			knowledgeArticleUserDO.setRelationName(wlyySurveyTemplateDO.getTitle());
			knowledgeArticleUserDO.setRelationType(1);
			knowledgeArticleUserDO.setRelationType(2);
			knowledgeArticleUserDO.setDel(1);
			knowledgeArticleUserDO.setUser(doctor);
			if (doctorDO!=null){
@ -216,16 +216,16 @@ public class BasePatientBusinessService extends BaseJpaService<BasePatientBusine
		MixEnvelop mixEnvelop = new MixEnvelop();
		sql.append("SELECT " +
				" t.id, " +
				" t.id as \"id\", " +
				" b.used as \"used\","+
				" t.title, " +
				" t.template_comment AS templateComment, " +
				" t.organization, " +
				" t.creater, " +
				" t.creater_code, " +
				" t.create_time AS createTime, " +
				" t.del, " +
				" t.update_time AS updateTime" +
				" t.title as \"title\", " +
				" t.template_comment AS \"templateComment\", " +
				" t.organization as \"organization\", " +
				" t.creater as \"creater\", " +
				" t.creater_code as \"creater_code\", " +
				" t.create_time AS \"createTime\", " +
				" t.del as \"del\", " +
				" t.update_time AS \"updateTime\"" +
				" FROM " +
				" wlyy_survey_template t ");
		//1为查询常用

+ 5 - 4
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/KnowledgeArticleService.java

@ -174,10 +174,10 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
	 */
	public List<Map<String,Object>> findArticleByDept(String dept)throws Exception{
		String sql = "SELECT " +
				" t.id, " +
				" t.title, " +
				" t.create_time AS create_time ," +
				" t.image AS image " +
				" t.id as \"id\", " +
				" t.title as \"title\", " +
				" t.create_time AS \"create_time\" ," +
				" t.image AS \"image\" " +
				" FROM " +
				" wlyy_knowledge_article t " +
				" JOIN wlyy_knowledge_article_dept d ON t.id = d.article_id " +
@ -255,6 +255,7 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
					wlyySurveyUserDO.setSurveyTempCode(patientBusinessDO.getRelationCode());
					wlyySurveyUserDO.setSurveyTempTitle(patientBusinessDO.getRelationName());
					wlyySurveyUserDO.setCreateTime(new Date());
					wlyySurveyUserDO.setEndTime(new Date());
					wlyySurveyUserDO = surveyUserDao.save(wlyySurveyUserDO);
					JSONObject object = new JSONObject();
					WlyySurveyTemplateDO wlyySurveyTemplateDO = surveyTemplateDao.findOne(wlyySurveyUserDO.getSurveyTempCode());

+ 72 - 51
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/WlyyDeviceController.java

@ -122,61 +122,82 @@ public class WlyyDeviceController extends BaseController {
    private IotPatientDeviceService iotPatientDeviceService;
    /**
     * 设备删除
     * 设备删除     屏蔽部分为患者端解绑设备
     */
    @ApiOperation("设备删除")
    @RequestMapping(value = "DeletePatientDevice",method = {RequestMethod.GET,RequestMethod.POST})
    @RequestMapping(value = "deletePatientDevice",method = {RequestMethod.POST})
    @ResponseBody
    public String delete(@ApiParam(name = "id", value = "删除设备关联ID")
                         @RequestParam(value = "id", required = true) String id) {
        try {
            PatientDevice pd = iotPatientDeviceService.findId(id);
            if (pd != null) {
                if (!StringUtils.equals(pd.getUser(), getRepUID())) {
                    return error(1,"只允许删除自己的设备!");
                }
                iotPatientDeviceService.deleteDevice(id, getRepUID());
                //居民自主解绑设备时发送消息给医生
                Patient patient = iotPatientDeviceService.findByCode(pd.getUser());   //getRepUID()
                SignFamily signFamily = iotPatientDeviceService.findDoctor(patient.getCode());
                String messageContent =  "您的居民"+patient.getName()+"解绑了";
                if ("1".equals(pd.getCategoryCode())){
                    messageContent +="血糖仪,点击下方查看居民详情";
                }else if ("2".equals(pd.getCategoryCode())){
                    messageContent +="血压计,点击下方查看居民详情";
                }else if ("4".equals(pd.getCategoryCode())){
                    messageContent +="智能手表,点击下方查看居民详情";
                }
                Message message = new Message();
                message.setCzrq(new Date());
                message.setCreateTime(new Date());
                message.setContent(messageContent);
                message.setRead(1);//设置未读
                message.setReceiver(signFamily.getDoctor());//设置接受医生的code
                message.setSender("admin");//设置发送的用户
                message.setSenderName("系统");
                message.setCode(UUID.randomUUID().toString().replaceAll("-", ""));
                message.setSenderPhoto("");
                message.setTitle("解绑设备消息");
                message.setType(301);//解绑设备消息
                message.setReadonly(1);//是否只读消息
                message.setSex(1);
                message.setRelationCode(patient.getCode());
                message.setOver("1");//未处理
                message.setData("");
                message.setDel("1");
                iotPatientDeviceService.saveMessage(message);
                //全部解绑后去判断就更新设备表中是否绑定字段
                iotPatientDeviceService.savePatientDeviceLog(pd,pd.getDeviceSn(),2,2);
                iotPatientDeviceService.unBindUpdateIsBinding(pd.getDeviceSn());
                return success("设备已删除!");
            } else {
                return error(-1, "不存在该设备!");
    public String delete(
            @ApiParam(name="deviceSn",value="设备SN")
            @RequestParam(value="deviceSn",required = true) String deviceSn,
            @ApiParam(name="type",value="设备类型")
            @RequestParam(value="type",required = true) String type
//            @ApiParam(name = "id", value = "删除设备关联ID")
//                         @RequestParam(value = "id", required = true) String id
    ) {
//        try {
//            PatientDevice pd = iotPatientDeviceService.findId(id);
//            if (pd != null) {
//                if (!StringUtils.equals(pd.getDoctor(), getRepUID())) {//user:915f019b-5b1d-11e6-8344-fa163e8aee56
//                    return error(1,"只允许删除自己的设备!");
//                }
//                iotPatientDeviceService.deleteDevice(id, getRepUID());
//                //居民自主解绑设备时发送消息给医生
//                Patient patient = iotPatientDeviceService.findByCode(pd.getUser());   //getRepUID()
//
//                SignFamily signFamily = iotPatientDeviceService.findDoctor(patient.getCode());
//                String messageContent =  "您的居民"+patient.getName()+"解绑了";
//                if ("1".equals(pd.getCategoryCode())){
//                    messageContent +="血糖仪,点击下方查看居民详情";
//                }else if ("2".equals(pd.getCategoryCode())){
//                    messageContent +="血压计,点击下方查看居民详情";
//                }else if ("4".equals(pd.getCategoryCode())){
//                    messageContent +="智能手表,点击下方查看居民详情";
//                }
//                Message message = new Message();
//                message.setCzrq(new Date());
//                message.setCreateTime(new Date());
//                message.setContent(messageContent);
//                message.setRead(1);//设置未读
//                message.setReceiver(signFamily.getDoctor());//设置接受医生的code
//                message.setSender("admin");//设置发送的用户
//                message.setSenderName("系统");
//                message.setCode(UUID.randomUUID().toString().replaceAll("-", ""));
//                message.setSenderPhoto("");
//                message.setTitle("解绑设备消息");
//                message.setType(301);//解绑设备消息
//                message.setReadonly(1);//是否只读消息
//                message.setSex(1);
//                message.setRelationCode(patient.getCode());
//                message.setOver("1");//未处理
//                message.setData("");
//                message.setDel("1");
//                iotPatientDeviceService.saveMessage(message);
//                //全部解绑后去判断就更新设备表中是否绑定字段
//                iotPatientDeviceService.savePatientDeviceLog(pd,pd.getDeviceSn(),2,2);
//                iotPatientDeviceService.unBindUpdateIsBinding(pd.getDeviceSn());
//                return success("设备已删除!");
//            } else {
//                return error(-1, "不存在该设备!");
//            }
//        } catch (Exception ex) {
//            error(ex);
//            return invalidUserException(ex, -1, ex.getMessage());
//        }
        try{
            List<PatientDevice> patientDevices = iotPatientDeviceService.findByDeviceSnAndCategory(deviceSn, type);
            PatientDevice patientDevice = new PatientDevice();
            if (patientDevices!=null && patientDevices.size()>0){
                patientDevice = patientDevices.get(0);
            }
        } catch (Exception ex) {
            error(ex);
            return invalidUserException(ex, -1, ex.getMessage());
            iotPatientDeviceService.deleteDevices(deviceSn,type);
            //全部解绑后去判断就更新设备表中是否绑定字段
            iotPatientDeviceService.savePatientDeviceLog(patientDevice,deviceSn,1,2);
            iotPatientDeviceService.unBindUpdateIsBinding(deviceSn);
            return write(200,"解绑成功!");
        }catch (Exception e){
            error(e);
            return write(-1,e.getMessage());
        }
    }
}

+ 18 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java

@ -775,4 +775,22 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
            //deviceDetailDao.updateUnbindAll(2,deviceSn);
        }
    }
    public List<PatientDevice> findByDeviceSnAndCategory(String deviceSn, String categoryCode){
        String sqlFind = "select * from wlyy.wlyy_patient_device where device_sn='"+deviceSn +"' and category_code="+categoryCode;
        List<PatientDevice> patientDevices = jdbcTempalte.query(sqlFind , new BeanPropertyRowMapper<>(PatientDevice.class));
        return patientDevices;
    }
    public void deleteDevices(String deviceSn, String type) {
        String sqlFind = "select * from wlyy.wlyy_patient_device where device_sn='"+deviceSn +"' and category_code="+type;
        List<PatientDevice> patientDevices = jdbcTempalte.query(sqlFind , new BeanPropertyRowMapper<>(PatientDevice.class));
        if (patientDevices == null || patientDevices.size() == 0) {
            throw new RuntimeException("设备未被绑定!");
        }
        for (PatientDevice patientDevice : patientDevices) {
            String sqlDel = "delete from wlyy.wlyy_patient_device where id="+patientDevice.getId() ;
            jdbcTempalte.execute(sqlDel);
        }
    }
}