Browse Source

代码修改

liubing 4 years ago
parent
commit
40e44191ce

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

@ -208,21 +208,22 @@ public class EmergencyAssistanceService extends BaseJpaService<EmergencyAssistan
            params.add(new BasicNameValuePair("output", "json"));
            params.add(new BasicNameValuePair("ak", baiduAk));
            String url = baiduUrl+"routematrix/v2/driving";
            String response = httpClientUtil.get(url,params,"UTF-8");
            JSONObject responseObj = JSONObject.parseObject(response);
            if (responseObj.getInteger("status")==0){
                JSONArray resultArr = responseObj.getJSONArray("result");
                int length = resultArr.size()>otherDoctorDistance.size()?resultArr.size():otherDoctorDistance.size();
                for (int i=0;i<length;i++){
                    JSONObject disTmp = resultArr.getJSONObject(i);
                    JSONObject docTmp = otherDoctorDistance.getJSONObject(i);
                    docTmp.put("time",disTmp.getJSONObject("duration").getString("text"));
                    docTmp.put("distance",disTmp.getJSONObject("distance").getInteger("value")/1000.0);//实际路线距离
                    docTmp.put("distanceMeter",disTmp.getJSONObject("distance").getInteger("value"));
                }
                otherDoctorDistance.sort(Comparator.comparing(obj -> ((JSONObject) obj).getInteger("distance")));
            }
            //前端做距离计算
//            String url = baiduUrl+"routematrix/v2/driving";
//            String response = httpClientUtil.get(url,params,"UTF-8");
//            JSONObject responseObj = JSONObject.parseObject(response);
//            if (responseObj.getInteger("status")==0){
//                JSONArray resultArr = responseObj.getJSONArray("result");
//                int length = resultArr.size()>otherDoctorDistance.size()?resultArr.size():otherDoctorDistance.size();
//                for (int i=0;i<length;i++){
//                    JSONObject disTmp = resultArr.getJSONObject(i);
//                    JSONObject docTmp = otherDoctorDistance.getJSONObject(i);
//                    docTmp.put("time",disTmp.getJSONObject("duration").getString("text"));
//                    docTmp.put("distance",disTmp.getJSONObject("distance").getInteger("value")/1000.0);//实际路线距离
//                    docTmp.put("distanceMeter",disTmp.getJSONObject("distance").getInteger("value"));
//                }
//                otherDoctorDistance.sort(Comparator.comparing(obj -> ((JSONObject) obj).getInteger("distance")));
//            }
        }
        assistanceDO.setOtherDoctorDistance(otherDoctorDistance.toJSONString());
        BasePatientDO patientDO = patientDao.findById(assistanceDO.getPatient());

+ 3 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/lifeCare/LifeCareOrderService.java

@ -324,7 +324,7 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
                " FROM " +
                "  base_life_care_order o " +
                " WHERE " +
                "  o.patient = '"+ patient + "' " +
                "  (o.patient = '"+ patient + "' or o.proxy_patient = '"+patient+"' )"+
                " GROUP BY o.`status`";
        List<Map<String,Object>> countMapList = jdbcTemplate.queryForList(countSql);
@ -413,14 +413,14 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
        JSONObject jsonObjectParam;
        try {
            jsonObjectParam = JSONObject.parseObject(jsonData);
            if (jsonObjectParam.getInteger("type")==1||jsonObjectParam.getInteger("type")==2){
            if (jsonObjectParam.getJSONObject("order").getInteger("type")==1||jsonObjectParam.getInteger("type")==2){
                //本人或家人代发起
                BasePatientDO patientDO = patientDao.findById(proxyPatient);
                jsonObjectParam.put("proxyPatient",proxyPatient);
                jsonObjectParam.put("proxyPatientName",patientDO.getName());
                jsonObjectParam.put("proxyPatientPhone",patientDO.getMobile());
            }
            if (jsonObjectParam.getInteger("type")==3) {//医生代发起
            if (jsonObjectParam.getJSONObject("order").getInteger("type")==3) {//医生代发起
                BaseDoctorDO doctorDO = doctorDao.findById(proxyPatient);
                jsonObjectParam.put("proxyPatient",proxyPatient);
                jsonObjectParam.put("proxyPatientName",doctorDO.getName());