Pārlūkot izejas kodu

互联网医院

Trick 5 gadi atpakaļ
vecāks
revīzija
d226b31e61

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

@ -670,7 +670,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param dept
     * @return
     */
    public List<Map<String,Object>> findDoctorByHospitalAndDept(String orgCode,String dept,String chargeType,String doctorCode,String outpatientType){
    public List<Map<String,Object>> findDoctorByHospitalAndDept(String orgCode,String dept,String chargeType,String doctorCode,String outpatientType,String startDate,String endDate){
        String sql ="SELECT " +
                " d.id, " +
                " d.photo, " +
@ -696,6 +696,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }else{
            sql+=" AND d.outpatient_type is not null ";
        }
        if(StringUtils.isNotBlank(endDate)&&StringUtils.isNotBlank(startDate)){
            sql+=" AND EXISTS ( " +
                    " SELECT " +
                    "  1 " +
                    " FROM " +
                    "  wlyy_doctor_work_time t " +
                    " WHERE " +
                    "  t.doctor = d.id " +
                    " AND t.start_time >='" +startDate+"'" +
                    " AND t.start_time <='"+endDate+"'"+
                    " )";
        }
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        if(list!=null&&list.size()>0&&StringUtils.isNotBlank(doctorCode)){
@ -717,7 +729,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param dept
     * @return
     */
    public MixEnvelop findDoctorWithWork(String orgCode,String dept,String chargeType,String doctorCode,String outpatientType,Integer page,Integer size){
    public MixEnvelop findDoctorWithWork(String orgCode,String dept,String chargeType,String doctorCode,String outpatientType,String startDate,String endDate,Integer page,Integer size){
        String totalSql ="SELECT " +
                " count(1) AS total " +
@ -735,6 +747,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }else{
            totalSql+=" AND d.outpatient_type is not null ";
        }
        if(StringUtils.isNotBlank(endDate)&&StringUtils.isNotBlank(startDate)){
            totalSql+=" AND EXISTS ( " +
                    " SELECT " +
                    "  1 " +
                    " FROM " +
                    "  wlyy_doctor_work_time t " +
                    " WHERE " +
                    "  t.doctor = d.id " +
                    " AND t.start_time >='" +startDate+"'" +
                    " AND t.start_time <='"+endDate+"'"+
                    " )";
        }
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
        Long count = 0L;
@ -769,6 +793,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }else{
            sql+=" AND d.outpatient_type is not null ";
        }
        if(StringUtils.isNotBlank(endDate)&&StringUtils.isNotBlank(startDate)){
            sql+=" AND EXISTS ( " +
                    " SELECT " +
                    "  1 " +
                    " FROM " +
                    "  wlyy_doctor_work_time t " +
                    " WHERE " +
                    "  t.doctor = d.id " +
                    " AND t.start_time >='" +startDate+"'" +
                    " AND t.start_time <='"+endDate+"'"+
                    " )";
        }
        sql += " LIMIT " + (page - 1) * size + "," + size + "";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        if(list!=null&&list.size()>0){
@ -1523,6 +1559,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            rs.put("jobTitleName",doctorDO.getJobTitleName());
            rs.put("chargeType",doctorDO.getChargeType());
            rs.put("photo",doctorDO.getPhoto());
            rs.put("consultStatus",doctorDO.getConsultStatus());
            //机构科室信息
            List<BaseDoctorHospitalDO> hospitalDOs =  baseDoctorHospitalDao.findByDoctorCode(doctorDO.getId());

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

@ -200,8 +200,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                                   @ApiParam(name = "doctorCode", value = "需要置顶医生")
                                                   @RequestParam(value = "doctorCode", required = false)String doctorCode,
                                                   @ApiParam(name = "outpatientType", value = "1图文,2视频")
                                                   @RequestParam(value = "outpatientType", required = false)String outpatientType) {
        return success(prescriptionService.findDoctorByHospitalAndDept(orgCode,dept,chargeType,doctorCode,outpatientType));
                                                   @RequestParam(value = "outpatientType", required = false)String outpatientType,
                                                   @ApiParam(name = "startDate", value = "开始时间,yyyy-MM-dd HH:mm:ss")
                                                   @RequestParam(value = "startDate", required = false)String startDate,
                                                   @ApiParam(name = "endDate", value = "结束时间,yyyy-MM-dd HH:mm:ss")
                                                   @RequestParam(value = "endDate", required = false)String endDate) {
        return success(prescriptionService.findDoctorByHospitalAndDept(orgCode,dept,chargeType,doctorCode,outpatientType,startDate,endDate));
    }
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.appointmentRevisit)
@ -339,12 +343,16 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "chargeType", required = false)String chargeType,
                                         @ApiParam(name = "outpatientType", value = "1图文,2视频")
                                         @RequestParam(value = "outpatientType", required = false)String outpatientType,
                                         @ApiParam(name = "startDate", value = "开始时间,yyyy-MM-dd HH:mm:ss")
                                         @RequestParam(value = "startDate", required = false)String startDate,
                                         @ApiParam(name = "endDate", value = "结束时间,yyyy-MM-dd HH:mm:ss")
                                         @RequestParam(value = "endDate", required = false)String endDate,
                                         @ApiParam(name = "page", value = "第几页")
                                         @RequestParam(value = "page", required = true)Integer page,
                                         @ApiParam(name = "size", value = "每页大小")
                                         @RequestParam(value = "size", required = true)Integer size) {
        return success(prescriptionService.findDoctorWithWork(orgCode,dept,chargeType,doctorCode,outpatientType,page,size));
        return success(prescriptionService.findDoctorWithWork(orgCode,dept,chargeType,doctorCode,outpatientType,startDate,endDate,page,size));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorWithMouthWork)