|
@@ -0,0 +1,80 @@
|
|
|
+package com.sooka.sponest.mobile.data.digitalenvironmentcontroller;
|
|
|
+
|
|
|
+import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
|
+import com.ruoyi.common.core.web.page.PageDomain;
|
|
|
+import com.ruoyi.common.core.web.page.TableSupport;
|
|
|
+import com.sooka.sponest.data.api.digitalenvironment.domain.EnvironmentLeaveField;
|
|
|
+import com.sooka.sponest.data.api.digitalenvironment.service.RemoteLeaveFieldService;
|
|
|
+import com.sooka.sponest.mobile.system.camera.service.AppCameraService;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Author LG
|
|
|
+ * @Date 2023/9/6 - 11:33
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/AppLeaveFieldController")
|
|
|
+public class LeaveFieldController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private RemoteLeaveFieldService leaveFieldService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ AppCameraService appCameraService;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询污染源管理列表
|
|
|
+ */
|
|
|
+ @GetMapping("/LeaveField/list")
|
|
|
+ public AjaxResult list(EnvironmentLeaveField leaveField) {
|
|
|
+ PageDomain pageDomain = TableSupport.buildPageRequest();
|
|
|
+ Integer pageNum = pageDomain.getPageNum();
|
|
|
+ Integer pageSize = pageDomain.getPageSize();
|
|
|
+ String leaveFieldType = leaveField.getLeaveFieldType();
|
|
|
+ return AjaxResult.success(leaveFieldService.list(pageNum, pageSize, leaveFieldType).getRows());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取污染源管理详细信息
|
|
|
+ */
|
|
|
+ @GetMapping("/LeaveField/edit")
|
|
|
+ public AjaxResult edit(EnvironmentLeaveField leaveField) {
|
|
|
+ AjaxResult ajaxResult = leaveFieldService.edit(leaveField.getId());
|
|
|
+ if("200".equals(ajaxResult.get("code").toString())){
|
|
|
+ Map<String, Object> info = (Map<String, Object>) ajaxResult.get("data");
|
|
|
+ return appCameraService.selectCameraByIds(info);
|
|
|
+ }else{
|
|
|
+ return ajaxResult;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增污染源管理
|
|
|
+ */
|
|
|
+ @PostMapping("/LeaveField")
|
|
|
+ public AjaxResult add(@RequestBody String json) {
|
|
|
+ return leaveFieldService.add(json);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改污染源管理
|
|
|
+ */
|
|
|
+ @PostMapping("/LeaveField/put")
|
|
|
+ public AjaxResult put(@RequestBody String json) {
|
|
|
+ return leaveFieldService.put(json);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除污染源管理
|
|
|
+ */
|
|
|
+ @GetMapping("/LeaveField/del")
|
|
|
+ public AjaxResult remove(@RequestParam("id") List<String> id) {
|
|
|
+ return leaveFieldService.remove(id.toArray(new String[0]));
|
|
|
+ }
|
|
|
+}
|