Parcourir la source

Merge remote-tracking branch 'origin/feature_zhujian' into feature_zhujian

Memory_LG il y a 11 mois
Parent
commit
ffc7f088d0

+ 53 - 0
data-ui/src/api/data/housingconstruction/inspect.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询钢瓶年检列表
+export function listInspect(query) {
+  return request({
+    url: '/center-data/inspect/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询钢瓶年检详细
+export function getInspect(id) {
+  return request({
+    url: '/center-data/inspect/' + id,
+    method: 'get'
+  })
+}
+
+// 新增钢瓶年检
+export function addInspect(data) {
+  return request({
+    url: '/center-data/inspect',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改钢瓶年检
+export function updateInspect(data) {
+  return request({
+    url: '/center-data/inspect',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除钢瓶年检
+export function delInspect(id) {
+  return request({
+    url: '/center-data/inspect/' + id,
+    method: 'delete'
+  })
+}
+
+//钢瓶列表
+export function getSteelcylinderList(query) {
+  return request({
+    url: '/center-data/steelcylinder/getSteelcylinderList',
+    method: 'get',
+    params: query
+  })
+}

+ 371 - 0
data-ui/src/views/data/housingconstruction/inspect/index.vue

@@ -0,0 +1,371 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" @submit.native.prevent>
+      <el-form-item label="钢瓶名称" prop="steelcylinderName">
+        <el-input
+          v-model="queryParams.steelcylinderName"
+          placeholder="请输入钢瓶名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item prop="deptId">
+        <template slot="label">
+          <span @click="changeQueryType" v-if="queryParams.deptName === 0">本级及下级</span>
+          <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"/>
+        <el-input v-model="queryParams.deptName" v-if="false"/>
+      </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="['data:inspect: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="['data:inspect: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="['data:inspect: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="['data:inspect:export']"
+        >导出
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="inspectList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="钢瓶名称" align="center" prop="steelcylinderName"/>
+      <el-table-column label="年检时间" align="center" prop="inspectTime"/>
+      <el-table-column label="年检状态" align="center" prop="state"/>
+      <el-table-column label="年检地点" align="center" prop="address"/>
+      <el-table-column label="下次年检时间" align="center" prop="nextInspectTime"/>
+      <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="['data:inspect:edit']"
+          >修改
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['data:inspect: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="600px" class="form-style">
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-form-item label="钢瓶" prop="steelcylinderId">
+          <el-select v-model="form.steelcylinderId" filterable placeholder="请选择钢瓶">
+            <el-option
+              v-for="dict in steelcylinderList"
+              :key="dict.id"
+              :label="dict.name"
+              :value="dict.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="年检时间" prop="inspectTime">
+          <el-date-picker clearable
+                          v-model="form.inspectTime"
+                          type="date"
+                          value-format="yyyy-MM-dd"
+                          placeholder="选择年检时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="年检状态" prop="state">
+          <el-input v-model="form.state" placeholder="请输入年检状态" maxlength="20"/>
+        </el-form-item>
+        <el-form-item label="年检地点" prop="address">
+          <el-input v-model="form.address" placeholder="请输入年检地点" maxlength="20"/>
+        </el-form-item>
+        <el-form-item label="下次年检时间" prop="nextInspectTime">
+          <el-date-picker clearable
+                          v-model="form.nextInspectTime"
+                          type="date"
+                          value-format="yyyy-MM-dd"
+                          placeholder="选择下次年检时间">
+          </el-date-picker>
+        </el-form-item>
+        <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-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {listInspect, getInspect, delInspect, addInspect, updateInspect,getSteelcylinderList} from "@/api/data/housingconstruction/inspect";
+import {treeselect} from "@/api/system/dept";
+import Treeselect from "@riophae/vue-treeselect";
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import {format_date} from "@/views/data/common/dateExport";
+
+export default {
+  name: "Inspect",
+  components: {Treeselect},
+  data() {
+    return {
+      deptOptions: undefined,
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 钢瓶年检表格数据
+      inspectList: [],
+      steelcylinderList:[],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        createName: null,
+        updateName: null,
+        deptId: null,
+        deptName: 0,
+        steelcylinderId: null,
+        steelcylinderName: null,
+        inspectTime: null,
+        state: null,
+        address: null,
+        nextInspectTime: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        steelcylinderId: [
+          {required: true, message: "钢瓶不能为空", trigger: "blur"},
+        ],
+        deptId: [
+          {required: true, message: "所属部门不能为空", trigger: "change"},
+        ],
+        state: [
+          {required: true, message: "年检状态不能为空", trigger: "change"},
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getTreeselect();
+    this.getSteelcylinderList();
+  },
+  methods: {
+    //钢瓶列表
+    getSteelcylinderList() {
+      getSteelcylinderList().then(response => {
+        this.steelcylinderList = response.data;
+      });
+    },
+    /** 查询部门下拉树结构 */
+    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;
+      listInspect(this.queryParams).then(response => {
+        this.inspectList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    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,
+        steelcylinderId: null,
+        steelcylinderName: null,
+        inspectTime: null,
+        state: null,
+        address: null,
+        nextInspectTime: 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();
+      this.open = true;
+      this.title = "添加钢瓶年检";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getInspect(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改钢瓶年检";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.form.steelcylinderName = this.steelcylinderList.filter((item) => {
+            return this.form.steelcylinderId == item.id;
+          })[0].name;
+          if (this.form.id != null) {
+            updateInspect(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addInspect(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 delInspect(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('center-data/inspect/export', {
+        ...this.queryParams
+      }, `钢瓶年检_${format_date(new Date())}.xlsx`)
+    },
+    // 点击按钮修改是否只查询本级部门用户
+    changeQueryType() {
+      this.queryParams.deptName = this.queryParams.deptName === 0 ? 1 : 0;
+    }
+  }
+};
+</script>

+ 91 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/controller/CenterdataTHousingconstructionInspectController.java

@@ -0,0 +1,91 @@
+package com.sooka.sponest.data.housingconstruction.controller;
+
+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.housingconstruction.domain.CenterdataTHousingconstructionInspect;
+import com.sooka.sponest.data.housingconstruction.service.ICenterdataTHousingconstructionInspectService;
+import com.sooka.sponest.data.utils.ExcelUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 钢瓶年检Controller
+ *
+ * @author 韩福成
+ * @date 2024-07-30
+ */
+@RestController
+@RequestMapping("/inspect")
+public class CenterdataTHousingconstructionInspectController extends BaseController {
+    @Autowired
+    private ICenterdataTHousingconstructionInspectService centerdataTHousingconstructionInspectService;
+
+    /**
+     * 查询钢瓶年检列表
+     */
+    @RequiresPermissions("data:inspect:list")
+    @GetMapping("/list")
+    public TableDataInfo list(CenterdataTHousingconstructionInspect centerdataTHousingconstructionInspect) {
+        startPage();
+        List<CenterdataTHousingconstructionInspect> list = centerdataTHousingconstructionInspectService.selectCenterdataTHousingconstructionInspectList(centerdataTHousingconstructionInspect);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出钢瓶年检列表
+     */
+    @RequiresPermissions("data:inspect:export")
+    @Log(title = "钢瓶年检", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, CenterdataTHousingconstructionInspect centerdataTHousingconstructionInspect) {
+        List<CenterdataTHousingconstructionInspect> list = centerdataTHousingconstructionInspectService.selectCenterdataTHousingconstructionInspectList(centerdataTHousingconstructionInspect);
+        ExcelUtil<CenterdataTHousingconstructionInspect> util = new ExcelUtil<CenterdataTHousingconstructionInspect>(CenterdataTHousingconstructionInspect.class);
+        util.exportExcel(response, list, "钢瓶年检数据");
+    }
+
+    /**
+     * 获取钢瓶年检详细信息
+     */
+    @RequiresPermissions("data:inspect:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id) {
+        return AjaxResult.success(centerdataTHousingconstructionInspectService.selectCenterdataTHousingconstructionInspectById(id));
+    }
+
+    /**
+     * 新增钢瓶年检
+     */
+    @RequiresPermissions("data:inspect:add")
+    @Log(title = "钢瓶年检", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CenterdataTHousingconstructionInspect centerdataTHousingconstructionInspect) {
+        return toAjax(centerdataTHousingconstructionInspectService.insertCenterdataTHousingconstructionInspect(centerdataTHousingconstructionInspect));
+    }
+
+    /**
+     * 修改钢瓶年检
+     */
+    @RequiresPermissions("data:inspect:edit")
+    @Log(title = "钢瓶年检", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CenterdataTHousingconstructionInspect centerdataTHousingconstructionInspect) {
+        return toAjax(centerdataTHousingconstructionInspectService.updateCenterdataTHousingconstructionInspect(centerdataTHousingconstructionInspect));
+    }
+
+    /**
+     * 删除钢瓶年检
+     */
+    @RequiresPermissions("data:inspect:remove")
+    @Log(title = "钢瓶年检", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids) {
+        return toAjax(centerdataTHousingconstructionInspectService.deleteCenterdataTHousingconstructionInspectByIds(ids));
+    }
+}

+ 166 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/domain/CenterdataTHousingconstructionInspect.java

@@ -0,0 +1,166 @@
+package com.sooka.sponest.data.housingconstruction.domain;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.sooka.sponest.data.base.domain.BaseBusinessEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.core.annotation.Excel;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+
+/**
+ * 钢瓶年检对象 centerdata_t_housingconstruction_inspect
+ *
+ * @author 韩福成
+ * @date 2024-07-30
+ */
+public class CenterdataTHousingconstructionInspect extends BaseBusinessEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键id
+     */
+    private String id;
+
+    /**
+     * 部门id
+     */
+    private Long deptId;
+
+    /**
+     * 部门名称
+     */
+    @Excel(name = "部门名称")
+    private String deptName;
+
+    /**
+     * 钢瓶id
+     */
+    private String steelcylinderId;
+
+    /**
+     * 钢瓶名称
+     */
+    @Excel(name = "钢瓶名称")
+    private String steelcylinderName;
+
+    /**
+     * 年检时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "年检时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date inspectTime;
+
+    /**
+     * 年检状态
+     */
+    @Excel(name = "年检状态")
+    private String state;
+
+    /**
+     * 年检地点
+     */
+    @Excel(name = "年检地点")
+    private String address;
+
+    /**
+     * 下次年检时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "下次年检时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date nextInspectTime;
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setSteelcylinderId(String steelcylinderId) {
+        this.steelcylinderId = steelcylinderId;
+    }
+
+    public String getSteelcylinderId() {
+        return steelcylinderId;
+    }
+
+    public void setSteelcylinderName(String steelcylinderName) {
+        this.steelcylinderName = steelcylinderName;
+    }
+
+    public String getSteelcylinderName() {
+        return steelcylinderName;
+    }
+
+    public void setInspectTime(Date inspectTime) {
+        this.inspectTime = inspectTime;
+    }
+
+    public Date getInspectTime() {
+        return inspectTime;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setNextInspectTime(Date nextInspectTime) {
+        this.nextInspectTime = nextInspectTime;
+    }
+
+    public Date getNextInspectTime() {
+        return nextInspectTime;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("createBy", getCreateBy())
+                .append("createName", getCreateName())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateName", getUpdateName())
+                .append("updateTime", getUpdateTime())
+                .append("deptId", getDeptId())
+                .append("deptName", getDeptName())
+                .append("steelcylinderId", getSteelcylinderId())
+                .append("steelcylinderName", getSteelcylinderName())
+                .append("inspectTime", getInspectTime())
+                .append("state", getState())
+                .append("address", getAddress())
+                .append("nextInspectTime", getNextInspectTime())
+                .toString();
+    }
+}

+ 62 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/mapper/CenterdataTHousingconstructionInspectMapper.java

@@ -0,0 +1,62 @@
+package com.sooka.sponest.data.housingconstruction.mapper;
+
+import com.sooka.sponest.data.housingconstruction.domain.CenterdataTHousingconstructionInspect;
+
+import java.util.List;
+
+
+/**
+ * 钢瓶年检Mapper接口
+ *
+ * @author 韩福成
+ * @date 2024-07-30
+ */
+public interface CenterdataTHousingconstructionInspectMapper {
+    /**
+     * 查询钢瓶年检
+     *
+     * @param id 钢瓶年检主键
+     * @return 钢瓶年检
+     */
+    public CenterdataTHousingconstructionInspect selectCenterdataTHousingconstructionInspectById(String id);
+
+    /**
+     * 查询钢瓶年检列表
+     *
+     * @param centerdataTHousingconstructionInspect 钢瓶年检
+     * @return 钢瓶年检集合
+     */
+    public List<CenterdataTHousingconstructionInspect> selectCenterdataTHousingconstructionInspectList(CenterdataTHousingconstructionInspect centerdataTHousingconstructionInspect);
+
+    /**
+     * 新增钢瓶年检
+     *
+     * @param centerdataTHousingconstructionInspect 钢瓶年检
+     * @return 结果
+     */
+    public int insertCenterdataTHousingconstructionInspect(CenterdataTHousingconstructionInspect centerdataTHousingconstructionInspect);
+
+    /**
+     * 修改钢瓶年检
+     *
+     * @param centerdataTHousingconstructionInspect 钢瓶年检
+     * @return 结果
+     */
+    public int updateCenterdataTHousingconstructionInspect(CenterdataTHousingconstructionInspect centerdataTHousingconstructionInspect);
+
+    /**
+     * 删除钢瓶年检
+     *
+     * @param id 钢瓶年检主键
+     * @return 结果
+     */
+    public int deleteCenterdataTHousingconstructionInspectById(String id);
+
+    /**
+     * 批量删除钢瓶年检
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteCenterdataTHousingconstructionInspectByIds(String[] ids);
+}

+ 62 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/service/ICenterdataTHousingconstructionInspectService.java

@@ -0,0 +1,62 @@
+package com.sooka.sponest.data.housingconstruction.service;
+
+
+import com.sooka.sponest.data.housingconstruction.domain.CenterdataTHousingconstructionInspect;
+
+import java.util.List;
+
+/**
+ * 钢瓶年检Service接口
+ *
+ * @author 韩福成
+ * @date 2024-07-30
+ */
+public interface ICenterdataTHousingconstructionInspectService {
+    /**
+     * 查询钢瓶年检
+     *
+     * @param id 钢瓶年检主键
+     * @return 钢瓶年检
+     */
+    public CenterdataTHousingconstructionInspect selectCenterdataTHousingconstructionInspectById(String id);
+
+    /**
+     * 查询钢瓶年检列表
+     *
+     * @param centerdataTHousingconstructionInspect 钢瓶年检
+     * @return 钢瓶年检集合
+     */
+    public List<CenterdataTHousingconstructionInspect> selectCenterdataTHousingconstructionInspectList(CenterdataTHousingconstructionInspect centerdataTHousingconstructionInspect);
+
+    /**
+     * 新增钢瓶年检
+     *
+     * @param centerdataTHousingconstructionInspect 钢瓶年检
+     * @return 结果
+     */
+    public int insertCenterdataTHousingconstructionInspect(CenterdataTHousingconstructionInspect centerdataTHousingconstructionInspect);
+
+    /**
+     * 修改钢瓶年检
+     *
+     * @param centerdataTHousingconstructionInspect 钢瓶年检
+     * @return 结果
+     */
+    public int updateCenterdataTHousingconstructionInspect(CenterdataTHousingconstructionInspect centerdataTHousingconstructionInspect);
+
+    /**
+     * 批量删除钢瓶年检
+     *
+     * @param ids 需要删除的钢瓶年检主键集合
+     * @return 结果
+     */
+    public int deleteCenterdataTHousingconstructionInspectByIds(String[] ids);
+
+    /**
+     * 删除钢瓶年检信息
+     *
+     * @param id 钢瓶年检主键
+     * @return 结果
+     */
+    public int deleteCenterdataTHousingconstructionInspectById(String id);
+}

+ 101 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/service/impl/CenterdataTHousingconstructionInspectServiceImpl.java

@@ -0,0 +1,101 @@
+package com.sooka.sponest.data.housingconstruction.service.impl;
+
+import java.util.List;
+
+import com.ruoyi.common.core.utils.DateUtils;
+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.housingconstruction.domain.CenterdataTHousingconstructionInspect;
+import com.sooka.sponest.data.housingconstruction.mapper.CenterdataTHousingconstructionInspectMapper;
+import com.sooka.sponest.data.housingconstruction.service.ICenterdataTHousingconstructionInspectService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 钢瓶年检Service业务层处理
+ *
+ * @author 韩福成
+ * @date 2024-07-30
+ */
+@Service
+public class CenterdataTHousingconstructionInspectServiceImpl extends BaseServiceImpl implements ICenterdataTHousingconstructionInspectService {
+    @Autowired
+    private CenterdataTHousingconstructionInspectMapper centerdataTHousingconstructionInspectMapper;
+
+    /**
+     * 查询钢瓶年检
+     *
+     * @param id 钢瓶年检主键
+     * @return 钢瓶年检
+     */
+    @Override
+    public CenterdataTHousingconstructionInspect selectCenterdataTHousingconstructionInspectById(String id) {
+        return centerdataTHousingconstructionInspectMapper.selectCenterdataTHousingconstructionInspectById(id);
+    }
+
+    /**
+     * 查询钢瓶年检列表
+     *
+     * @param centerdataTHousingconstructionInspect 钢瓶年检
+     * @return 钢瓶年检
+     */
+    @DataScopeMutiDept(deptAlias = "d")
+    @Override
+    public List<CenterdataTHousingconstructionInspect> selectCenterdataTHousingconstructionInspectList(CenterdataTHousingconstructionInspect centerdataTHousingconstructionInspect) {
+        setSookaDataBase(centerdataTHousingconstructionInspect);
+        return centerdataTHousingconstructionInspectMapper.selectCenterdataTHousingconstructionInspectList(centerdataTHousingconstructionInspect);
+    }
+
+    /**
+     * 新增钢瓶年检
+     *
+     * @param centerdataTHousingconstructionInspect 钢瓶年检
+     * @return 结果
+     */
+    @Override
+    public int insertCenterdataTHousingconstructionInspect(CenterdataTHousingconstructionInspect centerdataTHousingconstructionInspect) {
+        centerdataTHousingconstructionInspect.setId(IdUtils.fastSimpleUUID());
+        centerdataTHousingconstructionInspect.setCreateBy(SecurityUtils.getUserId().toString());
+        centerdataTHousingconstructionInspect.setCreateName(SecurityUtils.getLoginUser().getSysUser().getNickName());
+        centerdataTHousingconstructionInspect.setCreateTime(DateUtils.getNowDate());
+        return centerdataTHousingconstructionInspectMapper.insertCenterdataTHousingconstructionInspect(centerdataTHousingconstructionInspect);
+    }
+
+    /**
+     * 修改钢瓶年检
+     *
+     * @param centerdataTHousingconstructionInspect 钢瓶年检
+     * @return 结果
+     */
+    @Override
+    public int updateCenterdataTHousingconstructionInspect(CenterdataTHousingconstructionInspect centerdataTHousingconstructionInspect) {
+        centerdataTHousingconstructionInspect.setUpdateBy(SecurityUtils.getUserId());
+        centerdataTHousingconstructionInspect.setUpdateName(SecurityUtils.getLoginUser().getSysUser().getNickName());
+        centerdataTHousingconstructionInspect.setUpdateTime(DateUtils.getNowDate());
+        return centerdataTHousingconstructionInspectMapper.updateCenterdataTHousingconstructionInspect(centerdataTHousingconstructionInspect);
+    }
+
+    /**
+     * 批量删除钢瓶年检
+     *
+     * @param ids 需要删除的钢瓶年检主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCenterdataTHousingconstructionInspectByIds(String[] ids) {
+        return centerdataTHousingconstructionInspectMapper.deleteCenterdataTHousingconstructionInspectByIds(ids);
+    }
+
+    /**
+     * 删除钢瓶年检信息
+     *
+     * @param id 钢瓶年检主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCenterdataTHousingconstructionInspectById(String id) {
+        return centerdataTHousingconstructionInspectMapper.deleteCenterdataTHousingconstructionInspectById(id);
+    }
+}

+ 128 - 0
src/main/resources/mapper/housingconstruction/CenterdataTHousingconstructionInspectMapper.xml

@@ -0,0 +1,128 @@
+<?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.housingconstruction.mapper.CenterdataTHousingconstructionInspectMapper">
+
+    <resultMap type="CenterdataTHousingconstructionInspect" id="CenterdataTHousingconstructionInspectResult">
+        <result property="id"    column="id"    />
+        <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="deptId"    column="dept_id"    />
+        <result property="deptName"    column="dept_name"    />
+        <result property="steelcylinderId"    column="steelcylinder_id"    />
+        <result property="steelcylinderName"    column="steelcylinder_name"    />
+        <result property="inspectTime"    column="inspect_time"    />
+        <result property="state"    column="state"    />
+        <result property="address"    column="address"    />
+        <result property="nextInspectTime"    column="next_inspect_time"    />
+    </resultMap>
+
+    <sql id="selectCenterdataTHousingconstructionInspectVo">
+        select a.id, a.create_by, a.create_name, a.create_time, a.update_by, a.update_name, a.update_time, a.dept_id, a.dept_name, a.steelcylinder_id,
+               a.steelcylinder_name, a.inspect_time, a.state, a.address, a.next_inspect_time from centerdata_t_housingconstruction_inspect a
+    </sql>
+
+    <select id="selectCenterdataTHousingconstructionInspectList" parameterType="CenterdataTHousingconstructionInspect" resultMap="CenterdataTHousingconstructionInspectResult">
+        <include refid="selectCenterdataTHousingconstructionInspectVo"/>
+        left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
+        <where>
+            <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="steelcylinderId != null  and steelcylinderId != ''"> and steelcylinder_id = #{steelcylinderId}</if>
+            <if test="steelcylinderName != null  and steelcylinderName != ''"> and steelcylinder_name like concat('%', #{steelcylinderName}, '%')</if>
+            <if test="inspectTime != null "> and inspect_time = #{inspectTime}</if>
+            <if test="state != null  and state != ''"> and state = #{state}</if>
+            <if test="address != null  and address != ''"> and address = #{address}</if>
+            <if test="nextInspectTime != null "> and next_inspect_time = #{nextInspectTime}</if>
+            <if test="deptId != null">
+                <choose>
+                    <when test="deptName != null and deptName == 0">
+                        and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
+                    </when>
+                    <otherwise>and d.dept_id = #{deptId}</otherwise>
+                </choose>
+            </if>
+            ${params.dataScope}
+        </where>
+    </select>
+
+    <select id="selectCenterdataTHousingconstructionInspectById" parameterType="String" resultMap="CenterdataTHousingconstructionInspectResult">
+        <include refid="selectCenterdataTHousingconstructionInspectVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertCenterdataTHousingconstructionInspect" parameterType="CenterdataTHousingconstructionInspect">
+        insert into centerdata_t_housingconstruction_inspect
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != ''">id,</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="deptId != null">dept_id,</if>
+            <if test="deptName != null">dept_name,</if>
+            <if test="steelcylinderId != null">steelcylinder_id,</if>
+            <if test="steelcylinderName != null">steelcylinder_name,</if>
+            <if test="inspectTime != null">inspect_time,</if>
+            <if test="state != null">state,</if>
+            <if test="address != null">address,</if>
+            <if test="nextInspectTime != null">next_inspect_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != ''">#{id},</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="deptId != null">#{deptId},</if>
+            <if test="deptName != null">#{deptName},</if>
+            <if test="steelcylinderId != null">#{steelcylinderId},</if>
+            <if test="steelcylinderName != null">#{steelcylinderName},</if>
+            <if test="inspectTime != null">#{inspectTime},</if>
+            <if test="state != null">#{state},</if>
+            <if test="address != null">#{address},</if>
+            <if test="nextInspectTime != null">#{nextInspectTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateCenterdataTHousingconstructionInspect" parameterType="CenterdataTHousingconstructionInspect">
+        update centerdata_t_housingconstruction_inspect
+        <trim prefix="SET" suffixOverrides=",">
+            <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="deptId != null">dept_id = #{deptId},</if>
+            <if test="deptName != null">dept_name = #{deptName},</if>
+            <if test="steelcylinderId != null">steelcylinder_id = #{steelcylinderId},</if>
+            <if test="steelcylinderName != null">steelcylinder_name = #{steelcylinderName},</if>
+            <if test="inspectTime != null">inspect_time = #{inspectTime},</if>
+            <if test="state != null">state = #{state},</if>
+            <if test="address != null">address = #{address},</if>
+            <if test="nextInspectTime != null">next_inspect_time = #{nextInspectTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCenterdataTHousingconstructionInspectById" parameterType="String">
+        delete from centerdata_t_housingconstruction_inspect where id = #{id}
+    </delete>
+
+    <delete id="deleteCenterdataTHousingconstructionInspectByIds" parameterType="String">
+        delete from centerdata_t_housingconstruction_inspect where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>