Bladeren bron

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

Shi Kejing 3 jaren geleden
bovenliggende
commit
a6297e466f

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

@ -327,16 +327,16 @@ public class PatientDeviceController extends BaseController {
    public String updateDeviceFenceArea(@ApiParam(name = "deviceSn",value = "设备sn码")
                                        @RequestParam(value = "deviceSn",required = true)String deviceSn,
                                        @ApiParam(name = "fenceNO",value = "安全区编号")
                                        @RequestParam(value = "fenceNO",required = false)Integer fenceNO,
                                        @RequestParam(value = "fenceNO",defaultValue = "1",required = false)Integer fenceNO,
                                        @ApiParam(name = "enable",value = "0,1 是否启用")
                                        @RequestParam(value = "enable",required = false)String enable,
                                        @RequestParam(value = "enable",defaultValue = "1",required = false)String enable,
                                        @ApiParam(name = "name",value = "安全区名称")
                                        @RequestParam(value = "name",required = false)String name,
                                        @RequestParam(value = "name",defaultValue = "安全区域1",required = false)String name,
                                        @ApiParam(name = "freq",value = "0,触发一天;1,每日触发 ")
                                        @RequestParam(value = "freq",required = false)String freq,
                                        @ApiParam(name = "time_begin",value = "目标时间与当日0点之间相差的秒数 ")
                                        @RequestParam(value = "freq",defaultValue = "1",required = false)String freq,
                                        @ApiParam(name = "time_begin",defaultValue = "0",value = "目标时间与当日0点之间相差的秒数 ")
                                        @RequestParam(value = "time_begin",defaultValue = "0",required = false)String time_begin,
                                        @ApiParam(name = "time_end",value = "同上 ")
                                        @ApiParam(name = "time_end",defaultValue = "86400",value = "同上 ")
                                        @RequestParam(value = "time_end",defaultValue = "86400",required = false)String time_end,
                                        @ApiParam(name = "safe_area",value = "lon1,lat1;lon2,lat2; 5个坐标 形成一个封闭区域  A;B;C;D;A ")
                                        @RequestParam(value = "safe_area",required = false)String safe_area,

+ 6 - 6
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/third/device/PDeviceController.java

@ -108,17 +108,17 @@ public class PDeviceController extends BaseController {
    public String updateDeviceFenceArea(@ApiParam(name = "deviceSn",value = "设备sn码")
                                        @RequestParam(value = "deviceSn",required = true)String deviceSn,
                                        @ApiParam(name = "fenceNO",value = "安全区编号")
                                        @RequestParam(value = "fenceNO",required = false)Integer fenceNO,
                                        @RequestParam(value = "fenceNO",defaultValue = "1",required = false)Integer fenceNO,
                                        @ApiParam(name = "enable",value = "0,1 是否启用")
                                        @RequestParam(value = "enable",required = false)String enable,
                                        @RequestParam(value = "enable",defaultValue = "1",required = false)String enable,
                                        @ApiParam(name = "name",value = "安全区名称")
                                        @RequestParam(value = "name",required = false)String name,
                                        @RequestParam(value = "name",defaultValue = "安全区域1",required = false)String name,
                                        @ApiParam(name = "freq",value = "0,触发一天;1,每日触发 ")
                                        @RequestParam(value = "freq",required = false)String freq,
                                        @RequestParam(value = "freq",defaultValue = "1",required = false)String freq,
                                        @ApiParam(name = "time_begin",defaultValue = "0",value = "目标时间与当日0点之间相差的秒数 ")
                                        @RequestParam(value = "time_begin",required = false)String time_begin,
                                        @RequestParam(value = "time_begin",defaultValue = "0",required = false)String time_begin,
                                        @ApiParam(name = "time_end",defaultValue = "86400",value = "同上 ")
                                        @RequestParam(value = "time_end",required = false)String time_end,
                                        @RequestParam(value = "time_end",defaultValue = "86400",required = false)String time_end,
                                        @ApiParam(name = "safe_area",value = "lon1,lat1;lon2,lat2; 5个坐标 形成一个封闭区域  A;B;C;D;A ")
                                        @RequestParam(value = "safe_area",required = false)String safe_area,
                                        @ApiParam(name = "clear",value = "删除标志,删除传1")

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

@ -296,8 +296,8 @@ public class EmergencyAssistanceService extends BaseJpaService<EmergencyAssistan
            if (StringUtils.isNotBlank(assistanceDO.getDeviceSn())){
                List<BaseYxDeviceIndex> points = yxDeviceIndexDao.findBySn(assistanceDO.getDeviceSn());
                if (points.size()>0){
                    long lat = Long.parseLong(points.get(0).getLat());
                    long lon = Long.parseLong(points.get(0).getLon());
                    double lat = Double.parseDouble(points.get(0).getLat());
                    double lon = Double.parseDouble(points.get(0).getLon());
                    if (!(lat==0.0&&lon==0.0)){
                        assistanceDO.setServeAddress(LatitudeUtils.getLocationAddress(lat+"",lon+""));
                        assistanceDO.setServeLat(lat+"");

+ 7 - 3
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/DeviceUploadService.java

@ -500,13 +500,17 @@ public class DeviceUploadService {
                                        com.alibaba.fastjson.JSONObject positionTmp = new com.alibaba.fastjson.JSONObject();
                                        Double areaLon = Double.parseDouble( areaPoint[0]);
                                        Double areaLat = Double.parseDouble( areaPoint[1]);
//                                com.alibaba.fastjson.JSONObject positionTmp = gpsUtil.gcj02_To_Bd09(lat,lon);
//                                      com.alibaba.fastjson.JSONObject positionTmp = gpsUtil.gcj02_To_Bd09(lat,lon);
                                        positionTmp.put("lat",areaLat);
                                        positionTmp.put("lon",areaLon);
                                        fenceLocation.add(positionTmp);
                                    }
                                    if (!countDistance.isInPolygon(dulon,dulat,fenceLocation)){
                                        orderUtil.createSecurityOrder(sn,null,null,8,"1","yslkaqqy",null);
                                        com.alibaba.fastjson.JSONObject addressInfo = new com.alibaba.fastjson.JSONObject();
                                        addressInfo.put("lat",dulat+"");
                                        addressInfo.put("lon",dulon+"");
                                        addressInfo.put("address",LatitudeUtils.getLocationAddress(dulat+"",dulon+""));
                                        orderUtil.createSecurityOrder(sn,null,null,addressInfo,8,"1","preventLost",null);
                                    }
                                }
                            }
@ -519,7 +523,7 @@ public class DeviceUploadService {
                        yxDeviceIndexDao.save(deviceIndex);
                        hvDeviceService.updContactStatus(sn,1);
                    }
                    if ("AL".equals(equals(tmp1[0]))){//触发报警
                    if ("AL".equals(tmp1[0])){//触发报警
                        String lat,lon;
                        if("A".equals(tmp1[4])){
                            lat = tmp1[5];

+ 2 - 2
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/HvDeviceService.java

@ -109,14 +109,14 @@ public class HvDeviceService {
                //独立式可燃气体探测器(NB)
                JSONObject tmp = new JSONObject();
                tmp.put("gas",monitorValue);
                orderUtil.createSecurityOrder(resourceSerial,null,new JSONObject(),6,"11","preventGasLeakage",JSON.toJSONString(tmp, SerializerFeature.WriteMapNullValue));
                orderUtil.createSecurityOrder(resourceSerial,null,new JSONObject(),null,6,"11","preventGasLeakage",JSON.toJSONString(tmp, SerializerFeature.WriteMapNullValue));
            }
            if("600002".equals(deviceType)){
                //独立式光电感烟探测器(NB)
                JSONObject tmp = new JSONObject();
                tmp.put("smoke",monitorValue);
                orderUtil.createSecurityOrder(resourceSerial,null,new JSONObject(),7,"10","preventFire",JSON.toJSONString(tmp, SerializerFeature.WriteMapNullValue));
                orderUtil.createSecurityOrder(resourceSerial,null,new JSONObject(),null,7,"10","preventFire",JSON.toJSONString(tmp, SerializerFeature.WriteMapNullValue));
            }
        }

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

@ -143,7 +143,7 @@ public class YsDeviceService {
                }
            }
            if (fallFlag){//发起安防工单
                result = orderUtil.createSecurityOrder(deviceSN,sceneUrl,result,4,"2","preventFall",null);
                result = orderUtil.createSecurityOrder(deviceSN,sceneUrl,result,null,4,"2","preventFall",null);
            }
        }catch (Exception e){
            e.printStackTrace();

+ 17 - 10
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/util/SecurityOrderUtil.java

@ -54,22 +54,29 @@ public class SecurityOrderUtil {
    private DeviceSosLogDao sosLogDao;
    /***创建安防工单***/
    public JSONObject createSecurityOrder(String deviceSN, String sceneUrl, JSONObject result, Integer orderSource, String dictCode, String topicItem, String warnInfo){
    public JSONObject createSecurityOrder(String deviceSN, String sceneUrl, JSONObject result,JSONObject addressInfo, Integer orderSource, String dictCode, String topicItem, String warnInfo){
        try {
            String lat = "";
            String lon = "";
            String address=" ";
            List<DevicePatientDevice> devicePatientDeviceDos = patientDeviceDao.findByDeviceSn(deviceSN);
            if (devicePatientDeviceDos.size()>0){
                DevicePatientDevice deviceDO = devicePatientDeviceDos.get(0);
                Map<String, String> json = null;
                if (org.apache.commons.lang.StringUtils.isNotBlank(deviceDO.getSosAddress())) {
                    json = LatitudeUtils.getGeocoderLatitude(deviceDO.getSosAddress().replace("G.", "").replace("(糖友网)", "").replace("(高友网)", ""));
                if (null!=addressInfo){
                    lat = addressInfo.getString("lat");
                    lon = addressInfo.getString("lon");
                    address = addressInfo.getString("address");
                }else {
                    Map<String, String> json = null;
                    if (org.apache.commons.lang.StringUtils.isNotBlank(deviceDO.getSosAddress())) {
                        json = LatitudeUtils.getGeocoderLatitude(deviceDO.getSosAddress().replace("G.", "").replace("(糖友网)", "").replace("(高友网)", ""));
                    }
                    if (json != null) {
                        lat = json.get("lat").toString();
                        lon = json.get("lng").toString();
                        address = deviceDO.getSosAddress();
                    }
                }
                if (json != null) {
                    lat = json.get("lat").toString();
                    lon = json.get("lng").toString();
                }
                BasePatientDO patientDO = patientDao.findById(deviceDO.getUser());
                String  url = cloudCareUrl+"/cloudCare/noLogin/security/createOrder";
                String hospital = "";
@ -95,7 +102,7 @@ public class SecurityOrderUtil {
                jsonObject.put("patientPhone",patientDO.getMobile());
                jsonObject.put("serveDesc",serveDesc);
                jsonObject.put("hospital",sqlResult.get(0).get("org_code"));
                jsonObject.put("serveAddress",deviceDO.getSosAddress());
                jsonObject.put("serveAddress",address);
                jsonObject.put("serveLat",lat);
                jsonObject.put("serveLon",lon);
                jsonObject.put("topicItem",topicItem);

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

@ -67,7 +67,11 @@ 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){
                            sosContactsDO.setSuccessFlag(1);
                            if (1==sosContactsDO.getSuccessFlag()||0==sosContactsDO.getSuccessFlag()){
                                sosContactsDO.setSuccessFlag(1);
                            }else {
                                sosContactsDO.setSuccessFlag(-1);
                            }
                            sosContactsDO.setUpdateInfo(sosContactsDO.getUpdateInfo()+",{sim:"+sim+":"+1+"}");
                        }else {
                            sosContactsDO.setSuccessFlag(-1);
@ -78,7 +82,7 @@ public class PatientSosContactsJob implements Job {
                    if ("4".equals(category_code)||"7".equals(category_code)){
                        JSONObject response2 =  deviceService.updAqgDeviceSosInfo(device_sn,phone_seqid,sos_name,sos_phone,"1",null);
                        if (response2.getBoolean("success")){
                            if (1==sosContactsDO.getSuccessFlag()){
                            if (1==sosContactsDO.getSuccessFlag()||0==sosContactsDO.getSuccessFlag()){
                                sosContactsDO.setSuccessFlag(1);
                            }else {
                                sosContactsDO.setSuccessFlag(-1);