Kaynağa Gözat

坐标接口修改

liubing 4 yıl önce
ebeveyn
işleme
5adeff06aa

+ 2 - 2
svr/svr-iot/src/main/java/com/yihu/iot/controller/monitorPlatform/MonitorPlatformController.java

@ -447,8 +447,8 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
            @RequestParam(value = "diseaseCondition",required = false) Integer diseaseCondition,
            @ApiParam(name = "type", value = "1高血压 2糖尿病", defaultValue = "")
            @RequestParam(value = "type",required = false) String type,
            @ApiParam(name="deviceType",value="设备类型 1血糖仪,2血压计 5健康小屋",required = true)
            @RequestParam(value="deviceType",required = true,defaultValue = "1,2,5") String deviceType,
            @ApiParam(name="deviceType",value="设备类型 对应设备字典库的DEVICE_TYPE值",required = true)
            @RequestParam(value="deviceType",required = true) String deviceType,
            @ApiParam(name="page",value="第几页(默认第一页)",defaultValue = "1")
            @RequestParam(value="page",required = false) Integer page,
            @ApiParam(name="pageSize",value="每页几行(默认10条记录)",defaultValue = "10")

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/equipment/IotEqtDetailService.java

@ -197,7 +197,7 @@ public class IotEqtDetailService  extends BaseJpaService<IotEquipmentDetailDO, I
            locationDataVO.setLocation(geoPoint);
            locationDataVO.setDeviceTime(null);
            locationDataVO.setLabel(null);
            locationDataVO.setDiseaseCondition(0);
            locationDataVO.setDiseaseCondition(5);
            locationDataVO.setCreateTime(jsobj.get("createTime").toString());
            locationDataVO.setName((String) jsobj.get("name"));
            locationDataVO.setCode(null);

+ 27 - 22
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -104,6 +104,8 @@ public class MonitorPlatformService  {
            return envelop;
        }else {
            List<LocationDataVO> euipmentList = new ArrayList<>();
            int totalEqCount=0;
            int totalCount=0;
            //查找全部
            if(diseaseCondition!=null){
                JSONObject json = new JSONObject();
@ -113,40 +115,43 @@ public class MonitorPlatformService  {
                json.put("value",diseaseCondition);
                jsonArray.add(json);
            }
            //小屋总数
            if(deviceType.contains("5")){
               totalEqCount = iotEqtDetailService.getEquipmentCount();
            }
            String[] categoryCodes= deviceType.split(",");
            if(categoryCodes.length==1&&"5".equals(deviceType)){
                euipmentList = iotEqtDetailService.getEquipmentLocation(page,size);
                envelop.getDetailModelList().addAll(euipmentList);
                envelop.setTotalCount(iotEqtDetailService.getEquipmentCount());
            }
            else{
                if(deviceType.contains("5")){
                    euipmentList = iotEqtDetailService.getEquipmentLocation(page,size);
                    envelop.getDetailModelList().addAll(euipmentList);
                }
                if(!(deviceType.contains("1")&&deviceType.contains("2"))){
                    for (String categoryCode:categoryCodes){
                        if(!"5".equals(categoryCode)){
                            JSONObject json = new JSONObject();
                            json.put("andOr","and");
                            json.put("field","categoryCode");
                            json.put("condition","=");
                            json.put("value",Integer.parseInt(categoryCode));
                            jsonArray.add(json);
                        }
                    }
                for (String categoryCode:categoryCodes){
                     if(!"5".equals(categoryCode)){
                         JSONObject json = new JSONObject();
                         json.put("andOr","and");
                         json.put("field","categoryCode");
                         json.put("condition","=");
                         json.put("value",Integer.parseInt(categoryCode));
                         jsonArray.add(json);
                         JSONObject jsonObject = new JSONObject();
                         jsonObject.put("filter",jsonArray);
                         jsonObject.put("page",page);
                         jsonObject.put("size",size);
                         List<LocationDataVO> locationDataVOList = iotPatientDeviceService.findDeviceLocationsByIdCard(jsonObject.toString());
                         List<LocationDataVO> list2 = iotPatientDeviceService.addNameAndCodeToList(locationDataVOList);
                         //figureLabelSerachService.getFigureLabelByList(locationDataVOList);
                         envelop.getDetailModelList().addAll(list2);
                         totalCount += iotPatientDeviceService.getESCount(jsonObject.toString());
                         jsonArray.remove(json);
                     }
                }
                JSONObject jsonObject = new JSONObject();
                jsonObject.put("filter",jsonArray);
                jsonObject.put("page",page);
                jsonObject.put("size",size);
                List<LocationDataVO> locationDataVOList = iotPatientDeviceService.findDeviceLocationsByIdCard(jsonObject.toString());
                List<LocationDataVO> list2 = iotPatientDeviceService.addNameAndCodeToList(locationDataVOList);
                //figureLabelSerachService.getFigureLabelByList(locationDataVOList);
                envelop.getDetailModelList().addAll(list2);
                envelop.setTotalCount(iotPatientDeviceService.getESCount(jsonObject.toString()));
            }
            envelop.setTotalCount(totalCount>totalEqCount?totalCount:totalEqCount);
            return envelop;
        }
    }