| | |
| | | import com.hxzkmonitor.mapper.TbBaidumapMapper; |
| | | import com.hxzkmonitor.mapper.TbUserMapper; |
| | | import com.hxzkmonitor.pojo.*; |
| | | import com.hxzkmonitor.service.TbEquipmentService; |
| | | import com.hxzkmonitor.service.TbEvrydayweiyi2024Service; |
| | | import com.hxzkmonitor.service.TbSystemOperationLogService; |
| | | import com.hxzkmonitor.service.TbSystemService; |
| | | import com.hxzkmonitor.service.*; |
| | | import com.hxzkmonitor.udp.Udp_Out; |
| | | import com.hxzkmonitor.util.DateUtil; |
| | | import com.hxzkmonitor.util.R; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | @Autowired |
| | | TbUserMapper tbUserMapper; |
| | | |
| | | @Autowired |
| | | TbGuangboService tbGuangboService; |
| | | |
| | | @ApiOperation(value = "分页查询", notes = "分页查询") |
| | | @GetMapping("/api/everyday") |
| | | public R everyday(Page page , String username) { |
| | | public R everyday(Page page, String username) { |
| | | IPage<TbEquipment> ipage = tbEquipmentService.everyday(page, username); |
| | | |
| | | return R.ok(ipage); |
| | |
| | | //根据当前登录人查设备,然后根据时间查询所查到所有设备当天的数据以list返回给前端 |
| | | |
| | | @GetMapping("/api/searcheveryday") |
| | | public R searcheveryday(Page page, String keyword , String username) { |
| | | public R searcheveryday(Page page, String keyword, String username) { |
| | | return R.ok(tbEquipmentService.searcheveryday(page, keyword, username)); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @PostMapping("/api/addorupEquipment") |
| | | public R addorupEquipment(TbEquipment tbEquipment) throws Exception{ |
| | | public R addorupEquipment(TbEquipment tbEquipment) throws Exception { |
| | | if (tbEquipmentService.addorupEquipment(tbEquipment) == -1) { |
| | | return R.failed("当前编号已存在"); |
| | | } else { |
| | |
| | | } |
| | | |
| | | @GetMapping("/api/getEquipment") |
| | | public R getEquipment(Integer type,String username,String phone) { |
| | | return R.ok(tbEquipmentService.getEquipment(type,username,phone)); |
| | | public R getEquipment(Integer type, String username, String phone) { |
| | | return R.ok(tbEquipmentService.getEquipment(type, username, phone)); |
| | | } |
| | | |
| | | @GetMapping("/api/getEquipmentmonitor") |
| | | public R getEquipmentmonitor(String username,String phone) { |
| | | return R.ok(tbEquipmentService.getEquipmentmonitor( username, phone)); |
| | | public R getEquipmentmonitor(String username, String phone) { |
| | | return R.ok(tbEquipmentService.getEquipmentmonitor(username, phone)); |
| | | } |
| | | |
| | | @GetMapping("/api/getEquipmenttwo") |
| | | public R getEquipmenttwo(String username,String phone) { |
| | | return R.ok(tbEquipmentService.getEquipmenttwo( username, phone)); |
| | | public R getEquipmenttwo(String username, String phone) { |
| | | return R.ok(tbEquipmentService.getEquipmenttwo(username, phone)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/api/alldevice") |
| | | public R alldevice(String username,String phone) { |
| | | public R alldevice(String username, String phone) { |
| | | // TbUser user = tbUserService.getByUsername(SeachRole.name()); |
| | | Map<String, Object> result = new HashMap<>(); |
| | | List<TbEquipment> list = new ArrayList<>(); |
| | | // TbCompany tbCompany = new TbCompany(); |
| | | // if (user.getRole().equals("超级管理员")) { |
| | | list = tbEquipmentService.getalldevice( username, phone); |
| | | list = tbEquipmentService.getalldevice(username, phone); |
| | | |
| | | Map<String, Object> resultg = new HashMap<>(); |
| | | List<TbGuangbo> listg = new ArrayList<>(); |
| | | // TbCompany tbCompany = new TbCompany(); |
| | | // if (user.getRole().equals("超级管理员")) { |
| | | listg = tbGuangboService.getallguangbo(username, phone); |
| | | |
| | | |
| | | // } else { |
| | | // //获取登陆人公司名称, |
| | | // String SeachName = user.getCaname(); |
| | |
| | | // Integer comId = tbCompany.getId(); |
| | | // list = tbEquipmentService.list(new QueryWrapper<TbEquipment>().eq("companyid",comId)); |
| | | // } |
| | | List<TbSystem> list1 = tbSystemService.list( ); |
| | | List<TbSystem> list1 = tbSystemService.list(); |
| | | QueryWrapper queryWrapper2 = new QueryWrapper<>(); |
| | | queryWrapper2.eq("username", username); |
| | | TbUser tbUser = tbUserMapper.selectOne(queryWrapper2); |
| | | |
| | | QueryWrapper queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("companyname", tbUser.getCaname()); |
| | | TbBaidumap tbBaidumap = tbBaidumapMapper.selectOne(queryWrapper); |
| | | TbBaidumap tbBaidumap = tbBaidumapMapper.selectOne(queryWrapper); |
| | | result.put("dataList", list); |
| | | result.put("gbList", listg); |
| | | |
| | | result.put("view", tbBaidumap.getCenter()); |
| | | result.put("shijiao", tbBaidumap.getShijiao()); |
| | | // result.put("view", tbBaidumap.getCenter()); |
| | |
| | | } |
| | | |
| | | @GetMapping("/api/searchdevice") |
| | | public R search(String username, String query ) { |
| | | public R search(String username, String query) { |
| | | |
| | | return R.ok(tbEquipmentService.search(username,query)); |
| | | return R.ok(tbEquipmentService.search(username, query)); |
| | | // 执行搜索逻辑,并返回结果 |
| | | // List<Item> items = searchService.search(query); |
| | | // return items.stream().map(Item::getName).collect(Collectors.toList()); |
| | |
| | | // .collect(Collectors.toList()); |
| | | } |
| | | |
| | | @GetMapping("/api/resetinitv") |
| | | public R resetinitv(String tagid, String initv) { |
| | | |
| | | String xieyi = "$setbegvalue," + tagid + "," + initv + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/api/resetzuobiao") |
| | | public R resetzuobiao(String tagid ) { |
| | | |
| | | String xieyi = "$setbaselock," + tagid + ",END"; |
| | | Udp_Out.udp_to_cs(xieyi); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/api/jzsearch") |
| | | public R jzsearch( String query,String type) { |
| | | |
| | | return R.ok(tbEquipmentService.jzsearch(query,type)); |
| | | // 执行搜索逻辑,并返回结果 |
| | | // List<Item> items = searchService.search(query); |
| | | // return items.stream().map(Item::getName).collect(Collectors.toList()); |
| | | |
| | | // 如果没有服务,可以使用静态数据进行演示 |
| | | // return Arrays.asList("Search Result 1", "Search Result 2", "Search Result 3").stream() |
| | | // .filter(result -> result.contains(query)) |
| | | // .collect(Collectors.toList()); |
| | | } |
| | | |
| | | @GetMapping("/api/jzsearchfive") |
| | | public R jzsearchfive(String type ) { |
| | | |
| | | return R.ok(tbEquipmentService.jzsearchfive(type)); |
| | | // 执行搜索逻辑,并返回结果 |
| | | // List<Item> items = searchService.search(query); |
| | | // return items.stream().map(Item::getName).collect(Collectors.toList()); |
| | | |
| | | // 如果没有服务,可以使用静态数据进行演示 |
| | | // return Arrays.asList("Search Result 1", "Search Result 2", "Search Result 3").stream() |
| | | // .filter(result -> result.contains(query)) |
| | | // .collect(Collectors.toList()); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |