huangwenjie пре 5 година
родитељ
комит
2747fc5bf6

+ 0 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionDao.java

@ -1,8 +1,6 @@
package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

+ 5 - 0
business/im-service/pom.xml

@ -37,6 +37,10 @@
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-web</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-util</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>base-service</artifactId>
@ -44,4 +48,5 @@
        </dependency>
        <!--   poi xml导入导出工具 end -->
    </dependencies>
</project>

+ 14 - 18
business/im-service/src/main/java/com/yihu/jw/im/dao/ConsultDao.java

@ -1,11 +1,7 @@
package com.yihu.jw.im.dao;
import com.yihu.jw.entity.base.im.ConsultDo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
@ -13,18 +9,18 @@ import org.springframework.data.repository.PagingAndSortingRepository;
 * @author huangwenjie
 */
public interface ConsultDao extends PagingAndSortingRepository<ConsultDo, String>, JpaSpecificationExecutor<ConsultDo> {
	
	// 查询患者咨询记录
	Page<Object> findByPatient(String patient, String title, long id, PageRequest pageRequest);
	
	// 查询患者咨询记录
	Page<Object> findByPatient(String patient, String title, PageRequest 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 ConsultDo 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 a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate,a.signCode  from ConsultDo 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);
//	// 查询患者咨询记录
//	Page<Object> findByPatient(String patient, String title, String id, PageRequest pageRequest);
//
//	// 查询患者咨询记录
//	Page<Object> findByPatient(String patient, String title, PageRequest 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 ConsultDo a,ConsultTeamDo 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, String 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 ConsultDo a,ConsultTeamDo 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);
}

+ 3 - 3
business/im-service/src/main/java/com/yihu/jw/im/dao/ConsultTeamDao.java

@ -14,7 +14,7 @@ import java.util.List;
public interface ConsultTeamDao  extends PagingAndSortingRepository<ConsultTeamDo, String>, JpaSpecificationExecutor<ConsultTeamDo> {
	// 根據consult查詢咨询记录
	ConsultTeamDo findByConsult(String consult);
	
	@Query("select a from ConsultTeamDo a,ConsultTeamDoctor b where a.consult = b.consult and a.patient = ?1 and b.to = ?2 and a.del = '1' and a.type<>8 and a.status = 0")
	List<ConsultTeamDo> findUnfinishedConsultType(String patient,String doctor);
//
//	@Query("select a from ConsultTeamDo a,ConsultTeamDoctor b where a.consult = b.consult and a.patient = ?1 and b.to = ?2 and a.del = '1' and a.type<>8 and a.status = 0")
//	List<ConsultTeamDo> findUnfinishedConsultType(String patient,String doctor);
}

+ 48 - 24
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -1,6 +1,8 @@
package com.yihu.jw.im.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.im.ConsultTeamLogDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
@ -9,15 +11,18 @@ import com.yihu.jw.im.dao.ConsultTeamDao;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.im.util.ImageCompress;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.restmodel.im.ConsultVO;
import com.yihu.jw.util.common.FileUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
@ -73,41 +78,43 @@ public class ImService {
	@Value("${fastDFS.fastdfs_file_url}")
	private String fastdfs_file_url;
	
	@Autowired
	private JdbcTemplate jdbcTemplate;
	
	
	
	/**
	 * 查询患者所有的咨询记录
	 * @param patient 患者标识
	 * @param id 会话ID(等同IM表topicId)
	 * @param type 咨询会话类型
	 * @param pagesize 分页大小
	 * @param title 标题关键字
	 * @return
	 */
	public Page<Object> findConsultRecordByPatient(String patient, long id, int pagesize, String title) {
		if (id < 0) {
			id = 0;
		}
	public List<ConsultVO>  findConsultRecordByPatient(String patient, String id,Integer type, int pagesize, String title) {
		if (pagesize <= 0) {
			pagesize = 10;
		}
		// 排序
		Sort sort = new Sort(Sort.Direction.DESC, "id");
		// 分页信息
		PageRequest pageRequest = new PageRequest(0, pagesize, sort);
		
		String  sql = " SELECT a.type AS type,a.title AS title,a.symptoms AS symptoms,a.czrq AS czrq  from wlyy_consult a where a.patient = '"+patient+"' and type = "+type+" ";
		List<ConsultVO> result = new ArrayList<>();
		
		if(!StringUtils.isEmpty(title)){
			title="%"+title+"%";
			if (id > 0) {
				return consultDao.findByPatient(patient,title, id, pageRequest);
			} else {
				return consultDao.findByPatient(patient,title, pageRequest);
			}
		}else{
			if (id > 0) {
				return consultDao.findByPatient(patient, id, pageRequest);
			} else {
				return consultDao.findByPatient(patient, pageRequest);
			}
			sql +=" and title like '"+title+"'";
			
		}
		if (!StringUtils.isEmpty(id)) {
			sql += " and id = '" + id + "'";
		}
		sql += " ORDER BY id desc limit 0,"+pagesize+"";
		
		result = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ConsultVO.class));
		
		return result;
	}
	
	/**
@ -117,10 +124,27 @@ public class ImService {
	 * @param doctor  医生
	 * @return
	 */
	public List<ConsultTeamDo> getUnfinishedConsult(String patient, String doctor) {
		return consultTeamDao.findUnfinishedConsultType(patient, doctor);
	public Long  getUnfinishedConsult(String patient, String doctor) {
		
		String totalSql = "SELECT count(a.id) AS total " +
				"FROM wlyy_consult_team a,wlyy_consult_team_doctor b " +
				"WHERE a.consult=b.consult " +
				"AND a.patient= '" +patient+"' "+
				"AND b.to_doctor='" +doctor+"' "+
				"AND a.del='1' " +
				"AND a.type<> 8 " +
				"AND a.`status`=0";
		
		List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
		
		Long count = 0L;
		if (rstotal != null && rstotal.size() > 0) {
			count = (Long) rstotal.get(0).get("total");
		}
		return count;
	}
	
	
	/**
	 * 获取会话成员
	 *
@ -260,8 +284,8 @@ public class ImService {
			String response = imUtil.sendTopicIM(patientcode, patient.getName(), consult, String.valueOf(log.getType()), log.getContent(),null);
			
			if (org.apache.commons.lang3.StringUtils.isNotEmpty(response)) {
				JSONObject resObj = new JSONObject(response);
				if (resObj.getInt("status") == -1) {
				JSONObject resObj = JSON.parseObject(response);
				if (resObj.getInteger("status")  == -1) {
					throw new Exception("追问失败!" + resObj.getString("message"));
//					return invalidUserException(new RuntimeException(resObj.getString("message")), -1, "追问失败!" + resObj.getString("message"));
				}

+ 4 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/im/ConsultTeamDo.java

@ -4,6 +4,8 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
@ -11,6 +13,8 @@ import java.util.Date;
 * IM咨询扩展表
 * @author huangwenjie
 */
@Entity
@Table(name = "wlyy_consult_team")
public class ConsultTeamDo extends UuidIdentityEntity {
	
	private String consult;         // 咨询标识

+ 86 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/im/ConsultTeamDoctorDo.java

@ -0,0 +1,86 @@
package com.yihu.jw.entity.base.im;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import java.util.Date;
/**
 * @author 三师咨询转接给的医生记录对象
 * @date 2019/6/19 11:10
 */
public class ConsultTeamDoctorDo extends UuidIdentityEntity {
	// 三师咨询标识
	private String consult;
	// 医生标
	private String from;
	// 转出医生姓名
	private String fromName;
	// 替回答的医生标识
	private String to;
	// 是否有回复过
	private int reply;
	// 咨询时间
	private Date czrq;
	// 作废标识,1正常,0作废
	private String del;
	
	public String getConsult() {
		return consult;
	}
	
	public void setConsult(String consult) {
		this.consult = consult;
	}
	
	@Column(name = "form_doctor")
	public String getFrom() {
		return from;
	}
	
	public void setFrom(String from) {
		this.from = from;
	}
	
	@Column(name = "form_doctor_name")
	public String getFromName() {
		return fromName;
	}
	
	public void setFromName(String fromName) {
		this.fromName = fromName;
	}
	
	@Column(name = "to_doctor")
	public String getTo() {
		return to;
	}
	
	public void setTo(String to) {
		this.to = to;
	}
	
	public int getReply() {
		return reply;
	}
	
	public void setReply(int reply) {
		this.reply = reply;
	}
	
	public Date getCzrq() {
		return czrq;
	}
	
	public void setCzrq(Date czrq) {
		this.czrq = czrq;
	}
	
	public String getDel() {
		return del;
	}
	
	public void setDel(String del) {
		this.del = del;
	}
}

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

@ -1,7 +1,5 @@
package com.yihu.jw.rm.hospital;
import com.sun.xml.internal.rngom.parse.host.Base;
import com.yihu.jw.rm.base.BaseRequestMapping;
/**
 * Created by Trick on 2019/5/16.
@ -194,7 +192,7 @@ public class BaseHospitalRequestMapping {
    /**
     * 居民端-咨询IM
     */
    public static class PatientIM extends Base{
    public static class PatientIM extends Basic{
        public static final String PREFIX  = "/im/patient";
    
        //患者咨询记录查询

+ 81 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/im/ConsultVO.java

@ -0,0 +1,81 @@
package com.yihu.jw.restmodel.im;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
 * @author huangwenjie
 * @date 2019/6/18 08:55
 */
@ApiModel(value = "ConsultVO", description = "IM咨询VO类")
public class ConsultVO extends UuidIdentityVO {
	
	@ApiModelProperty(value = "咨询类型", example = "模块1")
	private Integer type;
	
	@ApiModelProperty(value = "咨询标题/主诉", example = "模块1")
	private String title;
	
	@ApiModelProperty(value = "主诉", example = "模块1")
	private String symptoms;
	
	@ApiModelProperty(value = "咨询状态(0进行中,1已完成,-1患者取消,-2超时未响应自动关闭)", example = "模块1")
	private Integer status;
	
	@ApiModelProperty(value = "咨询时间", example = "模块1")
	private Date czrq;
	
	@ApiModelProperty(value = "是否评价 1、已评价 0、未评价'", example = "模块1")
	private Integer evaluate;
	
	public Integer getType() {
		return type;
	}
	
	public void setType(Integer type) {
		this.type = type;
	}
	
	public String getTitle() {
		return title;
	}
	
	public void setTitle(String title) {
		this.title = title;
	}
	
	public String getSymptoms() {
		return symptoms;
	}
	
	public void setSymptoms(String symptoms) {
		this.symptoms = symptoms;
	}
	
	public Integer getStatus() {
		return status;
	}
	
	public void setStatus(Integer status) {
		this.status = status;
	}
	
	public Date getCzrq() {
		return czrq;
	}
	
	public void setCzrq(Date czrq) {
		this.czrq = czrq;
	}
	
	public Integer getEvaluate() {
		return evaluate;
	}
	
	public void setEvaluate(Integer evaluate) {
		this.evaluate = evaluate;
	}
}

+ 40 - 40
svr/svr-base/src/main/java/com/yihu/jw/base/service/system/SystemDictService.java

@ -75,26 +75,26 @@ public class SystemDictService extends BaseJpaService<SystemDictDO, SystemDictDa
    public JSONArray getDistListBySaasId(String type, String saasId, String name, String sorts, int page, int size) throws Exception {
        JSONArray jsonArray = new JSONArray();
        JSONObject jsonObject = new JSONObject();
        if (SystemDictEnum.Icd10Dict == SystemDictEnum.valueOf(type)) {
            jsonObject = dictIcd10Service.queryAll(saasId, createPage(page, size, sorts));
        } else if (SystemDictEnum.HospitalDeptDict == SystemDictEnum.valueOf(type)) {
            jsonObject = dictHospitalDeptService.queryAll(saasId, createPage(page, size, sorts));
        } else if (SystemDictEnum.JobTitleDict == SystemDictEnum.valueOf(type)) {
            jsonObject = dictJobTitleService.queryAll(saasId, createPage(page, size, sorts));
        } else if (SystemDictEnum.HealthProblemDict == SystemDictEnum.valueOf(type)) {
            jsonObject = dictHealthProblemService.queryAll(saasId, createPage(page, size, sorts));
        } else if (SystemDictEnum.MedicineDict == SystemDictEnum.valueOf(type)) {
            jsonObject = dictMedicineService.queryAll(saasId, createPage(page, size, sorts));
        } else if (SystemDictEnum.DiseaseDict == SystemDictEnum.valueOf(type)) {
            jsonObject = dictDiseaseService.queryAll(saasId, createPage(page, size, sorts));
        } else {
            jsonObject = this.queryAll(saasId, createPage(page, size, sorts));
        }
        jsonArray.add(jsonObject);
//        if (SystemDictEnum.Icd10Dict == SystemDictEnum.valueOf(type)) {
//            jsonObject = dictIcd10Service.queryAll(saasId, createPage(page, size, sorts));
//        } else if (SystemDictEnum.HospitalDeptDict == SystemDictEnum.valueOf(type)) {
//            jsonObject = dictHospitalDeptService.queryAll(saasId, createPage(page, size, sorts));
//
//        } else if (SystemDictEnum.JobTitleDict == SystemDictEnum.valueOf(type)) {
//            jsonObject = dictJobTitleService.queryAll(saasId, createPage(page, size, sorts));
//
//        } else if (SystemDictEnum.HealthProblemDict == SystemDictEnum.valueOf(type)) {
//            jsonObject = dictHealthProblemService.queryAll(saasId, createPage(page, size, sorts));
//
//        } else if (SystemDictEnum.MedicineDict == SystemDictEnum.valueOf(type)) {
//            jsonObject = dictMedicineService.queryAll(saasId, createPage(page, size, sorts));
//
//        } else if (SystemDictEnum.DiseaseDict == SystemDictEnum.valueOf(type)) {
//            jsonObject = dictDiseaseService.queryAll(saasId, createPage(page, size, sorts));
//        } else {
//            jsonObject = this.queryAll(saasId, createPage(page, size, sorts));
//        }
//        jsonArray.add(jsonObject);
        return jsonArray;
    }
@ -122,26 +122,26 @@ public class SystemDictService extends BaseJpaService<SystemDictDO, SystemDictDa
        JSONArray jsonArray = new JSONArray();
        JSONObject jsonObject = new JSONObject();
        if (SystemDictEnum.Icd10Dict == SystemDictEnum.valueOf(type)) {
            jsonObject = dictIcd10Service.queryAll(userId, createPage(page, size, sorts));
        } else if (SystemDictEnum.HospitalDeptDict == SystemDictEnum.valueOf(type)) {
            jsonObject = dictHospitalDeptService.queryAll("", createPage(page, size, sorts));
        } else if (SystemDictEnum.JobTitleDict == SystemDictEnum.valueOf(type)) {
            jsonObject = dictJobTitleService.queryAll("", createPage(page, size, sorts));
        } else if (SystemDictEnum.HealthProblemDict == SystemDictEnum.valueOf(type)) {
            jsonObject = dictHealthProblemService.queryAll("", createPage(page, size, sorts));
        } else if (SystemDictEnum.MedicineDict == SystemDictEnum.valueOf(type)) {
            jsonObject = dictMedicineService.queryAll("", createPage(page, size, sorts));
        } else if (SystemDictEnum.DiseaseDict == SystemDictEnum.valueOf(type)) {
            jsonObject = dictDiseaseService.queryAll("", createPage(page, size, sorts));
        } else {
            jsonObject = this.queryAll("", createPage(page, size, sorts));
        }
        jsonArray.add(jsonObject);
//        if (SystemDictEnum.Icd10Dict == SystemDictEnum.valueOf(type)) {
//            jsonObject = dictIcd10Service.queryAll(userId, createPage(page, size, sorts));
//        } else if (SystemDictEnum.HospitalDeptDict == SystemDictEnum.valueOf(type)) {
//            jsonObject = dictHospitalDeptService.queryAll("", createPage(page, size, sorts));
//
//        } else if (SystemDictEnum.JobTitleDict == SystemDictEnum.valueOf(type)) {
//            jsonObject = dictJobTitleService.queryAll("", createPage(page, size, sorts));
//
//        } else if (SystemDictEnum.HealthProblemDict == SystemDictEnum.valueOf(type)) {
//            jsonObject = dictHealthProblemService.queryAll("", createPage(page, size, sorts));
//
//        } else if (SystemDictEnum.MedicineDict == SystemDictEnum.valueOf(type)) {
//            jsonObject = dictMedicineService.queryAll("", createPage(page, size, sorts));
//
//        } else if (SystemDictEnum.DiseaseDict == SystemDictEnum.valueOf(type)) {
//            jsonObject = dictDiseaseService.queryAll("", createPage(page, size, sorts));
//        } else {
//            jsonObject = this.queryAll("", createPage(page, size, sorts));
//        }
//        jsonArray.add(jsonObject);
        return jsonArray;
    }

+ 5 - 1
svr/svr-internet-hospital-entrance/pom.xml

@ -153,7 +153,11 @@
            <artifactId>mqSdk</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>io.github.swagger2markup</groupId>
            <artifactId>swagger2markup</artifactId>
            <version>1.3.2</version>
        </dependency>
    </dependencies>

+ 0 - 14
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/config/JpaConfig.java

@ -1,14 +0,0 @@
package com.yihu.jw.hospital.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.orm.jpa.JpaTransactionManager;
@Configuration
public class JpaConfig {
    @Bean
    public JpaTransactionManager transactionManager(){
        return new JpaTransactionManager();
    }
}

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

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.restmodel.im.ConsultVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
@ -13,6 +14,7 @@ import com.yihu.jw.util.date.DateUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.axis.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;
@ -36,45 +38,37 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
	@ApiOperation(value = "患者咨询记录查询")
	public ListEnvelop records(
								@ApiParam(name = "patient", value = "居民id")
								@RequestParam(value = "patient",required = false) String patient,
								@RequestParam(value = "patient",required = true) String patient,
								@ApiParam(name = "title", value = "咨询标题关键字")
								@RequestParam(value = "title",required = false) String title,
								@ApiParam(name = "id", value = "咨询ID")
								@RequestParam(value = "id",required = false) Long id,
								@RequestParam(value = "id",required = false) String id,
								@ApiParam(name = "type", value = "咨询类型")
								@RequestParam(value = "type",required = true) Integer type,
								@ApiParam(name = "pagesize", value = "分页大小")
								@RequestParam(value = "pagesize",required = false) int pagesize
								)throws Exception{
		JSONArray array = new JSONArray();
		Page<Object> data = imService.findConsultRecordByPatient(patient, id, pagesize, title);
		List<ConsultVO>  data = imService.findConsultRecordByPatient(patient, id,type, pagesize, title);
		if (data != null) {
			for (Object consult : data.getContent()) {
			for (ConsultVO consult : data) {
				if (consult == null) {
					continue;
				}
				Object[] result = (Object[]) consult;
				JSONObject json = new JSONObject();
				json.put("id", result[0]);
				json.put("id", consult.getId());
				// 设置咨询类型:1三师咨询,2视频咨询,3图文咨询,4公共咨询,5病友圈
				json.put("type", result[1]);
				// 设置咨询标识
				json.put("code", result[2]);
				json.put("type", consult.getType());
				// 设置显示标题
				json.put("title", result[3]);
				json.put("title", consult.getTitle());
				// 设置主诉
				json.put("symptoms", result[4]);
				json.put("symptoms", consult.getSymptoms());
				// 咨询状态
				json.put("status", result[6]);
				json.put("status", consult.getStatus());
				// 设置咨询日期
				json.put("czrq", DateUtil.dateToStrLong((Date) result[5]));
				// 咨询状态
				json.put("doctorCode", result[7]);
				
				json.put("teamCode", result[8]);
				
				json.put("evaluate", result[9]);
				
				//签约code
				json.put("signCode", result[10]);
				json.put("czrq", DateUtil.dateToStrLong(consult.getCzrq()));
				//是否评价
				json.put("evaluate", consult.getEvaluate());
				
				array.add(json);
			}
@ -86,23 +80,23 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
	@ApiOperation(value = "查询居民与某个医生是否存在未结束的咨询")
	public Envelop isExistsUnfinishedConsult(
			@ApiParam(name = "doctor", value = "医生CODE")
			@RequestParam(value = "doctor",required = true) String doctor)throws Exception {
		org.json.JSONObject result = new org.json.JSONObject();
		List<ConsultTeamDo> consults = imService.getUnfinishedConsult(getUID(), doctor);
			@RequestParam(value = "doctor",required = true) String doctor,
			@ApiParam(name = "patient", value = "居民CODE")
			@RequestParam(value = "patient",required = false) String patient)throws Exception {
		
		if (consults != null && consults.size() > 0) {
			return success("查询成功",consults.get(0).getConsult());
		} else {
			return success("查询成功");
		if(StringUtils.isEmpty(patient)){
			patient= getUID();
		}
		
		Long count = imService.getUnfinishedConsult(getUID(), doctor);
		return success(count);
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.PatientIM.participants)
	@ApiOperation(value = "获取会话成员")
	public ListEnvelop participants(
			@ApiParam(name = "sessionId", value = "会话ID")
			@RequestParam(value = "sessionId",required = true) String sessionId){
			@RequestParam(value = "sessionId",required = true) String sessionId)throws Exception{
		
		JSONArray participants = imService.getSessions(sessionId);
		return success(participants);
@ -120,7 +114,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "page", value = "第几页")
			@RequestParam(value = "page",required = true) int page,
			@ApiParam(name = "pagesize", value = "分页数")
			@RequestParam(value = "pagesize",required = true) int pagesize){
			@RequestParam(value = "pagesize",required = true) int pagesize)throws Exception{
		JSONArray messageArray = imService.getSessionMessage(sessionId, startMsgId, endMsgId, page, pagesize, getUID());
		return success(messageArray);
	}

+ 1 - 1
svr/svr-internet-hospital/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name: svr-internet-hospital
    name: svr-internet-hospital-hwj
  cloud:
    config:
      failFast: true

+ 1 - 0
wlyy-lib-parent-pom/pom.xml

@ -28,6 +28,7 @@
        <module>../common/common-tracer</module>
        <module>../business/base-service</module>
        <module>../business/sms-service</module>
        <module>../business/im-service</module>
    </modules>
</project>

+ 5 - 1
wlyy-parent-pom/pom.xml

@ -76,7 +76,7 @@
        <!-- 应用 -->
        <module>../app/app-iot-server</module>
        <module>../app/public-health-server</module>
        <!--<module>../app/public-health-server</module>-->
    </modules>
@ -400,6 +400,10 @@
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <compilerArguments>
                        <verbose/>
                        <bootclasspath>${java.home}/lib/rt.jar${path.separator}${java.home}/lib/jce.jar</bootclasspath>
                    </compilerArguments>
                </configuration>
                <version>3.1</version>
            </plugin>