chenweida 8 anni fa
parent
commit
d5f0c7f2ca

+ 10 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/consult/Consult.java

@ -43,7 +43,8 @@ public class Consult extends IdEntity {
	// 结束时间
	private Date endTime;
	//签约表Code
	private String  signCode;
	private String signCode;
	private String relationCode;//关联业务表的code
	public String getCode() {
		return code;
@ -133,4 +134,12 @@ public class Consult extends IdEntity {
	public void setSignCode(String signCode) {
		this.signCode = signCode;
	}
	public String getRelationCode() {
		return relationCode;
	}
	public void setRelationCode(String relationCode) {
		this.relationCode = relationCode;
	}
}

+ 10 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/consult/ConsultTeam.java

@ -57,6 +57,8 @@ public class ConsultTeam extends IdEntity {
	//评价时间
	private Date evaluateTime;
	private String relationCode;//关联业务表的code
	public Integer getEvaluate() {
		return evaluate;
	}
@ -315,4 +317,12 @@ public class ConsultTeam extends IdEntity {
	public void setEndType(Integer endType) {
		this.endType = endType;
	}
	public String getRelationCode() {
		return relationCode;
	}
	public void setRelationCode(String relationCode) {
		this.relationCode = relationCode;
	}
}

+ 12 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/ConsultDao.java

@ -13,19 +13,19 @@ public interface ConsultDao extends PagingAndSortingRepository<Consult, Long>, J
    Consult findByCode(String code);
    // 查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate,a.signCode  from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.symptoms like ?2 order by a.czrq desc")
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate,a.signCode  from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.type<>8 and a.symptoms like ?2 order by a.czrq desc")
    Page<Object> findByPatient(String patient, String title, Pageable pageRequest);
    // 查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate,a.signCode from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?3 and a.del = '1'and a.symptoms like ?2 order by a.czrq desc")
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate,a.signCode from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?3 and a.del = '1' and a.type<>8 and a.symptoms like ?2 order by a.czrq desc")
    Page<Object> findByPatient(String patient, String title, long id, Pageable pageRequest);
    // 查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate,a.signCode  from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' order by a.czrq desc")
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate,a.signCode  from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.type<>8 order by a.czrq desc")
    Page<Object> findByPatient(String patient, Pageable pageRequest);
    // 查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate,a.signCode  from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?2 and a.del = '1'order by a.czrq desc")
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate,a.signCode  from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?2 and a.del = '1' and a.type<>8 order by a.czrq desc")
    Page<Object> findByPatient(String patient, long id, Pageable pageRequest);
    @Query("select count(a) from Consult a,ConsultTeamDoctor b  where a.code = b.consult and a.patient=?1 and b.to=?2 and b.from is null")
@ -37,4 +37,12 @@ public interface ConsultDao extends PagingAndSortingRepository<Consult, Long>, J
    //获取咨询的状态
    @Query("select a from Consult a,ConsultTeam b where a.code = b.consult and a.code = ?1 ")
    Consult findTypeByCode(String code);
    // 按类型查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.evaluate,a.relationCode  from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?2 and a.del = '1' and a.type=?3 order by a.czrq desc")
    Page<Object> findByPatientAndType(String patient, long id,Integer type,Pageable pageRequest);
    // 按类型查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.evaluate,a.relationCode  from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.type=?2 order by a.czrq desc")
    Page<Object> findByPatientAndType(String patient,Integer type, Pageable pageRequest);
}

+ 3 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionDao.java

@ -19,4 +19,7 @@ public interface PrescriptionDao extends PagingAndSortingRepository<Prescription
    @Modifying
    @Query("update Prescription p set p.status=?2 where p.code=?1")
    void updateStatus(String prescriptionCode,Integer status);
    @Query("select p from Prescription p where p.jwCode=?1 and p.status=?2 ")
    List<Prescription> fingdByJwCodeAndStatus(String jwcode,Integer status);
}

+ 22 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultService.java

@ -113,6 +113,28 @@ public class ConsultService extends BaseService {
		}
	}
	/**
	 * 按类型查找居民的咨询记录
	 * @return
     */
	public Page<Object> findConsultRecordByType(String patient,long id,int pagesize,Integer type,String title){
		if (id < 0) {
			id = 0;
		}
		if (pagesize <= 0) {
			pagesize = 10;
		}
		// 排序
		Sort sort = new Sort(Direction.DESC, "id");
		// 分页信息
		PageRequest pageRequest = new PageRequest(0, pagesize, sort);
		if (id > 0) {
			return consultDao.findByPatientAndType(patient, id,type, pageRequest);
		} else {
			return consultDao.findByPatientAndType(patient,type, pageRequest);
		}
	}
	public Consult findOneConsult(String consult) {
		return consultDao.findByCode(consult);
	}

+ 18 - 11
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -32,6 +32,7 @@ import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
import com.yihu.wlyy.service.app.health.HealthEduArticleService;
import com.yihu.wlyy.service.app.health.PatientHealthGuidanceService;
import com.yihu.wlyy.service.app.prescription.PrescriptionLogService;
import com.yihu.wlyy.service.app.talk.TalkGroupService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.*;
@ -103,21 +104,18 @@ public class ConsultTeamService extends ConsultService {
    private TalkGroupService talkGroupService;
    @Autowired
    private com.yihu.wlyy.service.common.account.DoctorService doctorService;
    @Autowired
    WeiXinAccessTokenUtils accessTokenUtils;
    Map<Integer, String> relations = new HashMap<>();
    @Autowired
    private HttpClientUtil HttpClientUtil;
    @Autowired
    private ImUtill ImUtill;
    @Autowired
    private PatientDeviceDao patientDeviceDao;
    @Autowired
    private MessageDao messageDao;
    @Autowired
    private PrescriptionDao prescriptionDao;
    @Autowired
    WeiXinAccessTokenUtils accessTokenUtils;
    Map<Integer, String> relations = new HashMap<>();
    @PostConstruct
    public void init() {
        relations.put(0, "其他");
@ -844,6 +842,7 @@ public class ConsultTeamService extends ConsultService {
            return 1;
        }
    }
    /**
     * 添加续方咨询
     * @param jwCode
@ -856,7 +855,10 @@ public class ConsultTeamService extends ConsultService {
    public Integer addPrescriptionConsult(String jwCode,String patient,String agent,String doctorCode,ConsultTeam ct,String reason) throws Exception {
        synchronized (jwCode.intern()){
            List<Prescription> prescriptionList = prescriptionDao.fingdByJwCodeAndStatus(jwCode,0);
            if(prescriptionList!=null&&prescriptionList.size()>0){//存在未审核的续方
                return -1;
            }
            Doctor doctor = doctorDao.findByCode(doctorCode);
            // 查询患者信息
            Patient p = patientDao.findByCode(patient);
@ -899,7 +901,9 @@ public class ConsultTeamService extends ConsultService {
            if(patient.equals(agent)){
                agent = null;
            }
            //关联业务code
            ct.setRelationCode(prescription.getCode());
            //医生信息
            ct.setDoctor(doctorCode);
            ct.setDoctorName(doctor.getName());
            // 设置患者信息
@ -923,6 +927,8 @@ public class ConsultTeamService extends ConsultService {
            Consult consult = addConsult(ct.getPatient(), null, ct.getSymptoms(), ct.getImages(), ct.getType());
            // 设置关联指导
            consult.setGuidance(ct.getGuidance());
            //关联业务code
            consult.setRelationCode(prescription.getCode());
            // 设置咨询标识
            ct.setConsult(consult.getCode());
@ -959,6 +965,7 @@ public class ConsultTeamService extends ConsultService {
            // 添加医生咨询日志
            String content = addLogs(ct);
            prescriptionLogService.addLog(prescription,3,1,1);
            return 1;
        }
    }

+ 30 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionLogService.java

@ -1,11 +1,13 @@
package com.yihu.wlyy.service.app.prescription;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionLog;
import com.yihu.wlyy.repository.prescription.PrescriptionLogDao;
import com.yihu.wlyy.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
@ -26,4 +28,32 @@ public class PrescriptionLogService extends BaseService {
    public List<PrescriptionLog> findPrescriptionLogsByPrescriptionCode(String prescriptionCode, Integer[] types) {
        return prescriptionLogDao.findPrescriptionLogsByPrescriptionCode(prescriptionCode, types);
    }
    /**
     * 添加日志
     * @param prescription
     * @param type 类型: 1智业对接 2易联众对接  3创建处方 4 审核  5付款 6 配送 7完成
     * @param flag 1成功 0失败
     * @param userType 1 患者 2医生
     */
    public void addLog(Prescription prescription,Integer type,Integer flag,Integer userType){
        PrescriptionLog log = new PrescriptionLog();
        log.setStatus(prescription.getStatus());
        log.setType(type);
        log.setCode(getCode());
        log.setCreateTime(new Date());
        log.setFlag(flag);
        log.setHospital(prescription.getHospital());
        log.setHospitalName(prescription.getHospitalName());
        log.setPrescriptionCode(prescription.getCode());
        if(userType==1){
            log.setUserCode(prescription.getParentCode());
            log.setUserName(prescription.getPatientName());
        }else {
            log.setUserCode(prescription.getDoctor());
            log.setUserName(prescription.getDoctorName());
        }
        log.setUserType(userType);
        prescriptionLogDao.save(log);
    }
}

+ 104 - 59
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java

@ -11,6 +11,7 @@ import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.service.app.consult.ConsultTeamService;
import com.yihu.wlyy.service.app.consult.DoctorCommentService;
import com.yihu.wlyy.service.app.prescription.PrescriptionDiagnosisService;
import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
import com.yihu.wlyy.service.app.statistics.DoctorStatisticsService;
import com.yihu.wlyy.service.app.talk.TalkGroupService;
@ -63,15 +64,17 @@ public class ConsultController extends WeixinBaseController {
    @Autowired
    private PatientDao patientDao;
    @Autowired
    private SignFamilyDao signFamilyDao;
    @Autowired
    private DoctorDao doctorDao;
    @Autowired
    private PrescriptionDiagnosisService prescriptionDiagnosisService;
    @Autowired
    private CommonUtil CommonUtil;
    @Autowired
    private ImUtill ImUtill;
    @Autowired
    private HttpUtil httpUtil;
    @Autowired
    private SignFamilyDao signFamilyDao;
    @Autowired
    private DoctorDao doctorDao;
    /**
     * 患者咨询记录查询
@ -129,7 +132,52 @@ public class ConsultController extends WeixinBaseController {
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "getPreConsultList",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取续方咨询列表")
    public String getPreConsultList(@RequestParam(required = false) String title,
                                    @RequestParam(required = true) long id,@RequestParam(required = true) int pagesize){
        try {
            JSONArray array = new JSONArray();
//            Page<Object> data = consultTeamService.findConsultRecordByType("a663d0cf7f8c4d38a8327cedc921e65f", id, pagesize,8, title);//8表示续方咨询
            Page<Object> data = consultTeamService.findConsultRecordByType(getRepUID(), id, pagesize,8, title);//8表示续方咨询
            if (data != null) {
                for (Object consult : data.getContent()) {
                    if (consult == null) {
                        continue;
                    }
                    Object[] result = (Object[]) consult;
                    JSONObject json = new JSONObject();
                    json.put("id", result[0]);
                    // 设置咨询类型:1三师咨询,2视频咨询,3图文咨询,4公共咨询,5病友圈,8 续方咨询
                    json.put("type", result[1]);
                    // 设置咨询标识
                    json.put("code", result[2]);
                    // 设置显示标题
                    json.put("title", result[3]);
                    // 设置主诉
                    json.put("symptoms", result[4]);
                    // 咨询状态
                    json.put("status", result[6]);
                    // 设置咨询日期
                    json.put("czrq", DateUtil.dateToStrLong((Date) result[5]));
                    // 咨询状态
                    json.put("doctorCode", result[7]);
                    json.put("evaluate", result[8]);
                    String relationCode = result[9]==null?"":result[9].toString();
                    json.put("prescriptionCode",relationCode);//续方code
                    json.put("prescriptionDt",prescriptionDiagnosisService.getPrescriptionDiagnosis(relationCode));//续方疾病类型
                    json.put("prescriptionInfo",prescriptionDiagnosisService.getPrescriptionInfo(relationCode));//续方药品信息
                    array.put(json);
                }
            }
            return write(200, "查询成功!", "list", array);
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    /**
     * 获取医生的排班时间
     *
@ -266,14 +314,14 @@ public class ConsultController extends WeixinBaseController {
        }
    }
    @RequestMapping(value = "isPrescriptionConsult", method = RequestMethod.GET)
    @RequestMapping(value = "isPrescriptionConsult",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("是否可以续方咨询")
    public String isPrescriptConsult(String patient) {
        try {
    public String isPrescriptConsult(String patient){
        try{
            SignFamily signFamily = signFamilyDao.findByPatient(patient);
            if (signFamily == null) {
                return error(-1, "您还未签约,不能发起续方咨询!");
            if(signFamily==null){
                return error(-1,"您还未签约,不能发起续方咨询!");
            }
            //点击后判断,如果用户当前存在可申请续方的处方记录,则进入续方申请流程,若不存在可续方记录,alert“当前没有可以申请续方的处方记录”
@ -281,42 +329,40 @@ public class ConsultController extends WeixinBaseController {
            Doctor doctor = doctorDao.findByAdminTeamId(signFamily.getAdminTeamId());
            JSONObject json = new JSONObject();
            json.put("doctor", doctor.getCode());
            json.put("doctorName", doctor.getName());
            json.put("adminTeamId", signFamily.getAdminTeamId());
            json.put("hospital", doctor.getHospital());
            json.put("hospitalName", doctor.getHospitalName());
            json.put("doctor",doctor.getCode());
            json.put("doctorName",doctor.getName());
            json.put("adminTeamId",signFamily.getAdminTeamId());
            json.put("hospital",doctor.getHospital());
            json.put("hospitalName",doctor.getHospitalName());
            return write(200, "查询成功!", "data", json);
        } catch (Exception e) {
        }catch (Exception e){
            error(e);
            return error(-1, "查询失败");
            return error(-1,"查询失败");
        }
    }
    @RequestMapping(value = "addPrescriptionConsult", method = RequestMethod.POST)
    @RequestMapping(value = "addPrescriptionConsult",method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("添加续方咨询")
    public String addPrescriptionConsult(@ApiParam(name = "patient", value = "居民code", defaultValue = "1")
                                         @RequestParam(value = "patient", required = true) String patient,
                                         @ApiParam(name = "jwCode", value = "基位处方code", defaultValue = "10")
    public String addPrescriptionConsult(@ApiParam(name = "jwCode", value = "基位处方code", defaultValue = "10")
                                         @RequestParam(value = "jwCode", required = true) String jwCode,
                                         @ApiParam(name = "doctor", value = "咨询医生(开方医生、审核医生)", defaultValue = "86225d1365e711e69f7c005056850d66")
                                         @RequestParam(value = "doctor", required = true) String doctor,
                                         @ApiParam(name = "adminTeamId", value = "签约行政团队id", defaultValue = "224")
                                         @RequestParam(value = "adminTeamId", required = true) Long adminTeamId,
                                         @ApiParam(name = "reason", value = "续方说明", defaultValue = "续方申请")
                                         @RequestParam(value = "reason", required = false) String reason) {
        try {
                                         @RequestParam(value = "reason", required = false) String reason){
        try{
            ConsultTeam consult = new ConsultTeam();
            consult.setType(8);//续方咨询
            consult.setAdminTeamId(adminTeamId);
            // 保存到数据库
            // int res = consultTeamService.addPrescriptionConsult(jwCode, "a663d0cf7f8c4d38a8327cedc921e65f", "a663d0cf7f8c4d38a8327cedc921e65f", doctor, consult, reason);
            int res = consultTeamService.addPrescriptionConsult(jwCode, getRepUID(), getUID(), doctor, consult, reason);
//            int res = consultTeamService.addPrescriptionConsult(jwCode, "a663d0cf7f8c4d38a8327cedc921e65f","a663d0cf7f8c4d38a8327cedc921e65f",doctor,consult,reason);
            int res = consultTeamService.addPrescriptionConsult(jwCode, getRepUID(),getUID(),doctor,consult,reason);
            if (res == -1) {
                return error(-1, "家庭签约信息不存在或已过期,无法进行家庭医生咨询!");
                return error(-1, "该处方存在未审核的续方,无法进行续方咨询!");
            }
//            Doctor doctor = doctorService.findDoctorByCode(consult.getDoctor());
@ -330,9 +376,9 @@ public class ConsultController extends WeixinBaseController {
            BusinessLogs.info(BusinessLogs.BusinessType.consult, getRepUID(), getUID(), new JSONObject(consult));
            return write(200, "提交成功", "data", consult);
        } catch (Exception e) {
        }catch (Exception e){
            error(e);
            return error(-1, "添加失败");
            return error(-1,"添加失败");
        }
    }
@ -355,8 +401,8 @@ public class ConsultController extends WeixinBaseController {
                      @RequestParam(required = false) String voice,
                      @RequestParam(required = false) Long guidance) {
        try {
            System.out.println("guidance1=" + guidance);
            System.out.println("symptoms=" + symptoms);
            System.out.println("guidance1="+guidance);
            System.out.println("symptoms="+symptoms);
            if (type == null) {
                type = 1;
            }
@ -400,9 +446,9 @@ public class ConsultController extends WeixinBaseController {
                consult.setGuidance(guidance);
            }
            System.out.println("guidance2=" + guidance);
            System.out.println("guidance2="+guidance);
            // 保存到数据库
            int res = consultTeamService.addTeamConsult(consult, getRepUID(), getUID());
            int res = consultTeamService.addTeamConsult(consult, getRepUID(),getUID());
            if (res == -1) {
                return error(-1, "家庭签约信息不存在或已过期,无法进行家庭医生咨询!");
            } else if (res == -2) {
@ -431,23 +477,23 @@ public class ConsultController extends WeixinBaseController {
        }
    }
    @RequestMapping(value = "intoTopic", method = RequestMethod.POST)
    @RequestMapping(value = "intoTopic",method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("进入咨询")
    public String intoTopic(@RequestParam(required = true) String consult) {
        try {
            int result = consultTeamService.intoTopic(consult, getRepUID(), getUID());
            if (result == -1) {
                return error(-1, "该咨询不是进行中");
    public String intoTopic(@RequestParam(required = true) String consult){
        try{
            int result = consultTeamService.intoTopic(consult,getRepUID(),getUID());
            if(result==-1){
                return error(-1,"该咨询不是进行中");
            }
            JSONObject json = new JSONObject();
            json.put("consult", consult);
            json.put("content", "进入咨询");
            json.put("consult",consult);
            json.put("content","进入咨询");
            BusinessLogs.info(BusinessLogs.BusinessType.consult, getUID(), getRepUID(), json);
            return success("进入成功");
        } catch (Exception e) {
        }catch (Exception e){
            error(e);
            return error(-1, "请求失败");
            return error(-1,"请求失败");
        }
    }
@ -510,9 +556,9 @@ public class ConsultController extends WeixinBaseController {
            consult.setVoice(voice);
            consult.setDoctor(doctorCode);//设置专科医生
            // 保存到数据库
            JSONObject object = consultTeamService.famousConsult(consult, getRepUID(), "1", getUID());
            JSONObject resultConsult = new JSONObject(consult);
            resultConsult.put("session_id", object.getString("session_id"));
            JSONObject object  = consultTeamService.famousConsult(consult, getRepUID(), "1",getUID());
            JSONObject resultConsult =  new JSONObject(consult);
            resultConsult.put("session_id",object.getString("session_id"));
            //名医咨询次数减一
            doctorWorkTimeService.setDoctorCurrentConsultTimesRemain(doctorCode);
            // 推送消息给医生
@ -778,10 +824,10 @@ public class ConsultController extends WeixinBaseController {
            int i = 0;
            List<String> failed = new ArrayList<>();
            String agent = getUID() == getRepUID() ? null : getUID();
            String agent = getUID()==getRepUID()?null:getUID();
            for (ConsultTeamLog log : logs) {
//                String response = ImUtill.sendTopicIM(getUID(), patient.getName(), consult, String.valueOf(log.getType()), log.getContent());
                String response = ImUtill.sendTopicIM(getRepUID(), patient.getName(), consult, String.valueOf(log.getType()), log.getContent(), agent);
                String response = ImUtill.sendTopicIM(getRepUID(), patient.getName(), consult, String.valueOf(log.getType()), log.getContent(),agent);
                if (StringUtils.isNotEmpty(response)) {
                    JSONObject resObj = new JSONObject(response);
                    if (resObj.getInt("status") == -1) {
@ -816,7 +862,7 @@ public class ConsultController extends WeixinBaseController {
            JSONObject messageObj = ImUtill.getTopicMessage(consultModel.getConsult(), consultModel.getStartMsgId(), consultModel.getEndMsgId(), page, pagesize, getRepUID());
            //过滤续签
            consultTeamService.removeRenewPerson(messageObj, getRepUID());
            consultTeamService.removeRenewPerson(messageObj,getRepUID());
            return write(200, "查询成功", "list", messageObj);
        } catch (Exception e) {
@ -833,7 +879,7 @@ public class ConsultController extends WeixinBaseController {
     */
    @RequestMapping(value = "logs")
    @ResponseBody
    public String logs(@RequestParam String sessionId, @RequestParam(required = false) String startMsgId, @RequestParam(required = false) String endMsgId, @RequestParam int page, @RequestParam int pagesize) {
    public String logs(@RequestParam String sessionId,@RequestParam(required = false) String startMsgId,@RequestParam(required = false) String endMsgId, @RequestParam int page, @RequestParam int pagesize) {
        try {
            JSONArray messageArray = ImUtill.getSessionMessage(sessionId, startMsgId, endMsgId, page, pagesize, getRepUID());
            return write(200, "查询成功", "list", messageArray);
@ -850,7 +896,7 @@ public class ConsultController extends WeixinBaseController {
            JSONArray participants = ImUtill.getSessions(sessionId);
            //过滤续签
            consultTeamService.removeRenewPerson(participants, getRepUID());
            consultTeamService.removeRenewPerson(participants,getRepUID());
            return write(200, "查询成功", "list", participants);
        } catch (Exception e) {
@ -877,7 +923,7 @@ public class ConsultController extends WeixinBaseController {
            String url = SystemConf.getInstance().getSystemProperties().getProperty("im_list_get")
                    + "api/v1/chats/message";
            String reG = httpUtil.sendGet(url, "id=" + logId + "&type=" + msgType);
            String reG = HttpUtil.sendGet(url, "id=" + logId + "&type=" + msgType);
            JSONObject obj = null;
            if (!org.springframework.util.StringUtils.isEmpty(reG)) {
                obj = new JSONObject(new String(reG.getBytes(), "utf-8"));
@ -961,22 +1007,21 @@ public class ConsultController extends WeixinBaseController {
    @RequestMapping(value = "getTopic")
    @ResponseBody
    public String getTopic(String consult) {
        try {
    public String getTopic(String consult){
        try{
            return success(ImUtill.getTopic(consult).get("data").toString());
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }catch (Exception e){
            return error(-1,e.getMessage());
        }
    }
    @RequestMapping(value = "getConsult")
    @ResponseBody
    public String getConsult(String consult) {
        try {
    public String getConsult(String consult){
        try{
            ConsultTeam consultTeam = consultTeamService.findByConsultCode(consult);
            return write(200, "查询成功", "data", consultTeam);
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }catch (Exception e){
            return error(-1,e.getMessage());
        }
    }
}