Bläddra i källkod

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

liubing 3 år sedan
förälder
incheckning
0a0ff7f449

+ 5 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/version/VersionEndpoint.java

@ -31,14 +31,16 @@ public class VersionEndpoint extends EnvelopRestEndpoint {
     */
    @GetMapping(value = BaseHospitalRequestMapping.Version.app)
    @ApiOperation(value = "app升级")
    public Envelop appVersion(String code, double version) {
    public Envelop appVersion(String code, String version) {
            AppVersionDO temp = versionsService.findVersionByCode(code);
            if (temp == null) {
                return Envelop.getError( "无效的APP类型失败!");
            }
            if (version > 0) {
                if (temp.getVersionInt() > version) {
            Integer versions = Integer.parseInt(version.replace(".","0"));
            if (versions > 0) {
                Integer versionsNew = Integer.parseInt(temp.getVersionStr().replace(".","0"));
                if (versionsNew > versions) {
                    // 有新的版本号
                    return success("发现新版本!", temp.getUrl());
                } else {

+ 12 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/DetectionPlatformService.java

@ -90,6 +90,15 @@ public class DetectionPlatformService  {
    }
    public JSONObject getDeviceComapny(){
        String filter = "";
        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"));
            orgCodes = orgCodes.replaceAll(",","','");
            filter = " not in ('"+orgCodes+"')";
        }
        JSONObject object = new JSONObject();
        String deviceTypeSum = "SELECT * FROM wlyy_devices WHERE device_name IS NOT NULL AND device_name != '' GROUP BY device_name";
        List<Map<String , Object>> deviceList = jdbcTemplate.queryForList(deviceTypeSum);
@ -107,7 +116,7 @@ public class DetectionPlatformService  {
        }
        String securitySql = "SELECT allCount,isUse,(allCount - isUse) inventory FROM \n" +
                "(SELECT COUNT(1) allCount FROM wlyy_devices WHERE device_type = 1) allCount,\n" +
                "(SELECT COUNT(pd.id) isUse FROM wlyy_devices d,wlyy_patient_device pd WHERE d.device_type = 1 AND d.device_code = pd.device_sn AND pd.del = 0) isUse";
                "(SELECT COUNT(DISTINCT pd.device_sn) isUse FROM wlyy_devices d,wlyy_patient_device pd WHERE d.device_type = 1 AND d.device_code = pd.device_sn and pd.user "+filter+" AND pd.del = 0) isUse";
        List<Map<String , Object>> securityList = jdbcTemplate.queryForList(securitySql);
        if (securityList.size() > 0) {
            object.put("securityAllCount",securityList.get(0).get("allCount")); //安防设备总量
@ -120,7 +129,7 @@ public class DetectionPlatformService  {
        }
        String healthSql = "SELECT allCount,isUse,(allCount - isUse) inventory FROM \n" +
                "(SELECT COUNT(1) allCount FROM wlyy_devices WHERE device_type = 0) allCount,\n" +
                "(SELECT COUNT(pd.id) isUse FROM wlyy_devices d,wlyy_patient_device pd WHERE d.device_type = 0 AND d.device_code = pd.device_sn AND pd.del = 0) isUse";
                "(SELECT COUNT(DISTINCT pd.device_sn) isUse FROM wlyy_devices d,wlyy_patient_device pd WHERE d.device_type = 0 AND d.device_code = pd.device_sn and pd.user "+filter+" AND pd.del = 0) isUse";
        List<Map<String , Object>> healthList = jdbcTemplate.queryForList(healthSql);
        if (healthList.size() > 0) {
            object.put("healthAllCount",healthList.get(0).get("allCount"));//健康设备总量
@ -138,7 +147,7 @@ public class DetectionPlatformService  {
        object.put("lawOfIOT",getRange( (securityIsUser.intValue() + healthIsUser.intValue() ),( securityAllCount.intValue() + healthAllCount.intValue()  ) ));//物联率 发放了就算物联
        object.put("isUseAllIot",(securityIsUser.intValue() + healthIsUser.intValue()));//已发放设备
        object.put("allIot",securityAllCount.intValue() + healthAllCount.intValue());//总设备
        String unUseSql = "SELECT DISTINCT wd.device_code FROM wlyy_devices wd INNER JOIN wlyy_patient_device pd on wd.device_code =pd.device_sn  WHERE contact_status = 0";//contact_status = 0   失联
        String unUseSql = "SELECT DISTINCT wd.device_code FROM wlyy_devices wd INNER JOIN wlyy_patient_device pd on wd.device_code =pd.device_sn and pd.user "+filter+"  WHERE contact_status = 0";//contact_status = 0   失联
        List<Map<String , Object>> unUseList = jdbcTemplate.queryForList(unUseSql);
        int unUseCount = unUseList.size();
        object.put("unUseCount",unUseCount);//设备失联数量

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

@ -853,8 +853,8 @@ public class StatisticsService {
        }
        JSONArray jsonArray = new JSONArray();
        String sql = " select dict.dict_code,dict_value,count(DISTINCT lab.patient) total from wlyy_hospital_sys_dict dict \n" +
                "LEFT JOIN wlyy_patient_label lab  on  dict.dict_code = lab.label_code AND  lab.label_type='1' " +
                "where  dict.dict_name='service_type' and lab.patient "+filter+" and  dict.dict_code is not null and dict_code<>5  \n" +
                "LEFT JOIN wlyy_patient_label lab  on  dict.dict_code = lab.label_code AND  lab.label_type='1' and lab.patient "+filter+" " +
                "where  dict.dict_name='service_type'  and  dict.dict_code is not null and dict_code<>5  \n" +
                " GROUP BY dict.dict_code; ";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
@ -1142,8 +1142,17 @@ public class StatisticsService {
    }
    public JSONObject deviceUsingInfo(String area){
        String filter = "";
        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"));
            orgCodes = orgCodes.replaceAll(",","','");
            filter = " not in ('"+orgCodes+"')";
        }
        JSONObject result = new JSONObject();
        String sql = "SELECT COUNT(DISTINCT device_sn) FROM wlyy_patient_device WHERE del = 0";
        String sql = "SELECT COUNT(DISTINCT device_sn) FROM wlyy_patient_device WHERE del = 0 and user "+filter;
        Integer use = jdbcTemplate.queryForObject(sql,Integer.class);
        sql = "SELECT COUNT(DISTINCT device_code) FROM wlyy_devices ";
        Integer total = jdbcTemplate.queryForObject(sql,Integer.class);
@ -1152,7 +1161,7 @@ public class StatisticsService {
        result.put("stock",total-use);//库存
        sql = "SELECT DISTINCT count(wd.device_code) FROM wlyy_devices wd INNER JOIN wlyy_patient_device pd on " +
                "wd.device_code =pd.device_sn  WHERE contact_status = 0";//contact_status = 0   失联
                "wd.device_code =pd.device_sn  WHERE contact_status = 0 and pd.user "+filter;//contact_status = 0   失联
        Integer lost = jdbcTemplate.queryForObject(sql,Integer.class);
        //物联率 失联率
        result.put("deviceAll",total);//物联率分母总数 设备总数(包括库存)
@ -1165,6 +1174,15 @@ public class StatisticsService {
    }
    public PageEnvelop getSecurityOrderList(String area,String status, String svrDesc,String topicItem, Integer page, Integer pageSize){
        String testPatients = "";
        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"));
            orgCodes = orgCodes.replaceAll(",","','");
            testPatients = " not in ('"+orgCodes+"') ";
        }
        page = page>1?page-1:0;
        JSONArray result = new JSONArray();
@ -1183,6 +1201,7 @@ public class StatisticsService {
        if (org.apache.commons.lang3.StringUtils.isNotBlank(topicItem)){
            fliter+=" and ord.topic_item='"+topicItem+"' ";
        }
        fliter +=" and ord.patient "+testPatients;
        Long count = jdbcTemplate.queryForObject(sqlCount+fliter,Long.class);
        fliter+=" order by ord.create_time desc limit " + (page*pageSize) + "," + pageSize;
        List<Map<String,Object>> sqlResult = jdbcTemplate.queryForList(sql+fliter);
@ -1241,6 +1260,15 @@ public class StatisticsService {
    public JSONObject getSecurityTab(String area,String status,String svrDesc,String topicItem){
        String testPatients = "";
        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"));
            orgCodes = orgCodes.replaceAll(",","','");
            testPatients = " not in ('"+orgCodes+"') ";
        }
        if (StringUtils.isNotBlank(area)){
        }
@ -1274,6 +1302,8 @@ public class StatisticsService {
        if (org.apache.commons.lang3.StringUtils.isNotBlank(topicItem)){
            fliter+=" and ord.topic_item='"+topicItem+"' ";
        }
        fliter +=" and ord.patient "+testPatients;
        fliter+=" group by ord.status,ord.serve_desc ";
        List<Map<String,Object>> sqlResult = jdbcTemplate.queryForList(sql+fliter);
        String pyCode = "";