wushilong 3 年之前
父节点
当前提交
af24403b3c

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

@ -1700,7 +1700,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                                double homeLon = Double.parseDouble(homeLatLon.split(",")[1]);
                                double homeDistance = countDistance.getDistance(result.getJSONObject("location").getDouble("lat"), result.getJSONObject("location").getDouble("lon"),
                                        homeLat, homeLon);
                                if (homeDistance > 50 * 1000) {
                                if (1000 * homeDistance > 50) {
                                    result.put("atHome", false);
                                } else {
                                    result.put("atHome", true);
@ -2432,7 +2432,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                                    double homeLon = Double.parseDouble(homeLatLon.split(",")[1]);
                                    double homeDistance = countDistance.getDistance(Double.parseDouble(latLon[0]), Double.parseDouble(latLon[1]),
                                            homeLat, homeLon);
                                    if (homeDistance > 50 * 1000) {
                                    if ( 1000 *homeDistance > 50 ) {
                                        tmp.put("atHome", false);
                                    } else {
                                        tmp.put("atHome", true);

+ 28 - 16
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/StatisticsService.java

@ -272,9 +272,21 @@ public class StatisticsService {
                SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, defalutArea, defalutLevel, ind, SaveModel.timeLevel_DDL);
                res.put("index_" + ind, saveModel.getResult2().longValue());
            }
            String emergencyCallSql = "SELECT COUNT(1) FROM base_emergency_assistance_order WHERE status >= 0 ";
            String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_org' ";
            List<Map<String, Object>> listtmp = jdbcTemplate.queryForList(sqltmp);
            String filter = "";
            String filter2 = "";
            if (listtmp.size() > 0) {
                String orgCodes = String.valueOf(listtmp.get(0).get("orgCodes"));
                orgCodes = orgCodes.replaceAll(",", "','");
                filter = " and hospital not in ('" + orgCodes + "') ";
                filter2 = " and org_code not in ('" + orgCodes + "') ";
            }
            String emergencyCallSql = "SELECT COUNT(1) FROM base_emergency_assistance_order WHERE status >= 0 "+filter;
            Integer emergencyCallNum = jdbcTemplate.queryForObject(emergencyCallSql, Integer.class);
            String securityMonitoringSql = "SELECT COUNT(1) FROM base_security_monitoring_order where 1=1 ";
            String securityMonitoringSql = "SELECT COUNT(1) FROM base_security_monitoring_order where 1=1 "+filter;
            Integer securityMonitoringNum = jdbcTemplate.queryForObject(securityMonitoringSql, Integer.class);
            res.put("index_41", emergencyCallNum);
            res.put("index_43", securityMonitoringNum);
@ -1815,26 +1827,26 @@ public class StatisticsService {
        for (String ind : split) {
            long total = 0l;
            SaveModel saveModelAdd = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, "330100", 2, ind, SaveModel.timeLevel_DDL, "6");
            res.put("index_"+ind, saveModelAdd.getResult2().longValue());
            res.put("index_" + ind, saveModelAdd.getResult2().longValue());
        }
        Long index_28 = (Long) res.get("index_28");
        Long index_29 = (Long) res.get("index_29");
        Long index_30 = (Long) res.get("index_30");
        DecimalFormat df=new DecimalFormat("0.00");
        if (index_28!=0){
            if (index_29!=0){
                res.put("noReply",df.format((float) index_29/index_28*100)+"%");
            }else {
                res.put("noReply","0.00%");
        DecimalFormat df = new DecimalFormat("0.00");
        if (index_28 != 0) {
            if (index_29 != 0) {
                res.put("noReply", df.format((float) index_29 / index_28 * 100) + "%");
            } else {
                res.put("noReply", "0.00%");
            }
            if (index_30!=0){
                res.put("reply",df.format((float) index_30/index_28*100 )+"%");
            }else {
                res.put("reply","0.00%");
            if (index_30 != 0) {
                res.put("reply", df.format((float) index_30 / index_28 * 100) + "%");
            } else {
                res.put("reply", "0.00%");
            }
        }else{
            res.put("reply","0.00%");
            res.put("noReply","0.00%");
        } else {
            res.put("reply", "0.00%");
            res.put("noReply", "0.00%");
        }
        return res;
    }