Browse Source

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

wsl 2 years ago
parent
commit
019cb89205

+ 1 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/assistance/EmergencyAssistanceService.java

@ -312,6 +312,7 @@ public class EmergencyAssistanceService extends BaseJpaService<EmergencyAssistan
                messageUtil.sendDoctorGetuiMessage(doctorDO.getId(),"2",url,"紧急呼叫",body);
                messageUtil.sendDoctorDingdingMessage(doctorDO,null,"text","2",dingDingBody,null,null);
                messageUtil.sendHongLingJinMsg(doctorDO,null,assistanceDO);
                imUtill.sendMDTSocketMessageToDoctor(doctorDO.getId(),message.toString());
            }
            //pc管理端端推送消息

+ 1 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/security/SecurityMonitoringOrderService.java

@ -314,6 +314,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
            String dingDingBody = orderDO.getPatientName()+"居民存在异常情况,请及时处理,异常内容:"+orderDO.getServeDesc()+"。";
            messageUtil.sendDoctorGetuiMessage(doctorDO.getId(), "1", url, "安防紧急预警", body);
            messageUtil.sendDoctorDingdingMessage(doctorDO,null,"text","1",dingDingBody,null,null);
            messageUtil.sendHongLingJinMsg(doctorDO,orderDO,null);
            imUtil.sendMDTSocketMessageToDoctor(doctorDO.getId(), message.toString());
        }
        //pc管理端端推送消息

+ 45 - 22
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/util/HongLingJinUtil.java

@ -65,26 +65,22 @@ public class HongLingJinUtil {
        return null;
    }
    public static void main(String[] args) throws Exception{
/*    public static void main(String[] args) throws Exception{
//        String url = "http://10.18.40.101:7688/api/zzd/common";
        String url = "https://zhyzh.gongshu.gov.cn/zzdcommon";
        JSONObject params = new JSONObject();
        JSONObject eventAssistName = new JSONObject();
        JSONObject test1 = new JSONObject();
        test1.put("deptName","");
        test1.put("mobile","");
        test1.put("realName","");
        eventAssistName.put("test",test1);
        eventAssistName.put("deptName","");
        eventAssistName.put("mobile","");
        eventAssistName.put("realName","");
        JSONObject eventChargeName = new JSONObject();
        JSONObject test2 = new JSONObject();
        test2.put("deptName","");
        test2.put("mobile","15659713528");
        test2.put("realName","测试账号");
/*        test1.put("mobile","15545430148");
        test1.put("realName","李康硕");*/
        eventChargeName.put("test",test2);
        eventChargeName.put("deptName","");
        eventChargeName.put("mobile","15545430148");
        eventChargeName.put("realName","李康硕");
*//*        test1.put("mobile","15545430148");
        test1.put("realName","李康硕");*//*
        params.put("eventAssistName",eventAssistName);
        params.put("eventChargeName",eventChargeName);
@ -92,29 +88,56 @@ public class HongLingJinUtil {
        params.put("eventLocation","测试地址");
        params.put("eventName","测试事件");
        params.put("taskDescription","测试事件1");
        params.put("eventState","0");
        params.put("taskId",0);
        params.put("eventState","1");
        params.put("taskId","1234");
        RestTemplate restTemplate = new RestTemplate();
        HttpHeaders headers = new HttpHeaders();
        headers.add("Authorization", "Bearer "+"a8d1f682-9281-4d88-84ed-3643e738da09");
        headers.add("Authorization", "Bearer "+"6540793f-a3a3-4e4c-8d65-76c3697e3adb");
        headers.add("Content-Type", MediaType.APPLICATION_JSON_VALUE);
        headers.add("Accept",MediaType.ALL_VALUE);
        org.springframework.http.HttpEntity<String> formEntity = new org.springframework.http.HttpEntity<String>(params.toString(), headers);
        String ret = restTemplate.postForObject(url, formEntity, String.class);
        System.out.println(ret);
    }
    }*/
    /**
     *
     * 预警消息推送
     */
    public void zzdcommon(){
    public void zzdcommon(String mobile,String name,String eventHappenTime
            ,String eventName,String taskDescription,String eventLocation,String taskId){
        try {
            String url = "http://10.18.40.101:7688/api/zzd/common";
//            String url = "https://zhyzh.gongshu.gov.cn/zzdcommon";
            JSONObject params = new JSONObject();
            JSONObject eventAssistName = new JSONObject();
            eventAssistName.put("deptName","");
            eventAssistName.put("mobile","");
            eventAssistName.put("realName","");
            JSONObject eventChargeName = new JSONObject();
            eventChargeName.put("deptName","");
            eventChargeName.put("mobile", mobile);
            eventChargeName.put("realName", name);
            params.put("eventAssistName",eventAssistName);
            params.put("eventChargeName",eventChargeName);
            params.put("eventHappenTime",eventHappenTime);
            params.put("eventLocation",eventLocation);
            params.put("eventName", eventName);
            params.put("taskDescription", taskDescription);
            params.put("eventState","1");
            params.put("eventSource","2");
            params.put("taskId", taskId);
            RestTemplate restTemplate = new RestTemplate();
            HttpHeaders headers = new HttpHeaders();
            headers.add("Authorization", "Bearer "+getToken());
            headers.add("Content-Type", MediaType.APPLICATION_JSON_VALUE);
            headers.add("Accept",MediaType.ALL_VALUE);
            org.springframework.http.HttpEntity<String> formEntity = new org.springframework.http.HttpEntity<String>(params.toString(), headers);
            String ret = restTemplate.postForObject(url, formEntity, String.class);
            logger.info("ret:"+ret);
        }catch (Exception e){
            e.printStackTrace();
        }

+ 34 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/util/MessageUtil.java

@ -8,6 +8,7 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.wx.WxAccessTokenDO;
import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
import com.yihu.jw.entity.care.assistance.EmergencyAssistanceDO;
import com.yihu.jw.entity.care.common.GetuiClientDO;
import com.yihu.jw.entity.care.doorCoach.BaseDoorCoachOrderDO;
import com.yihu.jw.entity.care.lifeCare.LifeCareOrderDO;
@ -19,6 +20,7 @@ import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.push.dao.GetuiClientDao;
import com.yihu.jw.push.service.GetuiService;
import com.yihu.jw.sms.service.TXYSmsService;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
import com.yihu.jw.wechat.dao.WxAccessTokenDao;
import com.yihu.jw.wechat.dao.WxTemplateConfigDao;
@ -74,6 +76,8 @@ public class MessageUtil {
    private GetuiClientDao getuiClientDao;
    @Autowired
    private DingdingUtil dingdingUtil;
    @Autowired
    private HongLingJinUtil hongLingJinUtil;
    /**
     * 您好{1}有一条新的在线报名申请,请及时前往APP消息应用进行处理。
@ -150,6 +154,36 @@ public class MessageUtil {
        }
    }
    /**
     * 红领巾消息推送
     */
    public void sendHongLingJinMsg(BaseDoctorDO doctorDO,SecurityMonitoringOrderDO orderDO, EmergencyAssistanceDO assistanceDO){
        try {
            String eventHappenTime;
            String eventName;
            String taskDescription;
            String eventLocation;
            String taskId;
            if(orderDO!=null){
                eventHappenTime = DateUtil.dateToStrFormatLong(orderDO.getCreateTime());
                taskId = orderDO.getId();
                eventName = "安防监控";
                taskDescription = orderDO.getPatientName()+"居民存在异常情况,请及时处理,异常内容:"+orderDO.getServeDesc()+"。";
                eventLocation = orderDO.getServeAddress();
            }else {
                eventHappenTime = DateUtil.dateToStrFormatLong(assistanceDO.getCreateTime());
                taskId = assistanceDO.getId();
                eventName = "紧急救助";
                taskDescription = "您好,"+assistanceDO.getPatientName()+"居民发起紧急呼叫,请及时处理。";
                eventLocation = assistanceDO.getServeAddress();
            }
            hongLingJinUtil.zzdcommon(doctorDO.getMobile(),doctorDO.getName(),eventHappenTime,eventName,taskDescription,eventLocation,taskId);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
    /**
     *
     * @param wechatId