Browse Source

健康指导BUG修复

8 years ago
parent
commit
566115c875

+ 22 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ImUtill.java

@ -198,4 +198,26 @@ public class ImUtill {
    }
    /**
     * 获取议题
     * @param topicId
     * @return
     */
    public static JSONObject getTopic(String topicId) throws  Exception{
        String url = SystemConf.getInstance().getSystemProperties().getProperty("im_list_get")
                + "api/v2/sessions/topics/"+topicId+"?topic_id="+topicId;
        try{
            String ret = HttpClientUtil.get(url,"utf-8");
            JSONObject obj = new JSONObject(ret);
            if(obj.getInt("status")==-1){
                throw new RuntimeException("获取议题失败!");
            }else{
                return obj;
            }
        }catch (Exception e){
            throw new RuntimeException("获取议题失败!");
        }
    }
}

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthGuidanceController.java

@ -145,7 +145,7 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
				// 保存
				if (patientHealthGuidanceService.add(guidance, getAccessToken()) != null) {
					Patient p = patientService.findByCode(patient);
					String imcotent  = "{\"title\":\"健康指导\",\"type\":1,\"id\":\"" + guidance.getId() + "\",\"img\":\"" + guidance.getImages() + "\",\"content\":\""+CommonUtil.getSubString(guidance.getContent(),0,30)+"\"}";
					String imcotent  = "{\"title\":\"健康指导\",\"type\":2,\"id\":\"" + guidance.getId() + "\",\"img\":\"" + guidance.getImages() + "\",\"content\":\""+CommonUtil.getSubString(guidance.getContent(),0,30)+"\"}";
					consultService.sendMucMessageBySingnType(getUID(), doctor.getName(), patient, imcotent, "4", p.getName());
					BusinessLogs.info(BusinessLogs.BusinessType.guidance, getUID(), patient, new JSONObject(guidance));
					return success("保存成功!");
@ -168,7 +168,7 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
				// 保存
				if (patientHealthGuidanceService.add(guidance, getAccessToken()) != null) {
					Patient p = patientService.findByCode(patient);
					String imcotent  = "{\"title\":\"健康指导\",\"type\":1,\"id\":\"" + guidance.getId() + "\",\"img\":\"" + guidance.getImages() + "\",\"content\":\""+CommonUtil.getSubString(guidance.getContent(),0,30)+"\"}";
					String imcotent  = "{\"title\":\"健康指导\",\"type\":2,\"id\":\"" + guidance.getId() + "\",\"img\":\"" + guidance.getImages() + "\",\"content\":\""+CommonUtil.getSubString(guidance.getContent(),0,30)+"\"}";
					consultService.sendMucMessageBySingnType(getUID(), doctor.getName(), patient, imcotent, "4", p.getName());
					BusinessLogs.info(BusinessLogs.BusinessType.guidance, getUID(), patient, new JSONObject(guidance));
					//发送成功记录模板发送次数

+ 12 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java

@ -22,6 +22,7 @@ import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.redis.listener.Topic;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@ -44,7 +45,7 @@ import com.yihu.wlyy.web.WeixinBaseController;
 * @author George
 */
@Controller
@RequestMapping(value = "/patient/consult", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/patient/consult/getTopic", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "患者端-患者咨询")
public class ConsultController extends WeixinBaseController {
@ -801,4 +802,14 @@ public class ConsultController extends WeixinBaseController {
        }
    }
    @RequestMapping(value = "getTopic")
    @ResponseBody
    public String getTopic(String consult){
        try{
            return success(ImUtill.getTopic(consult).getString("data"));
        }catch (Exception e){
            return error(-1,e.getMessage());
        }
    }
}

+ 1 - 1
patient-co-wlyy/src/main/resources/system.properties

@ -62,7 +62,7 @@ chat_server=http://weixin.xmtyw.cn/res/chat/
sign_check_upload=http://172.19.103.87:8011/wlyy_service
# IM配置
im_list_get=http://192.168.131.109:3008/
im_list_get=http://192.168.131.102:3008/
im_group_server=http://172.19.103.29:3000/api/v1/chats/gm
msg_push_server=http://172.19.103.29:3000/api/v1/chats/sm