Kaynağa Gözat

代码提交

huangwenjie 5 yıl önce
ebeveyn
işleme
c56dbba8ab

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

@ -2274,10 +2274,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "FROM " +
                "wlyy_hospital_waiting_room room," +
                "base_patient patient," +
                "wlyy_outpatient outpatient " +
                "wlyy_outpatient outpatient, " +
                "wlyy_consult_team consult " +
                "WHERE " +
                "room.patient_id=patient.id " +
                "AND room.outpatient_id=outpatient.id " +
                "AND consult.relation_code=outpatient.id " +
                "AND outpatient.status = 1 " +
                "AND room.doctor='"+doctor+"' " +
                "AND room.consult_type= 2";
@ -2288,6 +2290,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            for(Map<String,Object> outpatient :list){
                String idcard = (String)outpatient.get("idcard");
                outpatient.put("age",DateUtil.getAgeForIdcard(idcard));
    
                String outpatient_id = (String)outpatient.get("id");
                
                
            }
        }
    
@ -2358,8 +2364,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    
        for (int i = 0; i < _list.size(); i++) {
            com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject();
            System.out.println(_list.get(i));
            object.put("day",_list.get(i));
            if(_list.get(i).equals(DateUtil.getStringDateShort())){
                object.put("day","today");
            }else{
                object.put("day",_list.get(i));
            }
            object.put("data",waitinglist.get(_list.get(i)));
            result.add(object);
        }

+ 40 - 21
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -990,30 +990,43 @@ public class ImService {
		if (obj.getInteger("status") == -1) {
			throw new RuntimeException(String.valueOf(obj.get("message")));
		}
		
		
		String name = "";
		String returnJson = "";
		//推送给IM文字消息
		if (endType == 1) {
			BasePatientDO p = basePatientDao.findById(endOperator);
			name = p.getName();
			returnJson = imUtil.sendIM(consultTeam.getPatient(), consultTeam.getDoctor(), "7", name + "结束了本次咨询");
		} else {
			BaseDoctorDO d = baseDoctorDao.findById(endOperator);
			name = d.getName();
			returnJson = imUtil.sendIM(consultTeam.getDoctor(), consultTeam.getPatient(), "7", name + "结束了本次咨询");
		}
		
		if (org.apache.commons.lang3.StringUtils.isEmpty(returnJson)) {
			throw new RuntimeException("send consult finished IM message failed!");
//			throw new Exception("send consult finished IM message failed");
		} else {
			JSONObject jo = JSON.parseObject(returnJson);            //设置消息ID
			consultTeam.setEndMsgId(jo.getInteger("startId") + "");
			consultTeam.setEndOperator(endOperator);
			consultTeam.setEndType(endType);
		}
		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);
//			name = p.getName();
//			returnJson = imUtil.sendIM(consultTeam.getPatient(), consultTeam.getDoctor(), "7", name + "结束了本次咨询");
//		} else {
//			BaseDoctorDO d = baseDoctorDao.findById(endOperator);
//			name = d.getName();
//			returnJson = imUtil.sendIM(consultTeam.getDoctor(), consultTeam.getPatient(), "7", name + "结束了本次咨询");
//		}
		
//		if (org.apache.commons.lang3.StringUtils.isEmpty(returnJson)) {
//			throw new RuntimeException("send consult finished IM message failed!");
////			throw new Exception("send consult finished IM message failed");
//		} else {
//			JSONObject jo = JSON.parseObject(returnJson);            //设置消息ID
//			consultTeam.setEndMsgId(jo.getInteger("startId") + "");
//			consultTeam.setEndOperator(endOperator);
//			consultTeam.setEndType(endType);
//		}
		
//		org.json.JSONObject group = talkGroupService.findConsultTalkGroup(consultTeam.getConsult());
//
@ -1050,7 +1063,13 @@ public class ImService {
	 */
	public JSONObject getTopic(String consult) throws Exception {
		
		return imUtil.getTopic(consult);
		JSONObject object = imUtil.getTopic(consult);
		
		ConsultTeamDo consultTeamDo = consultTeamDao.findOne(consult);
		
		object.put("doctorCode",consultTeamDo.getDoctor());
		
		return object;
	}