Selaa lähdekoodia

紧急救助 居民定位更新

liubing 4 vuotta sitten
vanhempi
commit
23ff5873c0

+ 23 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/assistance/EmergencyAssistanceEndpoint.java

@ -240,6 +240,29 @@ public class EmergencyAssistanceEndpoint extends EnvelopRestEndpoint {
        }
    }
    @PostMapping(value = "updatePatientLocation")
    @ApiOperation(value = "更新医生定位信息")
    @ObserverRequired
    public ObjEnvelop updatePatientLocation(@ApiParam(name="patient",value = "patient")
                                           @RequestParam(value = "patient") String patient,
                                           @ApiParam(name="patientAddress",value = "患者地址描述")
                                           @RequestParam(value = "patientAddress") String patientAddress,
                                           @ApiParam(name="patientLat",value = "患者当前定位纬度")
                                           @RequestParam(value = "patientLat") String patientLat,
                                           @ApiParam(name="patientLon",value = "患者当前定位经度")
                                           @RequestParam(value = "patientLon") String patientLon){
        try {
            JSONObject result = assistanceService.updatePatientLocation(patient,patientAddress,patientLat,patientLon);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return ObjEnvelop.getError(result.getString(ResponseContant.resultMsg));
            }
            return ObjEnvelop.getSuccess("定位更新成功",result.getJSONObject("resultMsg"));
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("定位更新失败"+e.getMessage());
        }
    }
    @PostMapping(value = "sendQuickMessage")
    @ApiOperation(value = "患者发送快捷消息")

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

@ -481,6 +481,30 @@ public class EmergencyAssistanceService extends BaseJpaService<EmergencyAssistan
        return result;
    }
    public JSONObject updatePatientLocation(String patient,String patientAddress,String patientLat,String patientLon){
        JSONObject result = new JSONObject();
        BasePatientDO patientDO = patientDao.findById(patient);
        if (patientDO==null){
            String failMsg = "患者不存在";
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            result.put(ResponseContant.resultMsg,failMsg);
            return result;
        }
        EmergencyAssistanceDO assistanceDO = emergencyAssistanceDao.findByPatientAndStatus(patient,1);
        if (assistanceDO!=null){
            assistanceDO.setServeAddress(patientAddress);
            assistanceDO.setServeLat(patientLat);
            assistanceDO.setServeLon(patientLon);
            emergencyAssistanceDao.save(assistanceDO);
            return getOrderDetail(assistanceDO.getId());
        }
        else {
            result.put(ResponseContant.resultFlag, ResponseContant.success);
            result.put(ResponseContant.resultMsg,null);
        }
        return result;
    }
    public JSONObject sendQuickMessage(String orderId,String patient,String content){
        JSONObject result = new JSONObject();
        ConsultTeamDo consultTeam = consultTeamDao.queryByRelationCode(orderId);