ソースを参照

农村集体耕地

hanfucheng 1 年間 前
コミット
cbc6b641e9

+ 44 - 0
data-ui/src/api/data/digitalagriculture/collective_farmland/farmland.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询农村集体耕地列表
+export function listFarmland(query) {
+  return request({
+    url: '/center-data/collectiveFarmland/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询农村集体耕地详细
+export function getFarmland(id) {
+  return request({
+    url: '/center-data/collectiveFarmland/' + id,
+    method: 'get'
+  })
+}
+
+// 新增农村集体耕地
+export function addFarmland(data) {
+  return request({
+    url: '/center-data/collectiveFarmland',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改农村集体耕地
+export function updateFarmland(data) {
+  return request({
+    url: '/center-data/collectiveFarmland',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除农村集体耕地
+export function delFarmland(id) {
+  return request({
+    url: '/center-data/collectiveFarmland/' + id,
+    method: 'delete'
+  })
+}

+ 457 - 0
data-ui/src/views/data/digitalagriculture/collective_farmland/index.vue

@@ -0,0 +1,457 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"
+             @submit.native.prevent>
+      <el-form-item label="名称" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+<!--      <el-form-item label="许可证号" prop="license">-->
+<!--        <el-input-->
+<!--          v-model="queryParams.license"-->
+<!--          placeholder="请输入许可证号"-->
+<!--          clearable-->
+<!--          size="small"-->
+<!--          @keyup.enter.native="handleQuery"-->
+<!--        />-->
+<!--      </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>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['farm:collectiveFarmland:add']"
+        >新增
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['farm:collectiveFarmland:edit']"
+        >修改
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['farm:collectiveFarmland:remove']"
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['farm:collectiveFarmland:export']"
+        >导出
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="farmlandList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="名称" align="center" prop="name"/>
+      <el-table-column label="联系人" align="center" prop="contacts"/>
+      <el-table-column label="联系电话" align="center" prop="phone"/>
+      <el-table-column label="经度" align="center" prop="longitude"/>
+      <el-table-column label="纬度" align="center" prop="latitude"/>
+      <el-table-column label="经营范围" align="center" prop="limits"/>
+      <el-table-column label="许可证号" align="center" prop="license"/>
+      <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" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['farm:collectiveFarmland:edit']"
+          >修改
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['farm:collectiveFarmland:remove']"
+          >删除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改农村集体耕地对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="1000px"  class="form-style">
+      <el-form ref="form" :model="form" :rules="rules" label-width="110px">
+        <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="license">
+              <el-input v-model="form.license" 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="鼠标双击选择经纬度"/>
+            </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="contacts">
+              <el-input v-model="form.contacts" placeholder="请输入联系人" maxlength="20"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="联系电话" prop="phone">
+              <el-input v-model="form.phone" placeholder="请输入联系电话" maxlength="13"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="经营范围" prop="limits">
+              <el-input v-model="form.limits" placeholder="请输入经营范围" maxlength="32"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="地点" prop="address">
+              <el-input v-model="form.address" placeholder="请输入地点" maxlength="255"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <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-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" :fileType="['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>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <ISuperMap ref="ISuperMap" v-if="ISuperMapvisible" @send="send"/>
+  </div>
+</template>
+
+<script>
+import {
+  listFarmland,
+  getFarmland,
+  delFarmland,
+  addFarmland,
+  updateFarmland
+} from "@/api/data/digitalagriculture/collective_farmland/farmland";
+import DataImageUpload from "@/components/ImageUpload/dataUpload.vue";
+import {selectCenterMonitorlList} from "@/api/data/digitalforest/animal/animal";
+import Treeselect from "@riophae/vue-treeselect";
+import {treeselect} from "@/api/system/dept";
+import {format_date} from "@/views/data/common/dateExport";
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import {checkLat, checkLon, validPhoneMobile} from "@/api/rules/rules";
+import ISuperMap from "@/views/data/common/ISuperMap.vue";
+
+export default {
+  name: "Farmland",
+  components: {ISuperMap, Treeselect, DataImageUpload},
+  data() {
+    return {
+      ISuperMapvisible: false,
+      sign: 1,
+      // 遮罩层
+      loading: true,
+      cameraList: [],//设备集合
+      // 部门树选项
+      deptOptions: undefined,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 农村集体耕地表格数据
+      farmlandList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        deptId: null,
+        deptName: null,
+        createName: null,
+        updateName: null,
+        longitude: null,
+        latitude: null,
+        name: null,
+        contacts: null,
+        phone: null,
+        address: null,
+        limits: null,
+        license: null,
+      },
+      // 表单参数
+      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"},
+        ],
+        phone: [
+          {validator: validPhoneMobile, 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,
+          // 对应显示线 或 面
+          // 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.ISuperMapvisible = false
+    },
+    hx(node) {
+      this.form.dataDeptId = node.id
+      this.form.deptId = node.id
+      this.form.deptName = node.label
+      this.$refs.form.validateField('deptId');
+    },
+    getUrl(url) {
+      this.form.attachPaths = url
+    },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptions = response.data;
+      });
+    },
+    /** 查询农村集体耕地列表 */
+    getList() {
+      this.loading = true;
+      listFarmland(this.queryParams).then(response => {
+        this.farmlandList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        deptId: null,
+        deptName: null,
+        createBy: null,
+        createName: null,
+        createTime: null,
+        updateBy: null,
+        updateName: null,
+        updateTime: null,
+        longitude: null,
+        latitude: null,
+        name: null,
+        contacts: null,
+        phone: null,
+        address: null,
+        limits: null,
+        license: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      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;
+      });
+      getFarmland(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) {
+            updateFarmland(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addFarmland(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 delFarmland(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('center-data/collectiveFarmland/export', {
+        ...this.queryParams
+      }, `农村集体耕地_${format_date(new Date())}.xlsx`)
+    }
+  }
+};
+</script>

+ 108 - 0
src/main/java/com/sooka/sponest/data/digitalagriculture/controller/CenterdataTFarmCollectiveFarmlandController.java

@@ -0,0 +1,108 @@
+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;
+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.CenterdataTFarmCollectiveFarmland;
+import com.sooka.sponest.data.digitalagriculture.service.ICenterdataTFarmCollectiveFarmlandService;
+import com.sooka.sponest.data.utils.DataAttachUtil;
+import com.sooka.sponest.data.utils.DataProducerUtil;
+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;
+
+/**
+ * 农村集体耕地Controller
+ *
+ * @author 韩福成
+ * @date 2024-06-07
+ */
+@RestController
+@RequestMapping("/collectiveFarmland")
+public class CenterdataTFarmCollectiveFarmlandController extends BaseController {
+    @Autowired
+    private ICenterdataTFarmCollectiveFarmlandService centerdataTFarmCollectiveFarmlandService;
+
+    /**
+     * 查询农村集体耕地列表
+     */
+    @RequiresPermissions("farm:collectiveFarmland:list")
+    @GetMapping("/list")
+    public TableDataInfo list(CenterdataTFarmCollectiveFarmland centerdataTFarmCollectiveFarmland) {
+        startPage();
+        List<CenterdataTFarmCollectiveFarmland> list = centerdataTFarmCollectiveFarmlandService.selectCenterdataTFarmCollectiveFarmlandList(centerdataTFarmCollectiveFarmland);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出农村集体耕地列表
+     */
+    @RequiresPermissions("farm:collectiveFarmland:export")
+    @Log(title = "农村集体耕地", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, CenterdataTFarmCollectiveFarmland centerdataTFarmCollectiveFarmland) {
+        List<CenterdataTFarmCollectiveFarmland> list = centerdataTFarmCollectiveFarmlandService.selectCenterdataTFarmCollectiveFarmlandList(centerdataTFarmCollectiveFarmland);
+        ExcelUtil<CenterdataTFarmCollectiveFarmland> util = new ExcelUtil<>(CenterdataTFarmCollectiveFarmland.class);
+        util.exportExcel(response, list, "农村集体耕地数据");
+    }
+
+    /**
+     * 获取农村集体耕地详细信息
+     */
+    @RequiresPermissions("farm:collectiveFarmland:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id) {
+        CenterdataTFarmCollectiveFarmland centerdataTFarmCollectiveFarmland = centerdataTFarmCollectiveFarmlandService.selectCenterdataTFarmCollectiveFarmlandById(id);
+        centerdataTFarmCollectiveFarmland.setAttachPaths(DataAttachUtil.getDataAttachUpload(id));
+        return AjaxResult.success(centerdataTFarmCollectiveFarmland);
+    }
+
+    /**
+     * 新增农村集体耕地
+     */
+    @RequiresPermissions("farm:collectiveFarmland:add")
+    @Log(title = "农村集体耕地", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CenterdataTFarmCollectiveFarmland centerdataTFarmCollectiveFarmland) {
+        int result = centerdataTFarmCollectiveFarmlandService.insertCenterdataTFarmCollectiveFarmland(centerdataTFarmCollectiveFarmland);
+        DataAttachUtil.dataAttachUpload(centerdataTFarmCollectiveFarmland.getId(), centerdataTFarmCollectiveFarmland.getAttachPaths(), DocumentNameConstants.FARM_COLLECTIVE_FARMLAND, centerdataTFarmCollectiveFarmland.getBusSource());
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FARM_COLLECTIVE_FARMLAND,BusinessType.INSERT, JSON.toJSONString(centerdataTFarmCollectiveFarmland)));
+        return toAjax(result);
+    }
+
+    /**
+     * 修改农村集体耕地
+     */
+    @RequiresPermissions("farm:collectiveFarmland:edit")
+    @Log(title = "农村集体耕地", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CenterdataTFarmCollectiveFarmland centerdataTFarmCollectiveFarmland) {
+        int result = centerdataTFarmCollectiveFarmlandService.updateCenterdataTFarmCollectiveFarmland(centerdataTFarmCollectiveFarmland);
+        DataAttachUtil.dataAttachUpload(centerdataTFarmCollectiveFarmland.getId(), centerdataTFarmCollectiveFarmland.getAttachPaths(), DocumentNameConstants.FARM_COLLECTIVE_FARMLAND, centerdataTFarmCollectiveFarmland.getBusSource());
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FARM_COLLECTIVE_FARMLAND,BusinessType.UPDATE, JSON.toJSONString(centerdataTFarmCollectiveFarmland)));
+        return toAjax(result);
+    }
+
+    /**
+     * 删除农村集体耕地
+     */
+    @RequiresPermissions("farm:collectiveFarmland:remove")
+    @Log(title = "农村集体耕地", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids) {
+        int result = centerdataTFarmCollectiveFarmlandService.deleteCenterdataTFarmCollectiveFarmlandByIds(ids);
+        List<String> idList = Arrays.asList(ids);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FARM_COLLECTIVE_FARMLAND,BusinessType.DELETE, JSON.toJSONString(idList)));
+        return toAjax(result);
+    }
+}

+ 101 - 0
src/main/java/com/sooka/sponest/data/digitalagriculture/domain/CenterdataTFarmCollectiveFarmland.java

@@ -0,0 +1,101 @@
+package com.sooka.sponest.data.digitalagriculture.domain;
+
+import com.ruoyi.common.core.annotation.Excel;
+import com.sooka.sponest.data.base.domain.BaseBusinessEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 农村集体耕地对象 centerdata_t_farm_collective_farmland
+ *
+ * @author 韩福成
+ * @date 2024-06-07
+ */
+@Data
+public class CenterdataTFarmCollectiveFarmland extends BaseBusinessEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键id
+     */
+    private String id;
+
+    /**
+     * 部门id
+     */
+    private Long deptId;
+
+    /**
+     * 部门名称
+     */
+    @Excel(name = "部门名称")
+    private String deptName;
+
+    /**
+     * 经度
+     */
+    @Excel(name = "经度")
+    private String longitude;
+
+    /**
+     * 纬度
+     */
+    @Excel(name = "纬度")
+    private String latitude;
+
+    /**
+     * 名称
+     */
+    @Excel(name = "名称")
+    private String name;
+
+    /**
+     * 联系人
+     */
+    @Excel(name = "联系人")
+    private String contacts;
+
+    /**
+     * 联系电话
+     */
+    @Excel(name = "联系电话")
+    private String phone;
+
+    /**
+     * 地点
+     */
+    @Excel(name = "地点")
+    private String address;
+
+    /**
+     * 经营范围
+     */
+    @Excel(name = "经营范围")
+    private String limits;
+
+    /**
+     * 许可证号
+     */
+    @Excel(name = "许可证号")
+    private String license;
+
+    /**
+     * 设备中间表主键
+     */
+    @ApiModelProperty(value = "设备中间表主键", required = false)
+    private List<String> deviceList;
+
+    /**
+     * 图片上传路径
+     */
+    @ApiModelProperty(value = "图片上传路径",required = false)
+    private String attachPaths;
+    /**
+     * 图片来源
+     */
+    @ApiModelProperty(value = "图片来源",required = false)
+    private String busSource;
+
+}

+ 61 - 0
src/main/java/com/sooka/sponest/data/digitalagriculture/mapper/CenterdataTFarmCollectiveFarmlandMapper.java

@@ -0,0 +1,61 @@
+package com.sooka.sponest.data.digitalagriculture.mapper;
+
+import com.sooka.sponest.data.digitalagriculture.domain.CenterdataTFarmCollectiveFarmland;
+
+import java.util.List;
+
+/**
+ * 农村集体耕地Mapper接口
+ *
+ * @author 韩福成
+ * @date 2024-06-07
+ */
+public interface CenterdataTFarmCollectiveFarmlandMapper {
+    /**
+     * 查询农村集体耕地
+     *
+     * @param id 农村集体耕地主键
+     * @return 农村集体耕地
+     */
+    public CenterdataTFarmCollectiveFarmland selectCenterdataTFarmCollectiveFarmlandById(String id);
+
+    /**
+     * 查询农村集体耕地列表
+     *
+     * @param centerdataTFarmCollectiveFarmland 农村集体耕地
+     * @return 农村集体耕地集合
+     */
+    public List<CenterdataTFarmCollectiveFarmland> selectCenterdataTFarmCollectiveFarmlandList(CenterdataTFarmCollectiveFarmland centerdataTFarmCollectiveFarmland);
+
+    /**
+     * 新增农村集体耕地
+     *
+     * @param centerdataTFarmCollectiveFarmland 农村集体耕地
+     * @return 结果
+     */
+    public int insertCenterdataTFarmCollectiveFarmland(CenterdataTFarmCollectiveFarmland centerdataTFarmCollectiveFarmland);
+
+    /**
+     * 修改农村集体耕地
+     *
+     * @param centerdataTFarmCollectiveFarmland 农村集体耕地
+     * @return 结果
+     */
+    public int updateCenterdataTFarmCollectiveFarmland(CenterdataTFarmCollectiveFarmland centerdataTFarmCollectiveFarmland);
+
+    /**
+     * 删除农村集体耕地
+     *
+     * @param id 农村集体耕地主键
+     * @return 结果
+     */
+    public int deleteCenterdataTFarmCollectiveFarmlandById(String id);
+
+    /**
+     * 批量删除农村集体耕地
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteCenterdataTFarmCollectiveFarmlandByIds(String[] ids);
+}

+ 61 - 0
src/main/java/com/sooka/sponest/data/digitalagriculture/service/ICenterdataTFarmCollectiveFarmlandService.java

@@ -0,0 +1,61 @@
+package com.sooka.sponest.data.digitalagriculture.service;
+
+import com.sooka.sponest.data.digitalagriculture.domain.CenterdataTFarmCollectiveFarmland;
+
+import java.util.List;
+
+/**
+ * 农村集体耕地Service接口
+ *
+ * @author 韩福成
+ * @date 2024-06-07
+ */
+public interface ICenterdataTFarmCollectiveFarmlandService {
+    /**
+     * 查询农村集体耕地
+     *
+     * @param id 农村集体耕地主键
+     * @return 农村集体耕地
+     */
+    public CenterdataTFarmCollectiveFarmland selectCenterdataTFarmCollectiveFarmlandById(String id);
+
+    /**
+     * 查询农村集体耕地列表
+     *
+     * @param centerdataTFarmCollectiveFarmland 农村集体耕地
+     * @return 农村集体耕地集合
+     */
+    public List<CenterdataTFarmCollectiveFarmland> selectCenterdataTFarmCollectiveFarmlandList(CenterdataTFarmCollectiveFarmland centerdataTFarmCollectiveFarmland);
+
+    /**
+     * 新增农村集体耕地
+     *
+     * @param centerdataTFarmCollectiveFarmland 农村集体耕地
+     * @return 结果
+     */
+    public int insertCenterdataTFarmCollectiveFarmland(CenterdataTFarmCollectiveFarmland centerdataTFarmCollectiveFarmland);
+
+    /**
+     * 修改农村集体耕地
+     *
+     * @param centerdataTFarmCollectiveFarmland 农村集体耕地
+     * @return 结果
+     */
+    public int updateCenterdataTFarmCollectiveFarmland(CenterdataTFarmCollectiveFarmland centerdataTFarmCollectiveFarmland);
+
+    /**
+     * 批量删除农村集体耕地
+     *
+     * @param ids 需要删除的农村集体耕地主键集合
+     * @return 结果
+     */
+    public int deleteCenterdataTFarmCollectiveFarmlandByIds(String[] ids);
+
+    /**
+     * 删除农村集体耕地信息
+     *
+     * @param id 农村集体耕地主键
+     * @return 结果
+     */
+    public int deleteCenterdataTFarmCollectiveFarmlandById(String id);
+}

+ 133 - 0
src/main/java/com/sooka/sponest/data/digitalagriculture/service/impl/CenterdataTFarmCollectiveFarmlandServiceImpl.java

@@ -0,0 +1,133 @@
+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.SecurityUtils;
+import com.sooka.sponest.data.base.service.impl.BaseServiceImpl;
+import com.sooka.sponest.data.digitalagriculture.domain.CenterdataTFarmCollectiveFarmland;
+import com.sooka.sponest.data.digitalagriculture.mapper.CenterdataTFarmCollectiveFarmlandMapper;
+import com.sooka.sponest.data.digitalagriculture.service.ICenterdataTFarmCollectiveFarmlandService;
+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;
+
+import java.util.List;
+
+/**
+ * 农村集体耕地Service业务层处理
+ *
+ * @author 韩福成
+ * @date 2024-06-07
+ */
+@Service
+public class CenterdataTFarmCollectiveFarmlandServiceImpl extends BaseServiceImpl implements ICenterdataTFarmCollectiveFarmlandService {
+    @Autowired
+    private CenterdataTFarmCollectiveFarmlandMapper centerdataTFarmCollectiveFarmlandMapper;
+
+    @Autowired
+    private ICenterdataTEquipmentCameraService centerdataTEquipmentCameraService;
+
+    /**
+     * 查询农村集体耕地
+     *
+     * @param id 农村集体耕地主键
+     * @return 农村集体耕地
+     */
+    @Override
+    public CenterdataTFarmCollectiveFarmland selectCenterdataTFarmCollectiveFarmlandById(String id) {
+        CenterdataTFarmCollectiveFarmland centerdataTFarmCollectiveFarmland = centerdataTFarmCollectiveFarmlandMapper.selectCenterdataTFarmCollectiveFarmlandById(id);
+        centerdataTFarmCollectiveFarmland.setDeviceList(centerdataTEquipmentCameraService.selectCenterdataTEquipmentCameraByBusinessId(id));
+        return centerdataTFarmCollectiveFarmland;
+    }
+
+    /**
+     * 查询农村集体耕地列表
+     *
+     * @param centerdataTFarmCollectiveFarmland 农村集体耕地
+     * @return 农村集体耕地
+     */
+    @Override
+    @DataScopeMutiDept(deptAlias = "d")
+    public List<CenterdataTFarmCollectiveFarmland> selectCenterdataTFarmCollectiveFarmlandList(CenterdataTFarmCollectiveFarmland centerdataTFarmCollectiveFarmland) {
+        setSookaDataBase(centerdataTFarmCollectiveFarmland);
+        return centerdataTFarmCollectiveFarmlandMapper.selectCenterdataTFarmCollectiveFarmlandList(centerdataTFarmCollectiveFarmland);
+    }
+
+    /**
+     * 新增农村集体耕地
+     *
+     * @param centerdataTFarmCollectiveFarmland 农村集体耕地
+     * @return 结果
+     */
+    @Override
+    public int insertCenterdataTFarmCollectiveFarmland(CenterdataTFarmCollectiveFarmland centerdataTFarmCollectiveFarmland) {
+        centerdataTFarmCollectiveFarmland.setId(IdUtils.simpleUUID());
+        centerdataTFarmCollectiveFarmland.setCreateBy(SecurityUtils.getUserId().toString());
+        centerdataTFarmCollectiveFarmland.setCreateName(SecurityUtils.getLoginUser().getSysUser().getNickName());
+        centerdataTFarmCollectiveFarmland.setCreateTime(DateUtils.getNowDate());
+        if (StringUtils.isNotEmpty(centerdataTFarmCollectiveFarmland.getDeviceList())) {
+            centerdataTFarmCollectiveFarmland.getDeviceList().forEach(item -> {
+                CenterdataTEquipmentCamera camera = new CenterdataTEquipmentCamera();
+                camera.setId(IdUtils.fastSimpleUUID());
+                camera.setCameraId(item);
+                camera.setType("centerdata_t_farm_collective_farmland");
+                camera.setBusinessId(centerdataTFarmCollectiveFarmland.getId());
+                centerdataTEquipmentCameraService.insertCenterdataTEquipmentCamera(camera);
+            });
+        }
+        return centerdataTFarmCollectiveFarmlandMapper.insertCenterdataTFarmCollectiveFarmland(centerdataTFarmCollectiveFarmland);
+    }
+
+    /**
+     * 修改农村集体耕地
+     *
+     * @param centerdataTFarmCollectiveFarmland 农村集体耕地
+     * @return 结果
+     */
+    @Override
+    public int updateCenterdataTFarmCollectiveFarmland(CenterdataTFarmCollectiveFarmland centerdataTFarmCollectiveFarmland) {
+        centerdataTFarmCollectiveFarmland.setUpdateBy(SecurityUtils.getLoginUser().getUserid());
+        centerdataTFarmCollectiveFarmland.setUpdateName(SecurityUtils.getLoginUser().getSysUser().getNickName());
+        centerdataTFarmCollectiveFarmland.setUpdateTime(DateUtils.getNowDate());
+        centerdataTEquipmentCameraService.deleteCenterdataTEquipmentCameraByBusinessId(centerdataTFarmCollectiveFarmland.getId());
+        if (StringUtils.isNotEmpty(centerdataTFarmCollectiveFarmland.getDeviceList())) {
+            centerdataTFarmCollectiveFarmland.getDeviceList().forEach(item -> {
+                CenterdataTEquipmentCamera camera = new CenterdataTEquipmentCamera();
+                camera.setId(IdUtils.fastSimpleUUID());
+                camera.setCameraId(item);
+                camera.setType("centerdata_t_farm_collective_farmland");
+                camera.setBusinessId(centerdataTFarmCollectiveFarmland.getId());
+                centerdataTEquipmentCameraService.insertCenterdataTEquipmentCamera(camera);
+            });
+        }
+        return centerdataTFarmCollectiveFarmlandMapper.updateCenterdataTFarmCollectiveFarmland(centerdataTFarmCollectiveFarmland);
+    }
+
+    /**
+     * 批量删除农村集体耕地
+     *
+     * @param ids 需要删除的农村集体耕地主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCenterdataTFarmCollectiveFarmlandByIds(String[] ids) {
+        for (String id : ids) {
+            centerdataTEquipmentCameraService.deleteCenterdataTEquipmentCameraByBusinessId(id);
+        }
+        return centerdataTFarmCollectiveFarmlandMapper.deleteCenterdataTFarmCollectiveFarmlandByIds(ids);
+    }
+
+    /**
+     * 删除农村集体耕地信息
+     *
+     * @param id 农村集体耕地主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCenterdataTFarmCollectiveFarmlandById(String id) {
+        return centerdataTFarmCollectiveFarmlandMapper.deleteCenterdataTFarmCollectiveFarmlandById(id);
+    }
+}

+ 132 - 0
src/main/resources/mapper/digitalagriculture/CenterdataTFarmCollectiveFarmlandMapper.xml

@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.sooka.sponest.data.digitalagriculture.mapper.CenterdataTFarmCollectiveFarmlandMapper">
+
+    <resultMap type="CenterdataTFarmCollectiveFarmland" id="CenterdataTFarmCollectiveFarmlandResult">
+        <result property="id"    column="id"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="deptName"    column="dept_name"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createName"    column="create_name"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateName"    column="update_name"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="longitude"    column="longitude"    />
+        <result property="latitude"    column="latitude"    />
+        <result property="name"    column="name"    />
+        <result property="contacts"    column="contacts"    />
+        <result property="phone"    column="phone"    />
+        <result property="address"    column="address"    />
+        <result property="limits"    column="limits"    />
+        <result property="license"    column="license"    />
+    </resultMap>
+
+    <sql id="selectCenterdataTFarmCollectiveFarmlandVo">
+        select a.id, a.dept_id, a.dept_name, a.create_by, a.create_name, a.create_time, a.update_by,a.update_name, a.update_time, a.longitude, a.latitude, a.name, a.contacts, a.phone, a.address, a.limits, a.license from centerdata_t_farm_collective_farmland a
+    </sql>
+
+    <select id="selectCenterdataTFarmCollectiveFarmlandList" parameterType="CenterdataTFarmCollectiveFarmland" resultMap="CenterdataTFarmCollectiveFarmlandResult">
+        <include refid="selectCenterdataTFarmCollectiveFarmlandVo"/>
+        left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
+        <where>
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="deptName != null  and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
+            <if test="createName != null  and createName != ''"> and create_name like concat('%', #{createName}, '%')</if>
+            <if test="updateName != null  and updateName != ''"> and update_name like concat('%', #{updateName}, '%')</if>
+            <if test="longitude != null  and longitude != ''"> and longitude = #{longitude}</if>
+            <if test="latitude != null  and latitude != ''"> and latitude = #{latitude}</if>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="contacts != null  and contacts != ''"> and contacts = #{contacts}</if>
+            <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
+            <if test="address != null  and address != ''"> and address = #{address}</if>
+            <if test="limits != null  and limits != ''"> and limits = #{limits}</if>
+            <if test="license != null  and license != ''"> and license = #{license}</if>
+            ${params.dataScope}
+        </where>
+        order by a.create_time  desc
+    </select>
+
+    <select id="selectCenterdataTFarmCollectiveFarmlandById" parameterType="String" resultMap="CenterdataTFarmCollectiveFarmlandResult">
+        <include refid="selectCenterdataTFarmCollectiveFarmlandVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertCenterdataTFarmCollectiveFarmland" parameterType="CenterdataTFarmCollectiveFarmland">
+        insert into centerdata_t_farm_collective_farmland
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="deptName != null">dept_name,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createName != null">create_name,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateName != null">update_name,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="longitude != null">longitude,</if>
+            <if test="latitude != null">latitude,</if>
+            <if test="name != null">name,</if>
+            <if test="contacts != null">contacts,</if>
+            <if test="phone != null">phone,</if>
+            <if test="address != null">address,</if>
+            <if test="limits != null">limits,</if>
+            <if test="license != null">license,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="deptName != null">#{deptName},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createName != null">#{createName},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateName != null">#{updateName},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="longitude != null">#{longitude},</if>
+            <if test="latitude != null">#{latitude},</if>
+            <if test="name != null">#{name},</if>
+            <if test="contacts != null">#{contacts},</if>
+            <if test="phone != null">#{phone},</if>
+            <if test="address != null">#{address},</if>
+            <if test="limits != null">#{limits},</if>
+            <if test="license != null">#{license},</if>
+         </trim>
+    </insert>
+
+    <update id="updateCenterdataTFarmCollectiveFarmland" parameterType="CenterdataTFarmCollectiveFarmland">
+        update centerdata_t_farm_collective_farmland
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="deptName != null">dept_name = #{deptName},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createName != null">create_name = #{createName},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateName != null">update_name = #{updateName},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="longitude != null">longitude = #{longitude},</if>
+            <if test="latitude != null">latitude = #{latitude},</if>
+            <if test="name != null">name = #{name},</if>
+            <if test="contacts != null">contacts = #{contacts},</if>
+            <if test="phone != null">phone = #{phone},</if>
+            <if test="address != null">address = #{address},</if>
+            <if test="limits != null">limits = #{limits},</if>
+            <if test="license != null">license = #{license},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCenterdataTFarmCollectiveFarmlandById" parameterType="String">
+        delete from centerdata_t_farm_collective_farmland where id = #{id}
+    </delete>
+
+    <delete id="deleteCenterdataTFarmCollectiveFarmlandByIds" parameterType="String">
+        delete from centerdata_t_farm_collective_farmland where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>