|  | @ -10,6 +10,7 @@ import com.yihu.wlyy.entity.doctor.profile.Doctor;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.entity.doctor.schedule.WlyyDoctorWorkTime;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.entity.doctor.schedule.WlyyDoctorWorkWeek;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.entity.patient.Patient;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.logs.BusinessLogs;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.repository.patient.PatientDao;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.util.*;
 | 
	
	
		
			
				|  | @ -326,7 +327,7 @@ public class ConsultController extends WeixinBaseController {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             // 推送消息给医生
 | 
	
		
			
				|  |  |             PushMsgTask.getInstance().put(consult.getDoctor(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.D_CT_01.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.指定咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_CONSULT_TEAM.您有新的指定咨询.name(), consult.getConsult());
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             BusinessLogs.info(BusinessLogs.BusinessType.consult, getUID(), new JSONObject(consult));
 | 
	
		
			
				|  |  |             return write(200, "提交成功", "data", consult);
 | 
	
		
			
				|  |  |         } catch (Exception ex) {
 | 
	
		
			
				|  |  |             error(ex);
 | 
	
	
		
			
				|  | @ -398,6 +399,7 @@ public class ConsultController extends WeixinBaseController {
 | 
	
		
			
				|  |  |             doctorWorkTimeService.setDoctorCurrentConsultTimesRemain(doctorCode);
 | 
	
		
			
				|  |  |             // 推送消息给医生
 | 
	
		
			
				|  |  |             PushMsgTask.getInstance().put(consult.getDoctor(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.D_CT_03.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.名医咨询.name(), MessageType.MESSAGE_TYPE_DOCTOR_NEW_FAMOUS_CONSULT_TEAM.您有新的名医咨询.name(), consult.getConsult());
 | 
	
		
			
				|  |  |             BusinessLogs.info(BusinessLogs.BusinessType.consult, getUID(), new JSONObject(consult));
 | 
	
		
			
				|  |  |             return write(200, "提交成功", "data", consult);
 | 
	
		
			
				|  |  |         } catch (Exception ex) {
 | 
	
		
			
				|  |  |             error(ex);
 | 
	
	
		
			
				|  | @ -591,7 +593,7 @@ public class ConsultController extends WeixinBaseController {
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     @RequestMapping(value = "append")
 | 
	
		
			
				|  |  |     @ResponseBody
 | 
	
		
			
				|  |  |     public String append(@RequestParam String consult, @RequestParam String content, @RequestParam int type,@RequestParam(required = false,defaultValue = "0") Integer times) {
 | 
	
		
			
				|  |  |     public String append(@RequestParam String consult, @RequestParam String content, @RequestParam int type, @RequestParam(required = false, defaultValue = "0") Integer times) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             List<ConsultTeamLog> logs = new ArrayList<ConsultTeamLog>();
 | 
	
		
			
				|  |  |             ConsultTeam consultModel = consultTeamService.findByCode(consult);
 | 
	
	
		
			
				|  | @ -605,14 +607,14 @@ public class ConsultController extends WeixinBaseController {
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             String[] arr = null;
 | 
	
		
			
				|  |  |             if(type==3){
 | 
	
		
			
				|  |  |                String path =  fetchWxVoices();
 | 
	
		
			
				|  |  |                JSONObject obj = new JSONObject();
 | 
	
		
			
				|  |  |             if (type == 3) {
 | 
	
		
			
				|  |  |                 String path = fetchWxVoices();
 | 
	
		
			
				|  |  |                 JSONObject obj = new JSONObject();
 | 
	
		
			
				|  |  |                 // 将临时语音拷贝到正式存储路径下
 | 
	
		
			
				|  |  |                 if (StringUtils.isNotEmpty(path)) {
 | 
	
		
			
				|  |  |                     content = CommonUtil.copyTempVoice(path);
 | 
	
		
			
				|  |  |                     obj.put("path",content);
 | 
	
		
			
				|  |  |                     obj.put("times",times);
 | 
	
		
			
				|  |  |                     obj.put("path", content);
 | 
	
		
			
				|  |  |                     obj.put("times", times);
 | 
	
		
			
				|  |  |                     content = obj.toString();
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 ConsultTeamLog log = new ConsultTeamLog();
 | 
	
	
		
			
				|  | @ -622,9 +624,9 @@ public class ConsultController extends WeixinBaseController {
 | 
	
		
			
				|  |  |                 log.setChatType(type);
 | 
	
		
			
				|  |  |                 log.setType(3);
 | 
	
		
			
				|  |  |                 logs.add(log);
 | 
	
		
			
				|  |  |             }else if (type == 2) {
 | 
	
		
			
				|  |  |             } else if (type == 2) {
 | 
	
		
			
				|  |  |                 // 图片消息
 | 
	
		
			
				|  |  |                 content =  fetchWxImages();
 | 
	
		
			
				|  |  |                 content = fetchWxImages();
 | 
	
		
			
				|  |  |                 // 将临时图片拷贝到正式存储路径下
 | 
	
		
			
				|  |  |                 if (StringUtils.isNotEmpty(content)) {
 | 
	
		
			
				|  |  |                     content = CommonUtil.copyTempImage(content);
 | 
	
	
		
			
				|  | @ -658,11 +660,11 @@ public class ConsultController extends WeixinBaseController {
 | 
	
		
			
				|  |  |             List<String> failed = new ArrayList<>();
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             for (ConsultTeamLog log : logs) {
 | 
	
		
			
				|  |  |                 String response = ImUtill.sendTopicIM(getUID(),patient.getName(),consult,String.valueOf(log.getType()),log.getContent());
 | 
	
		
			
				|  |  |                 String response = ImUtill.sendTopicIM(getUID(), patient.getName(), consult, String.valueOf(log.getType()), log.getContent());
 | 
	
		
			
				|  |  |                 if (StringUtils.isNotEmpty(response)) {
 | 
	
		
			
				|  |  |                     JSONObject resObj = new JSONObject(response);
 | 
	
		
			
				|  |  |                     if(resObj.getInt("status")==-1){
 | 
	
		
			
				|  |  |                         return invalidUserException(new RuntimeException(resObj.getString("message")), -1, "追问失败!"+resObj.getString("message"));
 | 
	
		
			
				|  |  |                     if (resObj.getInt("status") == -1) {
 | 
	
		
			
				|  |  |                         return invalidUserException(new RuntimeException(resObj.getString("message")), -1, "追问失败!" + resObj.getString("message"));
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     failed.add(String.valueOf(resObj.get("data")));
 | 
	
		
			
				|  |  |                 }
 | 
	
	
		
			
				|  | @ -690,7 +692,7 @@ public class ConsultController extends WeixinBaseController {
 | 
	
		
			
				|  |  |             if (consultModel == null) {
 | 
	
		
			
				|  |  |                 return error(-1, "咨询记录不存在!");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             JSONObject messageObj =  ImUtill.getTopicMessage(consultModel.getConsult(),consultModel.getStartMsgId(),consultModel.getEndMsgId(),page,pagesize,getUID());
 | 
	
		
			
				|  |  |             JSONObject messageObj = ImUtill.getTopicMessage(consultModel.getConsult(), consultModel.getStartMsgId(), consultModel.getEndMsgId(), page, pagesize, getUID());
 | 
	
		
			
				|  |  |             return write(200, "查询成功", "list", messageObj);
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             error(e);
 |