Explorar el Código

Merge branch 'dev' of linzhuo/patient-co-management into dev

chenweida hace 8 años
padre
commit
fcaea94322

+ 4 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/family/FamilyService.java

@ -330,12 +330,12 @@ public class FamilyService {
        }
        patientInviteLogDao.save(patientInvitationLog);
        String content ="";
        if(patient.getSex()==2){
            content = patient.getName()+"小姐,再次感谢您对我的信任。同时,我也衷心的希望能够拥有为您整个家庭提供问下服务的荣幸。在此诚意地邀请您为"+doctor.getName()+"进行签约。";
        if(currentPatient.getSex()==2){
            content = currentPatient.getName()+"小姐,再次感谢您对我的信任。同时,我也衷心的希望能够拥有为您整个家庭提供问下服务的荣幸。在此诚意地邀请您为"+patient.getName()+"进行签约。";
        }else{
            content = patient.getName()+"先生,再次感谢您对我的信任。同时,我也衷心的希望能够拥有为您整个家庭提供问下服务的荣幸。在此诚意地邀请您为"+doctor.getName()+"进行签约。";
            content = currentPatient.getName()+"先生,再次感谢您对我的信任。同时,我也衷心的希望能够拥有为您整个家庭提供问下服务的荣幸。在此诚意地邀请您为"+patient.getName()+"进行签约。";
        }
        SendP2PUtil.sendP2Pmsg(doctorCode,patientCode,"1",content);
        SendP2PUtil.sendP2Pmsg(doctorCode,currentPatientCode,"1",content);
        return "1";
    }

+ 2 - 20
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/HttpClientUtil.java

@ -2,12 +2,8 @@ package com.yihu.wlyy.util;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.ParseException;
@ -16,12 +12,9 @@ import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.EntityUtils;
import org.springframework.web.client.RestTemplate;
public class HttpClientUtil {
@ -37,21 +30,10 @@ public class HttpClientUtil {
		CloseableHttpClient httpclient = HttpClients.createDefault();
		// 创建httppost
		HttpPost httppost = new HttpPost(url);
		StringEntity uefEntity;
		UrlEncodedFormEntity uefEntity;
		try {
			ObjectMapper objectMapper = new ObjectMapper();
			Map<String, Object> temp = new HashMap<>();
			Iterator<NameValuePair> it = params.iterator();
			while (it.hasNext()){
				NameValuePair nvp = it.next();
				temp.put(nvp.getName(), nvp.getValue());
			}
			String json = objectMapper.writeValueAsString(temp);
			uefEntity = new StringEntity(json, chatSet);
			uefEntity = new UrlEncodedFormEntity(params, chatSet);
			httppost.setEntity(uefEntity);
			httppost.addHeader(HTTP.CONTENT_TYPE, "application/json");
			CloseableHttpResponse response = httpclient.execute(httppost);
			try {
				HttpEntity entity = response.getEntity();