소스 검색

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

huangwenjie 5 년 전
부모
커밋
ef3f352980

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

@ -2269,7 +2269,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "room.reservation_type AS reservation_type," +
                "outpatient.disease_img AS disease_img," +
                "outpatient.description AS description," +
                "outpatient.origin_con_no AS origin_con_no " +
                "outpatient.origin_con_no AS origin_con_no, " +
                "consult.consult AS consult " +
                "FROM " +
                "wlyy_hospital_waiting_room room," +
                "base_patient patient," +

+ 58 - 19
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -962,6 +962,28 @@ public class ImService {
			return -1;
		}
		
		
		String name = "";
		String returnJson = "";
		
		/**
		 * 发送评价消息
		 */
		BaseDoctorDO doctor = baseDoctorDao.findById(consultTeam.getDoctor());
		BasePatientDO patient = basePatientDao.findById(consultTeam.getPatient());
		JSONObject evalueContent = new JSONObject();
		evalueContent.put("patientCode",consultTeam.getPatient());
		evalueContent.put("patientName",patient.getName());
		evalueContent.put("doctorCode",consultTeam.getDoctor());
		evalueContent.put("doctorName",doctor.getName());
		evalueContent.put("doctorPhoto",doctor.getPhoto());
		evalueContent.put("consultCode",consult);
		
//		returnJson = imUtil.sendIM(consultTeam.getDoctor(), consultTeam.getPatient(), "28", evalueContent.toString());
		String response = imUtil.sendTopicIM(consultTeam.getDoctor(), doctor.getName(), consult, "28", evalueContent.toString(),null);
		
		
		
		String endName = "";
		String endId = "";
		JSONObject obj = new JSONObject();
@ -992,21 +1014,7 @@ public class ImService {
		}
		
		
		String name = "";
		String returnJson = "";
		
		BasePatientDO p = basePatientDao.findById(endOperator);
		BaseDoctorDO d = baseDoctorDao.findById(endOperator);
		name = d.getName();
		
		JSONObject evalueContent = new JSONObject();
		evalueContent.put("patientCode",p.getId());
		evalueContent.put("patientName",p.getName());
		evalueContent.put("doctorCode",d.getId());
		evalueContent.put("doctorName",d.getName());
		evalueContent.put("consultCode",consult);
		
		returnJson = imUtil.sendIM(consultTeam.getDoctor(), consultTeam.getPatient(), "28", name + "结束了本次咨询");
//		//推送给IM文字消息
//		if (endType == 1) {
//			BasePatientDO p = basePatientDao.findById(endOperator);
@ -1065,7 +1073,7 @@ public class ImService {
		
		JSONObject object = imUtil.getTopic(consult);
		
		ConsultTeamDo consultTeamDo = consultTeamDao.findOne(consult);
		ConsultTeamDo consultTeamDo = consultTeamDao.findByConsult(consult);
		
		object.put("doctorCode",consultTeamDo.getDoctor());
		
@ -1186,9 +1194,15 @@ public class ImService {
			consultTeamDo.setEvaluateTime(new Date());
			consultTeamDao.save(consultTeamDo);
			
			/**
			 * todo 保存就诊记录表已评价标识
			 */
			ConsultDo consultDo = consultDao.findOne(consult);
			
			//如果是复诊咨询,则修改成已评价
			if("9".equals(consultDo.getType())){
				WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(consultTeamDo.getRelationCode());
				wlyyOutpatientDO.setEvaluateStatus("1");
				outpatientDao.save(wlyyOutpatientDO);
			}
			
		
		}
		
@ -1204,4 +1218,29 @@ public class ImService {
		baseDoctorDO.setConsultStatus(consultStatus);
		baseDoctorDao.save(baseDoctorDO);
	}
	
	public List<Map<String,Object>> getEvaluationByConsultCode(String consult) {
		//查询评价明细
		String sqlScoreList = "SELECT " +
				"a.score as score," +
				"a.score_type as score_type," +
				"a.content as content," +
				"b.create_time as create_time," +
				"c.type as type," +
				"c.name as patientname," +
				"b.id as id," +
				"c.photo as patientphoto," +
				"b.type as niming " +
				"FROM " +
				"base_evaluate a " +
				"LEFT JOIN base_evaluate_score b ON b.id=a.relation_code " +
				"LEFT JOIN wlyy_consult_team c ON c.consult=b.relation_code AND c.consult='"+consult+"' " +
				"WHERE a.relation_code=b.id ";
		List<Map<String,Object>> scoreList = jdbcTemplate.queryForList(sqlScoreList);
		if(scoreList.isEmpty()){
			return null;
		}else{
			return scoreList;
		}
	}
}

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

@ -315,6 +315,9 @@ public class BaseHospitalRequestMapping {
        
        //评价咨询
        public static final String evaluationByConsultCode = "/evaluationByConsultCode";
        
        //根据咨询CODE返回评价详情
        public static final String getEvaluationByConsultCode = "getEvaluationByConsultCode";
        
    }

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

@ -301,11 +301,23 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			@RequestParam(value = "scoreContent",required = false) String scoreContent,
			@ApiParam(name = "type", value = "1、实名,2、匿名")
			@RequestParam(value = "type",required = true) Integer type)throws Exception{
		if(StringUtils.isEmpty(scoreContent)){
			scoreContent= "[{\"scoreType\":\"1\",\"score\":100,\"content\":\"\"},{\"scoreType\":\"2\",\"score\":80,\"content\":\"\"},{\"scoreType\":\"3\",\"score\":80,\"content\":\"\"},{\"scoreType\":\"4\",\"score\":0,\"content\":\"测试评语。。。。123123\"}]";
		}
//		if(StringUtils.isEmpty(scoreContent)){
//			scoreContent= "[{\"scoreType\":\"1\",\"score\":100,\"content\":\"\"},{\"scoreType\":\"2\",\"score\":80,\"content\":\"\"},{\"scoreType\":\"3\",\"score\":80,\"content\":\"\"},{\"scoreType\":\"4\",\"score\":0,\"content\":\"测试评语。。。。123123\"}]";
//		}
		imService.evaluationByConsultCode(consult,scoreContent,type);
		return success("请求成功");
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.PatientIM.getEvaluationByConsultCode)
	@ApiOperation(value = "评价咨询", notes = "评价咨询")
	public ListEnvelop getEvaluationByConsultCode(
			@ApiParam(name = "consult", value = "咨询CODE")
			@RequestParam(value = "consult",required = true) String consult)throws Exception{
//		if(StringUtils.isEmpty(scoreContent)){
//			scoreContent= "[{\"scoreType\":\"1\",\"score\":100,\"content\":\"\"},{\"scoreType\":\"2\",\"score\":80,\"content\":\"\"},{\"scoreType\":\"3\",\"score\":80,\"content\":\"\"},{\"scoreType\":\"4\",\"score\":0,\"content\":\"测试评语。。。。123123\"}]";
//		}
		
		return success("请求成功",imService.getEvaluationByConsultCode(consult));
	}
}