瀏覽代碼

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

shikejing 4 年之前
父節點
當前提交
57bdf4d928

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

@ -355,6 +355,27 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
        }
    }
    @RequestMapping(value="getTotalRange",method = RequestMethod.GET)
    @ApiOperation("96使用率,86绑定率,88指导率,慢病患者设备使用率,慢病患者设备覆盖率整合")
    public MixEnvelop getTotalRange(@ApiParam(name="startTime",value="开始时间yyyy-MM-dd",defaultValue = "")
                                        @RequestParam(value="startTime",required = false) String startTime,
                                    @ApiParam(name="endTime",value="结束时间",defaultValue = "")
                                        @RequestParam(value="endTime",required = false) String endTime,
                                    @ApiParam(name="deviceType",value="设备类型",defaultValue = "")
                                        @RequestParam(value="deviceType",required = false) String deviceType,
                                    @ApiParam(name="area",value="地区",defaultValue = "")
                                        @RequestParam(value="area",required = false) String area,
                                    @ApiParam(name="hospital",value="机构",defaultValue = "")
                                        @RequestParam(value="hospital",required = false) String hospital){
        try {
            return MixEnvelop.getSuccess("查询成功",monitorPlatformService.getTotalRange(startTime,endTime,deviceType,area,hospital));
        }catch (Exception e){
            e.printStackTrace();
            return MixEnvelop.getError("查询失败");
        }
    }
    @RequestMapping(value = "/diseaseUseRange",method = RequestMethod.GET)
    @ApiOperation("慢病患者设备使用率")
    public MixEnvelop diseaseUseRange(

+ 15 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -18,6 +18,7 @@ import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.util.http.HttpClientUtil;
import io.swagger.annotations.ApiOperation;
import iot.device.LocationDataVO;
import netscape.javascript.JSObject;
import org.apache.http.Consts;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.message.BasicNameValuePair;
@ -822,6 +823,20 @@ public class MonitorPlatformService  {
        return new JSONObject();
    }
    public JSONObject getTotalRange(String startTime, String endTime,
                                  String deviceType, String area, String hospital){
        JSONObject result = new JSONObject();
        result.put("grant",totalRange(startTime,endTime,deviceType,area,hospital,"85"));
        result.put("binding",totalRange(startTime,endTime,deviceType,area,hospital,"86"));
        result.put("guide",totalRange(startTime,endTime,deviceType,area,hospital,"88"));
        result.put("malfunction",totalRange(startTime,endTime,deviceType,area,hospital,"0"));
        result.put("diseaseUsing",diseaseUseRange(startTime,endTime,deviceType,area,hospital));
        result.put("diseaseCover",diseaseRange(startTime,endTime,deviceType,area,hospital));
        return result;
    }
    /**
     * 慢病患者设备使用率
     * @param startTime