Browse Source

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

# Conflicts:
#	svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/DeviceDetailService.java
yeshijie 3 years ago
parent
commit
d0ae6b7230

+ 1 - 1
common/common-util/src/main/java/com/yihu/jw/util/common/LatitudeUtils.java

@ -39,7 +39,7 @@ public class LatitudeUtils {
        try {
            //将地址转换成utf-8的16进制
            address = URLEncoder.encode(address, "UTF-8");
            URL tirc = new URL("http://api.map.baidu.com/geocoder/v2/?address="+ address +"&output=json&key="+ UUID.randomUUID().toString().replace("-","")+"&ak="+ak);
            URL tirc = new URL("https://api.map.baidu.com/geocoder/v2/?address="+ address +"&output=json&key="+ UUID.randomUUID().toString().replace("-","")+"&ak="+ak);
            in = new BufferedReader(new InputStreamReader(tirc.openStream(),"UTF-8"));

+ 7 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/device/PatientDeviceDao.java

@ -55,7 +55,10 @@ public interface PatientDeviceDao extends PagingAndSortingRepository<DevicePatie
    @Query("select a from DevicePatientDevice a")
    List<DevicePatientDevice> findAll();
    @Query("select a from DevicePatientDevice a where a.categoryCode = ?1")
    @Query("select a from DevicePatientDevice a group by a.user")
    List<DevicePatientDevice> findAllGroupUser();
    @Query("select a from DevicePatientDevice a where a.categoryCode = ?1 and a.del=0 group by a.user")
    List<DevicePatientDevice> findAllByCategoryCode(String categoryCode);
    @Modifying
@ -65,6 +68,9 @@ public interface PatientDeviceDao extends PagingAndSortingRepository<DevicePatie
    @Query("select a from DevicePatientDevice a where a.user=?1 and a.del=0")
    List<DevicePatientDevice> findAllByUser(String user);
    @Query("select a from DevicePatientDevice a where a.user=?1 and a.categoryCode =?2 and a.del=0")
    List<DevicePatientDevice> findAllByUserAndCategoryCode(String user,String categoryCode);
    @Query("select a from DevicePatientDevice a where a.user=?1 and a.categoryCode =?2 and a.del=0")
    List<DevicePatientDevice> findByUserAndCategoryCode(String user,String categoryCode);
}

+ 2 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/PadDeviceController.java

@ -155,6 +155,8 @@ public class PadDeviceController extends BaseController {
                    return write(-1,"sn码已被使用");
                } else if (flagDevice == -4) {
                    return write(-1,"不存在该条记录");
                } else if (flagDevice == -5) {
                    return write(-1,"请勿重复绑定设备");
                }
                //注册设备地址
                deviceDetailService.registerToWlyy(device);

+ 2 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/PatientDeviceController.java

@ -142,6 +142,8 @@ public class PatientDeviceController extends BaseController {
                    return write(-1,"sn码已被使用");
                } else if (flagDevice == -4) {
                    return write(-1,"不存在该条记录");
                } else if (flagDevice == -5) {
                    return write(-1,"请勿重复绑定设备");
                }
                //注册设备地址
                deviceDetailService.registerToWlyy(device);

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

@ -110,12 +110,16 @@ public class EmergencyAssistanceService extends BaseJpaService<EmergencyAssistan
     * 获取百度天气
     */
    public JSONObject getBaiduWeather(){
        String url = "https://api.map.baidu.com/weather/v1/?district_id=330100&data_type=now&ak=0vjnCSReegE7A47a941ohjv9a07ONiMC";
        String response = httpClientUtil.get(url,"UTF-8");
        JSONObject responseObj = JSONObject.parseObject(response);
        if (responseObj.getInteger("status")==0){
            JSONObject now = responseObj.getJSONObject("result").getJSONObject("now");
            return now;
        try {
            String url = "https://api.map.baidu.com/weather/v1/?district_id=330100&data_type=now&ak=0vjnCSReegE7A47a941ohjv9a07ONiMC";
            String response = httpClientUtil.get(url,"UTF-8");
            JSONObject responseObj = JSONObject.parseObject(response);
            if (responseObj.getInteger("status")==0){
                JSONObject now = responseObj.getJSONObject("result").getJSONObject("now");
                return now;
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return new JSONObject();
    }

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

@ -170,7 +170,6 @@ public class DeviceDetailService extends BaseJpaService<DeviceDetail, DeviceDeta
			deviceDetail.setApplicantMail(doctor.getMobile());
		}
		deviceDetailDao.save(deviceDetail);
		return deviceDetail;
	}
	/**

+ 14 - 8
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/PatientDeviceService.java

@ -47,6 +47,7 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@ -247,6 +248,10 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
                //V1.0.0    监控器、报警器、燃气传感器 烟雾传感器支持一个设备绑定多个居民
                //监控器 12   报警器 7  14  15
                if ("12".equals(type) || "14".equals(type) || "15".equals(type) || "7".equals(type) ) {
                    if (devicePatientDevice.getUser().equals(device.getUser())) {
                        System.out.println("居民已经绑定此sn码:"+sn);
                        return -5;
                    }
                    System.out.println("此类设备支持多绑定");
                } else {
                    System.out.println("sn码" + sn + "已被使用!");
@ -1199,16 +1204,17 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
     */
    public com.alibaba.fastjson.JSONObject getX1Locations(String deviceSn,String time_begin){
        String url =AqgConfig.X1_locations;
        MultiValueMap<String, String> param = new LinkedMultiValueMap<>();
        param.add("device", deviceSn);
        param.add("depth", "1");
        param.add("rows_per_page", "300");
        String url = AqgConfig.X1_locations+"?device="+deviceSn+"&depth="+1+"&rows_per_page="+300;
        if (StringUtils.isNotBlank(time_begin)){
            param.add("time_begin", time_begin);
            url += "&time_begin="+time_begin;
        }
        HttpEntity<com.alibaba.fastjson.JSONObject> response = httpClientUtil.aqgCookieHttp(url, param, HttpMethod.GET, getCookie());
        return response.getBody();
        Map<String,Object> headers = new HashMap<>();
        headers.put("Accept", MediaType.APPLICATION_JSON.toString());
        headers.put("Cookie", getCookie());
        String  responseStr = httpClientUtil.get(url,"utf-8",headers);
        com.alibaba.fastjson.JSONObject result = JSON.parseObject(responseStr);
        return result;
    }
    public com.alibaba.fastjson.JSONObject getSleepDeviceInfo(String deviceSn){

+ 47 - 38
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/DetectionPlatformService.java

@ -15,6 +15,7 @@ import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -146,59 +147,67 @@ public class DetectionPlatformService  {
    }
    public List<Map<String , Object>> getDeviceType(){
        String sql = "SELECT category_code,device_name FROM wlyy_patient_device GROUP BY category_code";
        String sql = "SELECT category_code categoryCode,name FROM dm_device GROUP BY category_code";
        return jdbcTemplate.queryForList(sql);
    }
    public JSONArray getDeviceByCondition(String categoryCode , String user){
        JSONArray jsonArray = new JSONArray();
        List<DevicePatientDevice> patientDevices = patientDeviceDao.findAll();
        List<DevicePatientDevice> patientDevices = patientDeviceDao.findAllGroupUser();
        if (StringUtils.isNotBlank(categoryCode)) {  //categoryCode != null   根据设备类型查询
            patientDevices = patientDeviceDao.findAllByCategoryCode(categoryCode);
        }
        Map<String, List<DevicePatientDevice>> byUser = patientDevices.stream().collect(Collectors.groupingBy(DevicePatientDevice::getUser));
        List<BasePatientDO> patientDOS = patientDao.findAllByDel();
        if (StringUtils.isNotBlank(user)) {
            patientDOS = patientDao.findAllByDelAndId(user);  //user != null   根据居民查询
        if (StringUtils.isNotBlank(user)) {  //categoryCode != null   根据设备类型查询
            String sql = "select a.* from wlyy_patient_device a where a.user='"+user+"' and a.del=0 LIMIT 1";
            patientDevices = jdbcTemplate.query(sql, new BeanPropertyRowMapper(DevicePatientDevice.class));
        }
        List<BasePatientDO> patientDOS = patientDao.findAllByDel();
//        if (StringUtils.isNotBlank(user)) {
//            patientDOS = patientDao.findAllByDelAndId(user);  //user != null   根据居民查询
//        }
        Map<String, List<BasePatientDO>> byId = patientDOS.stream().collect(Collectors.groupingBy(BasePatientDO::getId));
        //首页默认根据居民展示  绑定设备的居民
        String userSql = "SELECT `user` FROM wlyy_patient_device WHERE del = 0 GROUP BY `user`";
        List<Map<String , Object>> userList = jdbcTemplate.queryForList(userSql);
        if (userList.size() > 0) {
            JSONObject userObj = new JSONObject();
            for (int i=0;i<userList.size();i++) {
//        String userSql = "SELECT `user` FROM wlyy_patient_device WHERE del = 0 GROUP BY `user`";
//        List<Map<String , Object>> userList = jdbcTemplate.queryForList(userSql);
        if (patientDevices.size() > 0) {
            for (int i=0;i<patientDevices.size();i++) {
                JSONArray arrayAll = new JSONArray();
                JSONArray array = new JSONArray();
                userObj.put("patient",userList.get(i).get("user"));
                userObj.put("patientName",byId.get(userList.get(i).get("user")).get(0).getName());
                userObj.put("patientType",byId.get(userList.get(i).get("user")).get(0).getArchiveType());
                userObj.put("latLon",byId.get(userList.get(i).get("user")).get(0).getLatLon());
                List<DevicePatientDevice> deviceList = byUser.get(userList.get(i).get("user"));
                if (deviceList.size() > 1) {    //居民绑定多台设备
                    for (int j=0;j<deviceList.size();j++) {
                        JSONObject obj = new JSONObject();
                        obj.put("deviceSn",deviceList.get(j).getDeviceSn());
                        obj.put("deviceName",deviceList.get(j).getDeviceName());
                        obj.put("categoryCode",deviceList.get(j).getCategoryCode());
                        array.add(obj);
                    }
                    userObj.put("deviceCount",deviceList.size());
                    userObj.put("deviceInfo",array);
                    arrayAll.add(userObj);
                } else {    //居民只绑定一台设备
                    for (int j=0;j<deviceList.size();j++) {
                        JSONObject obj = new JSONObject();
                        obj.put("deviceSn",deviceList.get(j).getDeviceSn());
                        obj.put("deviceName",deviceList.get(j).getDeviceName());
                        obj.put("categoryCode",deviceList.get(j).getCategoryCode());
                        array.add(obj);
                JSONObject userObj = new JSONObject();
                userObj.put("patient",patientDevices.get(i).getUser());
                userObj.put("patientName",byId.get(patientDevices.get(i).getUser()).get(0).getName());
                userObj.put("patientType",byId.get(patientDevices.get(i).getUser()).get(0).getArchiveType());
                userObj.put("latLon",byId.get(patientDevices.get(i).getUser()).get(0).getLatLon());
                List<DevicePatientDevice> deviceList = patientDeviceDao.findAllByUser(patientDevices.get(i).getUser());
                if (StringUtils.isNotBlank(categoryCode)) {
                    deviceList = patientDeviceDao.findAllByUserAndCategoryCode(patientDevices.get(i).getUser(),categoryCode);
                }
                if (deviceList != null) {
                    if (deviceList.size() > 1) {    //居民绑定多台设备
                        for (int j=0;j<deviceList.size();j++) {
                            JSONObject obj = new JSONObject();
                            obj.put("deviceSn",deviceList.get(j).getDeviceSn());
                            obj.put("deviceName",deviceList.get(j).getDeviceName());
                            obj.put("categoryCode",deviceList.get(j).getCategoryCode());
                            array.add(obj);
                        }
                        userObj.put("deviceCount",deviceList.size());
                        userObj.put("deviceInfo",array);
                        arrayAll.add(userObj);
                    } else {    //居民只绑定一台设备
                        for (int j=0;j<deviceList.size();j++) {
                            JSONObject obj = new JSONObject();
                            obj.put("deviceSn",deviceList.get(j).getDeviceSn());
                            obj.put("deviceName",deviceList.get(j).getDeviceName());
                            obj.put("categoryCode",deviceList.get(j).getCategoryCode());
                            array.add(obj);
                        }
                        userObj.put("deviceCount",deviceList.size());
                        userObj.put("deviceInfo",array);
                        arrayAll.add(userObj);
                    }
                    userObj.put("deviceCount",deviceList.size());
                    userObj.put("deviceInfo",array);
                    arrayAll.add(userObj);
                    jsonArray.add(arrayAll);
                }
                jsonArray.add(arrayAll);
            }
        } else {
            return jsonArray;

+ 39 - 52
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/DeviceService.java

@ -19,6 +19,8 @@ import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.healthIndex.HealthIndexUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -180,27 +182,17 @@ public class DeviceService {
                jsonObject.put("patientName",logDO.getPatientName());
                jsonObject.put("deviceSn",logDO.getDeviceSn());
                String url = cloudCareUrl+"cloudCare/noLogin/emergency_assistance/newOrder";
                Map map = new HashMap<String, String>();
                map.put("patientId", logDO.getPatient());
                List<NameValuePair> params = new ArrayList<>();
                params.add(new BasicNameValuePair("jsonData", jsonObject.toJSONString()));
                params.add(new BasicNameValuePair("patientId", logDO.getPatient()));
                if (deviceDO.getCategoryCode().equals("4")) {
                    map.put("orderSource", 2); //工单来源工单发起来源状态 1APP 2手环 3居家报警
                    params.add(new BasicNameValuePair("orderSource", "2"));//工单来源工单发起来源状态 1APP 2手环 3居家报警
                }
                if (deviceDO.getCategoryCode().equals("7")) {
                    map.put("orderSource", 3);
                }
                map.put("jsonData", jsonObject.toJSONString());
                String content = com.alibaba.fastjson.JSONObject.toJSONString(map);
                String postParams = AesEncryptUtils.agEncrypt(content);
                String response = httpClientUtil.postBodyRawForm(url,postParams);
                JSONObject result = com.alibaba.fastjson.JSONObject.parseObject(response);
                JSONObject jsonObjectData =JSONObject.parseObject(AesEncryptUtils.agDecrypt(result.getString("data")));
                logDO.setSosSendStatus(jsonObjectData.getInteger("status").toString());
                if (jsonObjectData.containsKey("message")){
                    logDO.setSosSendMessage(jsonObjectData.getString("message"));
                }
                if (jsonObjectData.containsKey("msg")){
                    logDO.setSosSendMessage(jsonObjectData.getString("msg"));
                    params.add(new BasicNameValuePair("orderSource", "3"));
                }
                String response = httpClientUtil.post(url, params,"UTF-8");
                System.out.println(response);
            }
            sosLogDao.save(logDO);
@ -259,11 +251,9 @@ public class DeviceService {
                        if (deviceDO.getCategoryCode().equals("4")) {
                            //获取手环最新定位信息
                            String url = cloudCareUrl+"/cloudCare/noLogin/device/getDeviceLastLocation";
                            Map map = new HashMap<String, String>();
                            map.put("deviceSn",deviceDO.getDeviceSn());
                            String content = com.alibaba.fastjson.JSONObject.toJSONString(map);
                            String postParams = AesEncryptUtils.agEncrypt(content);
                            String response = httpClientUtil.getBodyRawForm(url,postParams);
                            List<NameValuePair> params = new ArrayList<>();
                            params.add(new BasicNameValuePair("deviceSn", deviceDO.getDeviceSn()));
                            String response = httpClientUtil.post(url, params,"UTF-8");
                            JSONObject result = com.alibaba.fastjson.JSONObject.parseObject(response);
                            JSONObject jsonObjectData =JSONObject.parseObject(AesEncryptUtils.agDecrypt(result.getString("data")));
                            Double lat = jsonObjectData.getJSONObject("data").getJSONObject("obj").getJSONObject("locationdata").getJSONObject("point").getDouble("lat");
@ -276,7 +266,6 @@ public class DeviceService {
                                    "  and pack.del=1";
                            List<Map<String,Object>> sqlResult = jdbcTemplate.queryForList(sql);
                            if (sqlResult.size()>0){
                                map = new HashMap();
                                url = cloudCareUrl+"/cloudCare/noLogin/security/createOrder";
                                JSONObject jsonObject = new JSONObject();
                                jsonObject.put("patient",patientDO.getId());
@ -291,16 +280,16 @@ public class DeviceService {
                                jsonObject.put("deviceSn",deviceid);
                                JSONObject jsonObjectParam = new JSONObject();
                                jsonObjectParam.put("order", jsonObject);
                                map.put("jsonData", jsonObjectParam.toJSONString());
                                map.put("orderSource", 2);
                                map.put("warnStr", "疑似离开安全区域");
                                content = com.alibaba.fastjson.JSONObject.toJSONString(map);
                                postParams = AesEncryptUtils.agEncrypt(content);
                                response = httpClientUtil.postBodyRawForm(url,postParams);
                                result = com.alibaba.fastjson.JSONObject.parseObject(response);
                                jsonObjectData =JSONObject.parseObject(AesEncryptUtils.agDecrypt(result.getString("data")));
                                System.out.println(jsonObjectData.toJSONString());
                                params = new ArrayList<>();
                                params.add(new BasicNameValuePair("jsonData", jsonObjectParam.toJSONString()));
                                params.add(new BasicNameValuePair("orderSource", "2"));
                                params.add(new BasicNameValuePair("warnStr", "疑似离开安全区域"));
                                response = httpClientUtil.post(url, params,"UTF-8");
                                System.out.println(response);
                                System.out.println(response);
                            }
                        }
                    }
@ -613,16 +602,16 @@ public class DeviceService {
                                    planDetail.setUpTime(timeDate);
                                }
                            }
                        }
                        else if (3600*upLongWarn*1000<timeDiffer){//距离起床超过三个小时还在床
                            if ("1".equals(bed_status)){//还在床
                                if (null==planDetail.getUpStatus()) {
                                    planDetail.setUpStatus(1);
                                    planDetail.setBedStatus(1);
                                    planDetail.setBreath(breath);
                                    planDetail.setHeartRate(heartrate);
                                    outBedOrder(null, timeDate,devicePatientDeviceDos.get(0), patient, device, "超时未起床", JSON.toJSONStringWithDateFormat(planDetail, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue));
                                    orderCreate = true;
                                if (3600*upLongWarn*1000<timeDiffer){//距离起床超过三个小时还在床
                                    if (null==planDetail.getUpStatus()) {
                                        planDetail.setUpStatus(1);
                                        planDetail.setBedStatus(1);
                                        planDetail.setBreath(breath);
                                        planDetail.setHeartRate(heartrate);
                                        outBedOrder(null, timeDate,devicePatientDeviceDos.get(0), patient, device, "超时未起床", JSON.toJSONStringWithDateFormat(planDetail, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue));
                                        orderCreate = true;
                                    }
                                }
                            }
                        }
@ -802,16 +791,14 @@ public class DeviceService {
                    jsonObject.put("warnInfo",warnInfo);
                    JSONObject jsonObjectParam = new JSONObject();
                    jsonObjectParam.put("order", jsonObject);
                    map.put("jsonData", jsonObjectParam.toJSONString());
                    map.put("orderSource", 5);
                    map.put("warnStr", serverName);
                    String content = com.alibaba.fastjson.JSONObject.toJSONString(map);
                    String postParams = AesEncryptUtils.agEncrypt(content);
                    String response = httpClientUtil.postBodyRawForm(url,postParams);
                    JSONObject result = com.alibaba.fastjson.JSONObject.parseObject(response);
                    JSONObject jsonObjectData =JSONObject.parseObject(AesEncryptUtils.agDecrypt(result.getString("data")));
                    System.out.println(jsonObjectData.toJSONString());
                    List<NameValuePair> params = new ArrayList<>();
                    params.add(new BasicNameValuePair("jsonData", jsonObjectParam.toJSONString()));
                    params.add(new BasicNameValuePair("warnStr", serverName));
                    params.add(new BasicNameValuePair("orderSource", "5"));
                    String response = httpClientUtil.post(url, params,"UTF-8");
                    System.out.println(response);
                }
            }
            if (null!=record){

+ 9 - 11
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/YsDeviceService.java

@ -16,7 +16,9 @@ import com.yihu.jw.util.common.LatitudeUtils;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.utils.encode.Base64;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.entity.ContentType;
import org.apache.http.message.BasicNameValuePair;
import org.csource.common.MyException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -36,6 +38,7 @@ import java.net.URL;
import java.net.URLConnection;
import java.security.NoSuchAlgorithmException;
import java.security.Security;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -166,8 +169,6 @@ public class YsDeviceService {
                BasePatientDO patientDO = patientDao.findById(deviceDO.getUser());
                String  url = cloudCareUrl+"/cloudCare/noLogin/security/createOrder";
                Map map = new HashMap<String, String>();
                map = new HashMap();
                String hospital = "";
                String sql ="select DISTINCT pack.org_code,pack.org_name " +
                        " from base_service_package_sign_record sr,base_service_package_record pr,base_service_package_item item ,base_service_package pack " +
@ -202,16 +203,13 @@ public class YsDeviceService {
                }
                JSONObject jsonObjectParam = new JSONObject();
                jsonObjectParam.put("order", jsonObject);
                map.put("jsonData", jsonObjectParam.toJSONString());
                map.put("orderSource", orderSource);
                map.put("warnStr", serveDesc);
                String content = com.alibaba.fastjson.JSONObject.toJSONString(map);
                String postParams = AesEncryptUtils.agEncrypt(content);
                String response = httpClientUtil.postBodyRawForm(url,postParams);
                result = com.alibaba.fastjson.JSONObject.parseObject(response);
                JSONObject jsonObjectData =JSONObject.parseObject(AesEncryptUtils.agDecrypt(result.getString("data")));
                System.out.println(jsonObjectData.toJSONString());
                List<NameValuePair> params = new ArrayList<>();
                params.add(new BasicNameValuePair("jsonData", jsonObjectParam.toJSONString()));
                params.add(new BasicNameValuePair("warnStr", serveDesc));
                params.add(new BasicNameValuePair("orderSource", orderSource+""));
                String response = httpClientUtil.post(url, params,"UTF-8");
                System.out.println(response);
            }
        }catch (Exception e){
            e.printStackTrace();

+ 13 - 8
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/job/device/PatientSosContactsJob.java

@ -58,19 +58,24 @@ public class PatientSosContactsJob implements Job {
                    JSONObject response = cardService.setPatientContacts(sim, null, null, "1", sos_phone, null);//移动白名单
                    //0成功 12102名单重复
                    if (response.getInteger("status")==0||response.getInteger("status")==12108){
                        //设备修改
                        JSONObject response2 =  deviceService.updAqgDeviceSosInfo(device_sn,phone_seqid,sos_name,sos_phone,"1",null);
                        if (response2.getBoolean("success")){
                        sosContactsDO.setSuccessFlag(1);
                    }else {
                        sosContactsDO.setSuccessFlag(-1);
                        modify.add(sosContactsDO);
                    }
                    //设备修改
                    JSONObject response2 =  deviceService.updAqgDeviceSosInfo(device_sn,phone_seqid,sos_name,sos_phone,"1",null);
                    System.out.println(response2.toString());
                    if (response2.getBoolean("success")){
                        if (1==sosContactsDO.getSuccessFlag()){
                            sosContactsDO.setSuccessFlag(1);
                        }else {
                            sosContactsDO.setSuccessFlag(-1);
                        }
                        modify.add(sosContactsDO);
                        sosContactsDO.setSuccessFlag(-1);
                    }else {
                        sosContactsDO.setSuccessFlag(-1);
                        modify.add(sosContactsDO);
                        throw new Exception("物联网卡操作失败:"+response);
                    }
                    modify.add(sosContactsDO);
                }
            }catch (Exception e){
                logger.info(sim+"--同步失败--"+sos_phone);