Prechádzať zdrojové kódy

IM-service代码提交

huangwenjie 5 rokov pred
rodič
commit
187f39a8f5

+ 16 - 7
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -98,25 +98,34 @@ public class ImService {
			pagesize = 10;
		}
		
		String  sql = " SELECT " +
		String  sql = "SELECT " +
				"a.id AS id," +
				"a.type AS type," +
				"a.title AS title," +
				"a.symptoms AS symptoms," +
				"a.czrq AS czrq  " +
				"a.czrq AS czrq  " +
				"from wlyy_consult a where a.patient = '"+patient+"' and type = "+type+" ";
				"a.czrq AS czrq," +
				"b.status AS status," +
				"b.evaluate AS evaluate," +
				"d.name AS doctorName," +
				"d.photo AS doctorphoto," +
				"d.job_title_name AS jobTitleName " +
				"FROM wlyy_consult a," +
				"wlyy_consult_team b," +
				"base_doctor d " +
				"WHERE a.id=b.consult " +
				"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 title like '"+title+"'";
			sql +=" and a.title like '"+title+"'";
			
		}
		if (!StringUtils.isEmpty(id)) {
			sql += " and id = '" + id + "'";
			sql += " and a.id = '" + id + "'";
		}
		sql += " ORDER BY id desc limit 0,"+pagesize+"";
		sql += " ORDER BY a.id desc limit 0,"+pagesize+"";
		
		result = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ConsultVO.class));
		

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

@ -261,6 +261,9 @@ public class BaseHospitalRequestMapping {
        //居民添加咨询接口
        public static final String add = "/add";
        
        //居民详情
        public static final String patientInfo = "/patientInfo";
        
    }
    /**

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

@ -31,6 +31,15 @@ public class ConsultVO extends UuidIdentityVO {
	@ApiModelProperty(value = "是否评价 1、已评价 0、未评价'", example = "模块1")
	private Integer evaluate;
	
	@ApiModelProperty(value = "医生头像", example = "模块1")
	private String doctorphoto;
	
	@ApiModelProperty(value = "医生职称", example = "模块1")
	private String jobTitleName;
	
	@ApiModelProperty(value = "医生名称", example = "模块1")
	private String doctorName;
	
	public Integer getType() {
		return type;
	}
@ -78,4 +87,28 @@ public class ConsultVO extends UuidIdentityVO {
	public void setEvaluate(Integer evaluate) {
		this.evaluate = evaluate;
	}
	
	public String getDoctorphoto() {
		return doctorphoto;
	}
	
	public void setDoctorphoto(String doctorphoto) {
		this.doctorphoto = doctorphoto;
	}
	
	public String getJobTitleName() {
		return jobTitleName;
	}
	
	public void setJobTitleName(String jobTitleName) {
		this.jobTitleName = jobTitleName;
	}
	
	public String getDoctorName() {
		return doctorName;
	}
	
	public void setDoctorName(String doctorName) {
		this.doctorName = doctorName;
	}
}

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

@ -2,8 +2,10 @@ package com.yihu.jw.hospital.endpoint.consult;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.patient.service.BasePatientService;
import com.yihu.jw.restmodel.im.ConsultVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
@ -35,6 +37,9 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
	@Autowired
	private PrescriptionService prescriptionService;
	
	@Autowired
	private BasePatientService basePatientService;
	
	@GetMapping(value = BaseHospitalRequestMapping.PatientIM.records)
	@ApiOperation(value = "患者咨询记录查询")
	public ListEnvelop records(
@ -70,6 +75,12 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
				json.put("czrq", DateUtil.dateToStrLong(consult.getCzrq()));
				//是否评价
				json.put("evaluate", consult.getEvaluate());
				//医生头像
				json.put("doctorPhoto", consult.getDoctorphoto());
				//医生职称
				json.put("jobTitleName", consult.getJobTitleName());
				//医生名称
				json.put("doctorName", consult.getDoctorName());
				
				array.add(json);
			}
@ -201,4 +212,13 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			
		return success("进入成功", UUID.randomUUID().toString().replaceAll("-",""));
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.PatientIM.patientInfo)
	@ApiOperation(value = "根据居民ID获取居民详情信息", notes = "根据居民ID获取居民详情信息")
	public Envelop patientInfo(
			@ApiParam(name = "patient", value = "居民CODE")
			@RequestParam(value = "patient",required = false) String patient) throws Exception {
		BasePatientDO result = basePatientService.findByIdAndDel(patient);
		return success(result);
	}
}