Browse Source

Merge branch 'dev' of huangwenjie/wlyy2.0 into dev

huangwenjie 5 years ago
parent
commit
7d79b9c290

+ 18 - 5
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -167,9 +167,10 @@ public class ImService {
	 * @param type 咨询会话类型
	 * @param pagesize 分页大小
	 * @param title 标题关键字
	 * @param status 状态
	 * @return
	 */
	public List<ConsultVO>  findConsultRecordByPatient(String patient, String id,Integer type, int page,int pagesize, String title) {
	public List<ConsultVO>  findConsultRecordByPatient(String patient, String id,Integer type, int page,int pagesize, String title,Integer status) {
		if(page >=1){
			page --;
@ -189,20 +190,32 @@ public class ImService {
				"b.evaluate AS evaluate," +
				"d.name AS doctorName," +
				"d.photo AS doctorphoto," +
				"d.job_title_name AS jobTitleName " +
				"d.job_title_name AS jobTitleName, " +
				"h.dept_name AS deptName " +
				"FROM wlyy_consult a," +
				"wlyy_consult_team b," +
				"base_doctor d " +
				"WHERE a.id=b.consult " +
				"base_doctor d, " +
				"base_doctor_hospital h " +
				"WHERE a.id=b.consult and d.id = h.doctor_code " +
				"AND b.doctor=d.id AND a.patient='"+patient+"' AND a.type="+type;
		List<ConsultVO> result = new ArrayList<>();
		
		if(!StringUtils.isEmpty(title)){
			title="%"+title+"%";
			sql +=" and a.title like '"+title+"'";
		}
		
		//咨询状态
		if(status != 0){
			
			if(status ==2 ){//就诊中
				sql +=" and b.status = 0 ";
			}else if(status ==3 ){
				sql +=" and b.status = 1 ";
			}else{}
			
		}
		
		if (!StringUtils.isEmpty(id)) {
			sql += " and a.id = '" + id + "'";
		}

+ 11 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/im/ConsultVO.java

@ -43,6 +43,9 @@ public class ConsultVO extends UuidIdentityVO {
	@ApiModelProperty(value = "医生名称", example = "模块1")
	private String doctorName;
	
	@ApiModelProperty(value = "医生部门名称", example = "模块1")
	private String deptName;
	
	@ApiModelProperty(value = "患者头像", example = "模块1")
	private String patientphoto;
	
@ -244,4 +247,12 @@ public class ConsultVO extends UuidIdentityVO {
	public void setRegisterDate(Date registerDate) {
		this.registerDate = registerDate;
	}
	
	public String getDeptName() {
		return deptName;
	}
	
	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}
}

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

@ -73,13 +73,15 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
								@RequestParam(value = "id",required = false) String id,
								@ApiParam(name = "type", value = "咨询类型")
								@RequestParam(value = "type",required = true) Integer type,
								@ApiParam(name = "status", value = "咨询状态:0全部,1候诊中,2就诊中,3结束")
								@RequestParam(value = "status",required = false) Integer status,
								@ApiParam(name = "page", value = "第几页")
								@RequestParam(value = "page",required = false) int page,
								@ApiParam(name = "pagesize", value = "分页大小")
								@RequestParam(value = "pagesize",required = false) int pagesize
								)throws Exception{
		JSONArray array = new JSONArray();
		List<ConsultVO>  data = imService.findConsultRecordByPatient(patient, id,type, page,pagesize, title);
		List<ConsultVO>  data = imService.findConsultRecordByPatient(patient, id,type, page,pagesize, title,status);
		
		if (data != null) {
			for (ConsultVO consult : data) {
@ -106,6 +108,8 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
				json.put("jobTitleName", consult.getJobTitleName());
				//医生名称
				json.put("doctorName", consult.getDoctorName());
				//部门名称
				json.put("deptName", consult.getDeptName());
				
				array.add(json);
			}