Sfoglia il codice sorgente

数字农业增加可视化

hanfucheng 1 anno fa
parent
commit
7031fbd22b
16 ha cambiato i file con 1305 aggiunte e 862 eliminazioni
  1. 329 295
      data-ui/src/views/data/digitalagriculture/breedingFarm/index.vue
  2. 50 2
      data-ui/src/views/data/digitalagriculture/cesspitCollect/index.vue
  3. 377 310
      data-ui/src/views/data/digitalagriculture/garbage_transfer/index.vue
  4. 305 246
      data-ui/src/views/data/digitalagriculture/trash_can/index.vue
  5. 15 1
      src/main/java/com/sooka/sponest/data/digitalagriculture/controller/CenterdataTFarmBreedingFarmController.java
  6. 15 1
      src/main/java/com/sooka/sponest/data/digitalagriculture/controller/CenterdataTFarmCesspitCollectController.java
  7. 15 1
      src/main/java/com/sooka/sponest/data/digitalagriculture/controller/CenterdataTFarmGarbageTransferController.java
  8. 15 1
      src/main/java/com/sooka/sponest/data/digitalagriculture/controller/CenterdataTFarmTrashCanController.java
  9. 16 1
      src/main/java/com/sooka/sponest/data/digitalagriculture/domain/CenterdataTFarmBreedingFarm.java
  10. 17 0
      src/main/java/com/sooka/sponest/data/digitalagriculture/domain/CenterdataTFarmCesspitCollect.java
  11. 17 0
      src/main/java/com/sooka/sponest/data/digitalagriculture/domain/CenterdataTFarmGarbageTransfer.java
  12. 16 0
      src/main/java/com/sooka/sponest/data/digitalagriculture/domain/CenterdataTFarmTrashCan.java
  13. 28 2
      src/main/java/com/sooka/sponest/data/digitalagriculture/service/impl/CenterdataTFarmBreedingFarmServiceImpl.java
  14. 31 1
      src/main/java/com/sooka/sponest/data/digitalagriculture/service/impl/CenterdataTFarmCesspitCollectServiceImpl.java
  15. 28 0
      src/main/java/com/sooka/sponest/data/digitalagriculture/service/impl/CenterdataTFarmTrashCanServiceImpl.java
  16. 31 1
      src/main/java/com/sooka/sponest/data/digitalagriculture/service/impl/ICenterdataTFarmGarbageTransferServiceImpl.java

+ 329 - 295
data-ui/src/views/data/digitalagriculture/breedingFarm/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="true"  @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="true" @submit.native.prevent>
       <el-form-item label="名称" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -15,7 +15,8 @@
           <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
         </template>
         <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
-                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'"
+                    style="width: 240px"/>
         <el-input v-model="queryParams.deptName" v-if="false"/>
       </el-form-item>
       <el-form-item>
@@ -103,10 +104,10 @@
       <el-table-column label="死亡情况" align="center" prop="circumstancesOfDeath"/>
       <el-table-column label="处理方式" align="center" prop="processing"/>
       <el-table-column label="所属部门" align="center" prop="deptName"/>
-      <el-table-column label="创建人" align="center" prop="createName" />
-      <el-table-column label="创建时间" align="center" prop="createTime" />
-      <el-table-column label="修改人" align="center" prop="updateName" />
-      <el-table-column label="修改时间" align="center" prop="updateTime" />
+      <el-table-column label="创建人" align="center" prop="createName"/>
+      <el-table-column label="创建时间" align="center" prop="createTime"/>
+      <el-table-column label="修改人" align="center" prop="updateName"/>
+      <el-table-column label="修改时间" align="center" prop="updateTime"/>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
         <template slot-scope="scope">
           <el-button
@@ -143,7 +144,8 @@
         <el-row :gutter="20">
           <el-col :span="12">
             <el-form-item label="所属部门" prop="deptId" class="form-style">
-              <treeselect v-model="form.deptId" :options="deptOptions" multiple:false :show-count="true" :noResultsText="'空'" :noOptionsText="'空'"
+              <treeselect v-model="form.deptId" :options="deptOptions" multiple:false :show-count="true"
+                          :noResultsText="'空'" :noOptionsText="'空'"
                           placeholder="请选择部门" @select="hx"/>
             </el-form-item>
           </el-col>
@@ -168,7 +170,7 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="详细通讯地址" prop="address">
-              <el-input v-model="form.address" placeholder="请输入详细通讯地址"  maxlength="20"/>
+              <el-input v-model="form.address" placeholder="请输入详细通讯地址" maxlength="20"/>
             </el-form-item>
           </el-col>
         </el-row>
@@ -187,19 +189,20 @@
         <el-row :gutter="20">
           <el-col :span="12">
             <el-form-item label="数量" prop="number">
-              <el-input v-model="form.number" placeholder="请输入数量"  maxlength="20"/>
+              <el-input v-model="form.number" placeholder="请输入数量" maxlength="20"/>
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="备案表" prop="filing">
-              <el-input v-model="form.filing" placeholder="备案表"  maxlength="20"/>
+              <el-input v-model="form.filing" placeholder="备案表" maxlength="20"/>
             </el-form-item>
           </el-col>
         </el-row>
         <el-row :gutter="20">
           <el-col :span="12">
             <el-form-item label="年份" prop="year" label-width="120px" class="form-style">
-              <el-date-picker v-model="form.year" type="year" placeholder="选择年" value-format="yyyy" :editable="false"></el-date-picker>
+              <el-date-picker v-model="form.year" type="year" placeholder="选择年" value-format="yyyy"
+                              :editable="false"></el-date-picker>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -235,7 +238,7 @@
         <el-row :gutter="20">
           <el-col :span="12">
             <el-form-item label="死亡情况" prop="circumstancesOfDeath">
-              <el-input v-model="form.circumstancesOfDeath" placeholder="死亡情况"  maxlength="32"/>
+              <el-input v-model="form.circumstancesOfDeath" placeholder="死亡情况" maxlength="32"/>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -262,6 +265,27 @@
 
             </el-form-item>
           </el-col>
+          <el-col :span="12">
+            <el-form-item label="绑定设备" prop="deviceList">
+              <el-select v-model="form.deviceList" filterable placeholder="请选择设备" multiple filterable>
+                <el-option
+                  v-for="dict in cameraList"
+                  :key="dict.id"
+                  :label="dict.cameraName"
+                  :value="dict.id"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="图片" prop="attachPaths">
+              <ImageUpload ref="ImageUpload" :limit="1" :file-type="['png','jpg','jpeg']"
+                           :value="form.attachPaths"
+                           @input="getUrl"></ImageUpload>
+            </el-form-item>
+          </el-col>
         </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -274,297 +298,307 @@
 </template>
 
 <script>
-  import {
-    listBreedingFarm,
-    getBreedingFarm,
-    delBreedingFarm,
-    addBreedingFarm,
-    updateBreedingFarm
-  } from "@/api/data/digitalagriculture/breedingFarm";
-  import Deptselector from '@/views/components/deptselector';
-  import supermap from '@/views/components/supermap'
-  import {checkLon, checkLat} from "@/api/rules/rules";
-  import {format_date} from "@/views/data/common/dateExport";
-  import { treeselect } from "@/api/system/dept";
-  import Treeselect from '@riophae/vue-treeselect'
-  import '@riophae/vue-treeselect/dist/vue-treeselect.css'
-  import ISuperMap from "@/views/data/common/ISuperMap.vue";
-  import {checkPositiveInteger} from "../../../../api/rules/rules";
-  import {checkPositiveDecimal} from "../../../../api/rules/rules";
-  import {checkNonnegativeInteger} from "../../../../api/rules/rules";
+import {
+  listBreedingFarm,
+  getBreedingFarm,
+  delBreedingFarm,
+  addBreedingFarm,
+  updateBreedingFarm
+} from "@/api/data/digitalagriculture/breedingFarm";
+import Deptselector from '@/views/components/deptselector';
+import supermap from '@/views/components/supermap'
+import {checkLon, checkLat} from "@/api/rules/rules";
+import {format_date} from "@/views/data/common/dateExport";
+import {treeselect} from "@/api/system/dept";
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import ISuperMap from "@/views/data/common/ISuperMap.vue";
+import {checkPositiveInteger} from "../../../../api/rules/rules";
+import {checkPositiveDecimal} from "../../../../api/rules/rules";
+import {checkNonnegativeInteger} from "../../../../api/rules/rules";
+import {selectCenterMonitorlList} from "@/api/data/digitalforest/animal/animal";
+
 
+export default {
+  name: "BreedingFarm",
+  dicts: ['centerdata_breeding_variety', 'sys_dept_type', 'sys_isurge'],
+  components: {ISuperMap, Treeselect, Deptselector, supermap},
+  data() {
+    var circumstancesOfDeath = (rule, value, callback) => {
+      const reg = /^[A-z0-9\u4e00-\u9fa5]*$/;
+      if (!reg.test(value)) {
+        callback(new Error("名称只能包含非负整数、汉字、英文"));
+      } else {
+        callback();
+      }
+    };
+    return {
+      ISuperMapvisible: false,
+      sign: 1,
+      // 部门名称
+      deptName: undefined,
+      // 部门树选项
+      deptOptions: undefined,
+      cameraList: [],//设备集合
+      // 遮罩层
+      loading: true,
+      showLongitude: false,
+      titleLongitude: '经纬度',
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 备案畜禽规模养殖场表格数据
+      breedingFarmList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: null,
+        year: null,
+        number: null,
+        varieties: null,
+        isUsed: null,
+        assorted: null,
+        licence: null,
+        filing: null,
+        stoolVolume: null,
+        circumstancesOfDeath: null,
+        processing: null,
+        longitude: null,
+        latitude: null,
+        deptId: null,
+        deptName: 0,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        name: [
+          {required: true, message: "名称名称不能为空", trigger: "blur"}
+        ],
+        deptId: [
+          {required: true, message: "所属部门不能为空", trigger: "change"}
+        ],
+        varieties: [
+          {required: true, message: "种类不能为空", trigger: "change"}
 
-  export default {
-    name: "BreedingFarm",
-    dicts: ['centerdata_breeding_variety', 'sys_dept_type', 'sys_isurge'],
-    components: {ISuperMap, Treeselect, Deptselector,supermap},
-    data() {
-      var circumstancesOfDeath = (rule, value, callback) => {
-        const reg= /^[A-z0-9\u4e00-\u9fa5]*$/;
-        if (!reg.test(value)) {
-          callback(new Error("名称只能包含非负整数、汉字、英文"));
-        } else {
-          callback();
-        }};
-      return {
-        ISuperMapvisible: false,
-        sign: 1,
-        // 部门名称
-        deptName: undefined,
-        // 部门树选项
-        deptOptions: undefined,
-        cameraList: [],//设备集合
-        // 遮罩层
-        loading: true,
-        showLongitude: false,
-        titleLongitude: '经纬度',
-        // 选中数组
-        ids: [],
-        // 非单个禁用
-        single: true,
-        // 非多个禁用
-        multiple: true,
-        // 显示搜索条件
-        showSearch: true,
-        // 总条数
-        total: 0,
-        // 备案畜禽规模养殖场表格数据
-        breedingFarmList: [],
-        // 弹出层标题
-        title: "",
-        // 是否显示弹出层
-        open: false,
-        // 查询参数
-        queryParams: {
-          pageNum: 1,
-          pageSize: 10,
-          name: null,
-          year: null,
-          number: null,
-          varieties: null,
-          isUsed: null,
-          assorted: null,
-          licence: null,
-          filing: null,
-          stoolVolume: null,
-          circumstancesOfDeath: null,
-          processing: null,
-          longitude: null,
-          latitude: null,
-          deptId: null,
-          deptName: 0,
-        },
-        // 表单参数
-        form: {},
-        // 表单校验
-        rules: {
-          name: [
-            {required: true, message: "名称名称不能为空", trigger: "blur"}
-          ],
-          deptId: [
-            {required: true, message: "所属部门不能为空", trigger: "change"}
-          ],
-          varieties: [
-            {required: true, message: "种类不能为空", trigger: "change"}
+        ],
+        year: [
+          {required: true, message: '年份不能为空', trigger: 'blur'},
+        ],
+        longitude: [
+          {required: true, message: "经度不能为空", trigger: "change"},
+          {validator: checkLon, trigger: 'blur'}
+        ],
+        latitude: [
+          {required: true, message: "纬度不能为空", trigger: "change"},
+          {validator: checkLat, trigger: 'blur'}
+        ],
+        licence: [
+          {validator: checkNonnegativeInteger, trigger: 'blur'}
+        ],
+        filing: [
+          {validator: checkPositiveInteger, trigger: 'blur'}
+        ],
+        stoolVolume: [
+          {validator: checkPositiveDecimal, trigger: 'blur'}
+        ],
+        // circumstancesOfDeath: [
+        //   { validator: checkNonnegativeInteger,trigger: 'blur'}
+        // ],
+        circumstancesOfDeath: [{validator: circumstancesOfDeath, trigger: "blur"}],
+        number: [
+          {validator: checkPositiveInteger, trigger: 'blur'}
+        ]
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getTreeselect();
+  },
+  methods: {
+    showMap() {
+      this.ISuperMapvisible = true;
+      this.$nextTick(() => {
+        this.$refs.ISuperMap.init(this.sign, {
+          id: this.form.id,
+          longitude: this.form.longitude,
+          latitude: this.form.latitude,
 
-          ],
-          year: [
-            {required: true, message: '年份不能为空', trigger: 'blur'},
-          ],
-          longitude: [
-            { required: true, message: "经度不能为空", trigger: "change" },
-            { validator: checkLon,trigger: 'blur'}
-          ],
-          latitude: [
-            { required: true, message: "纬度不能为空", trigger: "change" },
-            { validator: checkLat,trigger: 'blur'}
-          ],
-          licence: [
-            { validator: checkNonnegativeInteger,trigger: 'blur'}
-          ],
-          filing: [
-            { validator: checkPositiveInteger,trigger: 'blur'}
-          ],
-          stoolVolume: [
-            { validator: checkPositiveDecimal,trigger: 'blur'}
-          ],
-          // circumstancesOfDeath: [
-          //   { validator: checkNonnegativeInteger,trigger: 'blur'}
-          // ],
-          circumstancesOfDeath: [ { validator: circumstancesOfDeath , trigger: "blur"} ],
-      number: [
-            { validator: checkPositiveInteger,trigger: 'blur'}
-          ]
-        }
+        })
+      })
+    },
+    getUrl(url) {
+      this.form.attachPaths = url
+    },
+    send(val) {
+      if (val === true) {
+        this.ISuperMapvisible = false;
+        return;
+      }
+      if (this.sign === 1) {
+        this.form.longitude = val.longitude;
+        this.form.latitude = val.latitude;
+      }
+
+      this.ISuperMapvisible = false
+    },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptions = response.data;
+      });
+    },
+    hx(node) {
+      this.form.dataDeptId = node.id
+      this.form.deptId = node.id
+      this.form.deptName = node.label
+      this.$refs.form.validateField('deptId');
+    },
+    /** 查询养殖场列表 */
+    getList() {
+      this.loading = true;
+      listBreedingFarm(this.queryParams).then(response => {
+        this.breedingFarmList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    setDataDeptId(e) {
+      this.form.deptId = e.deptId;
+      this.form.deptName = e.deptName;
+    },
+    showLatLng: function (lat, lng) {
+      this.form.latitude = lat
+      this.form.longitude = lng
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        createBy: null,
+        createName: null,
+        createTime: null,
+        updateBy: null,
+        updateName: null,
+        updateTime: null,
+        name: null,
+        address: null,
+        deptId: null,
+        deptName: null,
+        longitude: null,
+        latitude: null,
+        year: null,
+        number: null,
+        varieties: null,
+        isUsed: null,
+        assorted: null,
+        licence: null,
+        filingForm: null,
+        stoolVolume: null,
+        circumstancesOfDeath: null,
+        processing: null,
+        filing: null
       };
+      this.resetForm("form");
     },
-    created() {
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
       this.getList();
-      this.getTreeselect();
     },
-    methods: {
-      showMap() {
-        this.ISuperMapvisible = true;
-        this.$nextTick(() => {
-          this.$refs.ISuperMap.init(this.sign, {
-            id: this.form.id,
-            longitude: this.form.longitude,
-            latitude: this.form.latitude,
-
-          })
-        })
-      },
-      send(val) {
-        if (val===true){
-          this.ISuperMapvisible = false;
-          return;
-        }
-        if (this.sign === 1) {
-          this.form.longitude = val.longitude;
-          this.form.latitude = val.latitude;
-        }
-
-        this.ISuperMapvisible = false
-      },
-      /** 查询部门下拉树结构 */
-      getTreeselect() {
-        treeselect().then(response => {
-          this.deptOptions = response.data;
-        });
-      },
-      hx(node) {
-        this.form.dataDeptId = node.id
-        this.form.deptId = node.id
-        this.form.deptName = node.label
-        this.$refs.form.validateField('deptId');
-      },
-      /** 查询养殖场列表 */
-      getList() {
-        this.loading = true;
-        listBreedingFarm(this.queryParams).then(response => {
-          this.breedingFarmList = response.rows;
-          this.total = response.total;
-          this.loading = false;
-        });
-      },
-      setDataDeptId(e) {
-        this.form.deptId = e.deptId;
-        this.form.deptName = e.deptName;
-      },
-      showLatLng: function (lat, lng) {
-        this.form.latitude = lat
-        this.form.longitude = lng
-      },
-      // 取消按钮
-      cancel() {
-        this.open = false;
-        this.reset();
-      },
-      // 表单重置
-      reset() {
-        this.form = {
-          id: null,
-          createBy: null,
-          createName: null,
-          createTime: null,
-          updateBy: null,
-          updateName: null,
-          updateTime: null,
-          name: null,
-          address: null,
-          deptId: null,
-          deptName: null,
-          longitude: null,
-          latitude: null,
-          year: null,
-          number: null,
-          varieties: null,
-          isUsed: null,
-          assorted: null,
-          licence: null,
-          filingForm: null,
-          stoolVolume: null,
-          circumstancesOfDeath: null,
-          processing: null,
-          filing: null
-        };
-        this.resetForm("form");
-      },
-      /** 搜索按钮操作 */
-      handleQuery() {
-        this.queryParams.pageNum = 1;
-        this.getList();
-      },
-      /** 重置按钮操作 */
-      resetQuery() {
-        this.queryParams.deptName = 0;
-        this.resetForm("queryForm");
-        this.handleQuery();
-      },
-      // 多选框选中数据
-      handleSelectionChange(selection) {
-        this.ids = selection.map(item => item.id)
-        this.single = selection.length !== 1
-        this.multiple = !selection.length
-      },
-      /** 新增按钮操作 */
-      handleAdd() {
-        this.reset();
-
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams.deptName = 0;
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加养殖场";
+      selectCenterMonitorlList(this.queryParams).then(response => {
+        this.cameraList = response.data;
+      });
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      selectCenterMonitorlList(this.queryParams).then(response => {
+        this.cameraList = response.data;
+      });
+      getBreedingFarm(id).then(response => {
+        this.form = response.data;
         this.open = true;
-        this.title = "添加养殖场";
-      },
-      /** 修改按钮操作 */
-      handleUpdate(row) {
-        this.reset();
-        const id = row.id || this.ids
-        getBreedingFarm(id).then(response => {
-          this.form = response.data;
-          this.open = true;
-          this.title = "修改养殖场";
-        });
-      },
-      /** 提交按钮 */
-      submitForm() {
-        this.$refs["form"].validate(valid => {
-          if (valid) {
-            if (this.form.id != null) {
-              updateBreedingFarm(this.form).then(response => {
-                this.$modal.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
-              });
-            } else {
-              addBreedingFarm(this.form).then(response => {
-                this.$modal.msgSuccess("新增成功");
-                this.open = false;
-                this.getList();
-              });
-            }
+        this.title = "修改养殖场";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateBreedingFarm(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addBreedingFarm(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
           }
-        });
-      },
-      /** 删除按钮操作 */
-      handleDelete(row) {
-        const ids = row.id || this.ids;
-        this.$modal.confirm('是否确认删除已选择的数据项?').then(function () {
-          return delBreedingFarm(ids);
-        }).then(() => {
-          this.getList();
-          this.$modal.msgSuccess("删除成功");
-        }).catch(() => {
-        });
-      },
-      /** 导出按钮操作 */
-      handleExport() {
-        this.download('center-data/breedingFarm/export', {
-          ...this.queryParams
-        }, `养殖场_${format_date(new Date())}.xlsx`)
-      },
-      // 点击按钮修改是否只查询本级部门用户
-      changeQueryType() {
-        this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
-      }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除已选择的数据项?').then(function () {
+        return delBreedingFarm(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('center-data/breedingFarm/export', {
+        ...this.queryParams
+      }, `养殖场_${format_date(new Date())}.xlsx`)
+    },
+    // 点击按钮修改是否只查询本级部门用户
+    changeQueryType() {
+      this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
     }
-  };
+  }
+};
 </script>

+ 50 - 2
data-ui/src/views/data/digitalagriculture/cesspitCollect/index.vue

@@ -118,31 +118,68 @@
     />
 
     <!-- 添加或修改粪污收集点对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="550px" class="form-style">
+    <el-dialog :title="title" :visible.sync="open" width="1000px" class="form-style">
       <el-form ref="form" :model="form" :rules="rules" label-width="100px">
         <el-row :gutter="20">
-          <el-col :span="23">
+          <el-col :span="12">
             <el-form-item label="名称" prop="name">
               <el-input v-model="form.name" placeholder="请输入名称" maxlength="20"/>
             </el-form-item>
+          </el-col>
+          <el-col :span="12">
             <el-form-item label="编号" prop="code">
               <el-input v-model="form.code" placeholder="请输入编号" maxlength="20"/>
             </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
             <el-form-item label="经度" prop="longitude" @dblclick.native="showMap">
               <el-input v-model="form.longitude" placeholder="鼠标双击选择经纬度"/>
             </el-form-item>
+          </el-col>
+          <el-col :span="12">
             <el-form-item label="纬度" prop="latitude" @dblclick.native="showMap">
               <el-input v-model="form.latitude" placeholder="鼠标双击选择经纬度"/>
             </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
             <el-form-item label="覆盖区域" prop="coverage">
               <el-input v-model="form.coverage" placeholder="请输入覆盖区域" maxlength="50"/>
             </el-form-item>
+          </el-col>
+          <el-col :span="12">
             <el-form-item label="所属部门" prop="deptId">
               <treeselect v-model="form.deptId" :options="deptOptions" multiple:false :show-count="true" :noResultsText="'空'" :noOptionsText="'空'"
                           placeholder="请选择部门" @select="hx"/>
             </el-form-item>
           </el-col>
         </el-row>
+        <el-row :gutter="20">
+          <el-col :span="20">
+            <el-form-item label="绑定设备" prop="deviceList">
+              <el-select v-model="form.deviceList" filterable placeholder="请选择设备" multiple filterable>
+                <el-option
+                  v-for="dict in cameraList"
+                  :key="dict.id"
+                  :label="dict.cameraName"
+                  :value="dict.id"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="图片" prop="attachPaths">
+              <ImageUpload ref="ImageUpload" :limit="1" :file-type="['png','jpg','jpeg']"
+                           :value="form.attachPaths"
+                           @input="getUrl"></ImageUpload>
+            </el-form-item>
+          </el-col>
+        </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -169,6 +206,7 @@ import {
   listCesspitCollect,
   updateCesspitCollect
 } from "@/api/data/digitalagriculture/cesspitCollect/cesspitCollect";
+import {selectCenterMonitorlList} from "@/api/data/digitalforest/animal/animal";
 
 export default {
   name: "cesspitCollect",
@@ -181,6 +219,7 @@ export default {
   data() {
     return {
       ISuperMapvisible: false,
+      cameraList: [],//设备集合
       sign: 1,
       // 遮罩层
       loading: true,
@@ -285,6 +324,9 @@ export default {
       }
       this.ISuperMapvisible = false
     },
+    getUrl(url) {
+      this.form.attachPaths = url
+    },
     /** 查询部门下拉树结构 */
     getTreeselect() {
       treeselect().then(response => {
@@ -351,11 +393,17 @@ export default {
       this.reset();
       this.open = true;
       this.title = "添加粪污收集点";
+      selectCenterMonitorlList(this.queryParams).then(response => {
+        this.cameraList = response.data;
+      });
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
       const id = row.id || this.ids
+      selectCenterMonitorlList(this.queryParams).then(response => {
+        this.cameraList = response.data;
+      });
       getCesspitCollect(id).then(response => {
         this.form = response.data;
         this.open = true;

+ 377 - 310
data-ui/src/views/data/digitalagriculture/garbage_transfer/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-if="showSearch"  @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-if="showSearch" @submit.native.prevent>
       <el-form-item label-width="100px" label="名称" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -16,7 +16,8 @@
           <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
         </template>
         <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
-                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'"
+                    style="width: 240px"/>
         <el-input v-model="queryParams.deptName" v-if="false"/>
       </el-form-item>
       <el-form-item>
@@ -33,7 +34,8 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['garbage_transfer:garbageTransfer:add']"
-        >新增</el-button>
+        >新增
+        </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -44,7 +46,8 @@
           :disabled="single"
           @click="handleUpdate"
           v-hasPermi="['garbage_transfer:garbageTransfer:edit']"
-        >修改</el-button>
+        >修改
+        </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -55,7 +58,8 @@
           :disabled="multiple"
           @click="handleDelete"
           v-hasPermi="['garbage_transfer:garbageTransfer:remove']"
-        >删除</el-button>
+        >删除
+        </el-button>
       </el-col>
       <!--<el-col :span="1.5">
         <el-button
@@ -76,20 +80,21 @@
           size="mini"
           @click="handleExport"
           v-hasPermi="['garbage_transfer:garbageTransfer:export']"
-        >导出</el-button>
+        >导出
+        </el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="MachineryInfoList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column type="selection" width="55" align="center"/>
       <!--<el-table-column label="${comment}" align="center" prop="id" />-->
-      <el-table-column label="名称" align="center" prop="name" />
-      <el-table-column label="经度" align="center" prop="longitude" />
-      <el-table-column label="纬度" align="center" prop="latitude" />
-      <el-table-column label="编号" align="center" prop="code" />
-      <el-table-column label="覆盖区域" align="center" prop="coverage" />
-      <el-table-column label="所属部门" align="center" prop="deptName" />
+      <el-table-column label="名称" align="center" prop="name"/>
+      <el-table-column label="经度" align="center" prop="longitude"/>
+      <el-table-column label="纬度" align="center" prop="latitude"/>
+      <el-table-column label="编号" align="center" prop="code"/>
+      <el-table-column label="覆盖区域" align="center" prop="coverage"/>
+      <el-table-column label="所属部门" align="center" prop="deptName"/>
       <el-table-column label="创建人" align="center" prop="createName"/>
       <el-table-column label="创建时间" align="center" prop="createTime"/>
       <el-table-column label="修改人" align="center" prop="updateName"/>
@@ -102,14 +107,16 @@
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['garbage_transfer:garbageTransfer:edit']"
-          >修改</el-button>
+          >修改
+          </el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['garbage_transfer:garbageTransfer:remove']"
-          >删除</el-button>
+          >删除
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -123,42 +130,84 @@
     />
 
     <!-- 添加或修改农机管理对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="600px" class="form-style">
+    <el-dialog :title="title" :visible.sync="open" width="1000px" class="form-style">
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="名称" prop="name">
-          <el-input v-model="form.name" placeholder="请输入名称" maxlength="20"/>
-        </el-form-item>
-        <el-form-item label="覆盖区域" prop="coverage">
-          <el-input v-model="form.coverage" placeholder="请输入覆盖区域" maxlength="20"/>
-        </el-form-item>
-        <el-form-item label="编号" prop="code">
-          <el-input v-model="form.code" placeholder="请输入编号" maxlength="20"/>
-        </el-form-item>
-        <el-form-item label="经度" prop="longitude" @dblclick.native="showMap">
-          <el-input v-model="form.longitude" placeholder="鼠标双击选择经纬度" maxlength="32"/>
-        </el-form-item>
-        <el-form-item label="纬度" prop="latitude" @dblclick.native="showMap">
-          <el-input v-model="form.latitude" placeholder="鼠标双击选择经纬度" maxlength="32"/>
-        </el-form-item>
-        <el-form-item label="所属部门" prop="deptId" class="form-style">
-          <!--              <treeselect-->
-          <!--                v-if="!disable"-->
-          <!--                :flat="false"-->
-          <!--                :allowSelectingDisabledDescendants="true"-->
-          <!--                v-model="form.deptId" :options="deptOptions" :show-count="true"-->
-          <!--                placeholder="请选择所属部门"/>-->
-          <!--              <el-select v-model="form.deptName" placeholder="请选择所属部门" :style="inputStyle" v-if="disable" :disabled="disable">-->
-          <!--                <el-option-->
-          <!--                  v-for="dept in deptOptions"-->
-          <!--                  :key="dept.deptId"-->
-          <!--                  :label="dept.deptName"-->
-          <!--                  :value="dept"-->
-          <!--                />-->
-          <!--              </el-select>-->
-<!--              <deptselector :setValue=setDataDeptId :dataDeptId="form.deptId" v-model="form.deptId"></deptselector>-->
-          <treeselect v-model="form.deptId" :options="deptOptions" multiple:false :show-count="true" :noResultsText="'空'" :noOptionsText="'空'"
-                      placeholder="请选择部门" @select="hx"/>
-        </el-form-item>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="名称" prop="name">
+              <el-input v-model="form.name" placeholder="请输入名称" maxlength="20"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="覆盖区域" prop="coverage">
+              <el-input v-model="form.coverage" placeholder="请输入覆盖区域" maxlength="20"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="经度" prop="longitude" @dblclick.native="showMap">
+              <el-input v-model="form.longitude" placeholder="鼠标双击选择经纬度" maxlength="32"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="纬度" prop="latitude" @dblclick.native="showMap">
+              <el-input v-model="form.latitude" placeholder="鼠标双击选择经纬度" maxlength="32"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="编号" prop="code">
+              <el-input v-model="form.code" placeholder="请输入编号" maxlength="20"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="所属部门" prop="deptId" class="form-style">
+              <!--              <treeselect-->
+              <!--                v-if="!disable"-->
+              <!--                :flat="false"-->
+              <!--                :allowSelectingDisabledDescendants="true"-->
+              <!--                v-model="form.deptId" :options="deptOptions" :show-count="true"-->
+              <!--                placeholder="请选择所属部门"/>-->
+              <!--              <el-select v-model="form.deptName" placeholder="请选择所属部门" :style="inputStyle" v-if="disable" :disabled="disable">-->
+              <!--                <el-option-->
+              <!--                  v-for="dept in deptOptions"-->
+              <!--                  :key="dept.deptId"-->
+              <!--                  :label="dept.deptName"-->
+              <!--                  :value="dept"-->
+              <!--                />-->
+              <!--              </el-select>-->
+              <!--              <deptselector :setValue=setDataDeptId :dataDeptId="form.deptId" v-model="form.deptId"></deptselector>-->
+              <treeselect v-model="form.deptId" :options="deptOptions" multiple:false :show-count="true"
+                          :noResultsText="'空'" :noOptionsText="'空'"
+                          placeholder="请选择部门" @select="hx"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="20">
+            <el-form-item label="绑定设备" prop="deviceList">
+              <el-select v-model="form.deviceList" filterable placeholder="请选择设备" multiple filterable>
+                <el-option
+                  v-for="dict in cameraList"
+                  :key="dict.id"
+                  :label="dict.cameraName"
+                  :value="dict.id"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="图片" prop="attachPaths">
+              <ImageUpload ref="ImageUpload" :limit="1" :file-type="['png','jpg','jpeg']"
+                           :value="form.attachPaths"
+                           @input="getUrl"></ImageUpload>
+            </el-form-item>
+          </el-col>
+        </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -170,273 +219,291 @@
 </template>
 
 <script>
-  import { checkLat, checkLon } from '@/api/rules/rules'
-  import { listGarbageTransfer, getGarbageTransfer, delGarbageTransfer, addGarbageTransfer, updateGarbageTransfer } from "@/api/data/digitalagriculture/garbage_transfer/garbageTransfer";
-  import deptselector from '@/views/components/deptselector'
-  import { getToken } from '@/utils/auth'
-  import Treeselect from '@riophae/vue-treeselect'
-  import '@riophae/vue-treeselect/dist/vue-treeselect.css'
-  import {format_date} from "@/views/data/common/dateExport";
-  import ISuperMap from '@/views/data/common/ISuperMap.vue'
-  import { treeselect } from "@/api/system/dept";
+import {checkLat, checkLon} from '@/api/rules/rules'
+import {
+  listGarbageTransfer,
+  getGarbageTransfer,
+  delGarbageTransfer,
+  addGarbageTransfer,
+  updateGarbageTransfer
+} from "@/api/data/digitalagriculture/garbage_transfer/garbageTransfer";
+import deptselector from '@/views/components/deptselector'
+import {getToken} from '@/utils/auth'
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import {format_date} from "@/views/data/common/dateExport";
+import ISuperMap from '@/views/data/common/ISuperMap.vue'
+import {treeselect} from "@/api/system/dept";
+import {selectCenterMonitorlList} from "@/api/data/digitalforest/animal/animal";
 
-  export default {
-    name: "garbageTransfer",
-    components: {
-      ISuperMap,
-      deptselector,
-      Treeselect,
-    },
-    data() {
-      return {
-        ISuperMapvisible: false,
-        sign: 1,
-        // 遮罩层
-        loading: true,
-        // 选中数组
-        ids: [],
-        // 非单个禁用
-        single: true,
-        // 非多个禁用
-        multiple: true,
-        // 显示搜索条件
-        showSearch: true,
-        // 总条数
-        total: 0,
-        // 弹出层宽度
-        labelWidth: '150px',
-        // 文本框宽度
-        inputStyle: 'width: 310px',
-        // 农机管理表格数据
-        MachineryInfoList: [],
-        // 弹出层标题
-        title: "",
-        // 是否显示弹出层
+export default {
+  name: "garbageTransfer",
+  components: {
+    ISuperMap,
+    deptselector,
+    Treeselect,
+  },
+  data() {
+    return {
+      ISuperMapvisible: false,
+      cameraList: [],//设备集合
+      sign: 1,
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 弹出层宽度
+      labelWidth: '150px',
+      // 文本框宽度
+      inputStyle: 'width: 310px',
+      // 农机管理表格数据
+      MachineryInfoList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 部门名称
+      deptName: undefined,
+      // 部门树选项
+      deptOptions: [],
+      // 导入参数
+      upload: {
+        // 是否显示导入弹出层
         open: false,
-        // 部门名称
-        deptName: undefined,
-        // 部门树选项
-        deptOptions: [],
-        // 导入参数
-        upload: {
-          // 是否显示导入弹出层
-          open: false,
-          // 导入弹出层标题
-          title: '',
-          // 是否禁用上传
-          isUploading: false,
-          // 是否更新已经存在的数据
-          updateSupport: 0,
-          // 设置上传的请求头部
-          headers: { Authorization: 'Bearer ' + getToken() },
-          // 上传的地址
-          url: process.env.VUE_APP_BASE_API + '/center-data/MachineryInfo/import/importData'
-        },
-        // 查询参数
-        queryParams: {
-          pageNum: 1,
-          pageSize: 10,
-          name: null,
-          longitude: null,
-          latitude: null,
-          createDate: null,
-          updateDate: null,
-          remarks: null,
-          deptId: null,
-          deptName: 0,
-        },
-        // 表单参数
-        form: {},
-        // 表单校验
-        rules: {
-          name: [
-            {required: true, message: "名称不能为空", trigger: "blur"}
-          ],
-          longitude: [
-            { required: true, message: "经度不能为空", trigger: "change" },
-            { validator: checkLon,trigger: 'blur'}
-          ],
-          latitude: [
-            { required: true, message: "纬度不能为空", trigger: "change" },
-            { validator: checkLat,trigger: 'blur'}
-          ],
-          deptId: [
-            { required: true, message: "所属部门不能为空", trigger: "change" },
-          ],
-        }
+        // 导入弹出层标题
+        title: '',
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: {Authorization: 'Bearer ' + getToken()},
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + '/center-data/MachineryInfo/import/importData'
+      },
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: null,
+        longitude: null,
+        latitude: null,
+        createDate: null,
+        updateDate: null,
+        remarks: null,
+        deptId: null,
+        deptName: 0,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        name: [
+          {required: true, message: "名称不能为空", trigger: "blur"}
+        ],
+        longitude: [
+          {required: true, message: "经度不能为空", trigger: "change"},
+          {validator: checkLon, trigger: 'blur'}
+        ],
+        latitude: [
+          {required: true, message: "纬度不能为空", trigger: "change"},
+          {validator: checkLat, trigger: 'blur'}
+        ],
+        deptId: [
+          {required: true, message: "所属部门不能为空", trigger: "change"},
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getTreeselect();
+  },
+  methods: {
+    showMap() {
+      this.ISuperMapvisible = true;
+      this.$nextTick(() => {
+        this.$refs.ISuperMap.init(this.sign, {
+          id: this.form.id,
+          longitude: this.form.longitude,
+          latitude: this.form.latitude,
+          // 对应显示线 或 面
+          // xiantude: this.form.longitude
+        })
+      })
+    },
+    send(val) {
+      if (val === true) {
+        this.ISuperMapvisible = false;
+        return;
+      }
+      if (this.sign === 1) {
+        this.form.longitude = val.longitude;
+        this.form.latitude = val.latitude;
+      }
+      // if (this.sign === 2 || this.sign === 3) this.form.longitude = val.xiantude;
+      this.ISuperMapvisible = false
+    },
+    setDeptId(deptId) {
+      this.form.deptId = deptId
+    },
+    setDataDeptId(e) {
+      this.form.deptId = e.deptId
+      this.form.deptName = e.deptName
+    },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptions = response.data;
+      });
+    },
+    getUrl(url) {
+      this.form.attachPaths = url
+    },
+    hx(node) {
+      this.form.deptId = node.id
+      this.form.deptName = node.label
+      this.$refs.form.validateField('deptId');
+    },
+    // 筛选节点
+    filterNode(value, data) {
+      if (!value) return true
+      return data.label.indexOf(value) !== -1
+    },
+    // 节点单击事件
+    handleNodeClick(data) {
+      this.queryParams.deptId = data.id
+      this.handleQuery()
+    },
+    /** 查询垃圾转输站列表 */
+    getList() {
+      this.loading = true;
+      listGarbageTransfer(this.queryParams).then(response => {
+        this.MachineryInfoList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        name: null,
+        longitude: null,
+        latitude: null,
+        code: null,
+        coverage: null,
+        createBy: null,
+        createDate: null,
+        updateBy: null,
+        updateDate: null,
+        deptId: null
       };
+      this.resetForm("form");
     },
-    created() {
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
       this.getList();
-      this.getTreeselect();
     },
-    methods: {
-      showMap() {
-        this.ISuperMapvisible = true;
-        this.$nextTick(() => {
-          this.$refs.ISuperMap.init(this.sign, {
-            id: this.form.id,
-            longitude: this.form.longitude,
-            latitude: this.form.latitude,
-            // 对应显示线 或 面
-            // xiantude: this.form.longitude
-          })
-        })
-      },
-      send(val) {
-        if (val===true){
-          this.ISuperMapvisible = false;
-          return;
-        }
-        if (this.sign === 1) {
-          this.form.longitude = val.longitude;
-          this.form.latitude = val.latitude;
-        }
-        // if (this.sign === 2 || this.sign === 3) this.form.longitude = val.xiantude;
-        this.ISuperMapvisible = false
-      },
-      setDeptId(deptId) {
-        this.form.deptId = deptId
-      },
-      setDataDeptId(e) {
-        this.form.deptId = e.deptId
-        this.form.deptName = e.deptName
-      },
-      /** 查询部门下拉树结构 */
-      getTreeselect() {
-        treeselect().then(response => {
-          this.deptOptions = response.data;
-        });
-      },
-      hx(node) {
-        this.form.deptId = node.id
-        this.form.deptName = node.label
-        this.$refs.form.validateField('deptId');
-      },
-      // 筛选节点
-      filterNode(value, data) {
-        if (!value) return true
-        return data.label.indexOf(value) !== -1
-      },
-      // 节点单击事件
-      handleNodeClick(data) {
-        this.queryParams.deptId = data.id
-        this.handleQuery()
-      },
-      /** 查询垃圾转输站列表 */
-      getList() {
-        this.loading = true;
-        listGarbageTransfer(this.queryParams).then(response => {
-          this.MachineryInfoList = response.rows;
-          this.total = response.total;
-          this.loading = false;
-        });
-      },
-      // 取消按钮
-      cancel() {
-        this.open = false;
-        this.reset();
-      },
-      // 表单重置
-      reset() {
-        this.form = {
-          id: null,
-          name: null,
-          longitude: null,
-          latitude: null,
-          code: null,
-          coverage: null,
-          createBy: null,
-          createDate: null,
-          updateBy: null,
-          updateDate: null,
-          deptId: null
-        };
-        this.resetForm("form");
-      },
-      /** 搜索按钮操作 */
-      handleQuery() {
-        this.queryParams.pageNum = 1;
-        this.getList();
-      },
-      /** 重置按钮操作 */
-      resetQuery() {
-        this.queryParams.deptName = 0;
-        this.resetForm("queryForm");
-        this.handleQuery();
-      },
-      // 多选框选中数据
-      handleSelectionChange(selection) {
-        this.ids = selection.map(item => item.id)
-        this.single = selection.length!==1
-        this.multiple = !selection.length
-      },
-      /** 新增按钮操作 */
-      handleAdd() {
-        this.reset();
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams.deptName = 0;
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加垃圾转输站";
+      selectCenterMonitorlList(this.queryParams).then(response => {
+        this.cameraList = response.data;
+      });
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      let _this = this;
+      const id = row.id || this.ids
+      selectCenterMonitorlList(this.queryParams).then(response => {
+        this.cameraList = response.data;
+      });
+      getGarbageTransfer(id).then(response => {
+        this.form = response.data;
+        this.title = "修改垃圾转输站";
+        // treeselect().then(response => {
+        //   _this.deptOptions = response.data;
+        //   treeselectAll().then(response => {
+        //     addDeptToTreeSelect(_this.form.deptId, _this.deptOptions, response.data[0]);
         this.open = true;
-        this.title = "添加垃圾转输站";
-      },
-      /** 修改按钮操作 */
-      handleUpdate(row) {
-        this.reset();
-        let _this = this;
-        const id = row.id || this.ids
-        getGarbageTransfer(id).then(response => {
-          this.form = response.data;
-          this.title = "修改垃圾转输站";
-          // treeselect().then(response => {
-          //   _this.deptOptions = response.data;
-          //   treeselectAll().then(response => {
-          //     addDeptToTreeSelect(_this.form.deptId, _this.deptOptions, response.data[0]);
-              this.open = true;
-          //   });
-          // });
-        });
-      },
-      /** 提交按钮 */
-      submitForm() {
-        this.$refs["form"].validate(valid => {
-          if (valid) {
-            // this.form.deptName = this.deptOptions.filter((item) => {
-            //   return this.form.deptId == item.id;
-            // })[0].label;
-            if (this.form.id != null) {
-              updateGarbageTransfer(this.form).then(response => {
-                this.$modal.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
-              });
-            } else {
-              addGarbageTransfer(this.form).then(response => {
-                this.$modal.msgSuccess("新增成功");
-                this.open = false;
-                this.getList();
-              });
-            }
+        //   });
+        // });
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          // this.form.deptName = this.deptOptions.filter((item) => {
+          //   return this.form.deptId == item.id;
+          // })[0].label;
+          if (this.form.id != null) {
+            updateGarbageTransfer(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addGarbageTransfer(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
           }
-        });
-      },
-      /** 删除按钮操作 */
-      handleDelete(row) {
-        const ids = row.id || this.ids;
-        this.$modal.confirm('是否删除选中的数据?').then(function() {
-          return delGarbageTransfer(ids);
-        }).then(() => {
-          this.getList();
-          this.$modal.msgSuccess("删除成功");
-        }).catch(() => {});
-      },
-      /** 导出按钮操作 */
-      handleExport() {
-        this.download('/center-data/garbageTransfer/export', {
-          ...this.queryParams
-        }, `垃圾转输站_${format_date(new Date())}.xlsx`)
-      },
-      // 点击按钮修改是否只查询本级部门用户
-      changeQueryType() {
-        this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
-      }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否删除选中的数据?').then(function () {
+        return delGarbageTransfer(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('/center-data/garbageTransfer/export', {
+        ...this.queryParams
+      }, `垃圾转输站_${format_date(new Date())}.xlsx`)
+    },
+    // 点击按钮修改是否只查询本级部门用户
+    changeQueryType() {
+      this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
     }
-  };
+  }
+};
 </script>

+ 305 - 246
data-ui/src/views/data/digitalagriculture/trash_can/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"  @submit.native.prevent>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" @submit.native.prevent>
       <el-form-item label="名称" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -23,17 +23,18 @@
           <span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
         </template>
         <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
-                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
+                    placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'"
+                    style="width: 240px"/>
         <el-input v-model="queryParams.deptName" v-if="false"/>
       </el-form-item>
-     <!-- <el-form-item label="培训时间" prop="cultivateTime">
-        <el-date-picker clearable
-                        v-model="queryParams.cultivateTime"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择培训时间">
-        </el-date-picker>
-      </el-form-item>-->
+      <!-- <el-form-item label="培训时间" prop="cultivateTime">
+         <el-date-picker clearable
+                         v-model="queryParams.cultivateTime"
+                         type="date"
+                         value-format="yyyy-MM-dd"
+                         placeholder="选择培训时间">
+         </el-date-picker>
+       </el-form-item>-->
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -103,10 +104,10 @@
         </template>
       </el-table-column>
       <el-table-column label="所属部门" align="center" prop="deptName"/>
-      <el-table-column label="创建人" align="center" prop="createName" />
-      <el-table-column label="创建时间" align="center" prop="createTime" />
-      <el-table-column label="修改人" align="center" prop="updateName" />
-      <el-table-column label="修改时间" align="center" prop="updateTime" />
+      <el-table-column label="创建人" align="center" prop="createName"/>
+      <el-table-column label="创建时间" align="center" prop="createTime"/>
+      <el-table-column label="修改人" align="center" prop="updateName"/>
+      <el-table-column label="修改时间" align="center" prop="updateTime"/>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -138,20 +139,34 @@
     />
 
     <!-- 添加或修改垃圾桶对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" class="form-style">
+    <el-dialog :title="title" :visible.sync="open" width="1000px" class="form-style">
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-row :gutter="20">
+          <el-col :span="12">
             <el-form-item label="名称" prop="name">
               <el-input v-model="form.name" placeholder="请输入名称" maxlength="32"/>
             </el-form-item>
+          </el-col>
+          <el-col :span="12">
             <el-form-item label="编号" prop="code">
               <el-input v-model="form.code" placeholder="请输入编码" maxlength="32"/>
             </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
             <el-form-item label="经度" prop="longitude" @dblclick.native="showMap">
               <el-input v-model="form.longitude" placeholder="鼠标双击选择经纬度" maxlength="32"/>
             </el-form-item>
+          </el-col>
+          <el-col :span="12">
             <el-form-item label="纬度" prop="latitude" @dblclick.native="showMap">
               <el-input v-model="form.latitude" placeholder="鼠标双击选择经纬度" maxlength="32"/>
             </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
             <el-form-item label="覆盖区域" prop="coverage">
               <el-select v-model="form.coverage" placeholder="请选择覆盖区域" filterable>
                 <el-option
@@ -162,10 +177,38 @@
                 ></el-option>
               </el-select>
             </el-form-item>
+          </el-col>
+          <el-col :span="12">
             <el-form-item label="所属部门" prop="deptId" class="form-style">
-              <treeselect v-model="form.deptId" :options="deptOptions" multiple:false :show-count="true" :noResultsText="'空'" :noOptionsText="'空'"
+              <treeselect v-model="form.deptId" :options="deptOptions" multiple:false :show-count="true"
+                          :noResultsText="'空'" :noOptionsText="'空'"
                           placeholder="请选择部门" @select="hx"/>
             </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="20">
+            <el-form-item label="绑定设备" prop="deviceList">
+              <el-select v-model="form.deviceList" filterable placeholder="请选择设备" multiple filterable>
+                <el-option
+                  v-for="dict in cameraList"
+                  :key="dict.id"
+                  :label="dict.cameraName"
+                  :value="dict.id"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="图片" prop="attachPaths">
+              <ImageUpload ref="ImageUpload" :limit="1" :file-type="['png','jpg','jpeg']"
+                           :value="form.attachPaths"
+                           @input="getUrl"></ImageUpload>
+            </el-form-item>
+          </el-col>
+        </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -177,242 +220,258 @@
 </template>
 
 <script>
-  import {listTrashCan, getTrashCan, delTrashCan, addTrashCan, updateTrashCan} from "@/api/data/digitalagriculture/trashcan";
-  import Deptselector from '@/views/components/deptselector';
-  import {checkPositiveInteger} from "@/api/rules/rules";
-  import {checkPositiveDecimal, checkLon, checkLat, validPhoneMobile} from "@/api/rules/rules";
-  import { treeselect } from "@/api/system/dept";
-  import Treeselect from '@riophae/vue-treeselect'
-  import '@riophae/vue-treeselect/dist/vue-treeselect.css'
-  import ISuperMap from "@/views/data/common/ISuperMap";
-  import {format_date} from "@/views/data/common/dateExport";
+import {
+  listTrashCan,
+  getTrashCan,
+  delTrashCan,
+  addTrashCan,
+  updateTrashCan
+} from "@/api/data/digitalagriculture/trashcan";
+import Deptselector from '@/views/components/deptselector';
+import {checkLon, checkLat} from "@/api/rules/rules";
+import {treeselect} from "@/api/system/dept";
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import ISuperMap from "@/views/data/common/ISuperMap";
+import {format_date} from "@/views/data/common/dateExport";
+import {selectCenterMonitorlList} from "@/api/data/digitalforest/animal/animal";
 
-  export default {
-    name: "Trash",
-    dicts: ['sys_coverage_type'],
-    components: {Deptselector, ISuperMap,Treeselect},
-    data() {
-      return {
-        sign: 1,
-        ISuperMapvisible: false,
-        // 部门名称
-        deptName: undefined,
-        // 部门树选项
-        deptOptions: [],
-        // 遮罩层
-        loading: true,
-        // 选中数组
-        ids: [],
-        // 非单个禁用
-        single: true,
-        // 非多个禁用
-        multiple: true,
-        // 显示搜索条件
-        showSearch: true,
-        // 总条数
-        total: 0,
-        // 垃圾桶表格数据
-        trashList: [],
-        // 弹出层标题
-        title: "",
-        // 是否显示弹出层
-        open: false,
-        // 查询参数
-        queryParams: {
-          pageNum: 1,
-          pageSize: 10,
-          deptId: null,
-          deptName: 0,
-          longitude: null,
-          latitude: null,
-          name:null,
-          code:null,
-          coverage:null,
-        },
-        // 表单参数
-        form: {},
-        // 表单校验
-        rules: {
-          deptId: [
-            {required: true, message: "所属部门不能为空", trigger: "change"}
-          ],
-          name: [
-            {required: true, message: "名称不能为空", trigger: "blur"}
-          ],
-          code: [
-            {required: true, message: "编号不能为空", trigger: "blur"}
-          ],
-          coverage: [
-            {required: true, message: "覆盖区域不能为空", trigger: "blur"}
-          ],
-          longitude: [
-            { required: true, message: "经度不能为空", trigger: ["blur" , "change"] },
-            { validator: checkLon,trigger: 'blur'}
-          ],
-          latitude: [
-            { required: true, message: "纬度不能为空", trigger: ["blur" , "change"] },
-            { validator: checkLat,trigger: 'blur'}
-          ],
-        },
-        showLongitude: false
+export default {
+  name: "Trash",
+  dicts: ['sys_coverage_type'],
+  components: { Deptselector, ISuperMap, Treeselect},
+  data() {
+    return {
+      sign: 1,
+      ISuperMapvisible: false,
+      cameraList: [],//设备集合
+      // 部门名称
+      deptName: undefined,
+      // 部门树选项
+      deptOptions: [],
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 垃圾桶表格数据
+      trashList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        deptId: null,
+        deptName: 0,
+        longitude: null,
+        latitude: null,
+        name: null,
+        code: null,
+        coverage: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        deptId: [
+          {required: true, message: "所属部门不能为空", trigger: "change"}
+        ],
+        name: [
+          {required: true, message: "名称不能为空", trigger: "blur"}
+        ],
+        code: [
+          {required: true, message: "编号不能为空", trigger: "blur"}
+        ],
+        coverage: [
+          {required: true, message: "覆盖区域不能为空", trigger: "blur"}
+        ],
+        longitude: [
+          {required: true, message: "经度不能为空", trigger: ["blur", "change"]},
+          {validator: checkLon, trigger: 'blur'}
+        ],
+        latitude: [
+          {required: true, message: "纬度不能为空", trigger: ["blur", "change"]},
+          {validator: checkLat, trigger: 'blur'}
+        ],
+      },
+      showLongitude: false
+    };
+  },
+  created() {
+    this.getList();
+    this.getTreeselect();
+  },
+  methods: {
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptions = response.data;
+      });
+    },
+    hx(node) {
+      this.form.dataDeptId = node.id
+      this.form.deptId = node.id
+      this.form.deptName = node.label
+      this.$refs.form.validateField('deptId');
+    },
+    /** 查询垃圾桶列表 */
+    getList() {
+      this.loading = true;
+      listTrashCan(this.queryParams).then(response => {
+        this.trashList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    showMap() {
+      this.ISuperMapvisible = true;
+      this.$nextTick(() => {
+        this.$refs.ISuperMap.init(this.sign, {
+          id: this.form.id,
+          longitude: this.form.longitude,
+          latitude: this.form.latitude,
+          xiantude: this.form.longitude//this.form.longitude换成每个页面对应线或者面对应的字段
+        })
+      })
+    },
+    send(val) {
+      if (val === true) {
+        this.ISuperMapvisible = false;
+        return;
+      }
+      if (this.sign === 1) {
+        this.form.longitude = val.longitude;
+        this.form.latitude = val.latitude;
+      }
+      if (this.sign === 2 || this.sign === 3) this.form.longitude = val.xiantude;//this.form.longitude 换成对应的线或区域的字段
+      this.ISuperMapvisible = false
+    },
+    getUrl(url) {
+      this.form.attachPaths = url
+    },
+    /* showLatLng: function (lat, lng) {
+       this.form.latitude = lat
+       this.form.longitude = lng
+     },
+     showLatLng: function (lat, lng) {
+       this.form.latitude = lat;
+       this.form.longitude = lng;
+     },*/
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        createBy: null,
+        createName: null,
+        createTime: null,
+        updateBy: null,
+        updateName: null,
+        updateTime: null,
+        deptId: null,
+        deptName: null,
+        longitude: null,
+        latitude: null,
+        name: null,
+        code: null,
+        coverage: null
       };
+      this.resetForm("form");
     },
-    created() {
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
       this.getList();
-      this.getTreeselect();
     },
-    methods: {
-      /** 查询部门下拉树结构 */
-      getTreeselect() {
-        treeselect().then(response => {
-          this.deptOptions = response.data;
-        });
-      },
-      hx(node) {
-        this.form.dataDeptId = node.id
-        this.form.deptId = node.id
-        this.form.deptName = node.label
-        this.$refs.form.validateField('deptId');
-      },
-      /** 查询垃圾桶列表 */
-      getList() {
-        this.loading = true;
-        listTrashCan(this.queryParams).then(response => {
-          this.trashList = response.rows;
-          this.total = response.total;
-          this.loading = false;
-        });
-      },
-      showMap() {
-        this.ISuperMapvisible = true;
-        this.$nextTick(() => {
-          this.$refs.ISuperMap.init(this.sign, {
-            id: this.form.id,
-            longitude: this.form.longitude,
-            latitude: this.form.latitude,
-            xiantude: this.form.longitude//this.form.longitude换成每个页面对应线或者面对应的字段
-          })
-        })
-      },
-      send(val) {
-        if (val===true){
-          this.ISuperMapvisible = false;
-          return;
-        }
-        if (this.sign === 1) {
-          this.form.longitude = val.longitude;
-          this.form.latitude = val.latitude;
-        }
-        if (this.sign === 2 || this.sign === 3) this.form.longitude = val.xiantude;//this.form.longitude 换成对应的线或区域的字段
-        this.ISuperMapvisible = false
-      },
-     /* showLatLng: function (lat, lng) {
-        this.form.latitude = lat
-        this.form.longitude = lng
-      },
-      showLatLng: function (lat, lng) {
-        this.form.latitude = lat;
-        this.form.longitude = lng;
-      },*/
-      // 取消按钮
-      cancel() {
-        this.open = false;
-        this.reset();
-      },
-      // 表单重置
-      reset() {
-        this.form = {
-          id: null,
-          createBy: null,
-          createName: null,
-          createTime: null,
-          updateBy: null,
-          updateName: null,
-          updateTime: null,
-          deptId: null,
-          deptName: null,
-          longitude: null,
-          latitude: null,
-          name: null,
-          code: null,
-          coverage: null
-        };
-        this.resetForm("form");
-      },
-      /** 搜索按钮操作 */
-      handleQuery() {
-        this.queryParams.pageNum = 1;
-        this.getList();
-      },
-      /** 重置按钮操作 */
-      resetQuery() {
-        this.queryParams.deptName = 0;
-        this.resetForm("queryForm");
-        this.handleQuery();
-      },
-      // 多选框选中数据
-      handleSelectionChange(selection) {
-        this.ids = selection.map(item => item.id)
-        this.single = selection.length !== 1
-        this.multiple = !selection.length
-      },
-      /** 新增按钮操作 */
-      handleAdd() {
-        this.reset();
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams.deptName = 0;
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加垃圾桶";
+      selectCenterMonitorlList(this.queryParams).then(response => {
+        this.cameraList = response.data;
+      });
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      selectCenterMonitorlList(this.queryParams).then(response => {
+        this.cameraList = response.data;
+      });
+      getTrashCan(id).then(response => {
+        this.form = response.data;
         this.open = true;
-        this.title = "添加垃圾桶";
-      },
-      /** 修改按钮操作 */
-      handleUpdate(row) {
-        this.reset();
-        const id = row.id || this.ids
-        getTrashCan(id).then(response => {
-          this.form = response.data;
-          this.open = true;
-          this.title = "修改垃圾桶";
-        });
-      },
-      /** 提交按钮 */
-      submitForm() {
-        this.$refs["form"].validate(valid => {
-          if (valid) {
-            if (this.form.id != null) {
-              updateTrashCan(this.form).then(response => {
-                this.$modal.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
-              });
-            } else {
-              addTrashCan(this.form).then(response => {
-                this.$modal.msgSuccess("新增成功");
-                this.open = false;
-                this.getList();
-              });
-            }
+        this.title = "修改垃圾桶";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateTrashCan(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addTrashCan(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
           }
-        });
-      },
-      /** 删除按钮操作 */
-      handleDelete(row) {
-        const ids = row.id || this.ids;
-        this.$modal.confirm('是否确认删除已选择的数据项?').then(function () {
-          return delTrashCan(ids);
-        }).then(() => {
-          this.getList();
-          this.$modal.msgSuccess("删除成功");
-        }).catch(() => {
-        });
-      },
-      /** 导出按钮操作 */
-      handleExport() {
-        this.download('center-data/trash/export', {
-          ...this.queryParams
-        },  `垃圾桶_${format_date(new Date())}.xlsx`)
-      },
-      // 点击按钮修改是否只查询本级部门用户
-      changeQueryType() {
-        this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
-      }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除已选择的数据项?').then(function () {
+        return delTrashCan(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('center-data/trash/export', {
+        ...this.queryParams
+      }, `垃圾桶_${format_date(new Date())}.xlsx`)
+    },
+    // 点击按钮修改是否只查询本级部门用户
+    changeQueryType() {
+      this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
     }
-  };
+  }
+};
 </script>

+ 15 - 1
src/main/java/com/sooka/sponest/data/digitalagriculture/controller/CenterdataTFarmBreedingFarmController.java

@@ -1,13 +1,18 @@
 package com.sooka.sponest.data.digitalagriculture.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.ruoyi.common.core.constant.DocumentNameConstants;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.page.TableDataInfo;
 import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.sooka.sponest.data.base.domain.ESVo;
 import com.sooka.sponest.data.digitalagriculture.domain.CenterdataTFarmBreedingFarm;
 import com.sooka.sponest.data.digitalagriculture.service.ICenterdataTFarmBreedingFarmService;
+import com.sooka.sponest.data.utils.DataAttachUtil;
+import com.sooka.sponest.data.utils.DataProducerUtil;
 import com.sooka.sponest.data.utils.ExcelUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -16,6 +21,7 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -64,7 +70,9 @@ public class CenterdataTFarmBreedingFarmController extends BaseController {
     @RequiresPermissions("digitalagriculture:breedingFarm:query")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") String id) {
-        return AjaxResult.success(centerdataTFarmBreedingFarmService.selectCenterdataTFarmBreedingFarmById(id));
+        CenterdataTFarmBreedingFarm centerdataTFarmBreedingFarm = centerdataTFarmBreedingFarmService.selectCenterdataTFarmBreedingFarmById(id);
+        centerdataTFarmBreedingFarm.setAttachPaths(DataAttachUtil.getDataAttachUpload(id));
+        return AjaxResult.success(centerdataTFarmBreedingFarm);
     }
 
     /**
@@ -76,6 +84,8 @@ public class CenterdataTFarmBreedingFarmController extends BaseController {
     @PostMapping
     public AjaxResult add(@Validated @RequestBody CenterdataTFarmBreedingFarm centerdataTFarmBreedingFarm) {
         int result = centerdataTFarmBreedingFarmService.insertCenterdataTFarmBreedingFarm(centerdataTFarmBreedingFarm);
+        DataAttachUtil.dataAttachUpload(centerdataTFarmBreedingFarm.getId(), centerdataTFarmBreedingFarm.getAttachPaths(), DocumentNameConstants.FARM_BREEDING_FARM, centerdataTFarmBreedingFarm.getBusSource());
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FARM_BREEDING_FARM, BusinessType.INSERT, JSON.toJSONString(centerdataTFarmBreedingFarm)));
         return toAjax(result);
     }
 
@@ -88,6 +98,8 @@ public class CenterdataTFarmBreedingFarmController extends BaseController {
     @PutMapping
     public AjaxResult edit(@Validated @RequestBody CenterdataTFarmBreedingFarm centerdataTFarmBreedingFarm) {
         int result = centerdataTFarmBreedingFarmService.updateCenterdataTFarmBreedingFarm(centerdataTFarmBreedingFarm);
+        DataAttachUtil.dataAttachUpload(centerdataTFarmBreedingFarm.getId(), centerdataTFarmBreedingFarm.getAttachPaths(), DocumentNameConstants.FARM_BREEDING_FARM, centerdataTFarmBreedingFarm.getBusSource());
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FARM_BREEDING_FARM, BusinessType.UPDATE, JSON.toJSONString(centerdataTFarmBreedingFarm)));
         return toAjax(result);
     }
 
@@ -100,6 +112,8 @@ public class CenterdataTFarmBreedingFarmController extends BaseController {
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable String[] ids) {
         int result = centerdataTFarmBreedingFarmService.deleteCenterdataTFarmBreedingFarmByIds(ids);
+        List<String> idList = Arrays.asList(ids);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FARM_BREEDING_FARM, BusinessType.DELETE, JSON.toJSONString(idList)));
         return toAjax(result);
     }
 }

+ 15 - 1
src/main/java/com/sooka/sponest/data/digitalagriculture/controller/CenterdataTFarmCesspitCollectController.java

@@ -1,5 +1,7 @@
 package com.sooka.sponest.data.digitalagriculture.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.ruoyi.common.core.constant.DocumentNameConstants;
 import com.ruoyi.common.core.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
@@ -7,15 +9,19 @@ import com.ruoyi.common.core.web.page.TableDataInfo;
 import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.sooka.sponest.data.base.domain.ESVo;
 import com.sooka.sponest.data.digitalagriculture.domain.CenterdataTFarmCesspitCollect;
 import com.sooka.sponest.data.digitalagriculture.service.ICenterdataTFarmCesspitCollectService;
+import com.sooka.sponest.data.utils.DataAttachUtil;
 import com.sooka.sponest.data.utils.DataConstants;
+import com.sooka.sponest.data.utils.DataProducerUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -47,7 +53,9 @@ public class CenterdataTFarmCesspitCollectController extends BaseController {
     @RequiresPermissions("cesspitCollect:cesspitCollect:query")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") String id) {
-        return AjaxResult.success(centerdataTFarmCesspitCollectService.selectCenterdataTFarmCesspitCollectById(id));
+        CenterdataTFarmCesspitCollect centerdataTFarmCesspitCollect = centerdataTFarmCesspitCollectService.selectCenterdataTFarmCesspitCollectById(id);
+        centerdataTFarmCesspitCollect.setAttachPaths(DataAttachUtil.getDataAttachUpload(id));
+        return AjaxResult.success(centerdataTFarmCesspitCollect);
     }
 
     /**
@@ -65,6 +73,8 @@ public class CenterdataTFarmCesspitCollectController extends BaseController {
             return AjaxResult.error(DataConstants.ERROR_MSG);
         }
         int result = centerdataTFarmCesspitCollectService.insertCenterdataTFarmCesspitCollect(centerdataTFarmCesspitCollect);
+        DataAttachUtil.dataAttachUpload(centerdataTFarmCesspitCollect.getId(), centerdataTFarmCesspitCollect.getAttachPaths(), DocumentNameConstants.FARM_CESSPIT_COLLECT, centerdataTFarmCesspitCollect.getBusSource());
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FARM_CESSPIT_COLLECT, BusinessType.INSERT, JSON.toJSONString(centerdataTFarmCesspitCollect)));
         return toAjax(result);
     }
     /**
@@ -82,6 +92,8 @@ public class CenterdataTFarmCesspitCollectController extends BaseController {
             return AjaxResult.error(DataConstants.ERROR_MSG);
         }
         int result = centerdataTFarmCesspitCollectService.updateCenterdataTFarmCesspitCollect(centerdataTFarmCesspitCollect);
+        DataAttachUtil.dataAttachUpload(centerdataTFarmCesspitCollect.getId(), centerdataTFarmCesspitCollect.getAttachPaths(), DocumentNameConstants.FARM_CESSPIT_COLLECT, centerdataTFarmCesspitCollect.getBusSource());
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FARM_CESSPIT_COLLECT, BusinessType.UPDATE, JSON.toJSONString(centerdataTFarmCesspitCollect)));
         return toAjax(result);
     }
 
@@ -94,6 +106,8 @@ public class CenterdataTFarmCesspitCollectController extends BaseController {
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable String[] ids) {
         int result = centerdataTFarmCesspitCollectService.deleteCenterdataTFarmCesspitCollectByIds(ids);
+        List<String> idList = Arrays.asList(ids);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FARM_CESSPIT_COLLECT, BusinessType.DELETE, JSON.toJSONString(idList)));
         return toAjax(result);
     }
     /**

+ 15 - 1
src/main/java/com/sooka/sponest/data/digitalagriculture/controller/CenterdataTFarmGarbageTransferController.java

@@ -1,13 +1,18 @@
 package com.sooka.sponest.data.digitalagriculture.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.ruoyi.common.core.constant.DocumentNameConstants;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.page.TableDataInfo;
 import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.sooka.sponest.data.base.domain.ESVo;
 import com.sooka.sponest.data.digitalagriculture.domain.CenterdataTFarmGarbageTransfer;
 import com.sooka.sponest.data.digitalagriculture.service.ICenterdataTFarmGarbageTransferService;
+import com.sooka.sponest.data.utils.DataAttachUtil;
+import com.sooka.sponest.data.utils.DataProducerUtil;
 import com.sooka.sponest.data.utils.ExcelUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -16,6 +21,7 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -77,7 +83,9 @@ public class CenterdataTFarmGarbageTransferController extends BaseController {
     @RequiresPermissions("garbage_transfer:garbageTransfer:query")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") String id) {
-        return AjaxResult.success(centerdataTFarmGarbageTransferService.selectCenterdataTFarmGarbageTransferById(id));
+        CenterdataTFarmGarbageTransfer centerdataTFarmGarbageTransfer = centerdataTFarmGarbageTransferService.selectCenterdataTFarmGarbageTransferById(id);
+        centerdataTFarmGarbageTransfer.setAttachPaths(DataAttachUtil.getDataAttachUpload(id));
+        return AjaxResult.success(centerdataTFarmGarbageTransfer);
     }
 
     /**
@@ -95,6 +103,8 @@ public class CenterdataTFarmGarbageTransferController extends BaseController {
             return AjaxResult.error("垃圾转输站名称已存在");
         }
         int result = centerdataTFarmGarbageTransferService.insertCenterdataTFarmCenterdataTFarmGarbageTransfer(centerdataTFarmGarbageTransfer);
+        DataAttachUtil.dataAttachUpload(centerdataTFarmGarbageTransfer.getId(), centerdataTFarmGarbageTransfer.getAttachPaths(), DocumentNameConstants.FARM_GARBAGE_TRANSFER, centerdataTFarmGarbageTransfer.getBusSource());
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FARM_GARBAGE_TRANSFER, BusinessType.INSERT, JSON.toJSONString(centerdataTFarmGarbageTransfer)));
         return toAjax(result);
     }
 
@@ -113,6 +123,8 @@ public class CenterdataTFarmGarbageTransferController extends BaseController {
             return AjaxResult.error("垃圾转输站名称已存在");
         }
         int result = centerdataTFarmGarbageTransferService.updateCenterdataTFarmCenterdataTFarmGarbageTransfer(centerdataTFarmGarbageTransfer);
+        DataAttachUtil.dataAttachUpload(centerdataTFarmGarbageTransfer.getId(), centerdataTFarmGarbageTransfer.getAttachPaths(), DocumentNameConstants.FARM_GARBAGE_TRANSFER, centerdataTFarmGarbageTransfer.getBusSource());
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FARM_GARBAGE_TRANSFER, BusinessType.UPDATE, JSON.toJSONString(centerdataTFarmGarbageTransfer)));
         return toAjax(result);
     }
 
@@ -126,6 +138,8 @@ public class CenterdataTFarmGarbageTransferController extends BaseController {
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable String[] ids) {
         int result = centerdataTFarmGarbageTransferService.deleteCenterdataTFarmCenterdataTFarmGarbageTransfer(ids);
+        List<String> idList = Arrays.asList(ids);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FARM_BREEDING_FARM, BusinessType.DELETE, JSON.toJSONString(idList)));
         return toAjax(result);
     }
 

+ 15 - 1
src/main/java/com/sooka/sponest/data/digitalagriculture/controller/CenterdataTFarmTrashCanController.java

@@ -1,5 +1,7 @@
 package com.sooka.sponest.data.digitalagriculture.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.ruoyi.common.core.constant.DocumentNameConstants;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.page.TableDataInfo;
@@ -7,9 +9,12 @@ import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.security.annotation.RequiresPermissions;
 import com.ruoyi.common.security.utils.DictUtils;
+import com.sooka.sponest.data.base.domain.ESVo;
 import com.sooka.sponest.data.digitalagriculture.domain.CenterdataTFarmTrashCan;
 import com.sooka.sponest.data.digitalagriculture.service.ICenterdataTFarmTrashCanService;
+import com.sooka.sponest.data.utils.DataAttachUtil;
 import com.sooka.sponest.data.utils.DataConstants;
+import com.sooka.sponest.data.utils.DataProducerUtil;
 import com.sooka.sponest.data.utils.ExcelUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -17,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -62,7 +68,9 @@ public class CenterdataTFarmTrashCanController extends BaseController {
     @RequiresPermissions("digitalagriculture:trash:query")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") String id) {
-        return AjaxResult.success(centerdataTFarmTrashCanService.selectCenterdataTFarmTrashCanById(id));
+        CenterdataTFarmTrashCan centerdataTFarmTrashCan = centerdataTFarmTrashCanService.selectCenterdataTFarmTrashCanById(id);
+        centerdataTFarmTrashCan.setAttachPaths(DataAttachUtil.getDataAttachUpload(id));
+        return AjaxResult.success(centerdataTFarmTrashCan);
     }
 
     /**
@@ -81,6 +89,8 @@ public class CenterdataTFarmTrashCanController extends BaseController {
         }
         centerdataTFarmTrashCan.setCoverageLabel(DictUtils.getDictDataByValue("sys_coverage_type",centerdataTFarmTrashCan.getCoverage()));
         int result = centerdataTFarmTrashCanService.insertCenterdataTFarmTrashCan(centerdataTFarmTrashCan);
+        DataAttachUtil.dataAttachUpload(centerdataTFarmTrashCan.getId(), centerdataTFarmTrashCan.getAttachPaths(), DocumentNameConstants.FARM_TRASHCAN, centerdataTFarmTrashCan.getBusSource());
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FARM_TRASHCAN, BusinessType.INSERT, JSON.toJSONString(centerdataTFarmTrashCan)));
         return toAjax(result);
     }
 
@@ -100,6 +110,8 @@ public class CenterdataTFarmTrashCanController extends BaseController {
         }
         centerdataTFarmTrashCan.setCoverageLabel(DictUtils.getDictDataByValue("sys_coverage_type",centerdataTFarmTrashCan.getCoverage()));
         int result = centerdataTFarmTrashCanService.updateCenterdataTFarmTrashCan(centerdataTFarmTrashCan);
+        DataAttachUtil.dataAttachUpload(centerdataTFarmTrashCan.getId(), centerdataTFarmTrashCan.getAttachPaths(), DocumentNameConstants.FARM_TRASHCAN, centerdataTFarmTrashCan.getBusSource());
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FARM_TRASHCAN, BusinessType.UPDATE, JSON.toJSONString(centerdataTFarmTrashCan)));
         return toAjax(result);
     }
 
@@ -112,6 +124,8 @@ public class CenterdataTFarmTrashCanController extends BaseController {
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable String[] ids) {
         int result = centerdataTFarmTrashCanService.deleteCenterdataTFarmTrashCanByIds(ids);
+        List<String> idList = Arrays.asList(ids);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FARM_TRASHCAN, BusinessType.DELETE, JSON.toJSONString(idList)));
         return toAjax(result);
     }
 }

+ 16 - 1
src/main/java/com/sooka/sponest/data/digitalagriculture/domain/CenterdataTFarmBreedingFarm.java

@@ -9,6 +9,7 @@ import lombok.EqualsAndHashCode;
 
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
+import java.util.List;
 
 /**
  * 养殖场 centerdata_t_farm_breeding_farm
@@ -167,6 +168,20 @@ public class CenterdataTFarmBreedingFarm extends BaseBusinessEntity {
     @Excel(name = "备案表")
     private String filing;
 
-
+    /**
+     * 设备中间表主键
+     */
+    @ApiModelProperty(value = "设备中间表主键", required = false)
+    private List<String> deviceList;
+    /**
+     * 图片上传路径
+     */
+    @ApiModelProperty(value = "图片上传路径",required = false)
+    private String attachPaths;
+    /**
+     * 图片来源
+     */
+    @ApiModelProperty(value = "图片来源",required = false)
+    private String busSource;
 
 }

+ 17 - 0
src/main/java/com/sooka/sponest/data/digitalagriculture/domain/CenterdataTFarmCesspitCollect.java

@@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import javax.validation.constraints.NotNull;
+import java.util.List;
 
 /**
  * 粪污收集点  centerdata_t_farm_cesspit_collect
@@ -70,4 +71,20 @@ public class CenterdataTFarmCesspitCollect extends BaseBusinessEntity {
     @ApiModelProperty(value = "所属部门", required = false)
     @Excel(name = "所属部门")
     private String deptName;
+
+    /**
+     * 设备中间表主键
+     */
+    @ApiModelProperty(value = "设备中间表主键", required = false)
+    private List<String> deviceList;
+    /**
+     * 图片上传路径
+     */
+    @ApiModelProperty(value = "图片上传路径",required = false)
+    private String attachPaths;
+    /**
+     * 图片来源
+     */
+    @ApiModelProperty(value = "图片来源",required = false)
+    private String busSource;
 }

+ 17 - 0
src/main/java/com/sooka/sponest/data/digitalagriculture/domain/CenterdataTFarmGarbageTransfer.java

@@ -7,6 +7,7 @@ import lombok.Data;
 
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
+import java.util.List;
 
 /**
  * 垃圾转输站对象 centerdata_t_farm_garbage_transfer
@@ -72,4 +73,20 @@ public class CenterdataTFarmGarbageTransfer extends BaseBusinessEntity {
     @NotBlank(message = "部门名称不能为空")
     private String deptName;
 
+    /**
+     * 设备中间表主键
+     */
+    @ApiModelProperty(value = "设备中间表主键", required = false)
+    private List<String> deviceList;
+    /**
+     * 图片上传路径
+     */
+    @ApiModelProperty(value = "图片上传路径",required = false)
+    private String attachPaths;
+    /**
+     * 图片来源
+     */
+    @ApiModelProperty(value = "图片来源",required = false)
+    private String busSource;
+
 }

+ 16 - 0
src/main/java/com/sooka/sponest/data/digitalagriculture/domain/CenterdataTFarmTrashCan.java

@@ -8,6 +8,7 @@ import lombok.Data;
 
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
+import java.util.List;
 
 
 /**
@@ -84,5 +85,20 @@ public class CenterdataTFarmTrashCan extends BaseBusinessEntity {
     @Excel(name = "所属部门")
     private String deptName;
 
+    /**
+     * 设备中间表主键
+     */
+    @ApiModelProperty(value = "设备中间表主键", required = false)
+    private List<String> deviceList;
+    /**
+     * 图片上传路径
+     */
+    @ApiModelProperty(value = "图片上传路径",required = false)
+    private String attachPaths;
+    /**
+     * 图片来源
+     */
+    @ApiModelProperty(value = "图片来源",required = false)
+    private String busSource;
 
 }

+ 28 - 2
src/main/java/com/sooka/sponest/data/digitalagriculture/service/impl/CenterdataTFarmBreedingFarmServiceImpl.java

@@ -1,6 +1,7 @@
 package com.sooka.sponest.data.digitalagriculture.service.impl;
 
 import com.ruoyi.common.core.utils.DateUtils;
+import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.core.utils.uuid.IdUtils;
 import com.ruoyi.common.datascope.annotation.DataScopeMutiDept;
 import com.ruoyi.common.security.utils.DictUtils;
@@ -9,6 +10,8 @@ import com.sooka.sponest.data.base.service.impl.BaseServiceImpl;
 import com.sooka.sponest.data.digitalagriculture.domain.CenterdataTFarmBreedingFarm;
 import com.sooka.sponest.data.digitalagriculture.mapper.CenterdataTFarmBreedingFarmMapper;
 import com.sooka.sponest.data.digitalagriculture.service.ICenterdataTFarmBreedingFarmService;
+import com.sooka.sponest.data.system.equipment.domain.CenterdataTEquipmentCamera;
+import com.sooka.sponest.data.system.equipment.service.ICenterdataTEquipmentCameraService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -27,6 +30,9 @@ public class CenterdataTFarmBreedingFarmServiceImpl extends BaseServiceImpl impl
     @Autowired
     private CenterdataTFarmBreedingFarmMapper centerdataTFarmBreedingFarmMapper;
 
+    @Autowired
+    private ICenterdataTEquipmentCameraService centerdataTEquipmentCameraService;
+
     private static final String SYS_ISURGE = "sys_isurge";
 
     /**
@@ -62,6 +68,7 @@ public class CenterdataTFarmBreedingFarmServiceImpl extends BaseServiceImpl impl
         data.setVarietiesLabel(DictUtils.getDictDataByValue("centerdata_breeding_variety",data.getVarieties()));
         data.setAssortedLabel(DictUtils.getDictDataByValue(SYS_ISURGE,data.getAssorted()));
         data.setIsUsedLabel(DictUtils.getDictDataByValue(SYS_ISURGE,data.getIsUsed()));
+        data.setDeviceList(centerdataTEquipmentCameraService.selectCenterdataTEquipmentCameraByBusinessId(id));
         return data;
     }
 
@@ -77,7 +84,16 @@ public class CenterdataTFarmBreedingFarmServiceImpl extends BaseServiceImpl impl
         centerdataTFarmBreedingFarm.setCreateBy(SecurityUtils.getUserId().toString());
         centerdataTFarmBreedingFarm.setCreateName(SecurityUtils.getLoginUser().getSysUser().getNickName());
         centerdataTFarmBreedingFarm.setCreateTime(DateUtils.getNowDate());
-
+        if (StringUtils.isNotEmpty(centerdataTFarmBreedingFarm.getDeviceList())) {
+            centerdataTFarmBreedingFarm.getDeviceList().forEach(item -> {
+                CenterdataTEquipmentCamera camera = new CenterdataTEquipmentCamera();
+                camera.setId(IdUtils.fastSimpleUUID());
+                camera.setCameraId(item);
+                camera.setType("centerdata_t_farm_breeding_farm");
+                camera.setBusinessId(centerdataTFarmBreedingFarm.getId());
+                centerdataTEquipmentCameraService.insertCenterdataTEquipmentCamera(camera);
+            });
+        }
         return centerdataTFarmBreedingFarmMapper.insertCenterdataTFarmBreedingFarm(centerdataTFarmBreedingFarm);
     }
 
@@ -92,7 +108,17 @@ public class CenterdataTFarmBreedingFarmServiceImpl extends BaseServiceImpl impl
         centerdataTFarmBreedingFarm.setUpdateBy(SecurityUtils.getLoginUser().getUserid());
         centerdataTFarmBreedingFarm.setUpdateName(SecurityUtils.getLoginUser().getSysUser().getNickName());
         centerdataTFarmBreedingFarm.setUpdateTime(DateUtils.getNowDate());
-
+        centerdataTEquipmentCameraService.deleteCenterdataTEquipmentCameraByBusinessId(centerdataTFarmBreedingFarm.getId());
+        if (StringUtils.isNotEmpty(centerdataTFarmBreedingFarm.getDeviceList())) {
+            centerdataTFarmBreedingFarm.getDeviceList().forEach(item -> {
+                CenterdataTEquipmentCamera camera = new CenterdataTEquipmentCamera();
+                camera.setId(IdUtils.fastSimpleUUID());
+                camera.setCameraId(item);
+                camera.setType("centerdata_t_farm_breeding_farm");
+                camera.setBusinessId(centerdataTFarmBreedingFarm.getId());
+                centerdataTEquipmentCameraService.insertCenterdataTEquipmentCamera(camera);
+            });
+        }
         return centerdataTFarmBreedingFarmMapper.updateCenterdataTFarmBreedingFarm(centerdataTFarmBreedingFarm);
     }
 

+ 31 - 1
src/main/java/com/sooka/sponest/data/digitalagriculture/service/impl/CenterdataTFarmCesspitCollectServiceImpl.java

@@ -1,6 +1,8 @@
 package com.sooka.sponest.data.digitalagriculture.service.impl;
 
 import com.ruoyi.common.core.utils.DateUtils;
+import com.ruoyi.common.core.utils.StringUtils;
+import com.ruoyi.common.core.utils.uuid.IdUtils;
 import com.ruoyi.common.core.utils.uuid.UUID;
 import com.ruoyi.common.datascope.annotation.DataScopeMutiDept;
 import com.ruoyi.common.security.utils.SecurityUtils;
@@ -8,6 +10,8 @@ import com.sooka.sponest.data.base.service.impl.BaseServiceImpl;
 import com.sooka.sponest.data.digitalagriculture.domain.CenterdataTFarmCesspitCollect;
 import com.sooka.sponest.data.digitalagriculture.mapper.CenterdataTFarmCesspitCollectMapper;
 import com.sooka.sponest.data.digitalagriculture.service.ICenterdataTFarmCesspitCollectService;
+import com.sooka.sponest.data.system.equipment.domain.CenterdataTEquipmentCamera;
+import com.sooka.sponest.data.system.equipment.service.ICenterdataTEquipmentCameraService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -23,6 +27,9 @@ public class CenterdataTFarmCesspitCollectServiceImpl extends BaseServiceImpl im
     @Autowired
     private CenterdataTFarmCesspitCollectMapper centerdataTFarmCesspitCollectMapper;
 
+    @Autowired
+    private ICenterdataTEquipmentCameraService centerdataTEquipmentCameraService;
+
     /**
      * 查询粪污收集点列表
      * @param centerdataTFarmCesspitCollect 粪污收集点对象
@@ -46,6 +53,16 @@ public class CenterdataTFarmCesspitCollectServiceImpl extends BaseServiceImpl im
         centerdataTFarmCesspitCollect.setCreateBy(SecurityUtils.getUserId().toString());
         centerdataTFarmCesspitCollect.setCreateName(SecurityUtils.getLoginUser().getSysUser().getNickName());
         centerdataTFarmCesspitCollect.setCreateTime(DateUtils.getNowDate());
+        if (StringUtils.isNotEmpty(centerdataTFarmCesspitCollect.getDeviceList())) {
+            centerdataTFarmCesspitCollect.getDeviceList().forEach(item -> {
+                CenterdataTEquipmentCamera camera = new CenterdataTEquipmentCamera();
+                camera.setId(IdUtils.fastSimpleUUID());
+                camera.setCameraId(item);
+                camera.setType("centerdata_t_farm_cesspit_collect");
+                camera.setBusinessId(centerdataTFarmCesspitCollect.getId());
+                centerdataTEquipmentCameraService.insertCenterdataTEquipmentCamera(camera);
+            });
+        }
         return centerdataTFarmCesspitCollectMapper.insertCenterdataTFarmCesspitCollect(centerdataTFarmCesspitCollect);
     }
     /**
@@ -56,7 +73,9 @@ public class CenterdataTFarmCesspitCollectServiceImpl extends BaseServiceImpl im
      */
     @Override
     public CenterdataTFarmCesspitCollect selectCenterdataTFarmCesspitCollectById(String id) {
-        return centerdataTFarmCesspitCollectMapper.selectCenterdataTFarmCesspitCollectById(id);
+        CenterdataTFarmCesspitCollect centerdataTFarmCesspitCollect = centerdataTFarmCesspitCollectMapper.selectCenterdataTFarmCesspitCollectById(id);
+        centerdataTFarmCesspitCollect.setDeviceList(centerdataTEquipmentCameraService.selectCenterdataTEquipmentCameraByBusinessId(id));
+        return centerdataTFarmCesspitCollect;
     }
     /**
      * 修改粪污收集点
@@ -69,6 +88,17 @@ public class CenterdataTFarmCesspitCollectServiceImpl extends BaseServiceImpl im
         centerdataTFarmCesspitCollect.setUpdateBy(SecurityUtils.getUserId());
         centerdataTFarmCesspitCollect.setUpdateName(SecurityUtils.getLoginUser().getSysUser().getNickName());
         centerdataTFarmCesspitCollect.setUpdateTime(DateUtils.getNowDate());
+        centerdataTEquipmentCameraService.deleteCenterdataTEquipmentCameraByBusinessId(centerdataTFarmCesspitCollect.getId());
+        if (StringUtils.isNotEmpty(centerdataTFarmCesspitCollect.getDeviceList())) {
+            centerdataTFarmCesspitCollect.getDeviceList().forEach(item -> {
+                CenterdataTEquipmentCamera camera = new CenterdataTEquipmentCamera();
+                camera.setId(IdUtils.fastSimpleUUID());
+                camera.setCameraId(item);
+                camera.setType("centerdata_t_farm_cesspit_collect");
+                camera.setBusinessId(centerdataTFarmCesspitCollect.getId());
+                centerdataTEquipmentCameraService.insertCenterdataTEquipmentCamera(camera);
+            });
+        }
         return centerdataTFarmCesspitCollectMapper.updateCenterdataTFarmCesspitCollect(centerdataTFarmCesspitCollect);
     }
     /**

+ 28 - 0
src/main/java/com/sooka/sponest/data/digitalagriculture/service/impl/CenterdataTFarmTrashCanServiceImpl.java

@@ -1,6 +1,7 @@
 package com.sooka.sponest.data.digitalagriculture.service.impl;
 
 import com.ruoyi.common.core.utils.DateUtils;
+import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.core.utils.uuid.IdUtils;
 import com.ruoyi.common.datascope.annotation.DataScopeMutiDept;
 import com.ruoyi.common.security.utils.DictUtils;
@@ -9,6 +10,8 @@ import com.sooka.sponest.data.base.service.impl.BaseServiceImpl;
 import com.sooka.sponest.data.digitalagriculture.domain.CenterdataTFarmTrashCan;
 import com.sooka.sponest.data.digitalagriculture.mapper.CenterdataTFarmTrashCanMapper;
 import com.sooka.sponest.data.digitalagriculture.service.ICenterdataTFarmTrashCanService;
+import com.sooka.sponest.data.system.equipment.domain.CenterdataTEquipmentCamera;
+import com.sooka.sponest.data.system.equipment.service.ICenterdataTEquipmentCameraService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -24,6 +27,9 @@ public class CenterdataTFarmTrashCanServiceImpl extends BaseServiceImpl implemen
 
     @Autowired
     private CenterdataTFarmTrashCanMapper centerdataTFarmTrashCanMapper;
+
+    @Autowired
+    private ICenterdataTEquipmentCameraService centerdataTEquipmentCameraService;
     /**
      * 查询垃圾桶列表
      *
@@ -46,6 +52,7 @@ public class CenterdataTFarmTrashCanServiceImpl extends BaseServiceImpl implemen
     @Override
     public CenterdataTFarmTrashCan selectCenterdataTFarmTrashCanById(String id) {
         CenterdataTFarmTrashCan data = centerdataTFarmTrashCanMapper.selectCenterdataTFarmTrashCanById(id);
+        data.setDeviceList(centerdataTEquipmentCameraService.selectCenterdataTEquipmentCameraByBusinessId(id));
         data.setCoverageLabel(DictUtils.getDictDataByValue("sys_coverage_type",data.getCoverage()));
         return data;
     }
@@ -62,6 +69,16 @@ public class CenterdataTFarmTrashCanServiceImpl extends BaseServiceImpl implemen
         centerdataTFarmTrashCan.setCreateBy(SecurityUtils.getUserId().toString());
         centerdataTFarmTrashCan.setCreateName(SecurityUtils.getLoginUser().getSysUser().getNickName());
         centerdataTFarmTrashCan.setCreateTime(DateUtils.getNowDate());
+        if (StringUtils.isNotEmpty(centerdataTFarmTrashCan.getDeviceList())) {
+            centerdataTFarmTrashCan.getDeviceList().forEach(item -> {
+                CenterdataTEquipmentCamera camera = new CenterdataTEquipmentCamera();
+                camera.setId(IdUtils.fastSimpleUUID());
+                camera.setCameraId(item);
+                camera.setType("centerdata_t_farm_trashcan");
+                camera.setBusinessId(centerdataTFarmTrashCan.getId());
+                centerdataTEquipmentCameraService.insertCenterdataTEquipmentCamera(camera);
+            });
+        }
         return centerdataTFarmTrashCanMapper.insertCenterdataTFarmTrashCan(centerdataTFarmTrashCan);
     }
 
@@ -77,6 +94,17 @@ public class CenterdataTFarmTrashCanServiceImpl extends BaseServiceImpl implemen
         centerdataTFarmTrashCan.setUpdateBy(SecurityUtils.getLoginUser().getUserid());
         centerdataTFarmTrashCan.setUpdateName(SecurityUtils.getLoginUser().getSysUser().getNickName());
         centerdataTFarmTrashCan.setUpdateTime(DateUtils.getNowDate());
+        centerdataTEquipmentCameraService.deleteCenterdataTEquipmentCameraByBusinessId(centerdataTFarmTrashCan.getId());
+        if (StringUtils.isNotEmpty(centerdataTFarmTrashCan.getDeviceList())) {
+            centerdataTFarmTrashCan.getDeviceList().forEach(item -> {
+                CenterdataTEquipmentCamera camera = new CenterdataTEquipmentCamera();
+                camera.setId(IdUtils.fastSimpleUUID());
+                camera.setCameraId(item);
+                camera.setType("centerdata_t_farm_trashcan");
+                camera.setBusinessId(centerdataTFarmTrashCan.getId());
+                centerdataTEquipmentCameraService.insertCenterdataTEquipmentCamera(camera);
+            });
+        }
         return centerdataTFarmTrashCanMapper.updateCenterdataTFarmTrashCan(centerdataTFarmTrashCan);
     }
 

+ 31 - 1
src/main/java/com/sooka/sponest/data/digitalagriculture/service/impl/ICenterdataTFarmGarbageTransferServiceImpl.java

@@ -1,6 +1,8 @@
 package com.sooka.sponest.data.digitalagriculture.service.impl;
 
 import com.ruoyi.common.core.utils.DateUtils;
+import com.ruoyi.common.core.utils.StringUtils;
+import com.ruoyi.common.core.utils.uuid.IdUtils;
 import com.ruoyi.common.core.utils.uuid.UUID;
 import com.ruoyi.common.datascope.annotation.DataScopeMutiDept;
 import com.ruoyi.common.security.utils.SecurityUtils;
@@ -8,6 +10,8 @@ import com.sooka.sponest.data.base.service.impl.BaseServiceImpl;
 import com.sooka.sponest.data.digitalagriculture.domain.CenterdataTFarmGarbageTransfer;
 import com.sooka.sponest.data.digitalagriculture.mapper.CenterdataTFarmGarbageTransferMapper;
 import com.sooka.sponest.data.digitalagriculture.service.ICenterdataTFarmGarbageTransferService;
+import com.sooka.sponest.data.system.equipment.domain.CenterdataTEquipmentCamera;
+import com.sooka.sponest.data.system.equipment.service.ICenterdataTEquipmentCameraService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -19,6 +23,9 @@ public class ICenterdataTFarmGarbageTransferServiceImpl extends BaseServiceImpl
         @Autowired
         private CenterdataTFarmGarbageTransferMapper centerdataTFarmGarbageTransferMapper;
 
+    @Autowired
+    private ICenterdataTEquipmentCameraService centerdataTEquipmentCameraService;
+
     @Override
     @DataScopeMutiDept(deptAlias = "d")
     public List<CenterdataTFarmGarbageTransfer> selectCenterdataTFarmGarbageTransferList(CenterdataTFarmGarbageTransfer centerdataTFarmGarbageTransfer) {
@@ -28,7 +35,9 @@ public class ICenterdataTFarmGarbageTransferServiceImpl extends BaseServiceImpl
 
     @Override
     public CenterdataTFarmGarbageTransfer selectCenterdataTFarmGarbageTransferById(String id) {
-        return centerdataTFarmGarbageTransferMapper.selectCenterdataTFarmGarbageTransferById(id);
+        CenterdataTFarmGarbageTransfer data = centerdataTFarmGarbageTransferMapper.selectCenterdataTFarmGarbageTransferById(id);
+        data.setDeviceList(centerdataTEquipmentCameraService.selectCenterdataTEquipmentCameraByBusinessId(id));
+        return data;
     }
 
     @Override
@@ -37,6 +46,16 @@ public class ICenterdataTFarmGarbageTransferServiceImpl extends BaseServiceImpl
         centerdataTFarmGarbageTransfer.setCreateBy(SecurityUtils.getUserId().toString());
         centerdataTFarmGarbageTransfer.setCreateName(SecurityUtils.getLoginUser().getSysUser().getNickName());
         centerdataTFarmGarbageTransfer.setCreateTime(DateUtils.getNowDate());
+        if (StringUtils.isNotEmpty(centerdataTFarmGarbageTransfer.getDeviceList())) {
+            centerdataTFarmGarbageTransfer.getDeviceList().forEach(item -> {
+                CenterdataTEquipmentCamera camera = new CenterdataTEquipmentCamera();
+                camera.setId(IdUtils.fastSimpleUUID());
+                camera.setCameraId(item);
+                camera.setType("centerdata_t_farm_garbage_transfer");
+                camera.setBusinessId(centerdataTFarmGarbageTransfer.getId());
+                centerdataTEquipmentCameraService.insertCenterdataTEquipmentCamera(camera);
+            });
+        }
         return centerdataTFarmGarbageTransferMapper.insertCenterdataTFarmCenterdataTFarmGarbageTransfer(centerdataTFarmGarbageTransfer);
     }
 
@@ -45,6 +64,17 @@ public class ICenterdataTFarmGarbageTransferServiceImpl extends BaseServiceImpl
         centerdataTFarmGarbageTransfer.setUpdateBy(SecurityUtils.getUserId());
         centerdataTFarmGarbageTransfer.setUpdateName(SecurityUtils.getLoginUser().getSysUser().getNickName());
         centerdataTFarmGarbageTransfer.setUpdateTime(DateUtils.getNowDate());
+        centerdataTEquipmentCameraService.deleteCenterdataTEquipmentCameraByBusinessId(centerdataTFarmGarbageTransfer.getId());
+        if (StringUtils.isNotEmpty(centerdataTFarmGarbageTransfer.getDeviceList())) {
+            centerdataTFarmGarbageTransfer.getDeviceList().forEach(item -> {
+                CenterdataTEquipmentCamera camera = new CenterdataTEquipmentCamera();
+                camera.setId(IdUtils.fastSimpleUUID());
+                camera.setCameraId(item);
+                camera.setType("centerdata_t_farm_garbage_transfer");
+                camera.setBusinessId(centerdataTFarmGarbageTransfer.getId());
+                centerdataTEquipmentCameraService.insertCenterdataTEquipmentCamera(camera);
+            });
+        }
         return centerdataTFarmGarbageTransferMapper.updateCenterdataTFarmCenterdataTFarmGarbageTransfer(centerdataTFarmGarbageTransfer);
     }