Explorar o código

consult添加来源

wangjun %!s(int64=4) %!d(string=hai) anos
pai
achega
de15563e8a

+ 10 - 9
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -893,7 +893,7 @@ public class ImService {
	 * @return
	 * @throws Exception
	 */
	public JSONObject addTeamConsult(ConsultTeamDo ct, String patient, String doctor) throws Exception {
	public JSONObject addTeamConsult(ConsultTeamDo ct, String patient, String doctor,String source) throws Exception {
		JSONObject re = new JSONObject();
		boolean boo = StringUtils.isEmpty(getUnfinishedConsult(patient, doctor));
		logger.info("boo"+boo);
@ -938,7 +938,7 @@ public class ImService {
		// 医生未读数量为1
		ct.setDoctorRead(1);
		// 添加咨询记录
		ConsultDo consult = addConsult(ct.getPatient(), "专家咨询", ct.getSymptoms(), ct.getImages(), ct.getType());
		ConsultDo consult = addConsult(ct.getPatient(), "专家咨询", ct.getSymptoms(), ct.getImages(), ct.getType(),source);
//		// 设置关联指导
//		consult.setGuidance(ct.getGuidance());
		// 设置咨询标识
@ -1011,7 +1011,7 @@ public class ImService {
	 * @param type 咨询类型:9在线复诊,13专家咨询
	 * @return
	 */
	public ConsultDo addConsult(String patient, String title, String symptoms, String images, int type) {
	public ConsultDo addConsult(String patient, String title, String symptoms, String images, int type,String source) {
		ConsultDo consult = new ConsultDo();
		consult.setId(UUID.randomUUID().toString().replaceAll("-", ""));
		consult.setCzrq(new Date());
@ -1022,6 +1022,7 @@ public class ImService {
		consult.setImages(images);
		consult.setType(type);
		consult.setPayStatus(0);
		consult.setSource(source);
		return consultDao.save(consult);
	}
	
@ -1106,7 +1107,7 @@ public class ImService {
	 * @param reason
	 * @return
	 */
	public JSONObject addPrescriptionConsult(String outpatientCode, String patient,String doctorCode, ConsultTeamDo ct, String reason, Integer type,String wxId) throws Exception {
	public JSONObject addPrescriptionConsult(String outpatientCode, String patient,String doctorCode, ConsultTeamDo ct, String reason, Integer type,String wxId,String source) throws Exception {
		
		synchronized (outpatientCode.intern()) {
			
@ -1227,7 +1228,7 @@ public class ImService {
				//添加就诊图片
				ct.setImages(wlyyOutpatientDO.getDiseaseImg());
				// 添加咨询记录
				ConsultDo consult = addConsult(ct.getPatient(), consultTitle, ct.getSymptoms(), ct.getImages(), ct.getType());
				ConsultDo consult = addConsult(ct.getPatient(), consultTitle, ct.getSymptoms(), ct.getImages(), ct.getType(),source);
				// 设置关联指导
				consult.setGuidance(ct.getGuidance());
				//关联业务code
@ -1345,7 +1346,7 @@ public class ImService {
	 * 添加复诊咨询
	 * @return
	 */
	public JSONObject addConsult(String outpatientCode, String patient,String doctorCode, ConsultTeamDo ct, String reason, Integer type,String wxId) throws Exception {
	public JSONObject addConsult(String outpatientCode, String patient,String doctorCode, ConsultTeamDo ct, String reason, Integer type,String wxId,String source) throws Exception {
		//1、获取his就诊记录详情(保存续方表、药品续方信息表、续方疾病类型表)
		WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(outpatientCode);
		BaseDoctorDO doctor = baseDoctorDao.findById(doctorCode);
@ -1407,7 +1408,7 @@ public class ImService {
		//添加就诊图片
		ct.setImages(wlyyOutpatientDO.getDiseaseImg());
		// 添加咨询记录
		ConsultDo consult = addConsult(ct.getPatient(), consultTitle, ct.getSymptoms(), ct.getImages(), ct.getType());
		ConsultDo consult = addConsult(ct.getPatient(), consultTitle, ct.getSymptoms(), ct.getImages(), ct.getType(),source);
		// 设置关联指导
		consult.setGuidance(ct.getGuidance());
		//关联业务code
@ -2569,7 +2570,7 @@ public class ImService {
	 * @param images
	 * @return
	 */
	public String generalAddExpertConsult(String patient_code, String general_doctor, String special_doctor, String when, String symptoms, String images, ConsultTeamDo ct) throws Exception {
	public String generalAddExpertConsult(String patient_code, String general_doctor, String special_doctor, String when, String symptoms, String images, ConsultTeamDo ct,String source) throws Exception {
		// 设置咨询类型:15
		ct.setType(15);
		// 设置发病时间
@ -2632,7 +2633,7 @@ public class ImService {
		// 医生未读数量为1
		ct.setDoctorRead(1);
		// 添加咨询记录
		ConsultDo consult = addConsult(ct.getPatient(), consultTitle, ct.getSymptoms(), ct.getImages(), ct.getType());
		ConsultDo consult = addConsult(ct.getPatient(), consultTitle, ct.getSymptoms(), ct.getImages(), ct.getType(),source);
		// 设置关联指导
//		consult.setGuidance(ct.getGuidance());
		//关联业务code

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/im/ConsultDo.java

@ -38,6 +38,16 @@ public class ConsultDo extends UuidIdentityEntity {
	private String relationCode;
	//支付状态
	private Integer payStatus;
	//来源
	private String source;
	public String getSource() {
		return source;
	}
	public void setSource(String source) {
		this.source = source;
	}
	
	public String getPatient() {
		return patient;

+ 13 - 7
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -190,7 +190,9 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "type", value = "咨询类型(1、图文;2、视频,3、图文+视频)", defaultValue = "1")
			@RequestParam(value = "type", required = true) Integer type,
			@ApiParam(name = "reason", value = "复诊说明", defaultValue = "复诊说明")
			@RequestParam(value = "reason", required = false) String reason)throws Exception{
			@RequestParam(value = "reason", required = false) String reason,
										  @ApiParam(name = "source", value = "来源")
											  @RequestParam(value = "source", required = false) String source)throws Exception{
			ConsultTeamDo consult = new ConsultTeamDo();
			if(2 == type){
				consult.setType(16);//视频复诊
@ -235,13 +237,13 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
					if("0".equals(rsCode)||"-2".equals(rsCode)){
						//挂号成功,已经挂号
						//2.
						result = imService.addPrescriptionConsult(outpatientCode, patientCode,doctorCode,consult,reason,type,wxId);
						result = imService.addPrescriptionConsult(outpatientCode, patientCode,doctorCode,consult,reason,type,wxId,source);
					}else{
						return failed(mes);
					}
					logger.info("调用挂号接口====END");
				}else {
					result = imService.addPrescriptionConsult(outpatientCode, patientCode,doctorCode,consult,reason,type,wxId);
					result = imService.addPrescriptionConsult(outpatientCode, patientCode,doctorCode,consult,reason,type,wxId,source);
				}
			}
@ -297,7 +299,9 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
										  @ApiParam(name = "type", value = "咨询类型(1、图文;2、视频,3、图文+视频)", defaultValue = "1")
										  @RequestParam(value = "type", required = true) Integer type,
										  @ApiParam(name = "reason", value = "复诊说明", defaultValue = "复诊说明")
										  @RequestParam(value = "reason", required = false) String reason)throws Exception{
										  @RequestParam(value = "reason", required = false) String reason,
							  @ApiParam(name = "source", value = "来源")
								  @RequestParam(value = "source", required = false) String source)throws Exception{
		ConsultTeamDo consult = new ConsultTeamDo();
		if(2 == type){
			consult.setType(16);//视频复诊
@ -349,7 +353,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
*/
			//2.
			result = imService.addConsult(outpatientCode, patientCode,doctorCode,consult,reason,type,wxId);
			result = imService.addConsult(outpatientCode, patientCode,doctorCode,consult,reason,type,wxId,source);
		}
		return success("操作成功",result);
	}
@ -371,14 +375,16 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "images", value = "图片")
			@RequestParam(value = "images",required = false) String images,
			@ApiParam(name = "voice", value = "语音")
			@RequestParam(value = "voice",required = false) String voice)throws Exception{
			@RequestParam(value = "voice",required = false) String voice,
			@ApiParam(name = "source", value = "来源")
			@RequestParam(value = "source",required = false) String source)throws Exception{
		
		ConsultTeamDo consult = new ConsultTeamDo();
		consult.setType(15);//家医咨询求助互联网医院专科医生:全科医生-专科医生-咨询聊天
		
		String result = "";
		synchronized (patient_code.intern()){
			result = imService.generalAddExpertConsult(patient_code, general_doctor,special_doctor,when,symptoms,images,consult);
			result = imService.generalAddExpertConsult(patient_code, general_doctor,special_doctor,when,symptoms,images,consult,source);
			
			BaseDoctorDO generalDoctor = baseDoctorDao.findById(general_doctor);
			BaseDoctorDO specialDoctor = baseDoctorDao.findById(special_doctor);

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

@ -419,7 +419,9 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "voice", value = "语音")
			@RequestParam(value = "voice",required = false) String voice,
			@ApiParam(name = "type", value = "咨询类型:1专家咨询 14导诊助手 17专家视频咨询")
			@RequestParam(value = "type",required = false) Integer type)throws Exception{
			@RequestParam(value = "type",required = false) Integer type,
			@ApiParam(name = "source", value = "咨询类型来源")
			@RequestParam(value = "source",required = false) String source)throws Exception{
		
//		//发送厦门i健康智能推送
//		try{
@ -458,7 +460,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
//		JSONArray dts = null;
		synchronized (patient.intern()){//新增同步方法。设备保存写在service层但是不生效,写在controller层才生效
			JSONObject re = null;
			re = imService.addTeamConsult(consult, patient,doctor);
			re = imService.addTeamConsult(consult, patient,doctor,source);
//			res = re.getInteger("status");
//			dts = re.containsKey("doctor")?re.getJSONArray("doctor"):null;
			if (payFlag){