Selaa lähdekoodia

医生咨询列表

huangwenjie 5 vuotta sitten
vanhempi
commit
0c799fc439

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 125 - 0
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java


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

@ -331,6 +331,9 @@ public class BaseHospitalRequestMapping {
     */
    public static class DodtorIM extends Basic{
        public static final String PREFIX  = "/im/doctor";
    
        //医生咨询记录查询
        public static final String records ="/records";
        
        //添加复诊咨询
        public static final String addPrescriptionConsult ="/addPrescriptionConsult";

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

@ -40,6 +40,12 @@ public class ConsultVO extends UuidIdentityVO {
	@ApiModelProperty(value = "医生名称", example = "模块1")
	private String doctorName;
	
	@ApiModelProperty(value = "患者头像", example = "模块1")
	private String patientphoto;
	
	@ApiModelProperty(value = "患者名称", example = "模块1")
	private String patientName;
	
	public Integer getType() {
		return type;
	}
@ -111,4 +117,20 @@ public class ConsultVO extends UuidIdentityVO {
	public void setDoctorName(String doctorName) {
		this.doctorName = doctorName;
	}
	
	public String getPatientphoto() {
		return patientphoto;
	}
	
	public void setPatientphoto(String patientphoto) {
		this.patientphoto = patientphoto;
	}
	
	public String getPatientName() {
		return patientName;
	}
	
	public void setPatientName(String patientName) {
		this.patientName = patientName;
	}
}

+ 62 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -1,13 +1,16 @@
package com.yihu.jw.hospital.endpoint.consult;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.restmodel.im.ConsultVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.util.date.DateUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -16,6 +19,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * @author huangwenjie
@ -270,6 +275,63 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		return success("请求成功",result);
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.DodtorIM.records)
	@ApiOperation(value = "医生咨询记录查询")
	public Envelop records(
			@ApiParam(name = "doctor", value = "医生id")
			@RequestParam(value = "doctor",required = true) String doctor,
			@ApiParam(name = "title", value = "咨询标题关键字")
			@RequestParam(value = "title",required = false) String title,
			@ApiParam(name = "id", value = "咨询ID")
			@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 = true) 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.findConsultRecordByDoctor(doctor, id,type,status, page,pagesize, title);
		
		if (data != null) {
			for (ConsultVO consult : data) {
				if (consult == null) {
					continue;
				}
				JSONObject json = new JSONObject();
				json.put("id", consult.getId());
				// 设置咨询类型:1专家咨询,9在线复诊,待扩展,13协同门诊
				json.put("type", consult.getType());
				// 设置显示标题
				json.put("title", consult.getTitle());
				// 设置主诉
				json.put("symptoms", consult.getSymptoms());
				// 咨询状态
				json.put("status", consult.getStatus());
				// 设置咨询日期
				json.put("czrq", DateUtil.dateToStrLong(consult.getCzrq()));
				//是否评价
				json.put("evaluate", consult.getEvaluate());
				//患者头像
				json.put("patientPhoto", consult.getPatientphoto());
				//患者名称
				json.put("patientName", consult.getPatientName());
				
				array.add(json);
			}
		}
		
		Long total = imService.countConsultRecordByDoctor(doctor, id,type,status,title);
		
		JSONObject result = new JSONObject();
		result.put("total",total);
		result.put("list",array);
		return success(result);
	}
	
	
	@GetMapping(value = BaseHospitalRequestMapping.DodtorIM.testSendPrescriptionIM)
	@ApiOperation(value = "测试发送处方消息", notes = "测试发送处方消息")