Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

 Conflicts:
	svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/security/SecurityMonitoringOrderService.java
	svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/StatisticsService.java
wushilong 3 years ago
parent
commit
1f58855221

+ 13 - 3
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 (1000 * homeDistance > 50) {
                                if (homeDistance* 1000 > 50) {
                                    result.put("atHome", false);
                                } else {
                                    result.put("atHome", true);
@ -2291,12 +2291,22 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
    public JSONObject findMonitorPatientsByDoctors(String topicItem, String day, Integer page, Integer pageSize, Integer detail) {
        JSONObject result = new JSONObject();
        String sql = " SELECT DISTINCT p.id,p.name,p.residential_area residentialArea,p.photo,p.idcard,p.mobile, " +
                " p.openid,p.sex,p.pad_imei padImei,p.home_lat_lon homeLatLon,p.lat_lon latLon " +
                " from base_patient p , base_service_package_sign_record sr,base_service_package_record r,base_team_member m  " +
                " WHERE p.id = sr.patient and sr.status=1 and m.team_code = r.team_code and sr.id=r.sign_id  " +
                " and m.del = '1' ";
        String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_child' or dict_name = 'jkzl_older' ";
        List<Map<String,Object>> listtmp =  jdbcTemplate.queryForList(sqltmp);
        if(listtmp.size()>0){
            String orgCodes = String.valueOf(listtmp.get(0).get("orgCodes"));
            if (org.apache.commons.lang.StringUtils.isNotBlank(orgCodes)){
                orgCodes = orgCodes.replaceAll(",","','");
                sql += " and p.id not in ('"+orgCodes+"') ";
            }
        }
        String fliter = "";
        String categoryCode = "";
        String topicItemTmp = topicItem;
@ -2432,7 +2442,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 ( 1000 *homeDistance > 50 ) {
                                    if (homeDistance * 1000 > 50) {
                                        tmp.put("atHome", false);
                                    } else {
                                        tmp.put("atHome", true);

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

@ -158,6 +158,8 @@ public class StatisticsService {
        // activity-1   活动浏览次数
        // activity-2   公艺课程播放
        res.put("activity_1", 0);
        res.put("activity_2", 0);
        String sql = " SELECT activity_type, COUNT(id) total  FROM base_activity_click WHERE activity_type IN (1, 2) GROUP BY activity_type";
        List<Map<String, Object>> lists = jdbcTemplate.queryForList(sql);
        for (Map<String, Object> tmp : lists) {
@ -272,7 +274,6 @@ public class StatisticsService {
                SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, endDate, defalutArea, defalutLevel, ind, SaveModel.timeLevel_DDL);
                res.put("index_" + ind, saveModel.getResult2().longValue());
            }
            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 = "";
@ -302,6 +303,8 @@ public class StatisticsService {
            // activity-1   活动浏览次数
            // activity-2   公艺课程播放
            String sql = " SELECT activity_type, COUNT(id) total FROM base_activity_click WHERE activity_type IN (1, 2) GROUP BY activity_type";
            res.put("activity_1",0);
            res.put("activity_2",0);
            List<Map<String, Object>> lists = jdbcTemplate.queryForList(sql);
            for (Map<String, Object> tmp : lists) {
                Integer num = Integer.parseInt(tmp.get("total").toString());
@ -1827,26 +1830,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;
    }