| | |
| | | MapPathService mapPathService; |
| | | |
| | | |
| | | |
| | | @GetMapping("test") |
| | | public ResultBean<List<WebProvince>> add(HttpServletRequest request) { |
| | | String token = request.getHeader("token"); |
| | |
| | | /** |
| | | * @Description: 登陆接口 |
| | | * @Param: [parameters] |
| | | * @return: java.util.Map<java.lang.String , java.lang.Object> |
| | | * @return: java.util.Map<java.lang.String , java.lang.Object> |
| | | * @Author: 下雨听风 |
| | | * @Date: 2020/10/19 |
| | | */ |
| | |
| | | /** |
| | | * @Description: 退出接口 |
| | | * @Param: [request] |
| | | * @return: java.util.Map<java.lang.String , java.lang.Object> |
| | | * @return: java.util.Map<java.lang.String , java.lang.Object> |
| | | * @Author: 下雨听风 |
| | | * @Date: 2020/10/19 |
| | | */ |
| | |
| | | return resultMap; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | |
| | | } |
| | | |
| | | @UserLoginToken |
| | | @GetMapping("getAccountInfo") |
| | |
| | | /** |
| | | * @Description: 获取传感器平均值 |
| | | * @Param: [request] |
| | | * @return: com.moral.common.bean.ResultBean<java.util.List < java.util.Map < java.lang.String , java.lang.Object>>> |
| | | * @return: com.moral.common.bean.ResultBean<java.util.List < java.util.Map < java.lang.String , java.lang.Object>>> |
| | | * @Author: 下雨听风 |
| | | * @Date: 2020/10/19 |
| | | */ |
| | |
| | | /** |
| | | * @Description: 获取某个站点设备信息 |
| | | * @Param: [request] |
| | | * @return: com.moral.common.bean.ResultBean<java.util.List < com.moral.entity.MonitorPoint>> |
| | | * @return: com.moral.common.bean.ResultBean<java.util.List < com.moral.entity.MonitorPoint>> |
| | | * @Author: 下雨听风 |
| | | * @Date: 2020/10/19 |
| | | */ |
| | |
| | | /** |
| | | * @Description: 获取坐标接口,前端用于建点 |
| | | * @Param: [request] |
| | | * @return: com.moral.common.bean.ResultBean<java.util.List < com.moral.entity.Device>> |
| | | * @return: com.moral.common.bean.ResultBean<java.util.List < com.moral.entity.Device>> |
| | | * @Author: 下雨听风 |
| | | * @Date: 2020/10/19 |
| | | */ |
| | |
| | | /** |
| | | * @Description: 根据monitorId获取该站点下每一台设备具体传感器的五分钟平均值 |
| | | * @Param: [] |
| | | * @return: com.moral.common.bean.ResultBean<java.util.Map < java.lang.String , java.lang.Object>> |
| | | * @return: com.moral.common.bean.ResultBean<java.util.Map < java.lang.String , java.lang.Object>> |
| | | * @Author: 下雨听风 |
| | | * @Date: 2020/10/19 |
| | | */ |
| | |
| | | //根据orgId获取该站点下所有设备mac集合 |
| | | String accountId = WebTokenUtils.getIdBytoken(token); |
| | | Account account = accountService.getAccountById(Integer.parseInt(accountId)); |
| | | parameters.put("organizationId",account.getOrganizationId()); |
| | | List<MonitorPoint> monitorPoints = monitorPointService.getMonitorPointsAndDevicesByRegion(parameters); |
| | | if(ObjectUtils.isEmpty(monitorPoints)) |
| | | parameters.put("organizationId", account.getOrganizationId()); |
| | | List<MonitorPoint> monitorPoints = monitorPointService.getMonitorPointsByRegionAndOrgId(parameters); |
| | | if (ObjectUtils.isEmpty(monitorPoints)) |
| | | return ResultBean.fail("该账号对应地区无站点"); |
| | | |
| | | List<Device> devices = new ArrayList<>(); |
| | | for (MonitorPoint monitorPoint : monitorPoints) { |
| | | devices.addAll(monitorPoint.getDevices()); |
| | | if (!ObjectUtils.isEmpty(monitorPoint.getDevices())) |
| | | devices.addAll(monitorPoint.getDevices()); |
| | | } |
| | | if (ObjectUtils.isEmpty(devices)) |
| | | return ResultBean.fail("该账号对应地区无设备"); |
| | |
| | | /** |
| | | * @Description: 根据mac号获取单台设备信息,特殊客户只显示客户需要的传感器信息 |
| | | * @Param: [request] |
| | | * @return: com.moral.common.bean.ResultBean<java.util.Map < java.lang.String , java.lang.Object>> |
| | | * @return: com.moral.common.bean.ResultBean<java.util.Map < java.lang.String , java.lang.Object>> |
| | | * @Author: 下雨听风 |
| | | * @Date: 2020/10/22 |
| | | */ |
| | |
| | | /** |
| | | * @Description: 根据token获取用户地图 |
| | | * @Param: [request] |
| | | * @return: com.moral.common.bean.ResultBean<java.util.List < com.moral.entity.WebProvince>> |
| | | * @return: com.moral.common.bean.ResultBean<java.util.List < com.moral.entity.WebProvince>> |
| | | * @Author: 下雨听风 |
| | | * @Date: 2020/11/27 |
| | | */ |
| | |
| | | |
| | | @UserLoginToken |
| | | @GetMapping("monitor-points") |
| | | public ResultBean<List<MonitorPoint>> getmMnitorPoints(HttpServletRequest request){ |
| | | public ResultBean<List<MonitorPoint>> getmMnitorPoints(HttpServletRequest request) { |
| | | String accountId = WebTokenUtils.getIdBytoken(request.getHeader("token")); |
| | | Account account = accountService.getAccountById(Integer.parseInt(accountId)); |
| | | String regionCode = request.getParameter("regionCode"); |
| | | Map<String,Object> paramMap = new HashMap<>(); |
| | | paramMap.put("organizationId",account.getOrganizationId()); |
| | | paramMap.put("regionCode",regionCode); |
| | | Map<String, Object> paramMap = new HashMap<>(); |
| | | paramMap.put("organizationId", account.getOrganizationId()); |
| | | paramMap.put("regionCode", regionCode); |
| | | List<MonitorPoint> monitorPoints = monitorPointService.getMonitorPointsAndDevicesByRegion(paramMap); |
| | | if (ObjectUtils.isEmpty(monitorPoints)) |
| | | return new ResultBean<>("无对应站点设备信息", ResultBean.FAIL); |