Browse Source

IM-service代码提交

huangwenjie 5 years ago
parent
commit
5f9fa66024

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

@ -1417,7 +1417,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param diseaseKey 疾病名称
     * @return
     */
    public List<Map<String,Object>> findDoctorByHospitalAndDiseaseAndDept(String orgCode, String dept, String diseaseKey) {
    public List<Map<String,Object>> findDoctorByHospitalAndDiseaseAndDept(String orgCode, String dept, String diseaseKey,String doctorNameKey) {
    
        String sql ="SELECT " +
                " d.id, " +
@ -1427,7 +1427,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " d.introduce," +
                " d.job_title_code AS jobTitleCode, " +
                " d.job_title_name AS jobTitleName," +
                " d.charge_type AS chargeType" +
                " d.charge_type AS chargeType," +
                " h.dept_name AS deptName" +
                " FROM " +
                " base_doctor d " +
                " JOIN base_doctor_hospital h ON h.doctor_code = d.id " +
@ -1436,8 +1437,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if(StringUtils.isNotBlank(diseaseKey)){
            sql+=" AND d.expertise like '%"+diseaseKey+"%'";
        }
    
        if(StringUtils.isNotBlank(doctorNameKey)){
            sql+=" AND d.name like '%"+doctorNameKey+"%'";
        }
        
        if(StringUtils.isNotBlank(dept)){
            sql+=" h.dept_code = '"+dept+"' ";
            sql+=" AND h.dept_code = '"+dept+"' ";
        }
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
    
@ -1453,4 +1459,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    
        return list;
    }
    
    /**
     * 获取常见疾病和热门部门字典
     * @param dictName 字典名称
     * @return
     */
    public List<Map<String,Object>> findHotDeptAndDiseaseDict(String dictName) {
        String sql ="SELECT * from wlyy_hospital_sys_dict where dict_name='"+dictName+"' ORDER BY sort ASC;";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        
        return  list;
    }
}

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

@ -98,7 +98,13 @@ public class ImService {
			pagesize = 10;
		}
		
		String  sql = " SELECT a.type AS type,a.title AS title,a.symptoms AS symptoms,a.czrq AS czrq  from wlyy_consult a where a.patient = '"+patient+"' and type = "+type+" ";
		String  sql = " SELECT " +
				"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+" ";
		List<ConsultVO> result = new ArrayList<>();
		
		if(!StringUtils.isEmpty(title)){

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

@ -78,6 +78,11 @@ public class BaseHospitalRequestMapping {
         * 根据疾病名称,热门部门查询医生
         */
        public static final String findDoctorByHospitalAndDiseaseAndDept = "/findDoctorByHospitalAndDiseaseAndDept";
    
        /**
         * 获取常见疾病和热门部门字典
         */
        public static final String findHotDeptAndDiseaseDict = "/findHotDeptAndDiseaseDict";
        /**
         * 挂号
@ -253,6 +258,9 @@ public class BaseHospitalRequestMapping {
        //居民咨询发消息(追问接口)
        public static final String append ="/append";
        
        //居民添加咨询接口
        public static final String add = "/add";
        
    }
    /**

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

@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
 * @author huangwenjie
@ -160,7 +161,44 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
	                                               @ApiParam(name = "dept", value = "部门code")
	                                               @RequestParam(value = "dept", required = false)String dept,
	                                               @ApiParam(name = "diseaseKey", value = "疾病名称关键字")
	                                               @RequestParam(value = "diseaseKey", required = false)String diseaseKey) {
		return success(prescriptionService.findDoctorByHospitalAndDiseaseAndDept(orgCode,dept,diseaseKey));
	                                               @RequestParam(value = "diseaseKey", required = false)String diseaseKey,
                                                   @ApiParam(name = "doctorNameKey", value = "医生名称关键字")
	                                               @RequestParam(value = "doctorNameKey", required = false)String doctorNameKey) throws Exception{
		return success(prescriptionService.findDoctorByHospitalAndDiseaseAndDept(orgCode,dept,diseaseKey,doctorNameKey));
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.Prescription.findHotDeptAndDiseaseDict)
	@ApiOperation(value = "获取常见疾病和热门部门字典", notes = "获取常见疾病和热门部门字典")
	public ListEnvelop findHotDeptAndDiseaseDict(@ApiParam(name = "dictName", value = "dictName")
	                                             @RequestParam(value = "dictName", required = true,defaultValue = "ONLINE_HOSPITAL_DEPT_350211A1002")String dictName)throws Exception{
		return success(prescriptionService.findHotDeptAndDiseaseDict(dictName));
	}
	@PostMapping(value = BaseHospitalRequestMapping.PatientIM.add)
	@ApiOperation(value = "居民添加咨询接口", notes = "居民添加咨询接口")
	public Envelop add(
			@ApiParam(name = "patient", value = "居民CODE")
			@RequestParam(value = "patient",required = false) String patient,
			@ApiParam(name = "doctor", value = "医生CODE")
			@RequestParam(value = "doctor",required = true) String doctor,
			@ApiParam(name = "when", value = "发病时间")
			@RequestParam(value = "when",required = true) String when,
			@ApiParam(name = "symptoms", value = "主述")
			@RequestParam(value = "symptoms",required = false) String symptoms,
			@ApiParam(name = "images", value = "图片")
			@RequestParam(value = "images",required = false) String images,
			@ApiParam(name = "voice", value = "语音")
			@RequestParam(value = "voice",required = false) String voice)throws Exception{
		
		System.out.println("symptoms="+symptoms);
		
//		if (type == null) {
//			type = 1;
//		}
//		if (type != 1 && type != 2) {
//			return error(-1, "无效请求!");
//		}
		
			
		return success("进入成功", UUID.randomUUID().toString().replaceAll("-",""));
	}
}