Ver código fonte

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

Trick 5 anos atrás
pai
commit
0cd057ae4a

+ 7 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -526,9 +526,13 @@ public class EntranceService {
            //查询信息结束
            sbs.append("</MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            logger.info("resp==="+resp);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
        }
        JSONArray jsonArray = ConvertUtil.convertListEnvelopInRow(resp);
        if(null==jsonArray){
            return null;
        }
        List<WlyyOutpatientVO> wlyyOutpatientVOS = new ArrayList<>();
        WlyyOutpatientVO wlyyOutpatientVO;
        for (Object object : jsonArray) {
@ -1614,6 +1618,7 @@ public class EntranceService {
        jsonObject.put("content", content);
        jsonObject.put("contentString",contentString);
        String responseMsg =httpClientUtil.sendPost(serverUrl+"/interface/ehospitalNoticePush.htm",jsonObject.toString());
        logger.info("ehospitalNoticePushResult:"+responseMsg);
        return responseMsg;
    }
@ -1626,6 +1631,7 @@ public class EntranceService {
        JSONObject  jsonObject=new JSONObject ();
        jsonObject.put("openId",openId);
        String responseMsg =httpClientUtil.sendPost(serverUrl+"/interface/getUserInfoByOpenId.htm",jsonObject.toString());
        logger.info("getUserInfoByOpenIdResult:"+responseMsg);
        return responseMsg;
    }
    /**
@ -1637,6 +1643,7 @@ public class EntranceService {
        JSONObject  jsonObject=new JSONObject ();
        jsonObject.put("interfaceid",interfaceid);
        String responseMsg =httpClientUtil.sendPost(serverUrl+"/interface/getAccessToken.htm",jsonObject.toString());
        logger.info("getAccessTokenResult:"+responseMsg);
        return responseMsg;
    }

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/util/MqSdkUtil.java

@ -134,6 +134,7 @@ public class MqSdkUtil {
            msgId = queueTools.putMsg(queueManager, xmlNodeName, reqMsg);
            // 获取响应消息
            respMsg = queueTools.getMsgById(queueManager, xmlNodeName, msgId, 150);
            log.info("respMsg=="+reqMsg);
            return respMsg;
        } catch (MQException e) {
            // 2033表示队列中没有消息
@ -269,6 +270,7 @@ public class MqSdkUtil {
            }
        }else if(retCode.equals("0")){
            log.info("ERRORMSG=="+ ((JSONObject) retInfo).get("RetCon").toString());
            //重新封装到json中
            ((net.sf.json.JSONObject) json).element("MsgInfo",   ((JSONObject) retInfo).get("RetCon"));
        }

+ 29 - 0
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -29,6 +29,8 @@ 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.consult.WlyyHospitalSysDictVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionDiagnosisVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.restmodel.im.ConsultVO;
import com.yihu.jw.rm.base.BaseRequestMapping;
@ -37,6 +39,7 @@ import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
@ -55,6 +58,7 @@ import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;
import java.util.logging.Logger;
/**
 * IM接口业务类
@ -62,6 +66,9 @@ import java.util.*;
 */
@Service
public class ImService {
	
	private org.slf4j.Logger logger = LoggerFactory.getLogger(ImService.class);
	
	@Autowired
	public ConsultDao consultDao;
	
@ -1325,4 +1332,26 @@ public class ImService {
	public Integer sessionCountByType(String userid,Integer type,Integer status){
		return imUtil.sessionCountByType(userid,type,status);
	}
	
	/**
	 * 发送复诊诊断和药品消息
	 * @param wlyyPrescriptionVO
	 * @return
	 */
	public void pushPrescriptionImMessage(WlyyPrescriptionVO wlyyPrescriptionVO) throws Exception {
		
		//获取诊断
		List<WlyyPrescriptionDiagnosisVO> wlyyPrescriptionDiagnosisVOS = wlyyPrescriptionVO.getDiagnosisVOs();
		if(!wlyyPrescriptionDiagnosisVOS.isEmpty()){
			String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyPrescriptionVO.getPatientCode()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_9", "28", JSON.toJSONString(wlyyPrescriptionDiagnosisVOS),"1");
		}
		
		//获取药品
		List<WlyyPrescriptionInfoVO> infoVOs = wlyyPrescriptionVO.getInfoVOs();
		if(!infoVOs.isEmpty()){
			String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyPrescriptionVO.getPatientCode()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_9", "28", JSON.toJSONString(infoVOs),"1");
		}
	
	}
}

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

@ -292,14 +292,21 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			@RequestParam(value = "patientCode",required = false) String patientCode
			) throws Exception {
		int resutl = imService.finish(consult,patientCode,1);
		BasePatientDO basePatientDO = basePatientService.findByIdAndDel(patientCode);
		
		BasePatientDO basePatientDO = basePatientService.findByIdAndDel(patientCode);
		JSONObject msgObj = new JSONObject();
		msgObj.put("msg",basePatientDO.getName()+"结束了咨询");
		msgObj.put("consultcode",consult);
		
		String jsonStr = "";
		
		String jsonStr = "{\"id\":\""+UUID.randomUUID().toString()+"\",\"sender_id\":\""+patientCode+"\",\"sender_name\":\"系统\",\"timestamp\":"+new Date().getTime()+",\"content_type\":7,\"content\":"+msgObj.toString()+",\"business_type\":1}";
		if(1 == resutl){
			jsonStr = "{\"id\":\""+UUID.randomUUID().toString()+"\",\"sender_id\":\""+patientCode+"\",\"sender_name\":\"系统\",\"timestamp\":"+new Date().getTime()+",\"content_type\":7,\"content\":"+msgObj.toString()+",\"business_type\":1}";
		}
//		else{
//			throw  new Exception("结束失败");
//		}
		return success(jsonStr);
	}