Browse Source

新增热门医生查询总数和医生欢迎度新增接口

wangjun 4 years ago
parent
commit
570b6c16af

+ 9 - 0
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorInfoService.java

@ -6,6 +6,7 @@ import com.yihu.jw.doctor.dao.DoctorSpecialDiseaseDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.DoctorSpecialDiseaseDo;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.message.BaseBannerDoctorDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
@ -372,4 +373,12 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
        List<BaseDoctorDO> doctors = baseDoctorDao.findByIdcard(idcard);
        return doctors;
    }
    public BaseDoctorDO popularityIncrease(String doctor){
        BaseDoctorDO baseDoctorDO=baseDoctorDao.findById(doctor);
        if (null!=baseDoctorDO){
            baseDoctorDO.setPopularity(baseDoctorDO.getPopularity()+1);
        }
        baseDoctorDO = baseDoctorDao.save(baseDoctorDO);
        return baseDoctorDO;
    }
}

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

@ -3096,6 +3096,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            rs.put("visitDept",doctorDO.getVisitDept());
            rs.put("learning",doctorDO.getLearning());
            rs.put("sex",doctorDO.getSex());
            rs.put("popularity",doctorDO.getPopularity());
            //机构科室信息
            List<BaseDoctorHospitalDO> hospitalDOs = baseDoctorHospitalDao.findByDoctorCode(doctorDO.getId());
@ -4436,7 +4437,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param consutlSort
     * @return
     */
    public List<Map<String, Object>> findDoctorByHospitalAndDiseaseAndDept(String iswork, String patientid, String orgCode, String dept,
    public MixEnvelop findDoctorByHospitalAndDiseaseAndDept(String iswork, String patientid, String orgCode, String dept,
                                                                           String diseaseKey, String doctorNameKey,
                                                                           String jobTitleNameKey, String outpatientType,
                                                                           String keyName, String workingTime, String consultStatus, String chargType, String consutlSort, String isAttention, Integer page, Integer pagesize) {
@ -4583,13 +4584,22 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        sql += " and d.del='1' order by a.total " + consutlSort;
        String sqlCount = "select count(1) as \"total\" from ( "+sql+" ) t";
        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, params, page, pagesize);
        List<Map<String, Object>> listCount = hibenateUtils.createSQLQuery(sqlCount, params);
        Long count = 0L;
        if(listCount!=null){
            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
            count = hibenateUtils.objTransformLong(listCount.get(0).get("total"));
        }
        logger.info("findDoctorByHospitalAndDiseaseAndDept end:" + DateUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss:SSS"));
        logger.info("sql:" + sql);
        return list;
        MixEnvelop envelop =new MixEnvelop();
        envelop.setDetailModelList(list);
        envelop.setTotalCount(count.intValue());
        envelop.setPageSize(pagesize);
        envelop.setCurrPage(page);
        return envelop;
    }
    /**

+ 13 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorDO.java

@ -235,8 +235,20 @@ public class BaseDoctorDO extends UuidIdentityEntityWithOperator {
     * 学术背景
     */
    private String learning;
    /**
     * 人气值
     */
    private Integer popularity;
    @Column(name = "popularity")
    public Integer getPopularity() {
        return popularity;
    }
    public void setPopularity(Integer popularity) {
        this.popularity = popularity;
    }
	@Column(name = "password")
    @Column(name = "password")
    public String getPassword() {
        return password;
    }

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

@ -476,6 +476,7 @@ public class BaseHospitalRequestMapping {
        public static final String findProvince="/findProvince";
        public static final String findCity="/findCity";
        public static final String findPatientOpenId="/findPatientOpenId";
        public static final String popularityIncrease="/popularityIncrease";
        public static final String selectByUrl="/selectByUrl";

+ 19 - 18
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -22,6 +22,7 @@ import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.service.BasePatientService;
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.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.patient.PatientRequestMapping;
@ -323,48 +324,48 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
	
	@GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorByHospitalAndDiseaseAndDept)
	@ApiOperation(value = "根据疾病名称,热门部门查询医生", notes = "根据疾病名称,热门部门查询医生")
	public ListEnvelop findDoctorByHospitalAndDiseaseAndDept(@ApiParam(name = "iswork", value = "机构code")
	public MixEnvelop findDoctorByHospitalAndDiseaseAndDept(@ApiParam(name = "iswork", value = "机构code")
																 @RequestParam(value = "iswork", required = false)String iswork,
	                                                         @ApiParam(name = "patientid", value = "居民ID")
															@ApiParam(name = "patientid", value = "居民ID")
	                                                         @RequestParam(value = "patientid", required = false)String patientid,
			                                       @ApiParam(name = "orgCode", value = "机构code")
															@ApiParam(name = "orgCode", value = "机构code")
	                                               @RequestParam(value = "orgCode", required = false)String orgCode,
	                                               @ApiParam(name = "dept", value = "部门code")
															@ApiParam(name = "dept", value = "部门code")
	                                               @RequestParam(value = "dept", required = false)String dept,
	                                               @ApiParam(name = "diseaseKey", value = "疾病名称关键字")
															@ApiParam(name = "diseaseKey", value = "疾病名称关键字")
	                                               @RequestParam(value = "diseaseKey", required = false)String diseaseKey,
                                                   @ApiParam(name = "doctorNameKey", value = "医生名称关键字")
															@ApiParam(name = "doctorNameKey", value = "医生名称关键字")
	                                               @RequestParam(value = "doctorNameKey", required = false)String doctorNameKey,
                                                   @ApiParam(name = "jobTitleNameKey", value = "医生职称关键字")
															@ApiParam(name = "jobTitleNameKey", value = "医生职称关键字")
                                                   @RequestParam(value = "jobTitleNameKey", required = false)String jobTitleNameKey,
                                                   @ApiParam(name = "outpatientType", value = "咨询类型1图文,2视频")
															@ApiParam(name = "outpatientType", value = "咨询类型1图文,2视频")
                                                   @RequestParam(value = "outpatientType", required = false)String outpatientType,
                                                   @ApiParam(name = "keyName", value = "姓名/科室/疾病模糊搜索关键字")
															@ApiParam(name = "keyName", value = "姓名/科室/疾病模糊搜索关键字")
                                                   @RequestParam(value = "keyName", required = false)String keyName,
                                                   @ApiParam(name = "workingTime", value = "排班时间YYYY-MM-DD")
															@ApiParam(name = "workingTime", value = "排班时间YYYY-MM-DD")
	                                               @RequestParam(value = "workingTime", required = false)String workingTime,
	                                               @ApiParam(name = "consultStatus", value = "在线状态")
															@ApiParam(name = "consultStatus", value = "在线状态")
	                                               @RequestParam(value = "consultStatus", required = false,defaultValue = "")String consultStatus,
                                                   @ApiParam(name = "chargType", value = "医生号别")
															@ApiParam(name = "chargType", value = "医生号别")
	                                                @RequestParam(value = "chargType", required = false,defaultValue = "")String chargType,
                                                   @ApiParam(name = "consutlSort", value = "咨询量排序")
															@ApiParam(name = "consutlSort", value = "咨询量排序")
                                                   @RequestParam(value = "consutlSort", required = true,defaultValue = "DESC")String consutlSort,
													@ApiParam(name = "isAttention", value = "是否关注")
															@ApiParam(name = "isAttention", value = "是否关注")
													@RequestParam(value = "isAttention", required = false)String isAttention,
	                                                 @ApiParam(name = "page", value = "第几页")
															@ApiParam(name = "page", value = "第几页")
	                                                     @RequestParam(value = "page",required = false) Integer page,
	                                                 @ApiParam(name = "pagesize", value = "分页大小")
															@ApiParam(name = "pagesize", value = "分页大小")
	                                                     @RequestParam(value = "pagesize",required = false) Integer pagesize
	) throws Exception{
		logger.info("findDoctorByHospitalAndDiseaseAndDept start:"+DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss:SSS"));
		return success(prescriptionService.findDoctorByHospitalAndDiseaseAndDept(iswork,patientid,
		return prescriptionService.findDoctorByHospitalAndDiseaseAndDept(iswork,patientid,
				orgCode,dept,
				diseaseKey,doctorNameKey,
				jobTitleNameKey,outpatientType,
				keyName,workingTime,consultStatus,chargType,consutlSort,isAttention,page,pagesize));
				keyName,workingTime,consultStatus,chargType,consutlSort,isAttention,page,pagesize);
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.Prescription.findHotDeptAndDiseaseDict)

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

@ -5,12 +5,14 @@ import com.yihu.jw.area.service.BaseCityService;
import com.yihu.jw.area.service.BaseCommitteeService;
import com.yihu.jw.area.service.BaseProvinceService;
import com.yihu.jw.area.service.BaseTownService;
import com.yihu.jw.doctor.service.BaseDoctorInfoService;
import com.yihu.jw.doctor.service.excel.DoctorWorkTimeExcelReader;
import com.yihu.jw.doctor.service.excel.DoctorWorkTimeMainExcelDO;
import com.yihu.jw.entity.base.area.BaseCityDO;
import com.yihu.jw.entity.base.area.BaseCommitteeDO;
import com.yihu.jw.entity.base.area.BaseProvinceDO;
import com.yihu.jw.entity.base.area.BaseTownDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.hospital.mapping.service.PatientMappingService;
@ -109,6 +111,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    private BaseCityService baseCityService;
    @Autowired
    private PatientMappingService patientMappingService;
    @Autowired
    private BaseDoctorInfoService baseDoctorInfoService;
    @Value("${demo.flag}")
    private boolean demoFlag;
@ -1949,4 +1953,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.popularityIncrease)
    @ApiOperation(value = "医生人气值增长")
    public Envelop popularityIncrease (
            @ApiParam(name = "doctor", value = "医生id")
            @RequestParam(value = "doctor", required = false) String doctor) throws Exception {
        BaseDoctorDO baseDoctorDO=baseDoctorInfoService.popularityIncrease(doctor);
        return  success("操作成功",baseDoctorDO);
    }
}