Ver código fonte

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

wangzhinan 4 anos atrás
pai
commit
4c7fcf472a
18 arquivos alterados com 651 adições e 167 exclusões
  1. 87 3
      business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorInfoService.java
  2. 19 8
      business/base-service/src/main/java/com/yihu/jw/evaluate/score/service/BaseEvaluateScoreService.java
  3. 3 0
      business/base-service/src/main/java/com/yihu/jw/hospital/dict/WlyyHospitalSysDictDao.java
  4. 58 14
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  5. 76 28
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/WorkTimeService.java
  6. 11 3
      business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java
  7. 4 3
      common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java
  8. 12 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorDO.java
  9. 4 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  10. 9 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/dao/patient/WlyyHospitalSysDictDao.java
  11. 51 16
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  12. 4 3
      server/svr-authentication/src/main/java/com/yihu/jw/security/service/YkyyService.java
  13. 35 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  14. 4 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  15. 10 0
      svr/svr-iot/src/main/java/com/yihu/iot/controller/monitorPlatform/MonitorPlatformController.java
  16. 25 3
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java
  17. 238 81
      svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java
  18. 1 1
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java

+ 87 - 3
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorInfoService.java

@ -140,7 +140,8 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                "\tn.req_fee as \"spfzFee\",\n" +
                "\tp.req_fee as \"spzxFee\",\n" +
                "\tv.req_fee as \"twzxFee\",\n" +
                "\td.req_fee as \"xtzxFee\"\n" +
                "\td.req_fee as \"xtzxFee\",\n" +
                "\tg.req_fee as \"jyzxFee\"\n" +
                " FROM " +
                " base_doctor a " +
                " JOIN base_doctor_hospital b ON a.id = b.doctor_code " +
@ -150,6 +151,7 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                " LEFT JOIN wlyy_charge_dict p ON a.spzx_charge_type = p.charge_type\n" +
                " LEFT JOIN wlyy_charge_dict v ON a.twzx_charge_type = v.charge_type\n" +
                " LEFT JOIN wlyy_charge_dict d ON a.xtfz_charge_type = d.charge_type\n" +
                " LEFT JOIN wlyy_charge_dict g ON a.jyzx_charge_type = g.charge_type\n" +
                " LEFT JOIN base_doctor_mapping c ON a.id = c.doctor " +
                " WHERE 1=1";
        if (StringUtils.isNotBlank(city)){
@ -204,7 +206,8 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                "\tn.req_fee as \"spfzFee\",\n" +
                "\tp.req_fee as \"spzxFee\",\n" +
                "\tv.req_fee as \"twzxFee\",\n" +
                "\tq.req_fee as \"xtzxFee\"\n" +
                "\tq.req_fee as \"xtzxFee\",\n" +
                "\tg.req_fee as \"jyzxFee\"\n" +
                " FROM " +
                " base_doctor a " +
                " LEFT JOIN base_doctor_hospital b ON a.id = b.doctor_code " +
@ -216,6 +219,7 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                " LEFT JOIN wlyy_charge_dict p ON a.spzx_charge_type = p.charge_type\n" +
                " LEFT JOIN wlyy_charge_dict v ON a.twzx_charge_type = v.charge_type\n" +
                " LEFT JOIN wlyy_charge_dict q ON a.xtfz_charge_type = q.charge_type\n" +
                " LEFT JOIN wlyy_charge_dict g ON a.jyzx_charge_type = g.charge_type\n" +
                " WHERE 1=1 ";
        if(StringUtils.isNotBlank(doctorId)){
            sql+=" AND a.id =:id";
@ -285,7 +289,64 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
        String outpatientType = jsonObject.get("outpatientType").toString();
        String newSpecialDisease = jsonObject.get("specialDisease").toString();
        String newSpecialDiseaseCode = jsonObject.get("specialDiseaseCode").toString();
        baseDoctorDao.update(doctorId,introduce,expertise,photo,outpatientType);
        BaseDoctorDO doctorDO = baseDoctorDao.findOne(doctorId);
        if (doctorDO!=null){
            doctorDO.setIntroduce(introduce);
            doctorDO.setExpertise(expertise);
            doctorDO.setPhoto(photo);
            doctorDO.setOutpatientType(outpatientType);
            if (StringUtils.isNoneBlank(jsonObject.get("TWZXFee")==null?"":jsonObject.get("TWZXFee").toString())){
                String chargeType = findOrCreateChargeType(jsonObject.get("TWZXFee").toString(),doctorDO.getName());
                doctorDO.setTwzxChargeType(chargeType);
            }else {
                if (jsonObject.get("TWZXType")!=null) {
                    doctorDO.setTwzxChargeType(jsonObject.get("TWZXType").toString());
                }
            }
            if (StringUtils.isNoneBlank(jsonObject.get("SPZXFee")==null?"":jsonObject.get("SPZXFee").toString())){
                String chargeType = findOrCreateChargeType(jsonObject.get("SPZXFee").toString(),doctorDO.getName());
                doctorDO.setSpzxChargeType(chargeType);
            }else {
                if (jsonObject.get("SPZXType")!=null) {
                    doctorDO.setSpzxChargeType(jsonObject.get("SPZXType").toString());
                }
            }
            if (StringUtils.isNoneBlank(jsonObject.get("TWFZFee")==null?"":jsonObject.get("TWFZFee").toString())){
                String chargeType = findOrCreateChargeType(jsonObject.get("TWFZFee").toString(),doctorDO.getName());
                doctorDO.setTwfzChargeType(chargeType);
            }else {
                if (jsonObject.get("TWFZType")!=null){
                    doctorDO.setTwfzChargeType(jsonObject.get("TWFZType").toString());
                }
            }
            if (StringUtils.isNoneBlank(jsonObject.get("SPFZFee")==null?"":jsonObject.get("SPFZFee").toString())){
                String chargeType = findOrCreateChargeType(jsonObject.get("SPFZFee").toString(),doctorDO.getName());
                doctorDO.setSpfzChargeType(chargeType);
            }else {
                if (jsonObject.get("SPFZType")!=null){
                    doctorDO.setSpfzChargeType(jsonObject.get("SPFZType").toString());
                }
            }
            if (StringUtils.isNoneBlank(jsonObject.get("JYZXFee")==null?"":jsonObject.get("JYZXFee").toString())){
                String chargeType = findOrCreateChargeType(jsonObject.get("JYZXFee").toString(),doctorDO.getName());
                doctorDO.setJyzxChargeType(chargeType);
            }else {
                if (jsonObject.get("JYZXType")!=null){
                    doctorDO.setJyzxChargeType(jsonObject.get("JYZXType").toString());
                }
            }
            if (StringUtils.isNoneBlank(jsonObject.get("XTFZFee")==null?"":jsonObject.get("XTFZFee").toString())){
                String chargeType = findOrCreateChargeType(jsonObject.get("XTFZFee").toString(),doctorDO.getName());
                doctorDO.setXtfzChargeType(chargeType);
            }else {
                if (jsonObject.get("XTFZType")!=null){
                    doctorDO.setXtfzChargeType(jsonObject.get("XTFZType").toString());
                }
            }
        }
        //baseDoctorDao.update(doctorId,introduce,expertise,photo,outpatientType);
        baseDoctorDao.save(doctorDO);
        //删除医生旧专病门诊,保存新专病门诊
        Map<String,Object> params = new HashedMap();
        String sqlTotal ="SELECT " +
@ -487,4 +548,27 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }
    public String findOrCreateChargeType(String fee,String doctorName){
        if (StringUtils.isNoneBlank(fee)){
            double chargeFee = Double.parseDouble(fee);
            WlyyChargeDictDO wlyyChargeDictDO = wlyyChargeDictDao.findByReqFee(chargeFee);
            if (null!=wlyyChargeDictDO){
                return wlyyChargeDictDO.getChargeType();
            }else {
                wlyyChargeDictDO = new WlyyChargeDictDO();
                wlyyChargeDictDO.setCreateTime(new Date());
                wlyyChargeDictDO.setReqFee(chargeFee);
                wlyyChargeDictDO.setChargeType(fee+"");
                wlyyChargeDictDO.setChargeName(doctorName+"创建的号别");
                wlyyChargeDictDO = wlyyChargeDictDao.save(wlyyChargeDictDO);
                return  wlyyChargeDictDO.getChargeType();
            }
        }else {
            return "";
        }
    }
    public List<WlyyChargeDictDO> findChargeDicts(){
        List<WlyyChargeDictDO> wlyyChargeDictDOS =  wlyyChargeDictDao.findByDeptTypeCode("6");
        return wlyyChargeDictDOS;
    }
}

+ 19 - 8
business/base-service/src/main/java/com/yihu/jw/evaluate/score/service/BaseEvaluateScoreService.java

@ -6,6 +6,7 @@ import com.yihu.jw.evaluate.score.dao.BaseEvaluateScoreDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -30,7 +31,8 @@ public class BaseEvaluateScoreService extends BaseJpaService<BaseEvaluateScoreDO
    private BaseEvaluateScoreDao baseEvaluateScoreDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Value("${wechat.id}")
    private String wxId;
    /**
     * 计算总评分,周同比,日环比
@ -70,7 +72,7 @@ public class BaseEvaluateScoreService extends BaseJpaService<BaseEvaluateScoreDO
     * @return
     */
    private Double getAvgScore(String startTime,String endTime,String area,int level){
        String sql = "select count(*) as total, sum(score) as score from base.base_evaluate_score o where ";
        String sql = "select count(*) as total, sum(score) as score from base_evaluate_score o where ";
        if (level == 4){
            sql += " o.doctor IN (SELECT doctor_code FROM `base_doctor_hospital` dh where dh.org_code ='"+area+"' and dh.del=1)";
@ -81,13 +83,22 @@ public class BaseEvaluateScoreService extends BaseJpaService<BaseEvaluateScoreDO
        }else if (level == 6){
            sql += " o.doctor ='"+area+"'";
        }
        if (startTime != null){
            sql += " and o.create_time >='" + startTime + "'";
        }
        if(endTime != null){
            sql += " and o.create_time <='" + endTime + "'";
        if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
            if (startTime != null){
                sql += " and o.create_time >= to_date('" + startTime + "','yyyy-mm-dd hh24:mi:ss')";
            }
            if(endTime != null){
                sql += " and o.create_time <=to_date('" + endTime + "','yyyy-mm-dd hh24:mi:ss')";
            }
        }else {
            if (startTime != null){
                sql += " and o.create_time >='" + startTime + "'";
            }
            if(endTime != null){
                sql += " and o.create_time <='" + endTime + "'";
            }
        }
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sql);
        double total = 0d;
        double score = 0d;

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/dict/WlyyHospitalSysDictDao.java

@ -2,6 +2,7 @@ package com.yihu.jw.hospital.dict;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
@ -18,4 +19,6 @@ public interface WlyyHospitalSysDictDao extends PagingAndSortingRepository<WlyyH
    WlyyHospitalSysDictDO findById(String id);
    List<WlyyHospitalSysDictDO> findByDictName(String dictName);
    @Query("from WlyyHospitalSysDictDO where 1=1")
    List<WlyyHospitalSysDictDO> findAlldict();
}

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

@ -1655,6 +1655,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        "\ta.req_fee as \"spfzFee\",\n" +
                        "\tb.req_fee as \"spzxFee\",\n" +
                        "\tv.req_fee as \"twzxFee\",\n" +
                        "\tg.req_fee as \"jyzxFee\",\n" +
                        "\td.req_fee as \"xtzxFee\"\n" +
                        "FROM\n" +
                        "\tbase_doctor t\n" +
@ -1662,7 +1663,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        "LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" +
                        "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
                        "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
                        "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
                        "LEFT JOIN wlyy_charge_dict d ON t.twzx_charge_type = d.charge_type\n" +
                        " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
                        "WHERE t.id = '"+doctor.get("id")+"' ";
                chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
                /*if (null!=doctor.get("chargeType")){
@ -3601,6 +3603,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "\ta.req_fee as \"spfzFee\",\n" +
                    "\tb.req_fee as \"spzxFee\",\n" +
                    "\tv.req_fee as \"twzxFee\",\n" +
                    "\tg.req_fee as \"jyzxFee\",\n" +
                    "\td.req_fee as \"xtzxFee\"\n" +
                    "FROM\n" +
                    "\tbase_doctor t\n" +
@ -3609,6 +3612,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
                    " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
                    "WHERE t.id = '"+doctorDO.getId()+"' ";
            chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
            rs.put("chargeTypeList",chargeDictDOLists);
@ -3885,6 +3889,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "\ta.req_fee as \"spfzFee\",\n" +
                    "\tb.req_fee as \"spzxFee\",\n" +
                    "\tv.req_fee as \"twzxFee\",\n" +
                    "\tg.req_fee as \"jyzxFee\",\n" +
                    "\td.req_fee as \"xtzxFee\"\n" +
                    "FROM\n" +
                    "\tbase_doctor t\n" +
@ -3893,6 +3898,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
                    " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
                    "WHERE t.id = '"+doctorDO.getId()+"' ";
            chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
            rs.put("chargeTypeList",chargeDictDOLists);
@ -4700,7 +4706,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        } else {
            sql += "date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS timedate_format,";
        }
        sql += "outpatient.disease_img AS \"disease_img\"," +
        sql += " outpatient.disease_img AS \"disease_img\"," +
                "outpatient.description AS \"description\"," +
                "room.reservation_type AS \"reservation_type\"," +
                "outpatient.origin_con_no AS \"origin_con_no\" " +
@ -4740,7 +4746,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            //在线复诊
            sql += " AND room.reservation_type !=3 AND room.consult_type =2";
        } else {
            sql += " AND room.reservation_type !=2";
        }
        if (StringUtils.isNoneBlank(dept)) {
@ -5466,6 +5472,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "\ta.req_fee as \"spfzFee\",\n" +
                    "\tb.req_fee as \"spzxFee\",\n" +
                    "\tv.req_fee as \"twzxFee\",\n" +
                    "\tg.req_fee as \"jyzxFee\",\n" +
                    "\td.req_fee as \"xtzxFee\"\n" +
                    "FROM\n" +
                    "\tbase_doctor t\n" +
@ -5474,6 +5481,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
                    " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
                    "WHERE t.id = '"+map.get("id")+"' ";
            chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
            map.put("chargeTypeList",chargeDictDOLists);
@ -9687,19 +9695,19 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                                }
                                doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
                                if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
                                    if (!doctorDO.getOutpatientType().contains("zj")){
                                        doctorDO.setOutpatientType(doctorDO.getOutpatientType()+",zj");
                                    if (!doctorDO.getOutpatientType().contains("zjsp")){
                                        doctorDO.setOutpatientType(doctorDO.getOutpatientType()+",zjsp");
                                    }
                                }else {
                                    doctorDO.setOutpatientType("zj");
                                    doctorDO.setOutpatientType("zjsp");
                                }
                            }else {
                                if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
                                    if (doctorDO.getOutpatientType().contains("zj")){
                                        doctorDO.getOutpatientType().replace(",zj","");
                                    if (doctorDO.getOutpatientType().contains("zjsp")){
                                        doctorDO.getOutpatientType().replace(",zjsp","");
                                    }
                                }else{
                                    doctorDO.setOutpatientType("zj");
                                    doctorDO.setOutpatientType("zjsp");
                                }
                            }
@ -9785,11 +9793,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        }
                        doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
                        if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())) {
                            if (!doctorDO.getOutpatientType().contains("zj")) {
                                doctorDO.setOutpatientType(doctorDO.getOutpatientType() + ",zj");
                            if (!doctorDO.getOutpatientType().contains("zjsp")) {
                                doctorDO.setOutpatientType(doctorDO.getOutpatientType() + ",zjsp");
                            }
                        }else {
                            doctorDO.setOutpatientType("zj");
                            doctorDO.setOutpatientType("zjsp");
                        }
                    }
                    baseDoctorDao.save(doctorDO);
@ -9807,10 +9815,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "\tt.source as \"source\",\n" +
                "\tt.outpatient_type as \"outpatientType\",\n" +
                "\tt.create_time as \"createTime\",\n" +
                "\th.org_code as \"orgCode\",\n" +
                "\tb.idcard as \"idCard\" \n" +
                "FROM\n" +
                "\twlyy_outpatient t\n" +
                "\tLEFT JOIN base_patient b ON t.patient = b.id where 1=1 ";
                "\tLEFT JOIN base_patient b ON t.patient = b.id " +
                " left join base_doctor_hospital h on t.doctor = h.doctor_code where 1=1 ";
        if (StringUtils.isNoneBlank(startTime)){
            if("xm_ykyy_wx".equals(wechatId)){
                if (flag){
@ -9837,11 +9847,45 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        for (Map<String,Object> map:list){
            if (map.get("createTime")!=null){
                map.put("createTime",DateUtil.dateToStrLong(DateUtil.strToDateLong(map.get("createTime").toString())));
                map.put("orgCode",wechatId);
            }
        }
        return list;
    }
    public com.alibaba.fastjson.JSONObject getWorkDoctorCount(String nowTime,String orgCode){
        String sql = "select count(*) as \"total\",t.doctor as \"doctor\" from wlyy_doctor_work_time t " +
                " left join base_doctor_hospital b on t.doctor = b.doctor_code where 1=1 ";
        if(StringUtils.isNoneBlank(nowTime)){
            if("xm_ykyy_wx".equals(wechatId)){
                if (flag){
                    sql+=" and t.start_time >= '" + nowTime + " 00:00:00' and t.end_time <='"+nowTime+" 23:59:59' ";
                }else {
                    sql+=" and t.start_time >= to_date('" + nowTime + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss') and t.end_time <=to_date('"+nowTime+" 23:59:59', 'yyyy-mm-dd hh24:mi:ss') ";
                }
            }else{
                sql+=" and t.start_time >= '" + nowTime + " 00:00:00' and t.end_time <='"+nowTime+" 23:59:59' ";
            }
        }
        if(StringUtils.isNoneBlank(orgCode)){
            sql+=" and b.org_code ='"+orgCode+"'";
        }
        sql+=" group by t.doctor";
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
        long count =0;
        if(list!=null){
            count = list.size();
        }
        com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
        jsonObject.put("workDoctorCount",count);
        return  jsonObject;
    }
    public List<WlyyHospitalSysDictDO> findAllDict(){
        List<WlyyHospitalSysDictDO> wlyyHospitalSysDictDOS = wlyyHospitalSysDictDao.findAlldict();
        return  wlyyHospitalSysDictDOS;
    }
    public WlyyHospitalSysDictDO findDictById(String dictId){
        WlyyHospitalSysDictDO wlyyHospitalSysDictDOS = wlyyHospitalSysDictDao.findById(dictId);
        return  wlyyHospitalSysDictDOS;
    }
}

+ 76 - 28
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/WorkTimeService.java

@ -7,14 +7,17 @@ import com.yihu.jw.doctor.service.excel.DoctorWorkTimeExcelDO;
import com.yihu.jw.doctor.service.excel.DoctorWorkTimeMainExcelDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.doctor.WlyyDoctorWorkTimeDO;
import com.yihu.jw.entity.hospital.prescription.WlyyHospitalWorkRuleDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.doctor.dao.DoctorWorkTimeDao;
import com.yihu.jw.hospital.prescription.dao.WlyyHospitalWorkRuleDao;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -52,6 +55,8 @@ public class WorkTimeService {
    @Autowired
    private BaseOrgDao baseOrgDao;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    /**
     * 保存排班规则
@ -87,34 +92,77 @@ public class WorkTimeService {
     * @param doctor
     * @return
     */
    public Boolean checkDoctorWork(String doctor){
        String sql = "SELECT " +
                " d.id " +
                " FROM " +
                " base_doctor d " +
                " WHERE " +
                " d.id =:doctor " +
                " AND ( " +
                " EXISTS ( " +
                "  SELECT " +
                "   t.id " +
                "  FROM " +
                "   wlyy_doctor_work_time t " +
                "  WHERE " +
                "   t.doctor = d.id " +
                "  AND t.start_time <=:startTime " +
                "  AND t.end_time >=:endTime" +
                " ) " +
                " OR d.consult_status = '1' " +
                ")";
        Map<String,Object> params = new HashedMap();
        params.put("doctor",doctor);
        Date date = new Date();
        params.put("startTime",date);
        params.put("endTime",date);
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,params);
        if(list!=null&&list.size()>0){
            return true;
    public Boolean checkDoctorWork(String doctor,String ywCode){
        logger.info("当前判断的业务Code:"+ywCode);
        if (StringUtils.isNoneBlank(ywCode)){
            WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById(ywCode);
            String isCheckDoctorWork = "1";
            if (wlyyHospitalSysDictDO!=null){
                isCheckDoctorWork = wlyyHospitalSysDictDO.getDictValue();
            }
            if ("1".equalsIgnoreCase(isCheckDoctorWork)){
                String sql = "SELECT " +
                        " d.id " +
                        " FROM " +
                        " base_doctor d " +
                        " WHERE " +
                        " d.id =:doctor " +
                        " AND ( " +
                        " EXISTS ( " +
                        "  SELECT " +
                        "   t.id " +
                        "  FROM " +
                        "   wlyy_doctor_work_time t " +
                        "  WHERE " +
                        "   t.doctor = d.id " +
                        "  AND t.start_time <=:startTime " +
                        "  AND t.end_time >=:endTime" +
                        " ) " +
                        " OR d.consult_status = '1' " +
                        ")";
                Map<String,Object> params = new HashedMap();
                params.put("doctor",doctor);
                Date date = new Date();
                params.put("startTime",date);
                params.put("endTime",date);
                List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,params);
                if(list!=null&&list.size()>0){
                    return true;
                }else {
                    return false;
                }
            }else {
                return true;
            }
        }else {
            String sql = "SELECT " +
                    " d.id " +
                    " FROM " +
                    " base_doctor d " +
                    " WHERE " +
                    " d.id =:doctor " +
                    " AND ( " +
                    " EXISTS ( " +
                    "  SELECT " +
                    "   t.id " +
                    "  FROM " +
                    "   wlyy_doctor_work_time t " +
                    "  WHERE " +
                    "   t.doctor = d.id " +
                    "  AND t.start_time <=:startTime " +
                    "  AND t.end_time >=:endTime" +
                    " ) " +
                    " OR d.consult_status = '1' " +
                    ")";
            Map<String,Object> params = new HashedMap();
            params.put("doctor",doctor);
            Date date = new Date();
            params.put("startTime",date);
            params.put("endTime",date);
            List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,params);
            if(list!=null&&list.size()>0){
                return true;
            }
        }
        return false;
    }

+ 11 - 3
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -20,6 +20,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -54,6 +55,8 @@ public class StatisticsEsService {
    private BaseCityDao cityDao;
    @Autowired
    private BaseEvaluateScoreService baseEvaluateScoreService;
    @Value("${wechat.id}")
    private String wxId;
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
@ -116,7 +119,12 @@ public class StatisticsEsService {
        object.put("prescriptionRate",prescriptionRate);//开方率
        String startTime = DateUtil.getStringDateShort()+" 00:00:00";
        String endTime = DateUtil.getStringDateShort() +" 23:59:59";
        String sql = "select count(*) as \"total\" from wlyy_consult_oupatient_info o where  o.create_time >='"+startTime+"' and o.create_time <='"+endTime+"'";
        String sql = "";
        if("xm_ykyy_wx".equalsIgnoreCase(wxId)){
            sql = "select count(*) as \"total\" from wlyy_consult_outpatient_info o where  o.create_time >= to_date('"+startTime+"','yyyy-mm-dd hh24:mi:ss') and o.create_time <= to_date('"+endTime+"','yyyy-mm-dd hh24:mi:ss')";
        }else {
            sql = "select count(*) as \"total\" from wlyy_consult_outpatient_info o where  o.create_time >='"+startTime+"' and o.create_time <='"+endTime+"'";
        }
        if (level==4){
            sql += " and o.doctor IN (SELECT doctor_code as \"doctor_code\" FROM `base_doctor_hospital` dh where dh.org_code ='"+area+"' and dh.del=1)";
        }if (level==2){
@ -129,7 +137,7 @@ public class StatisticsEsService {
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sql);
        Long count = 0L;
        if(rstotal!=null&&rstotal.size()>0){
            count = (Long) rstotal.get(0).get("total");
            count =Long.parseLong(rstotal.get(0).get("total").toString()) ;
        }
        object.put("todayOutPatientCount",count);//今日问诊量
        Map<String, Object> scoreAndPercentage = baseEvaluateScoreService.getScoreAndPercentage(area, level);
@ -1091,7 +1099,7 @@ public class StatisticsEsService {
            List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sqlCount);//总人数
            Long total = 0L;
            if(rstotal!=null&&rstotal.size()>0){
                total = (Long) rstotal.get(0).get("total");
                total = Long.parseLong(rstotal.get(0).get("total").toString()) ;
            }
            for (Map<String,Object> map:mapList){
                Integer count = Integer.parseInt(map.get("count").toString());

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

@ -1,5 +1,6 @@
package com.yihu.jw.entity;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
@ -18,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;

+ 12 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorDO.java

@ -276,6 +276,18 @@ public class BaseDoctorDO extends UuidIdentityEntityWithOperator {
     * 协同复诊号别
     */
    private String xtfzChargeType;
    /**
     * 家医咨询号别
     */
    private String jyzxChargeType;
    @Column(name = "jyzx_charge_type")
    public String getJyzxChargeType() {
        return jyzxChargeType;
    }
    public void setJyzxChargeType(String jyzxChargeType) {
        this.jyzxChargeType = jyzxChargeType;
    }
    @Column(name = "YKT_DOCTOR_ID")
    public String getYktDoctorId() {

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

@ -1415,6 +1415,10 @@ public class BaseHospitalRequestMapping {
        public static final String findHospitalInfo = "/findHospitalInfo";
        public static final String synYktZxPrice = "/synYktZxPrice";
        public static final String findHospitalConsultInfo = "/findHospitalConsultInfo";
        public static final String findDictLists = "/findDictLists";
        public static final String findWorkDoctorCount = "/findWorkDoctorCount";
        public static final String findAllDict = "/findAllDict";
        public static final String findDictById = "/findDictById";
    }
    /**

+ 9 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/dao/patient/WlyyHospitalSysDictDao.java

@ -0,0 +1,9 @@
package com.yihu.jw.security.dao.patient;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface WlyyHospitalSysDictDao  extends PagingAndSortingRepository<WlyyHospitalSysDictDO, String>, JpaSpecificationExecutor<WlyyHospitalSysDictDO> {
    WlyyHospitalSysDictDO findDictById(String id);
}

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

@ -4,10 +4,12 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.code.kaptcha.impl.DefaultKaptcha;
import com.google.code.kaptcha.util.Config;
import com.netflix.discovery.converters.Auto;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.login.BaseLoginLogDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.restmodel.ResultStatus;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
@ -16,6 +18,7 @@ import com.yihu.jw.security.dao.OauthKeypairDao;
import com.yihu.jw.security.dao.doctor.BaseDoctorDao;
import com.yihu.jw.security.dao.patient.BasePatientDao;
import com.yihu.jw.security.dao.patient.WechatDao;
import com.yihu.jw.security.dao.patient.WlyyHospitalSysDictDao;
import com.yihu.jw.security.exception.ImgCaptchaException;
import com.yihu.jw.security.login.service.BaseLoginLogService;
import com.yihu.jw.security.model.*;
@ -149,6 +152,8 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    private XzzxService xzzxService;
    @Autowired
    private WechatDao wechatDao;
    @Autowired
    private WlyyHospitalSysDictDao wlyyhospitalSysdictDao;
    @PostConstruct
    private void init() {
@ -174,12 +179,20 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    public ResponseEntity<Oauth2Envelop<WlyyUserSimple>> login(@RequestParam Map<String, String> parameters, HttpSession httpSession) throws Exception {
        logger.info("login:登录进入1");
        //图形验证码验证
        String key = parameters.get("key");
        String text = parameters.get("text");
        if(org.apache.commons.lang3.StringUtils.isNotBlank(key)&& org.apache.commons.lang3.StringUtils.isNotBlank(text)){
            if(!verifyCaptcha(key,text)){
                throw new ImgCaptchaException("img_captcha error");
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyhospitalSysdictDao.findDictById("isNeedPictureCode");
        String isNeedPictureCode = "1";
        if (wlyyHospitalSysDictDO!=null){
            isNeedPictureCode = wlyyHospitalSysDictDO.getDictValue();
        }
        logger.info("isNeedPictureCode:"+isNeedPictureCode);
        if ("1".equalsIgnoreCase(isNeedPictureCode)){
            //图形验证码验证
            String key = parameters.get("key");
            String text = parameters.get("text");
            if(org.apache.commons.lang3.StringUtils.isNotBlank(key)&& org.apache.commons.lang3.StringUtils.isNotBlank(text)){
                if(!verifyCaptcha(key,text)){
                    throw new ImgCaptchaException("img_captcha error");
                }
            }
        }
        logger.info("login:登录进入2");
@ -1720,14 +1733,25 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    public ResponseEntity<Oauth2Envelop<WlyyUserSimple>> ykLogin(@RequestParam Map<String, String> parameters, HttpSession httpSession) throws Exception {
        //图形验证码验证
        String key = parameters.get("key");
        String text = parameters.get("text");
        /*String key = parameters.get("key");
        String text = parameters.get("text");*/
        String captcha = parameters.get("captcha");
        String loginType = parameters.get("login_type");
        String appletCode = parameters.get("appletCode");
        if(org.apache.commons.lang3.StringUtils.isNotBlank(key)&& org.apache.commons.lang3.StringUtils.isNotBlank(text)){
            if(!verifyCaptcha(key,text)){
                throw new ImgCaptchaException("img_captcha error");
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyhospitalSysdictDao.findDictById("isNeedPictureCode");
        String isNeedPictureCode = "1";
        if (wlyyHospitalSysDictDO!=null){
            isNeedPictureCode = wlyyHospitalSysDictDO.getDictValue();
        }
        logger.info("isNeedPictureCode:"+isNeedPictureCode);
        if ("1".equalsIgnoreCase(isNeedPictureCode)){
            //图形验证码验证
            String key = parameters.get("key");
            String text = parameters.get("text");
            if(org.apache.commons.lang3.StringUtils.isNotBlank(key)&& org.apache.commons.lang3.StringUtils.isNotBlank(text)){
                if(!verifyCaptcha(key,text)){
                    throw new ImgCaptchaException("img_captcha error");
                }
            }
        }
        String username = parameters.get("username");
@ -2025,12 +2049,23 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    @RequestMapping(value = "/oauth/ykDoctorlogin", method = RequestMethod.POST)
    public ResponseEntity<Oauth2Envelop<WlyyUserSimple>> ykDoctorlogin(@RequestParam Map<String, String> parameters, HttpSession httpSession) throws Exception {
        logger.info("login:登录进入1");
        //图形验证码验证
        /*//图形验证码验证
        String key = parameters.get("key");
        String text = parameters.get("text");
        if(org.apache.commons.lang3.StringUtils.isNotBlank(key)&& org.apache.commons.lang3.StringUtils.isNotBlank(text)){
            if(!verifyCaptcha(key,text)){
                throw new ImgCaptchaException("img_captcha error");
        String text = parameters.get("text");*/
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyhospitalSysdictDao.findDictById("isNeedPictureCode");
        String isNeedPictureCode = "1";
        if (wlyyHospitalSysDictDO!=null){
            isNeedPictureCode = wlyyHospitalSysDictDO.getDictValue();
        }
        logger.info("isNeedPictureCode:"+isNeedPictureCode);
        if ("1".equalsIgnoreCase(isNeedPictureCode)){
            //图形验证码验证
            String key = parameters.get("key");
            String text = parameters.get("text");
            if(org.apache.commons.lang3.StringUtils.isNotBlank(key)&& org.apache.commons.lang3.StringUtils.isNotBlank(text)){
                if(!verifyCaptcha(key,text)){
                    throw new ImgCaptchaException("img_captcha error");
                }
            }
        }
        logger.info("login:登录进入2");

+ 4 - 3
server/svr-authentication/src/main/java/com/yihu/jw/security/service/YkyyService.java

@ -435,9 +435,10 @@ public class YkyyService {
                            String pw = idcard.substring(idcard.length() - 6);
                            doctor.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
                            doctor.setSalt(salt);
                            doctor.setJobTitleCode(doctorJson.getString("jobtitlecode"));
                            doctor.setJobTitleName(doctorJson.getString("jobTitleName"));
                            if(StringUtils.isNoneBlank(doctorJson.getString("jobtitlecode"))){
                                doctor.setJobTitleCode(doctorJson.getString("jobtitlecode"));
                                doctor.setJobTitleName(doctorJson.getString("jobTitleName"));
                            }
                            doctor.setVerifyCode(verifyCode);
                            doctor.setYktDoctorId(yktDoctorId);
//                            doctor.setExpertise(doctorJson.getString("expertise"));

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

@ -14,6 +14,7 @@ import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleUserDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.*;
@ -674,8 +675,10 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.checkDoctorWork)
    @ApiOperation(value = "判断医生是否在班")
    public ObjEnvelop checkDoctorWork(@ApiParam(name = "doctor", value = "判断医生是否在班")
                                      @RequestParam(value = "doctor",required = true)String doctor) throws Exception{
        return success(workTimeService.checkDoctorWork(doctor));
                                      @RequestParam(value = "doctor",required = true)String doctor,
                                      @ApiParam(name = "ywCode", value = "业务code")
                                      @RequestParam(value = "ywCode",required = false)String ywCode) throws Exception{
        return success(workTimeService.checkDoctorWork(doctor,ywCode));
    }
@ -1215,4 +1218,34 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDictLists)
    @ApiOperation(value = "查询基础号别字典", notes = "查询基础号别字典")
    public ListEnvelop findDictLists() throws Exception{
        return success(baseDoctorService.findChargeDicts());
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findWorkDoctorCount)
    @ApiOperation(value = "查询医生排版数量", notes = "查询医生排版数量")
    public ObjEnvelop<JSONObject> findWorkDoctorCount(
            @ApiParam(name = "nowTime", value = "当前时间 yyyy-MM-dd hh:mm:ss")
            @RequestParam(value = "nowTime", required = false)String nowTime,
            @ApiParam(name = "orgCode", value = "医院code")
            @RequestParam(value = "orgCode", required = false)String orgCode) throws Exception{
        return success(prescriptionService.getWorkDoctorCount(nowTime,orgCode));
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findAllDict)
    @ApiOperation(value = "查询配置字典所有项", notes = "查询配置字典所有项")
    public ListEnvelop<WlyyHospitalSysDictDO> findAllDict() throws Exception{
        return success(prescriptionService.findAllDict());
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDictById)
    @ApiOperation(value = "根据id查询配置字典", notes = "根据id查询配置字典")
        public Envelop findDictById(@ApiParam(name = "dictId", value = "dictId")
                                                                      @RequestParam(value = "dictId", required = true)String dictId) throws Exception{
        return success(prescriptionService.findDictById(dictId));
    }
}

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

@ -1345,8 +1345,10 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.checkDoctorWork)
    @ApiOperation(value = "判断医生是否在班")
    public ObjEnvelop checkDoctorWork(@ApiParam(name = "doctor", value = "判断医生是否在班")
                                      @RequestParam(value = "doctor",required = true)String doctor) throws Exception{
        return success(workTimeService.checkDoctorWork(doctor));
                                      @RequestParam(value = "doctor",required = true)String doctor,
                                      @ApiParam(name = "ywCode", value = "业务code")
                                      @RequestParam(value = "ywCode",required = false) String ywCode) throws Exception{
        return success(workTimeService.checkDoctorWork(doctor,ywCode));
    }
    
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.importDoctorWork)

+ 10 - 0
svr/svr-iot/src/main/java/com/yihu/iot/controller/monitorPlatform/MonitorPlatformController.java

@ -872,4 +872,14 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
        }
    }
    @RequestMapping(value = "savePatientDeviceLocation",method = RequestMethod.POST)
    public Envelop savePatientDeviceLocation(){
        try {
            return success(monitorPlatformService.savePatientDeviceLocation());
        }catch (Exception e){
            e.printStackTrace();
            return MixEnvelop.getError("操作失败");
        }
    }
}

+ 25 - 3
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java

@ -35,6 +35,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.core.geo.GeoPoint;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowCallbackHandler;
@ -255,9 +256,30 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
     * @return
     */
    public List<LocationDataVO> findAllDeviceLocations() throws IOException {
        SearchSourceBuilder queryStr = elasticSearchQueryGenerator.getQueryAllBuilder();
        JestResult esResult = elasticSearchHelper.search(ConstantUtils.deviceLocationIndex,ConstantUtils.deviceLocationType,queryStr.toString());
        return getESResultBeanList(esResult);
        String sql ="select id,idcard idCard,category_code categoryCode,device_sn deviceSn,location,device_time deviceTime,disease_condition diseaseCondition,\n" +
                "create_time createTime,device_name equimentName from device.wlyy_patient_device_location where del=0 ";
        List<Map<String,Object>> result = jdbcTemplate.queryForList(sql);
        List<LocationDataVO> locationDataVOList = new ArrayList<>();
        result.forEach(map->{
            LocationDataVO locationDataVO = new LocationDataVO();
            JSONObject location = JSONObject.parseObject(map.get("location").toString());
            GeoPoint geoPoint = new GeoPoint(Double.parseDouble(location.get("lat").toString()),Double.parseDouble(location.get("lon").toString()));
            locationDataVO.setId(map.get("id").toString());
            locationDataVO.setIdCard(map.get("idCard").toString());
            locationDataVO.setCategoryCode(map.get("categoryCode").toString());
            locationDataVO.setDeviceSn(map.get("deviceSn").toString());
            locationDataVO.setLocation(geoPoint);
            locationDataVO.setDeviceTime(map.get("deviceTime").toString());
            locationDataVO.setLabel(null);
            locationDataVO.setDiseaseCondition(Integer.parseInt(map.get("diseaseCondition").toString()));
            locationDataVO.setCreateTime(map.get("createTime").toString());
            locationDataVO.setCode(null);
            locationDataVO.setEquimentName((String) map.get("equimentName"));
            locationDataVOList.add(locationDataVO);
        });
//        SearchSourceBuilder queryStr = elasticSearchQueryGenerator.getQueryAllBuilder();
//        JestResult esResult = elasticSearchHelper.search(ConstantUtils.deviceLocationIndex,ConstantUtils.deviceLocationType,queryStr.toString());
        return locationDataVOList;
    }
    /**

+ 238 - 81
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -16,14 +16,18 @@ import com.yihu.iot.util.excel.HibenateUtils;
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.entity.iot.equipment.IotEquipmentDetailDO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.util.common.LatitudeUtils;
import com.yihu.jw.util.http.HttpClientUtil;
import io.swagger.annotations.ApiOperation;
import iot.device.LocationDataVO;
import org.apache.http.Consts;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.message.BasicNameValuePair;
import org.apache.jasper.tagplugins.jstl.core.ForEach;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.elasticsearch.core.geo.GeoPoint;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.SqlInOutParameter;
import org.springframework.stereotype.Service;
@ -31,6 +35,7 @@ import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.print.DocFlavor;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.text.DecimalFormat;
@ -86,29 +91,47 @@ public class MonitorPlatformService  {
        MixEnvelop<LocationDataVO, LocationDataVO> envelopTmp = null;
        Integer total = 0;
        if(org.apache.commons.lang.StringUtils.isNotBlank(type)){
            String re = searchpatientdevicesn(type, page, size);
            JSONObject json = JSON.parseObject(re);
            if(json.getInteger("status")==200){
                JSONObject data = json.getJSONObject("data");
                total = data.getInteger("total");
                JSONArray list = data.getJSONArray("list");
                for(int i=0;i<list.size();i++){
                    JSONArray jsonArrayTemp = new JSONArray();
                    JSONObject deviceSn = new JSONObject();
                    deviceSn.put("andOr","or");
                    deviceSn.put("field","deviceSn");
                    deviceSn.put("condition","=");
                    deviceSn.put("value",list.getString(i));
                    jsonArrayTemp.add(deviceSn);
                    JSONObject jsonObject = new JSONObject();
                    jsonObject.put("filter",jsonArrayTemp);
                    jsonObject.put("page",page);
                    jsonObject.put("size",size);
                    List<LocationDataVO> locationDataVOList = iotPatientDeviceService.findDeviceLocationsByIdCard(jsonObject.toString());
                    //figureLabelSerachService.getFigureLabelByList(locationDataVOList);
                    List<LocationDataVO> list2 = iotPatientDeviceService.addNameAndCodeToList(locationDataVOList);
                    envelop.getDetailModelList().addAll(list2);
                }
            JSONObject json = iotSearchPatientDeviceSN(type,page,size,deviceName);
            total = json.getInteger("total");
            JSONArray list = json.getJSONArray("list");
            for(int i=0;i<list.size();i++){
                String sql ="select id, idcard idCard,category_code categoryCode,device_sn deviceSn,location,device_time deviceTime,disease_condition diseaseCondition,\n" +
                        "create_time createTime,device_name equimentName from device.wlyy_patient_device_location where del=0 and  device_sn='"+list.getString(i)+"'";
                List<Map<String,Object>> result = jdbcTemplate.queryForList(sql.toString());
                List<LocationDataVO> locationDataVOList = new ArrayList<>();
                result.forEach(map->{
                    LocationDataVO locationDataVO = new LocationDataVO();
                    JSONObject location = JSONObject.parseObject(map.get("location").toString());
                    GeoPoint geoPoint = new GeoPoint(Double.parseDouble(location.get("lat").toString()),Double.parseDouble(location.get("lon").toString()));
                    locationDataVO.setId(map.get("id").toString());
                    locationDataVO.setIdCard(map.get("idCard").toString());
                    locationDataVO.setCategoryCode(map.get("categoryCode").toString());
                    locationDataVO.setDeviceSn(map.get("deviceSn").toString());
                    locationDataVO.setLocation(geoPoint);
                    locationDataVO.setDeviceTime(map.get("deviceTime").toString());
                    locationDataVO.setLabel(null);
                    locationDataVO.setDiseaseCondition(Integer.parseInt(map.get("diseaseCondition").toString()));
                    locationDataVO.setCreateTime(map.get("createTime").toString());
//                    locationDataVO.setName(ConcealUtil.nameOrAddrConceal(map.get("name").toString()));
                    locationDataVO.setCode(null);
                    locationDataVO.setEquimentName((String) map.get("equimentName"));
                    locationDataVOList.add(locationDataVO);
                });
//                JSONArray jsonArrayTemp = new JSONArray();
//                JSONObject deviceSn = new JSONObject();
//                deviceSn.put("andOr","or");
//                deviceSn.put("field","deviceSn");
//                deviceSn.put("condition","=");
//                deviceSn.put("value",list.getString(i));
//                jsonArrayTemp.add(deviceSn);
//                JSONObject jsonObject = new JSONObject();
//                jsonObject.put("filter",jsonArrayTemp);
//                jsonObject.put("page",page);
//                jsonObject.put("size",size);
//                List<LocationDataVO> locationDataVOList = iotPatientDeviceService.findDeviceLocationsByIdCard(jsonObject.toString());
                //figureLabelSerachService.getFigureLabelByList(locationDataVOList);
                List<LocationDataVO> list2 = iotPatientDeviceService.addNameAndCodeToList(locationDataVOList);
                envelop.getDetailModelList().addAll(list2);
            }
            envelop.setTotalCount(total);
            return envelop;
@ -136,66 +159,144 @@ public class MonitorPlatformService  {
                        envelop.getDetailModelList().addAll(euipmentList);
                    }
                }
                for (String categoryCode:categoryCodes){
                    JSONObject json = new JSONObject();
                    JSONArray jsonArray = new JSONArray();
                    if(diseaseCondition!=null){
                        json.put("andOr","and");
                        json.put("field","diseaseCondition");
                        json.put("condition","=");
                        json.put("value",diseaseCondition);
                        jsonArray.add(json);
                    }
                     if(!"5".equals(categoryCode)){
                         json = new JSONObject();
                         List<String> listTmp = new ArrayList<>();
                         if (org.apache.commons.lang3.StringUtils.isNoneBlank(deviceName)){
                             String[] deviceNames = deviceName.split(",");
                             for (String tmp :deviceNames){
                                 String sql="select DISTINCT device_code from device.wlyy_devices wd INNER JOIN wlyy.wlyy_patient_device pd on pd.device_sn = wd.device_code  where wd.device_name like '%"+tmp+"%' and pd.del=0  ";
                                 List<String> tmpList = jdbcTemplate.queryForList(sql,String.class);
                                 listTmp.addAll(tmpList);
                             }
                             if (listTmp.size()!=0){
                                 json.put("andOr","and");
                                 json.put("field","deviceSn");
                                 json.put("condition","in");
                                 json.put("value",listTmp);
                                 jsonArray.add(json);
                             }
                         }
                         else{
                             String sql="select DISTINCT device_code from device.wlyy_devices wd INNER JOIN wlyy.wlyy_patient_device pd on pd.device_sn = wd.device_code where 1=1 and pd.del=0 ";
                             if (org.apache.commons.lang3.StringUtils.isNoneBlank(deviceType)){
                                 sql+="and pd.category_code in ('"+deviceType.replace(",","','")+"') ";
                             }
                             List<String> tmpList = jdbcTemplate.queryForList(sql,String.class);
                             json.put("andOr","and");
                             json.put("field","deviceSn");
                             json.put("condition","in");
                             json.put("value",tmpList);
                             jsonArray.add(json);
                         }
                         JSONObject jsonObject = new JSONObject();
                         jsonObject.put("filter",jsonArray);
                         jsonObject.put("page",page);
                         jsonObject.put("size",size);
                         if (jsonArray.size()!=0){
                             List<LocationDataVO> locationDataVOList = iotPatientDeviceService.findDeviceLocationsByIdCard(jsonObject.toString());
                             List<LocationDataVO> list2 = iotPatientDeviceService.addNameAndCodeToList(locationDataVOList);
                             //figureLabelSerachService.getFigureLabelByList(locationDataVOList);
                             envelop.getDetailModelList().addAll(list2);
                           totalCount += iotPatientDeviceService.getESCount(jsonObject.toString());
                         }
                     }
                     break;
                StringBuffer sql = new StringBuffer("select id,idcard idCard,category_code categoryCode,device_sn deviceSn,location,device_time deviceTime,disease_condition diseaseCondition,\n" +
                        "create_time createTime,device_name equimentName\n" +
                        "from device.wlyy_patient_device_location  ");
                StringBuffer sqlCounts = new StringBuffer("select count(*) from device.wlyy_patient_device_location ");
                StringBuffer sqlCondition  = new StringBuffer("where del=0 ");
                if (diseaseCondition!=null){
                    sqlCondition.append(" and disease_condition ="+diseaseCondition);
                }
                if (org.apache.commons.lang3.StringUtils.isNoneBlank(deviceType)){
                    sqlCondition.append(" and category_code in('").append(deviceType.replace(",","','")).append("') ");
                }
                if (org.apache.commons.lang3.StringUtils.isNoneBlank(deviceName)){
                    sqlCondition.append(" and device_name in ('").append(deviceName.replace(",","','")).append("') ");
                }
                sql.append(sqlCondition);
                sqlCounts.append(sqlCondition);
                sql.append( " limit "+(page-1)*size+","+page*size);
                totalCount = jdbcTemplate.queryForObject(sqlCounts.toString(),Integer.class);
                List<Map<String,Object>> result = jdbcTemplate.queryForList(sql.toString());
                List<LocationDataVO> locationDataVOList = new ArrayList<>();
                result.forEach(map->{
                    LocationDataVO locationDataVO = new LocationDataVO();
                    JSONObject location = JSONObject.parseObject(map.get("location").toString());
                    GeoPoint geoPoint = new GeoPoint(Double.parseDouble(location.get("lat").toString()),Double.parseDouble(location.get("lon").toString()));
                    locationDataVO.setId(map.get("id").toString());
                    locationDataVO.setIdCard(map.get("idCard").toString());
                    locationDataVO.setCategoryCode(map.get("categoryCode").toString());
                    locationDataVO.setDeviceSn(map.get("deviceSn").toString());
                    locationDataVO.setLocation(geoPoint);
                    locationDataVO.setDeviceTime(map.get("deviceTime").toString());
                    locationDataVO.setLabel(null);
                    locationDataVO.setDiseaseCondition(Integer.parseInt(map.get("diseaseCondition").toString()));
                    locationDataVO.setCreateTime(map.get("createTime").toString());
//                    locationDataVO.setName(ConcealUtil.nameOrAddrConceal(map.get("name").toString()));
                    locationDataVO.setCode(null);
                    locationDataVO.setEquimentName((String) map.get("equimentName"));
                    locationDataVOList.add(locationDataVO);
                });
                List<LocationDataVO> list2 = iotPatientDeviceService.addNameAndCodeToList(locationDataVOList);
                envelop.getDetailModelList().addAll(list2);
//                for (String categoryCode:categoryCodes){
//                    JSONObject json = new JSONObject();
//                    JSONArray jsonArray = new JSONArray();
//                    if(diseaseCondition!=null){
//                        json.put("andOr","and");
//                        json.put("field","diseaseCondition");
//                        json.put("condition","=");
//                        json.put("value",diseaseCondition);
//                        jsonArray.add(json);
//                    }
//                     if(!"5".equals(categoryCode)){
//                         json = new JSONObject();
//                         List<String> listTmp = new ArrayList<>();
//                         if (org.apache.commons.lang3.StringUtils.isNoneBlank(deviceName)){
//                             String[] deviceNames = deviceName.split(",");
//                             for (String tmp :deviceNames){
//                                 String sql="select DISTINCT device_code  from device.wlyy_devices wd   where wd.device_name like '%"+tmp+"%'  ";
//                                 List<String> tmpList = jdbcTemplate.queryForList(sql,String.class);
//                                 listTmp.addAll(tmpList);
//                             }
//                             if (listTmp.size()!=0){
//                                 json.put("andOr","and");
//                                 json.put("field","deviceSn");
//                                 json.put("condition","in");
//                                 json.put("value",listTmp);
//                                 jsonArray.add(json);
//                             }
//                         }
//                         else{
//                            if(!"5".equals(categoryCode)) {
//                                json.put("andOr", "and");
//                                json.put("field", "categoryCode");
//                                json.put("condition", "=");
//                                json.put("value", Integer.parseInt(categoryCode));
//                                jsonArray.add(json);
//                            }
//                         }
//                         JSONObject jsonObject = new JSONObject();
//                         jsonObject.put("filter",jsonArray);
//                         jsonObject.put("page",page);
//                         jsonObject.put("size",size);
//                         if (jsonArray.size()!=0){
//                             List<LocationDataVO> locationDataVOList = iotPatientDeviceService.findDeviceLocationsByIdCard(jsonObject.toString());
//                             List<LocationDataVO> list2 = iotPatientDeviceService.addNameAndCodeToList(locationDataVOList);
//                             //figureLabelSerachService.getFigureLabelByList(locationDataVOList);
//                             envelop.getDetailModelList().addAll(list2);
//                           totalCount += iotPatientDeviceService.getESCount(jsonObject.toString());
//                         }
//                     }
//                     if (org.apache.commons.lang3.StringUtils.isNoneBlank(deviceName)){
//                         break;
//                     }
//                }
            }
            envelop.setTotalCount(totalCount>totalEqCount?totalCount:totalEqCount);
            return envelop;
        }
    }
    public com.alibaba.fastjson.JSONObject iotSearchPatientDeviceSN(String type,Integer page,Integer pageSize,String deviceName){
        if(page != 0){
            page = page - 1;
        }
        StringBuffer sql = new StringBuffer("select t.device_sn from");
        sql.append("  ( SELECT DISTINCT d.* FROM wlyy.wlyy_patient_device d, wlyy.wlyy_sign_family f WHERE f.`status` > 0 AND f.patient = d.`user`  ");
        if (org.apache.commons.lang3.StringUtils.isNoneBlank(deviceName)){
            sql.append("and d.device_name in ('").append(deviceName.replace(",","','")).append("') ");
        }
        sql.append("  ) t, wlyy.wlyy_patient p " );
        sql.append("  LEFT JOIN wlyy.wlyy_sign_patient_label_info l on  p. CODE = l.patient");
        sql.append("   and l.`status`=1 AND l.label_type = 3 and l.label='"+type+"'");
        sql.append(" WHERE t.user = p. CODE limit "+page+","+pageSize);
        List<String> list = jdbcTemplate.queryForList(sql.toString(),String.class);
        Integer count = 0;
        StringBuffer countsql = new StringBuffer("select count(t.device_sn) total from");
        countsql.append("  ( SELECT DISTINCT d.* FROM wlyy.wlyy_patient_device d, wlyy.wlyy_sign_family f WHERE f.`status` > 0 AND f.patient = d.`user`  ");
        if (org.apache.commons.lang3.StringUtils.isNoneBlank(deviceName)){
            countsql.append("and d.device_name in ('").append(deviceName.replace(",","','")).append("') ");
        }
        countsql.append("   ) t,wlyy.wlyy_patient p " );
        countsql.append("  LEFT JOIN wlyy.wlyy_sign_patient_label_info l on  p. CODE = l.patient");
        countsql.append("   and l.`status`=1 AND l.label_type = 3 and l.label='"+type+"'");
        countsql.append(" WHERE t.user = p. CODE ");
        count = jdbcTemplate.queryForObject(countsql.toString(),Integer.class);
        com.alibaba.fastjson.JSONObject result = new com.alibaba.fastjson.JSONObject();
        result.put("total",count);
        result.put("list",list);
        return result;
    }
    /**
     * 根据病种类型,搜索已绑定设备的居民设备SN码
     * 类型(1高血压 2糖尿病)
@ -1027,15 +1128,26 @@ public class MonitorPlatformService  {
                jsonObject.put("filter",jsonArray1);
                jsonObject.put("page",1);
                jsonObject.put("size",5);
                List<LocationDataVO> list = null;
                String sqlLocation = "select idcard idCard,category_code categoryCode,device_sn deviceSn,location,device_time deviceTime,disease_condition diseaseCondition,\n" +
                        "create_time createTime,device_name equimentName\n" +
                        "from device.wlyy_patient_device_location where del=0 and  device_sn='"+deviceSn+"' limit 0,5 ";
                try {
                    list = iotPatientDeviceService.findDeviceLocationsBySn(jsonObject.toString());
                    if(list.size()>0){
                        data.put("locationData",list.get(0).getLocation());
                        data.put("diseaseCondition",list.get(0).getDiseaseCondition());
                    List<Map<String,Object>> locationDataVOList = jdbcTemplate.queryForList(sqlLocation);
                    JSONObject location = JSONObject.parseObject(locationDataVOList.get(0).get("location").toString());
                    if(locationDataVOList.size()>0){
                        data.put("locationData",location);
                        data.put("diseaseCondition",Integer.parseInt(locationDataVOList.get(0).get("diseaseCondition").toString()));
                    }else{
                        data.put("locationData","{}");
                    }
//                    list = iotPatientDeviceService.findDeviceLocationsBySn(jsonObject.toString());
//                    if(list.size()>0){
//                        data.put("locationData",list.get(0).getLocation());
//                        data.put("diseaseCondition",list.get(0).getDiseaseCondition());
//                    }else{
//                        data.put("locationData","{}");
//                    }
                }catch (Exception e){
                    e.printStackTrace();
                }
@ -1612,4 +1724,49 @@ public class MonitorPlatformService  {
        return deviceName;
    }
    public JSONObject savePatientDeviceLocation(){
        String sql = "select DISTINCT pd.category_code ,pd.czrq create_time,pd.device_sn ,pd.device_name, p.disease_condition ,p.`code`,p.idcard ,p.address,sf.hospital_name\n" +
                "from  wlyy.wlyy_patient_device pd \n" +
                "INNER JOIN wlyy.wlyy_sign_family sf on pd.`user` = sf.patient and sf.`status`>0 \n" +
                "INNER JOIN wlyy.wlyy_patient p on p.idcard = sf.idcard and p.`status`=1\n" +
                "where  pd.del=0 and pd.category_code in (1,2)";
//        sql="select * from device.wlyy_patient_device_location_tmp";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        list.forEach(map->{
            try {
                if(map.get("disease_condition")==null){
                    //未定标的居民设置成-1
                    map.put("disease_condition","-1");
                }
                Map<String, String> json = null;
                if (map.get("address")!=null){
                    if (org.apache.commons.lang3.StringUtils.isNoneBlank(map.get("address").toString())) {
                        json = LatitudeUtils.getGeocoderLatitude(map.get("address").toString().replace("G.", "").replace("(糖友网)", "").replace("(高友网)", ""));
                    }
                }
                if (json==null||map.get("address")==null){
                    if (map.get("hospital_name")!=null){
                        if (!org.apache.commons.lang3.StringUtils.isNoneBlank(map.get("hospital_name").toString())) {
                            json = LatitudeUtils.getGeocoderLatitude(("福建省厦门市"+map.get("hospital_name").toString()).replace("G.", "").replace("(糖友网)", "").replace("(高友网)", ""));
                        }
                    }
                }
                if (json !=null) {
                    JSONObject location = new JSONObject();
                    location.put("lat", Double.valueOf(json.get("lat")));
                    location.put("lon", Double.valueOf(json.get("lng")));
                    String insertSql = "INSERT INTO device.wlyy_patient_device_location(patient,idcard,disease_condition,device_sn,\n" +
                            "device_name,category_code,device_time,create_time,location)\n" +
                            "VALUES('" + map.get("code").toString() + "','" + map.get("idcard").toString() + "','" + map.get("disease_condition").toString() + "','" + map.get("device_sn").toString() + "','" + map.get("device_name") + "',\n" +
                            "'" + map.get("category_code").toString() + "','" + map.get("create_time") + "','" + map.get("create_time").toString() + "','" + location.toJSONString() + "')\n";
                    jdbcTemplate.execute(insertSql);
                }
            }catch (Exception e){
                System.out.println(map.get("device_sn").toString()+"-----"+map.get("idcard").toString());
                e.printStackTrace();
            }
        });
        return null;
    }
}

+ 1 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java

@ -1429,7 +1429,7 @@ public class RehabilitationManageService {
        Integer allCount = rehabilitationDetailDao.findAllByPlanId(planId);//计划总服务项目数
        Integer finishedCount = rehabilitationDetailDao.findByStatusAndPlanId(1,planId);
        PatientRehabilitationPlanDO p =patientRehabilitationPlanDao.findById(planId);
        SpecialistPatientRelationDO specialistPatientRelationDO = specialistPatientRelationDao.findByTeamCodeAndPatient(p.getTeamCode(), p.getPatient());
        SpecialistPatientRelationDO specialistPatientRelationDO = specialistPatientRelationDao.findByDoctorAndPatient(p.getCreateUser(), p.getPatient());
        resultMap.put("allCount",allCount);
        resultMap.put("finishedCount",finishedCount);
        resultMap.put("specialistPatientRelationDO",specialistPatientRelationDO);