Selaa lähdekoodia

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

chenweida 8 vuotta sitten
vanhempi
commit
326a26a720

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

@ -18,6 +18,7 @@ import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.repository.patient.SocialSecurityInfoDao;
import com.yihu.wlyy.util.IdCardUtil;
import com.yihu.wlyy.util.MD5;
import com.yihu.wlyy.util.SendP2PUtil;
import com.yihu.wlyy.util.SystemConf;
import com.yihu.wlyy.wechat.util.WeiXinTempMsgSendUtils;
import org.json.JSONArray;
@ -328,6 +329,13 @@ public class FamilyService {
        }
        patientInviteLogDao.save(patientInvitationLog);
        String content ="";
        if(patient.getSex()==2){
            content = patient.getName()+"小姐,再次感谢您对我的信任。同时,我也衷心的希望能够拥有为您整个家庭提供问下服务的荣幸。在此诚意地邀请您为"+doctor.getName()+"进行签约。";
        }else{
            content = patient.getName()+"先生,再次感谢您对我的信任。同时,我也衷心的希望能够拥有为您整个家庭提供问下服务的荣幸。在此诚意地邀请您为"+doctor.getName()+"进行签约。";
        }
        SendP2PUtil.sendP2Pmsg(doctorCode,patientCode,"1",content);
        return "1";
    }

+ 4 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/ExpensesRemindService.java

@ -12,6 +12,7 @@ import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.common.SMSService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.SendP2PUtil;
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
@ -197,7 +198,9 @@ public class ExpensesRemindService extends BaseService {
                PushMsgTask.getInstance().putWxMsg(tokenUtils.getAccessToken(), 8, p.getOpenid(), p.getName(), json);
                wFlag = true;
            }
            //发送IM
            SendP2PUtil.sendP2Pmsg(doc.getCode(),p.getCode(),"1",doc.getName() + "医生提醒您:为完成家庭医生签约," +
                    "尽早为您提供家庭医生服务,请尽快到" + hos.getName() + "(地址:" + hos.getAddress() + ")缴费");
            if (ignore) {
                redisTemplate.opsForValue().set("expenses:remind:" + p.getCode(), df.format(new Date()));
                redisTemplate.expire("expenses:remind:" + p.getCode(), 1, TimeUnit.DAYS);

+ 2 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/guahao/GuahaoXMService.java

@ -8,6 +8,7 @@ import com.yihu.wlyy.repository.patient.PatientReservationDao;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.SOAPUtil;
import com.yihu.wlyy.util.SendP2PUtil;
import org.apache.commons.lang3.StringUtils;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
@ -496,6 +497,7 @@ public class GuahaoXMService implements IGuahaoService {
                }
                if(StringUtils.isNotBlank(dcode)){
                    reservation.setDoctor(dcode);//代理签约维护待签约人编码
                    SendP2PUtil.sendP2Pmsg(dcode,patient,"1","我已成功为您预约:"+startTime+","+hospitalName+hosDeptName+doctorName+"医生的号源。您可直接前往医院就诊</br><a name='guahao' href='javascript:void(0)' data-id='"+code+"'>点击查看详情</a>");
                }
                // 保存预约记录
                patientReservationDao.save(reservation);

+ 27 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/SendP2PUtil.java

@ -0,0 +1,27 @@
package com.yihu.wlyy.util;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import java.util.ArrayList;
import java.util.List;
public class SendP2PUtil {
	public static String sendP2Pmsg(String from,String to,String contentType,String content){
		String url = SystemConf.getInstance().getSystemProperties().getProperty("im_list_get")
				+ "api/v1/chats/pm";
		List<NameValuePair> params = new ArrayList<>();
		params.add(new BasicNameValuePair("from", from));
		params.add(new BasicNameValuePair("to", to));
		params.add(new BasicNameValuePair("content",  content));
		params.add(new BasicNameValuePair("contentType",contentType));
		String response = HttpClientUtil.post(url, params, "UTF-8");
		if (StringUtils.isEmpty(response)) {
			return "-1";
		}else{
			return "200";
		}
	}
}

+ 3 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthEduArticleController.java

@ -7,7 +7,9 @@ import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.service.app.health.*;
import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.util.SendP2PUtil;
import com.yihu.wlyy.web.WeixinBaseController;
import com.yihu.wlyy.web.doctor.message.DoctorMessageController;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.htmlparser.Parser;
@ -303,6 +305,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
					// 设置为示读
					heap.setRead(1);
					list.add(heap);
					SendP2PUtil.sendP2Pmsg(doctor.getCode(), p, "4", "{\"title\":\"" + temp.getTitle() + "\",\"id\":\"" + temp.getCode() + "\",\"img\":\"" + temp.getUrl() + "\",\"content\":\"为了您的健康,我给您发送了一篇文章,请咨询查阅,如有问题,可随时与我沟通\"}");
					if (StringUtils.isNotEmpty(patientTemp.getOpenid())) {
						// 推送消息给微信端
						JSONObject json = new JSONObject();

+ 2 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthGuidanceController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.health;
import com.yihu.wlyy.util.SendP2PUtil;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
@ -79,6 +80,7 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
			// 保存
			if (patientHealthGuidanceService.add(guidance, getAccessToken()) != null) {
				SendP2PUtil.sendP2Pmsg(getUID(), patient, "1",content);
				return success("保存成功!");
			} else {
				return error(-1, "保存失败!");