Переглянути джерело

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

# Conflicts:
#	svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/wechat/WechatMenuController.java
wangzhinan 4 роки тому
батько
коміт
eb2aa19bff

+ 10 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OutpatientDao.java

@ -45,9 +45,19 @@ public interface OutpatientDao extends PagingAndSortingRepository<WlyyOutpatient
    @Query("from WlyyOutpatientDO a where a.generalDoctor = ?1 and a.registerDate >=?2 and a.registerDate <=?3 and a.status = ?4 and a.doctor is not null order by registerDate ASC")
    List<WlyyOutpatientDO> findByGeneralDoctor(String generalDoctor, Date startDate,Date endDate,String status);
    @Query("from WlyyOutpatientDO a where a.generalDoctor = ?1 and a.registerDate >=?2 and a.registerDate <=?3 and a.status in(?4) and a.doctor is not null order by registerDate ASC")
    List<WlyyOutpatientDO> findByGeneralDoctorAndStatusAndDate(String generalDoctor, Date startDate,Date endDate,String status);
    @Query("from WlyyOutpatientDO a where a.generalDoctor = ?1 and a.status in(?2) and a.doctor is not null order by registerDate ASC")
    List<WlyyOutpatientDO> findByGeneralDoctorAndStatus(String generalDoctor,String status);
    @Query("from WlyyOutpatientDO a where a.status in(1,2) and a.payStatus = 1")
    List<WlyyOutpatientDO> findByStatus();
    @Query("from WlyyOutpatientDO a where a.status in(1,2) and a.payStatus = 1 and a.outpatientType=?1 and a.registerDate <=?2")
    List<WlyyOutpatientDO> findOutpatientListByOutpatientType(String outpatientType,Date endDate);
    @Query("from WlyyOutpatientDO a where a.status in(1,2) and a.payStatus = 1 and a.createTime<'2020-08-31 23:59:59'")
    List<WlyyOutpatientDO> findPreviousByStatus();
    List<WlyyOutpatientDO> findByDoctorAndCreateTimeAndPatientCancelRemark(String doctor,Date createTime,String patientCancelRemark);

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

@ -9117,4 +9117,53 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    public com.alibaba.fastjson.JSONObject selectHospitalInfo(String doctorId){
        /**
         * 1、今日待就诊:今日当前家庭医生在当前医院的未完成的协同门诊书
         2、下一次就诊时间:当前家庭医生在当前医院下一次未接诊的就诊时间。
         3、服务评分:当前医院的综合服务评分
         4、在线医生:当前医院在班的专科医生数
         5、可预约医生:当前医院有开通协同门诊业务的医生数(包含当前在线)
         6、累计就诊:当前医院累计协同门诊的已接诊数量
         */
        Date startTime  = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 00:00:00");
        Date endTime  = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 23:59:59");
        com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
        // 1、今日待就诊:今日当前家庭医生在当前医院的未完成的协同门诊书
        List<WlyyOutpatientDO> outpatientDOS =  outpatientDao.findByGeneralDoctorAndStatusAndDate(doctorId,startTime,endTime,"0,1,2");
        jsonObject.put("NowWaitTotal",outpatientDOS.size());
        //2、下一次就诊时间:当前家庭医生在当前医院下一次未接诊的就诊时间。
        List<WlyyOutpatientDO> outpatientDOList =  outpatientDao.findByGeneralDoctorAndStatus(doctorId,"0");
        if (outpatientDOList!=null&&outpatientDOList.size()!=0){
            jsonObject.put("nextTime",DateUtil.dateToStrLong(outpatientDOList.get(0).getRegisterDate()));
        }else {
            jsonObject.put("nextTime",null);
        }
        //3、服务评分:当前医院的综合服务评分
        //在线医生:当前医院在班的专科医生数
        String sql ="SELECT d.* FROM base_doctor d WHERE (EXISTS (SELECT 1 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("startTime",startTime);
        params.put("endTime",endTime);
        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, params);
        jsonObject.put("onlineDoctors",list.size());
        //可预约医生:当前医院有开通协同门诊业务的医生数(包含当前在线)
        sql += " AND outpatient_type IN('xt') ";
        List<Map<String, Object>> specialist = hibenateUtils.createSQLQuery(sql, params);
        jsonObject.put("xtOnlineDoctors",specialist.size());
        //累计就诊:当前医院累计协同门诊的已接诊数量
        List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findOutpatientListByOutpatientType("xt",new Date());
        jsonObject.put("xtOupatients",wlyyOutpatientDOList.size());
        return jsonObject;
    }
}

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

@ -1406,6 +1406,7 @@ public class BaseHospitalRequestMapping {
        public static final String findPrivateDict  = "/findPrivateDict";
        public static final String savePrivateDict = "/savePrivateDict";
        public static final String delPrivateDict = "/delPrivateDict";
        public static final String findHospitalInfo = "/findHospitalInfo";
    }
    /**

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

@ -18,6 +18,7 @@ import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO;
import com.yihu.jw.es.service.StatisticsEsService;
import com.yihu.jw.hospital.dao.consult.KnowledgeArticleUserDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.httplog.service.WlyyHttpLogService;
@ -161,6 +162,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    private WlyyHttpLogService wlyyHttpLogService;
    @Autowired
    private HospitalSystemMessageService hospitalSystemMessageService;
    @Autowired
    private StatisticsEsService statisticsEsService;
@ -1098,4 +1101,28 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
        return wlyyHttpLogService.findLog(startTime,endTime,interfaceName,patient,doctor,page,pageSize);
    }
    @PostMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findHospitalInfo)
    @ApiOperation(value = "查询医院统计信息", notes = "查询医院统计信息")
    public ObjEnvelop selectHospitalInfo(@ApiParam(name = "doctorId", value = "医生id")
                                          @RequestParam(value = "doctorId", required = false)String doctorId) throws Exception{
        JSONObject object = prescriptionService.selectHospitalInfo(doctorId);
        String date = DateUtil.getStringDateShort();
        //服务评分
        JSONObject jsonObject = statisticsEsService.getScoreList(null,date,2,"350200","4");
        if (jsonObject!=null){
            com.alibaba.fastjson.JSONArray array  = jsonObject.getJSONArray("resultList");
            if (array!=null&&array.size()!=0){
                JSONObject object1 = array.getJSONObject(0);
                object.put("scoreRate",object1.getString("scoreRate"));
            }else {
                object.put("scoreRate",null);
            }
        }else {
            object.put("scoreRate",null);
        }
        return success(object);
    }
}