Browse Source

Merge branch 'dev' of liubing/wlyy2.0 into dev

liubing 4 years ago
parent
commit
46219606bc

+ 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 = "患者发送快捷消息")

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

@ -284,12 +284,12 @@ public class EmergencyAssistanceService extends BaseJpaService<EmergencyAssistan
            result.put(ResponseContant.resultMsg,failMsg);
            return result;
        }
        if (assistanceDO.getStatus()!=0){
            String failMsg = "当前工单未完成 无法查看";
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            result.put(ResponseContant.resultMsg,failMsg);
            return result;
        }
//        if (assistanceDO.getStatus()!=0){
//            String failMsg = "当前工单未完成 无法查看";
//            result.put(ResponseContant.resultFlag, ResponseContant.fail);
//            result.put(ResponseContant.resultMsg,failMsg);
//            return result;
//        }
        return getOrderDetail(orderID);
    }
@ -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);