parent
ec8e6de5cf
commit
9f455a44e1
@ -0,0 +1,104 @@
|
|||||||
|
package com.ruoyi.szxc.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.szxc.domain.SzxcJmTag;
|
||||||
|
import com.ruoyi.szxc.service.ISzxcJmTagService;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 居民标签关联Controller
|
||||||
|
*
|
||||||
|
* @author hs
|
||||||
|
* @date 2024-03-21
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/szxc/jmtag")
|
||||||
|
public class SzxcJmTagController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISzxcJmTagService szxcJmTagService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询居民标签关联列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('szxc:jmtag:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SzxcJmTag szxcJmTag)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SzxcJmTag> list = szxcJmTagService.selectSzxcJmTagList(szxcJmTag);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出居民标签关联列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('szxc:jmtag:export')")
|
||||||
|
@Log(title = "居民标签关联", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, SzxcJmTag szxcJmTag)
|
||||||
|
{
|
||||||
|
List<SzxcJmTag> list = szxcJmTagService.selectSzxcJmTagList(szxcJmTag);
|
||||||
|
ExcelUtil<SzxcJmTag> util = new ExcelUtil<SzxcJmTag>(SzxcJmTag.class);
|
||||||
|
util.exportExcel(response, list, "居民标签关联数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取居民标签关联详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('szxc:jmtag:query')")
|
||||||
|
@GetMapping(value = "/{jmId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("jmId") Long jmId)
|
||||||
|
{
|
||||||
|
return success(szxcJmTagService.selectSzxcJmTagByJmId(jmId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增居民标签关联
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('szxc:jmtag:add')")
|
||||||
|
@Log(title = "居民标签关联", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody SzxcJmTag szxcJmTag)
|
||||||
|
{
|
||||||
|
return toAjax(szxcJmTagService.insertSzxcJmTag(szxcJmTag));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改居民标签关联
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('szxc:jmtag:edit')")
|
||||||
|
@Log(title = "居民标签关联", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody SzxcJmTag szxcJmTag)
|
||||||
|
{
|
||||||
|
return toAjax(szxcJmTagService.updateSzxcJmTag(szxcJmTag));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除居民标签关联
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('szxc:jmtag:remove')")
|
||||||
|
@Log(title = "居民标签关联", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{jmIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] jmIds)
|
||||||
|
{
|
||||||
|
return toAjax(szxcJmTagService.deleteSzxcJmTagByJmIds(jmIds));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
package com.ruoyi.szxc.service;
|
||||||
|
|
||||||
|
import com.ruoyi.szxc.domain.SzxcJmTag;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 居民标签关联Service接口
|
||||||
|
*
|
||||||
|
* @author hs
|
||||||
|
* @date 2024-03-21
|
||||||
|
*/
|
||||||
|
public interface ISzxcJmTagService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询居民标签关联
|
||||||
|
*
|
||||||
|
* @param jmId 居民标签关联主键
|
||||||
|
* @return 居民标签关联
|
||||||
|
*/
|
||||||
|
public SzxcJmTag selectSzxcJmTagByJmId(Long jmId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询居民标签关联列表
|
||||||
|
*
|
||||||
|
* @param szxcJmTag 居民标签关联
|
||||||
|
* @return 居民标签关联集合
|
||||||
|
*/
|
||||||
|
public List<SzxcJmTag> selectSzxcJmTagList(SzxcJmTag szxcJmTag);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增居民标签关联
|
||||||
|
*
|
||||||
|
* @param szxcJmTag 居民标签关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertSzxcJmTag(SzxcJmTag szxcJmTag);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改居民标签关联
|
||||||
|
*
|
||||||
|
* @param szxcJmTag 居民标签关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateSzxcJmTag(SzxcJmTag szxcJmTag);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除居民标签关联
|
||||||
|
*
|
||||||
|
* @param jmIds 需要删除的居民标签关联主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSzxcJmTagByJmIds(Long[] jmIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除居民标签关联信息
|
||||||
|
*
|
||||||
|
* @param jmId 居民标签关联主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSzxcJmTagByJmId(Long jmId);
|
||||||
|
}
|
||||||
@ -0,0 +1,94 @@
|
|||||||
|
package com.ruoyi.szxc.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.szxc.domain.SzxcJmTag;
|
||||||
|
import com.ruoyi.szxc.mapper.SzxcJmTagMapper;
|
||||||
|
import com.ruoyi.szxc.service.ISzxcJmTagService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 居民标签关联Service业务层处理
|
||||||
|
*
|
||||||
|
* @author hs
|
||||||
|
* @date 2024-03-21
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SzxcJmTagServiceImpl implements ISzxcJmTagService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private SzxcJmTagMapper szxcJmTagMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询居民标签关联
|
||||||
|
*
|
||||||
|
* @param jmId 居民标签关联主键
|
||||||
|
* @return 居民标签关联
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SzxcJmTag selectSzxcJmTagByJmId(Long jmId)
|
||||||
|
{
|
||||||
|
return szxcJmTagMapper.selectSzxcJmTagByJmId(jmId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询居民标签关联列表
|
||||||
|
*
|
||||||
|
* @param szxcJmTag 居民标签关联
|
||||||
|
* @return 居民标签关联
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SzxcJmTag> selectSzxcJmTagList(SzxcJmTag szxcJmTag)
|
||||||
|
{
|
||||||
|
return szxcJmTagMapper.selectSzxcJmTagList(szxcJmTag);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增居民标签关联
|
||||||
|
*
|
||||||
|
* @param szxcJmTag 居民标签关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertSzxcJmTag(SzxcJmTag szxcJmTag)
|
||||||
|
{
|
||||||
|
return szxcJmTagMapper.insertSzxcJmTag(szxcJmTag);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改居民标签关联
|
||||||
|
*
|
||||||
|
* @param szxcJmTag 居民标签关联
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateSzxcJmTag(SzxcJmTag szxcJmTag)
|
||||||
|
{
|
||||||
|
return szxcJmTagMapper.updateSzxcJmTag(szxcJmTag);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除居民标签关联
|
||||||
|
*
|
||||||
|
* @param jmIds 需要删除的居民标签关联主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteSzxcJmTagByJmIds(Long[] jmIds)
|
||||||
|
{
|
||||||
|
return szxcJmTagMapper.deleteSzxcJmTagByJmIds(jmIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除居民标签关联信息
|
||||||
|
*
|
||||||
|
* @param jmId 居民标签关联主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteSzxcJmTagByJmId(Long jmId)
|
||||||
|
{
|
||||||
|
return szxcJmTagMapper.deleteSzxcJmTagByJmId(jmId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询居民标签关联列表
|
||||||
|
export function listJmtag(query) {
|
||||||
|
return request({
|
||||||
|
url: '/szxc/jmtag/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询居民标签关联详细
|
||||||
|
export function getJmtag(jmId) {
|
||||||
|
return request({
|
||||||
|
url: '/szxc/jmtag/' + jmId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增居民标签关联
|
||||||
|
export function addJmtag(data) {
|
||||||
|
return request({
|
||||||
|
url: '/szxc/jmtag',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改居民标签关联
|
||||||
|
export function updateJmtag(data) {
|
||||||
|
return request({
|
||||||
|
url: '/szxc/jmtag',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除居民标签关联
|
||||||
|
export function delJmtag(jmId) {
|
||||||
|
return request({
|
||||||
|
url: '/szxc/jmtag/' + jmId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -0,0 +1,233 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<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="['szxc:jmtag: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="['szxc:jmtag: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="['szxc:jmtag: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="['szxc:jmtag:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="jmtagList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="居民id" align="center" prop="jmId" />
|
||||||
|
<el-table-column label="标签id" align="center" prop="tagId" />
|
||||||
|
<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="['szxc:jmtag:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['szxc:jmtag: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="500px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
</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 { listJmtag, getJmtag, delJmtag, addJmtag, updateJmtag } from "@/api/szxc/jmtag";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Jmtag",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 居民标签关联表格数据
|
||||||
|
jmtagList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询居民标签关联列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listJmtag(this.queryParams).then(response => {
|
||||||
|
this.jmtagList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
jmId: null,
|
||||||
|
tagId: 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.jmId)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加居民标签关联";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const jmId = row.jmId || this.ids
|
||||||
|
getJmtag(jmId).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改居民标签关联";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.jmId != null) {
|
||||||
|
updateJmtag(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addJmtag(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const jmIds = row.jmId || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除居民标签关联编号为"' + jmIds + '"的数据项?').then(function() {
|
||||||
|
return delJmtag(jmIds);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('szxc/jmtag/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `jmtag_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
Loading…
Reference in new issue