|
@@ -0,0 +1,82 @@
|
|
|
|
+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.EnvironmentKeyEnterprise;
|
|
|
|
+import com.sooka.sponest.data.api.digitalenvironment.domain.EnvironmentSourcePollution;
|
|
|
|
+import com.sooka.sponest.data.api.digitalenvironment.service.RemoteKeyEnterpriseService;
|
|
|
|
+import com.sooka.sponest.mobile.system.camera.service.AppCameraService;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
+
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @Author LG
|
|
|
|
+ * @Date 2023/9/5 - 14:33
|
|
|
|
+ */
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("/AppKeyEnterpriseController")
|
|
|
|
+public class KeyEnterpriseController {
|
|
|
|
+ @Resource
|
|
|
|
+ private RemoteKeyEnterpriseService keyEnterpriseService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ AppCameraService appCameraService;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询污染源管理列表
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/keyEnterprise/list")
|
|
|
|
+ public AjaxResult list(EnvironmentKeyEnterprise keyEnterprise) {
|
|
|
|
+ PageDomain pageDomain = TableSupport.buildPageRequest();
|
|
|
|
+ Integer pageNum = pageDomain.getPageNum();
|
|
|
|
+ Integer pageSize = pageDomain.getPageSize();
|
|
|
|
+ return AjaxResult.success(keyEnterpriseService.getList(pageNum, pageSize).getRows());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取污染源管理详细信息
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/keyEnterprise/edit")
|
|
|
|
+ public AjaxResult getInfo(EnvironmentKeyEnterprise keyEnterprise) {
|
|
|
|
+ AjaxResult ajaxResult = keyEnterpriseService.getEdit(keyEnterprise.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("/keyEnterprise")
|
|
|
|
+ public AjaxResult add(@RequestBody String json) {
|
|
|
|
+ return keyEnterpriseService.add(json);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改污染源管理
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/keyEnterprise/put")
|
|
|
|
+ public AjaxResult edit(@RequestBody String json) {
|
|
|
|
+ return keyEnterpriseService.edit(json);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 删除污染源管理
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/keyEnterprise/del")
|
|
|
|
+ public AjaxResult remove(@RequestParam("id") List<String> id) {
|
|
|
|
+ return keyEnterpriseService.del(id.toArray(new String[0]));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|