BiggasController.java 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. package com.sooka.sponest.mobile.data.digitalenvironmentcontroller;
  2. import com.ruoyi.common.core.web.domain.AjaxResult;
  3. import com.ruoyi.common.core.web.page.PageDomain;
  4. import com.ruoyi.common.core.web.page.TableSupport;
  5. import com.sooka.sponest.data.api.digitalenvironment.domain.EnvironmentBiggas;
  6. import com.sooka.sponest.data.api.digitalenvironment.service.RemoteBiggasService;
  7. import com.sooka.sponest.mobile.system.camera.service.AppCameraService;
  8. import org.springframework.web.bind.annotation.*;
  9. import javax.annotation.Resource;
  10. import java.util.List;
  11. import java.util.Map;
  12. /**
  13. * @Author LG
  14. * @Date 2023/9/6 - 14:41
  15. */
  16. @RestController
  17. @RequestMapping("/AppBiggasController")
  18. public class BiggasController {
  19. @Resource
  20. private RemoteBiggasService biggasService;
  21. @Resource
  22. AppCameraService appCameraService;
  23. /**
  24. * 查询大气监测点/水质监测点/污染源监测点管理列表
  25. */
  26. @GetMapping("/biggas/list")
  27. public AjaxResult list(EnvironmentBiggas biggas) {
  28. PageDomain pageDomain = TableSupport.buildPageRequest();
  29. Integer pageNum = pageDomain.getPageNum();
  30. Integer pageSize = pageDomain.getPageSize();
  31. String type = biggas.getType();
  32. return AjaxResult.success(biggasService.getList(pageNum, pageSize, type).getRows());
  33. }
  34. /**
  35. * 获取重点企业详细信息
  36. */
  37. @GetMapping("/biggas/edit")
  38. public AjaxResult getInfo(EnvironmentBiggas biggas) {
  39. AjaxResult ajaxResult = biggasService.getEdit(biggas.getId());
  40. if("200".equals(ajaxResult.get("code").toString())){
  41. Map<String, Object> info = (Map<String, Object>) ajaxResult.get("data");
  42. return appCameraService.selectCameraByIds(info);
  43. }else{
  44. return ajaxResult;
  45. }
  46. }
  47. /**
  48. * 新增重点企业
  49. */
  50. @PostMapping("/biggas")
  51. public AjaxResult add(@RequestBody String json) {
  52. return biggasService.add(json);
  53. }
  54. /**
  55. * 修改重点企业
  56. */
  57. @PostMapping("/biggas/put")
  58. public AjaxResult edit(@RequestBody String json) {
  59. return biggasService.edit(json);
  60. }
  61. /**
  62. * 删除重点企业
  63. */
  64. @GetMapping("/biggas/del")
  65. public AjaxResult remove(@RequestParam("id") List<String> id) {
  66. return biggasService.del(id.toArray(new String[0]));
  67. }
  68. }