liubing 3 anos atrás
pai
commit
feacd68222

+ 8 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/message/PatientMessageEndpoint.java

@ -1,7 +1,9 @@
package com.yihu.jw.care.endpoint.message;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.aop.ObserverRequired;
import com.yihu.jw.care.service.message.PatientMessageService;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
@ -125,8 +127,12 @@ public class PatientMessageEndpoint extends EnvelopRestEndpoint {
                                 @ApiParam(name = "safe_area",value = "lon1,lat1;lon2,lat2; 5个坐标 形成一个封闭区域  A;B;C;D;A ")
                                 @RequestParam(value = "safe_area",required = false)String safe_area){
        try {
            patientMessageService.ConfirmFences(messageId,safe_area);
            return Envelop.getSuccess("已确认");
            JSONObject result = patientMessageService.ConfirmFences(messageId,safe_area);
            if (result.getInteger(ResponseContant.resultFlag)==ResponseContant.success){
                return ObjEnvelop.getSuccess("已确认","");
            }else {
                return ObjEnvelop.getError(result.getString(ResponseContant.resultMsg));
            }
        }catch (Exception e){
            return failedException2(e);
        }

+ 15 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/message/PatientMessageService.java

@ -21,6 +21,7 @@ import com.yihu.jw.entity.care.securitymonitoring.BaseEmergencyWarnLogDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.util.date.DateUtil;
import org.apache.commons.lang3.StringUtils;
@ -184,11 +185,16 @@ public class PatientMessageService {
     * @param safe_area
     */
    @Transactional(rollbackFor =Exception.class )
    public void ConfirmFences(String msgId,String safe_area){
    public JSONObject ConfirmFences(String msgId,String safe_area){
        JSONObject result = new JSONObject();
        SystemMessageDO systemMessageDO = systemMessageDao.findOne(msgId);
        if (systemMessageDO!=null){
            systemMessageDao.save(systemMessageDO);
        if ("1".equals(systemMessageDO.getData())){
            result.put(ResponseContant.resultFlag,ResponseContant.fail);
            result.put(ResponseContant.resultMsg,"已有家属确认管理,无需再次确认!");
            return result;
        }
        List<PatientSafeAreaDO> patientSafeAreaDOs = patientSafeAreaDao.findByPatient2(systemMessageDO.getRelationCode());
        PatientSafeAreaDO patientSafeAreaDO = null;
@ -196,7 +202,9 @@ public class PatientMessageService {
            patientSafeAreaDO = patientSafeAreaDOs.get(0);
        }else {
            return;
            result.put(ResponseContant.resultFlag,ResponseContant.fail);
            result.put(ResponseContant.resultMsg,"居民未绑定防走失设备!");
            return result;
        }
        if (StringUtils.isNotBlank(safe_area)&&null != patientSafeAreaDO){
            patientSafeAreaDO.setSafeAreaGz(safe_area);
@ -211,5 +219,8 @@ public class PatientMessageService {
        //修改数据
        patientSafeAreaConfirmDao.manageByPatient(patientSafeAreaDO.getPatient());
        systemMessageDao.readByTypeAndRelationCode("44",patientSafeAreaDO.getPatient(),"1");
        result.put(ResponseContant.resultFlag,ResponseContant.success);
        result.put(ResponseContant.resultMsg,"已确认");
        return result;
    }
}

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

@ -1575,6 +1575,11 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                        JSONObject locationTmp = response.getJSONObject("last_location");
                        Double lon = locationTmp.getJSONArray("coordinates").getDouble(0);
                        Double lat = locationTmp.getJSONArray("coordinates").getDouble(1);
                        if (!response.getBoolean("online")){//设备离线 取居民表定位
                            result.put("X1online",false);
                        }else {
                            result.put("X1online",true);
                        }
                        JSONObject tmp = gpsUtil.gcj02_To_Bd09(lat,lon);
                        tmp.put("city",response.getString("last_city"));
                        tmp.put("province",response.getString("last_province"));

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

@ -366,7 +366,14 @@ public class DeviceService {
    public void byLocation(String imei,String time_begin,boolean is_reply,boolean is_track,String city,String address,double lon,double lat,String type) {
        try {
            if(StringUtils.isNotBlank(imei)){
                List<DevicePatientDevice> devicePatientDeviceDos = patientDeviceDao.findByDeviceSn(imei);
                if (devicePatientDeviceDos.size()>0){
                    DevicePatientDevice deviceDO = devicePatientDeviceDos.get(0);
                    BasePatientDO patientDO = patientDao.findById(deviceDO.getUser());
                    JSONObject position = gpsUtil.gcj02_To_Bd09(lat,lon);
                    patientDO.setLatLon(position.getDouble("lat")+","+position.getDouble("lon"));
                    patientDao.save(patientDO);
                }
            }
        } catch (Exception e) {