Browse Source

代码修改

liubing 3 years ago
parent
commit
ab75ac4bc2

+ 1 - 1
business/sms-service/pom.xml

@ -64,7 +64,7 @@
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-redis</artifactId>
            <version>RELEASE</version>
<!--            <version>RELEASE</version>-->
            <scope>compile</scope>
        </dependency>
    </dependencies>

+ 1 - 1
svr/svr-base/pom.xml

@ -180,7 +180,7 @@
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>RELEASE</version>
<!--            <version>RELEASE</version>-->
            <scope>compile</scope>
        </dependency>

+ 1 - 1
svr/svr-base/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name: svr-base
    name: svr-base-lb
  cloud:
    config:
      failFast: true

+ 6 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doctor/admin/AdminInfoEndpoint.java

@ -149,7 +149,8 @@ public class AdminInfoEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "getServiceSituation")
    @ApiOperation(value = "设备库存、使用、总备案、照护类型设备数量")
    public ObjEnvelop getServiceSituation() {
    public ObjEnvelop getServiceSituation( @RequestParam(required = true) String area,
                                           @RequestParam(required = true) int level) {
        try {
            JSONObject param = new JSONObject();
            String doctorId =  permissionService.getUID();
@ -157,7 +158,7 @@ public class AdminInfoEndpoint extends EnvelopRestEndpoint {
            if(permissionService.noPermission(0,param)){
                return ObjEnvelop.getError("该操作没有权限");
            }
            return success("查询成功", 200, platformService.getServiceSituation());
            return success("查询成功", 200, platformService.getServiceSituation(area,level));
        } catch (Exception e) {
            return failedObjEnvelopException(e);
        }
@ -165,7 +166,8 @@ public class AdminInfoEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "getDeviceCompany")
    @ApiOperation(value = "设备物联率、失联率")
    public ObjEnvelop getDeviceCompany() {
    public ObjEnvelop getDeviceCompany( @RequestParam(required = true) String area,
                                        @RequestParam(required = true) int level) {
        try {
            JSONObject param = new JSONObject();
            String doctorId =  permissionService.getUID();
@ -173,7 +175,7 @@ public class AdminInfoEndpoint extends EnvelopRestEndpoint {
            if(permissionService.noPermission(0,param)){
                return ObjEnvelop.getError("该操作没有权限");
            }
            JSONObject o = platformService.getDeviceComapny();
            JSONObject o = platformService.getDeviceComapny(area,level);
            return success(o);
        } catch (Exception e) {
            return failedObjEnvelopException(e);

+ 2 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/statistics/DetectionPlatformEndpoint.java

@ -74,7 +74,7 @@ public class DetectionPlatformEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "设备物联率、失联率")
    public ObjEnvelop getDeviceCompany() {
        try {
            JSONObject o = platformService.getDeviceComapny();
            JSONObject o = platformService.getDeviceComapny(null,null);
            return success(o);
        } catch (Exception e) {
            return failedObjEnvelopException(e);
@ -280,7 +280,7 @@ public class DetectionPlatformEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "物联网检测大屏,设备库存、使用、总备案、照护类型设备数量")
    public ObjEnvelop getServiceSituation() {
        try {
            return success("查询成功", 200, platformService.getServiceSituation());
            return success("查询成功", 200, platformService.getServiceSituation(null,null));
        } catch (Exception e) {
            return failedObjEnvelopException(e);
        }

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

@ -117,7 +117,9 @@ public class DetectionPlatformService  {
        }
    }
    public JSONObject getDeviceComapny(){
    public JSONObject getDeviceComapny(String area,Integer level){
        String olderFilter = roleService.getOlderRoleSQL(area,level+"");
        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);
@ -144,7 +146,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(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";
                "(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 "+olderFilter.replace("{patient}","pd.user")+" ) isUse";
        List<Map<String , Object>> securityList = jdbcTemplate.queryForList(securitySql);
        if (securityList.size() > 0) {
            object.put("securityAllCount",securityList.get(0).get("allCount")); //安防设备总量
@ -157,7 +159,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(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";
                "(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 "+olderFilter.replace("{patient}","pd.user")+" ) isUse";
        List<Map<String , Object>> healthList = jdbcTemplate.queryForList(healthSql);
        if (healthList.size() > 0) {
            object.put("healthAllCount",healthList.get(0).get("allCount"));//健康设备总量
@ -175,7 +177,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 and pd.user "+filter+"  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+" "+olderFilter.replace("{patient}","pd.user")+" WHERE contact_status = 0";//contact_status = 0   失联
        List<Map<String , Object>> unUseList = jdbcTemplate.queryForList(unUseSql);
        int unUseCount = unUseList.size();
        object.put("unUseCount",unUseCount);//设备失联数量 失联分子
@ -492,8 +494,9 @@ public class DetectionPlatformService  {
        return object;
    }
    public JSONObject getServiceSituation(){
    public JSONObject getServiceSituation(String area,Integer level){
        JSONObject object = new JSONObject();
        String olderFilter = roleService.getOlderRoleSQL(area,level+"");
        /*****设备分类****/
        // SELECT hsd.`value` dict_value,aa.count FROM base_system_dict_entry hsd LEFT JOIN (SELECT serve_desc,COUNT(1) count FROM base_security_monitoring_order GROUP BY serve_desc)aa ON hsd.`value` = aa.serve_desc WHERE hsd.remark = 'security'
        String passportTypeSql = "SELECT sde.`value`,COUNT(d.id) count,GROUP_CONCAT(DISTINCT d.category_code SEPARATOR ',') AS category_code,GROUP_CONCAT(DISTINCT d.model SEPARATOR ',') AS model FROM base_system_dict_entry sde LEFT JOIN dm_device d ON FIND_IN_SET(sde.`code`,d.service_topic) WHERE sde.remark = 'security' GROUP BY sde.`value` ";
@ -510,7 +513,7 @@ public class DetectionPlatformService  {
                model = (String) passportType.get(i).get("model");
                model = model.replace(",","','");
                if ( count.intValue() > 0) {
                    useSql = "SELECT COUNT(DISTINCT device_sn) FROM wlyy_patient_device WHERE category_code IN ("+ passportType.get(i).get("category_code") +") AND del = 0";
                    useSql = "SELECT COUNT(DISTINCT device_sn) FROM wlyy_patient_device pd WHERE category_code IN ("+ passportType.get(i).get("category_code") +") AND del = 0 "+olderFilter.replace("{patient}","pd.user");
                    use = jdbcTemplate.queryForObject(useSql,Integer.class);
                    passportType.get(i).put("use",use);//使用
                    allSql = "SELECT COUNT(DISTINCT device_code) FROM wlyy_devices WHERE device_model IN ('"+ model +"')";