已修改88个文件
已添加4个文件
已重命名1个文件
| | |
| | | <td><img src="https://oscimg.oschina.net/oscnet/1cbcf0e6f257c7d3a063c0e3f2ff989e4b3.jpg"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/97fcdc766fa04c03722aef4b3d77f71e8d2.jpg"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/642858372da91853c39e2d4746f036ea171.jpg"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/707825ad3f29de74a8d6d02fbd73ad631ea.jpg"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/46be40cc6f01aa300eed53a19b5012bf484.jpg"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/8678d5204148e2610c9d02822274a961dcf.jpg"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/feb2b25a08bf9dd121b8f51274ae935ead6.jpg"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/4284796d4cea240d181b8f2201813dda710.jpg"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/3ecfac87a049f7fe36abbcaafb2c40d36cf.jpg"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/71c2d48905221a09a728df4aff4160b8607.jpg"/></td> |
| | |
| | | <td><img src="https://oscimg.oschina.net/oscnet/644e78da53c2e92a95dfda4f76e6d117c4b.jpg"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/c162686bf3a39e3cd6b4fd6b5919f515ebf.jpg"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/412fb931faa8b3e3de6f9cbbc5b7979cf36.jpg"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/fdea1d8bb8625c27bf964176a2c8ebc6945.jpg"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/509d2708cfd762b6e6339364cac1cc1970c.jpg"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/b6115bc8c31de52951982e509930b20684a.jpg"/></td> |
| | |
| | | {
|
| | | "name": "ruoyi",
|
| | | "version": "1.0.0",
|
| | | "version": "1.1.0",
|
| | | "description": "è¥ä¾ç®¡çç³»ç»",
|
| | | "author": "è¥ä¾",
|
| | | "license": "MIT",
|
| | |
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | }
|
| | |
|
| | | // å é¤ç»å½æ¥å¿
|
| | | export function delLogininfor(infoId) {
|
| | | return request({
|
| | | url: '/monitor/logininfor/' + infoId,
|
| | | method: 'delete'
|
| | | })
|
| | | }
|
| | |
|
| | | // æ¸
空ç»å½æ¥å¿
|
| | | export function cleanLogininfor() {
|
| | | return request({
|
| | | url: '/monitor/logininfor/clean',
|
| | | method: 'delete'
|
| | | })
|
| | | }
|
| | |
|
| | | // 导åºç»å½æ¥å¿
|
| | | export function exportLogininfor(query) {
|
| | | return request({
|
| | | url: '/monitor/logininfor/export',
|
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | } |
| | |
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | }
|
| | |
|
| | | // å 餿使¥å¿
|
| | | export function delOperlog(operId) {
|
| | | return request({
|
| | | url: '/monitor/operlog/' + operId,
|
| | | method: 'delete'
|
| | | })
|
| | | }
|
| | |
|
| | | // æ¸
空æä½æ¥å¿
|
| | | export function cleanOperlog() {
|
| | | return request({
|
| | | url: '/monitor/operlog/clean',
|
| | | method: 'delete'
|
| | | })
|
| | | }
|
| | |
|
| | | // å¯¼åºæä½æ¥å¿
|
| | | export function exportOperlog(query) {
|
| | | return request({
|
| | | url: '/monitor/operlog/export',
|
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | } |
| | |
| | | url: '/system/config/' + configId,
|
| | | method: 'delete'
|
| | | })
|
| | | }
|
| | |
|
| | | // 导åºåæ°
|
| | | export function exportConfig(query) {
|
| | | return request({
|
| | | url: '/system/config/export',
|
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | } |
| | |
| | | url: '/system/dict/data/' + dictCode,
|
| | | method: 'delete'
|
| | | })
|
| | | }
|
| | |
|
| | | // 导åºåå
¸æ°æ®
|
| | | export function exportData(query) {
|
| | | return request({
|
| | | url: '/system/dict/data/export',
|
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | } |
| | |
| | | method: 'delete'
|
| | | })
|
| | | }
|
| | |
|
| | | // 导åºåå
¸ç±»å
|
| | | export function exportType(query) {
|
| | | return request({
|
| | | url: '/system/dict/type/export',
|
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | }
|
| | |
| | | url: '/system/post/' + postId,
|
| | | method: 'delete'
|
| | | })
|
| | | }
|
| | |
|
| | | // 导åºå²ä½
|
| | | export function exportPost(query) {
|
| | | return request({
|
| | | url: '/system/post/export',
|
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | } |
| | |
| | | url: '/system/role/' + roleId,
|
| | | method: 'delete'
|
| | | })
|
| | | }
|
| | |
|
| | | // 导åºè§è²
|
| | | export function exportRole(query) {
|
| | | return request({
|
| | | url: '/system/role/export',
|
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | } |
| | |
| | | })
|
| | | }
|
| | |
|
| | | // 导åºç¨æ·
|
| | | export function exportUser(query) {
|
| | | return request({
|
| | | url: '/system/user/export',
|
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | }
|
| | |
|
| | | // ç¨æ·å¯ç éç½®
|
| | | export function resetUserPwd(userId, password) {
|
| | | const data = {
|
| | |
| | | method: 'post',
|
| | | data: data
|
| | | })
|
| | | } |
| | | }
|
| | |
| | | * Copyright (c) 2019 ruoyi
|
| | | */
|
| | |
|
| | | /** åºç¡éç¨ **/
|
| | | .pt5 {
|
| | | padding-top: 5px;
|
| | | }
|
| | | .pr5 {
|
| | | padding-right: 5px;
|
| | | }
|
| | | .pb5 {
|
| | | padding-bottom: 5px;
|
| | | }
|
| | | .mt5 {
|
| | | margin-top: 5px;
|
| | | }
|
| | | .mr5 {
|
| | | margin-right: 5px;
|
| | | }
|
| | | .mb5 {
|
| | | margin-bottom: 5px;
|
| | | }
|
| | | .mb8 {
|
| | | margin-bottom: 8px;
|
| | | }
|
| | | .ml5 {
|
| | | margin-left: 5px;
|
| | | }
|
| | | .mt10 {
|
| | | margin-top: 10px;
|
| | | }
|
| | | .mr10 {
|
| | | margin-right: 10px;
|
| | | }
|
| | | .mb10 {
|
| | | margin-bottom: 10px;
|
| | | }
|
| | | .ml0 {
|
| | | margin-left: 10px;
|
| | | }
|
| | | .mt20 {
|
| | | margin-top: 20px;
|
| | | }
|
| | | .mr20 {
|
| | | margin-right: 20px;
|
| | | }
|
| | | .mb20 {
|
| | | margin-bottom: 20px;
|
| | | }
|
| | | .m20 {
|
| | | margin-left: 20px;
|
| | | }
|
| | |
|
| | | .el-table .el-table__header-wrapper th {
|
| | | word-break: break-word;
|
| | | background-color: #f8f8f9;
|
| | |
| | | import './permission' // permission control
|
| | | import { getDicts } from "@/api/system/dict/data";
|
| | | import { getConfigKey } from "@/api/system/config";
|
| | | import { parseTime, resetForm, addDateRange, selectDictLabel } from "@/utils/ruoyi";
|
| | | import { parseTime, resetForm, addDateRange, selectDictLabel, download } from "@/utils/ruoyi";
|
| | | import Pagination from "@/components/Pagination";
|
| | |
|
| | | // å
¨å±æ¹æ³æè½½
|
| | |
| | | Vue.prototype.resetForm = resetForm
|
| | | Vue.prototype.addDateRange = addDateRange
|
| | | Vue.prototype.selectDictLabel = selectDictLabel
|
| | | Vue.prototype.download = download
|
| | |
|
| | | Vue.prototype.msgSuccess = function (msg) {
|
| | | this.$message({ showClose: true, message: msg, type: "success" });
|
| | |
| | | * Copyright (c) 2019 ruoyi
|
| | | */
|
| | |
|
| | | const baseURL = process.env.VUE_APP_BASE_API
|
| | |
|
| | | // æ¥ææ ¼å¼å
|
| | | export function parseTime(time, pattern) {
|
| | | if (arguments.length === 0) {
|
| | |
| | | return actions.join('');
|
| | | }
|
| | |
|
| | | // éç¨ä¸è½½æ¹æ³
|
| | | export function download(fileName) {
|
| | | window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
|
| | | }
|
| | |
|
| | | // åç¬¦ä¸²æ ¼å¼å(%s )
|
| | | export function sprintf(str) {
|
| | | var args = arguments, flag = true, i = 1;
|
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :inline="true" label-width="68px">
|
| | | <el-form-item label="ç»å½å°å">
|
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
| | | <el-form-item label="ç»å½å°å" prop="ipaddr">
|
| | | <el-input
|
| | | v-model="queryParams.ipaddr"
|
| | | placeholder="请è¾å
¥ç»å½å°å"
|
| | |
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¨æ·åç§°">
|
| | | <el-form-item label="ç¨æ·åç§°" prop="userName">
|
| | | <el-input
|
| | | v-model="queryParams.userName"
|
| | | placeholder="请è¾å
¥ç¨æ·åç§°"
|
| | |
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¶æ">
|
| | | <el-form-item label="ç¶æ" prop="status">
|
| | | <el-select
|
| | | v-model="queryParams.status"
|
| | | placeholder="ç»å½ç¶æ"
|
| | |
| | | </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-table v-loading="loading" :data="list" style="width: 100%;">
|
| | | <el-row :gutter="10" class="mb8">
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="danger"
|
| | | icon="el-icon-delete"
|
| | | size="mini"
|
| | | :disabled="multiple"
|
| | | @click="handleDelete"
|
| | | v-hasPermi="['monitor:logininfor:remove']"
|
| | | >å é¤</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="danger"
|
| | | icon="el-icon-delete"
|
| | | size="mini"
|
| | | @click="handleClean"
|
| | | v-hasPermi="['monitor:logininfor:remove']"
|
| | | >æ¸
空</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="warning"
|
| | | icon="el-icon-download"
|
| | | size="mini"
|
| | | @click="handleExport"
|
| | | v-hasPermi="['system:logininfor:export']"
|
| | | >导åº</el-button>
|
| | | </el-col>
|
| | | </el-row>
|
| | |
|
| | | <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="访é®ç¼å·" align="center" prop="infoId" />
|
| | | <el-table-column label="ç¨æ·åç§°" align="center" prop="userName" />
|
| | | <el-table-column label="ç»å½å°å" align="center" prop="ipaddr" width="130" :show-overflow-tooltip="true" />
|
| | |
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { list } from "@/api/monitor/logininfor";
|
| | | import { list, delLogininfor, cleanLogininfor, exportLogininfor } from "@/api/monitor/logininfor";
|
| | |
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // é䏿°ç»
|
| | | ids: [],
|
| | | // éå¤ä¸ªç¦ç¨
|
| | | multiple: true,
|
| | | // æ»æ¡æ°
|
| | | total: 0,
|
| | | // è¡¨æ ¼æ°æ®
|
| | |
| | | handleQuery() {
|
| | | this.queryParams.pageNum = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** éç½®æé®æä½ */
|
| | | resetQuery() {
|
| | | this.dateRange = [];
|
| | | this.resetForm("queryForm");
|
| | | this.handleQuery();
|
| | | },
|
| | | // å¤éæ¡é䏿°æ®
|
| | | handleSelectionChange(selection) {
|
| | | this.ids = selection.map(item => item.infoId)
|
| | | this.multiple = !selection.length
|
| | | },
|
| | | /** å é¤æé®æä½ */
|
| | | handleDelete(row) {
|
| | | const infoIds = row.infoId || this.ids;
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤è®¿é®ç¼å·ä¸º"' + infoIds + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return delLogininfor(infoIds);
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("å 餿å");
|
| | | }).catch(function() {});
|
| | | },
|
| | | /** æ¸
空æé®æä½ */
|
| | | handleClean() {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤æ¸
空ææç»å½æ¥å¿æ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return cleanLogininfor();
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("æ¸
空æå");
|
| | | }).catch(function() {});
|
| | | },
|
| | | /** å¯¼åºæé®æä½ */
|
| | | handleExport() {
|
| | | const queryParams = this.queryParams;
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å¯¼åºæææä½æ¥å¿æ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return exportLogininfor(queryParams);
|
| | | }).then(response => {
|
| | | this.download(response.msg);
|
| | | }).catch(function() {});
|
| | | }
|
| | | }
|
| | | };
|
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :inline="true">
|
| | | <el-form-item label="ç»å½å°å">
|
| | | <el-form :model="queryParams" ref="queryForm" :inline="true">
|
| | | <el-form-item label="ç»å½å°å" prop="ipaddr">
|
| | | <el-input
|
| | | v-model="queryParams.ipaddr"
|
| | | placeholder="请è¾å
¥ç»å½å°å"
|
| | |
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¨æ·åç§°">
|
| | | <el-form-item label="ç¨æ·åç§°" prop="userName">
|
| | | <el-input
|
| | | v-model="queryParams.userName"
|
| | | placeholder="请è¾å
¥ç¨æ·åç§°"
|
| | |
| | | </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>
|
| | |
|
| | |
| | | this.pageNum = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** éç½®æé®æä½ */
|
| | | resetQuery() {
|
| | | this.resetForm("queryForm");
|
| | | this.handleQuery();
|
| | | },
|
| | | /** 强éæé®æä½ */
|
| | | handleForceLogout(row) {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å¼ºéå称为"' + row.userName + '"çæ°æ®é¡¹?', "è¦å", {
|
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :inline="true" label-width="68px">
|
| | | <el-form-item label="ç³»ç»æ¨¡å">
|
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
| | | <el-form-item label="ç³»ç»æ¨¡å" prop="title">
|
| | | <el-input
|
| | | v-model="queryParams.title"
|
| | | placeholder="请è¾å
¥ç³»ç»æ¨¡å"
|
| | |
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="æä½äººå">
|
| | | <el-form-item label="æä½äººå" prop="operName">
|
| | | <el-input
|
| | | v-model="queryParams.operName"
|
| | | placeholder="请è¾å
¥æä½äººå"
|
| | |
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç±»å">
|
| | | <el-form-item label="ç±»å" prop="businessType">
|
| | | <el-select
|
| | | v-model="queryParams.businessType"
|
| | | placeholder="æä½ç±»å"
|
| | |
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¶æ">
|
| | | <el-form-item label="ç¶æ" prop="status">
|
| | | <el-select
|
| | | v-model="queryParams.status"
|
| | | placeholder="æä½ç¶æ"
|
| | |
| | | </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-table v-loading="loading" :data="list" style="width: 100%;">
|
| | | <el-row :gutter="10" class="mb8">
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="danger"
|
| | | icon="el-icon-delete"
|
| | | size="mini"
|
| | | :disabled="multiple"
|
| | | @click="handleDelete"
|
| | | v-hasPermi="['monitor:operlog:remove']"
|
| | | >å é¤</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="danger"
|
| | | icon="el-icon-delete"
|
| | | size="mini"
|
| | | @click="handleClean"
|
| | | v-hasPermi="['monitor:operlog:remove']"
|
| | | >æ¸
空</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="warning"
|
| | | icon="el-icon-download"
|
| | | size="mini"
|
| | | @click="handleExport"
|
| | | v-hasPermi="['system:config:export']"
|
| | | >导åº</el-button>
|
| | | </el-col>
|
| | | </el-row>
|
| | |
|
| | | <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="æ¥å¿ç¼å·" align="center" prop="operId" />
|
| | | <el-table-column label="ç³»ç»æ¨¡å" align="center" prop="title" />
|
| | | <el-table-column label="æä½ç±»å" align="center" prop="businessType" :formatter="typeFormat" />
|
| | |
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { list } from "@/api/monitor/operlog";
|
| | | import { list, delOperlog, cleanOperlog, exportOperlog } from "@/api/monitor/operlog";
|
| | |
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // é䏿°ç»
|
| | | ids: [],
|
| | | // éå¤ä¸ªç¦ç¨
|
| | | multiple: true,
|
| | | // æ»æ¡æ°
|
| | | total: 0,
|
| | | // è¡¨æ ¼æ°æ®
|
| | |
| | | this.queryParams.pageNum = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** éç½®æé®æä½ */
|
| | | resetQuery() {
|
| | | this.dateRange = [];
|
| | | this.resetForm("queryForm");
|
| | | this.handleQuery();
|
| | | },
|
| | | // å¤éæ¡é䏿°æ®
|
| | | handleSelectionChange(selection) {
|
| | | this.ids = selection.map(item => item.operId)
|
| | | this.multiple = !selection.length
|
| | | },
|
| | | /** è¯¦ç»æé®æä½ */
|
| | | handleView(row) {
|
| | | this.open = true;
|
| | | this.form = row;
|
| | | },
|
| | | /** å é¤æé®æä½ */
|
| | | handleDelete(row) {
|
| | | const operIds = row.operId || this.ids;
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å 餿¥å¿ç¼å·ä¸º"' + operIds + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return delOperlog(operIds);
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("å 餿å");
|
| | | }).catch(function() {});
|
| | | },
|
| | | /** æ¸
空æé®æä½ */
|
| | | handleClean() {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤æ¸
ç©ºæææä½æ¥å¿æ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return cleanOperlog();
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("æ¸
空æå");
|
| | | }).catch(function() {});
|
| | | },
|
| | | /** å¯¼åºæé®æä½ */
|
| | | handleExport() {
|
| | | const queryParams = this.queryParams;
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å¯¼åºæææä½æ¥å¿æ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return exportOperlog(queryParams);
|
| | | }).then(response => {
|
| | | this.download(response.msg);
|
| | | }).catch(function() {});
|
| | | }
|
| | | }
|
| | | };
|
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :inline="true" label-width="68px">
|
| | | <el-form-item label="åæ°åç§°">
|
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
| | | <el-form-item label="åæ°åç§°" prop="configName">
|
| | | <el-input
|
| | | v-model="queryParams.configName"
|
| | | placeholder="请è¾å
¥åæ°åç§°"
|
| | |
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="åæ°é®å">
|
| | | <el-form-item label="åæ°é®å" prop="configKey">
|
| | | <el-input
|
| | | v-model="queryParams.configKey"
|
| | | placeholder="请è¾å
¥åæ°é®å"
|
| | |
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç³»ç»å
ç½®">
|
| | | <el-form-item label="ç³»ç»å
ç½®" prop="configType">
|
| | | <el-select v-model="queryParams.configType" placeholder="ç³»ç»å
ç½®" clearable size="small">
|
| | | <el-option
|
| | | v-for="dict in typeOptions"
|
| | |
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button>
|
| | | <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:config:add']">æ°å¢</el-button>
|
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <el-table v-loading="loading" :data="configList">
|
| | | <el-row :gutter="10" class="mb8">
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="primary"
|
| | | icon="el-icon-plus"
|
| | | size="mini"
|
| | | @click="handleAdd"
|
| | | v-hasPermi="['system:config:add']"
|
| | | >æ°å¢</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="success"
|
| | | icon="el-icon-edit"
|
| | | size="mini"
|
| | | :disabled="single"
|
| | | @click="handleUpdate"
|
| | | v-hasPermi="['system:config:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="danger"
|
| | | icon="el-icon-delete"
|
| | | size="mini"
|
| | | :disabled="multiple"
|
| | | @click="handleDelete"
|
| | | v-hasPermi="['system:config:remove']"
|
| | | >å é¤</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="warning"
|
| | | icon="el-icon-download"
|
| | | size="mini"
|
| | | @click="handleExport"
|
| | | v-hasPermi="['system:config:export']"
|
| | | >导åº</el-button>
|
| | | </el-col>
|
| | | </el-row>
|
| | |
|
| | | <el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange">
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="忰䏻é®" align="center" prop="configId" />
|
| | | <el-table-column label="åæ°åç§°" align="center" prop="configName" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="åæ°é®å" align="center" prop="configKey" :show-overflow-tooltip="true" />
|
| | |
| | | </el-table-column>
|
| | | <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" |
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-edit"
|
| | | @click="handleUpdate(scope.row)"
|
| | | v-hasPermi="['system:config:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | |
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { listConfig, getConfig, delConfig, addConfig, updateConfig } from "@/api/system/config";
|
| | | import { listConfig, getConfig, delConfig, addConfig, updateConfig, exportConfig } from "@/api/system/config";
|
| | |
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // é䏿°ç»
|
| | | ids: [],
|
| | | // éå个ç¦ç¨
|
| | | single: true,
|
| | | // éå¤ä¸ªç¦ç¨
|
| | | multiple: true,
|
| | | // æ»æ¡æ°
|
| | | total: 0,
|
| | | // åæ°è¡¨æ ¼æ°æ®
|
| | |
| | | this.queryParams.pageNum = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** éç½®æé®æä½ */
|
| | | resetQuery() {
|
| | | this.dateRange = [];
|
| | | this.resetForm("queryForm");
|
| | | this.handleQuery();
|
| | | },
|
| | | /** æ°å¢æé®æä½ */
|
| | | handleAdd() {
|
| | | this.reset();
|
| | | this.open = true;
|
| | | this.title = "æ·»å åæ°";
|
| | | },
|
| | | // å¤éæ¡é䏿°æ®
|
| | | handleSelectionChange(selection) {
|
| | | this.ids = selection.map(item => item.configId)
|
| | | this.single = selection.length!=1
|
| | | this.multiple = !selection.length
|
| | | },
|
| | | /** ä¿®æ¹æé®æä½ */
|
| | | handleUpdate(row) {
|
| | | this.reset();
|
| | | getConfig(row.configId).then(response => {
|
| | | const configId = row.configId || this.ids
|
| | | getConfig(configId).then(response => {
|
| | | this.form = response.data;
|
| | | this.open = true;
|
| | | this.title = "ä¿®æ¹åæ°";
|
| | |
| | | },
|
| | | /** å é¤æé®æä½ */
|
| | | handleDelete(row) {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤å称为"' + row.configName + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | const configIds = row.configId || this.ids;
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤åæ°ç¼å·ä¸º"' + configIds + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return delConfig(row.configId);
|
| | | return delConfig(configIds);
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("å 餿å");
|
| | | }).catch(function() {});
|
| | | },
|
| | | /** å¯¼åºæé®æä½ */
|
| | | handleExport() {
|
| | | const queryParams = this.queryParams;
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å¯¼åºææåæ°æ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return exportConfig(queryParams);
|
| | | }).then(response => {
|
| | | this.download(response.msg);
|
| | | }).catch(function() {});
|
| | | }
|
| | | }
|
| | | };
|
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :inline="true">
|
| | | <el-form-item label="åå
¸åç§°">
|
| | | <el-form :model="queryParams" ref="queryForm" :inline="true">
|
| | | <el-form-item label="åå
¸åç§°" prop="dictType">
|
| | | <el-select v-model="queryParams.dictType" size="small">
|
| | | <el-option
|
| | | v-for="item in typeOptions"
|
| | |
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="åå
¸æ ç¾">
|
| | | <el-form-item label="åå
¸æ ç¾" prop="dictLabel">
|
| | | <el-input
|
| | | v-model="queryParams.dictLabel"
|
| | | placeholder="请è¾å
¥åå
¸æ ç¾"
|
| | |
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¶æ">
|
| | | <el-form-item label="ç¶æ" prop="status">
|
| | | <el-select v-model="queryParams.status" placeholder="æ°æ®ç¶æ" clearable size="small">
|
| | | <el-option
|
| | | v-for="dict in statusOptions"
|
| | |
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button>
|
| | | <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:dict:add']">æ°å¢</el-button>
|
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <el-table v-loading="loading" :data="dataList" style="width: 100%;">
|
| | | <el-row :gutter="10" class="mb8">
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="primary"
|
| | | icon="el-icon-plus"
|
| | | size="mini"
|
| | | @click="handleAdd"
|
| | | v-hasPermi="['system:dict:add']"
|
| | | >æ°å¢</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="success"
|
| | | icon="el-icon-edit"
|
| | | size="mini"
|
| | | :disabled="single"
|
| | | @click="handleUpdate"
|
| | | v-hasPermi="['system:dict:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="danger"
|
| | | icon="el-icon-delete"
|
| | | size="mini"
|
| | | :disabled="multiple"
|
| | | @click="handleDelete"
|
| | | v-hasPermi="['system:dict:remove']"
|
| | | >å é¤</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="warning"
|
| | | icon="el-icon-download"
|
| | | size="mini"
|
| | | @click="handleExport"
|
| | | v-hasPermi="['system:dict:export']"
|
| | | >导åº</el-button>
|
| | | </el-col>
|
| | | </el-row>
|
| | |
|
| | | <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="åå
¸ç¼ç " align="center" prop="dictCode" />
|
| | | <el-table-column label="åå
¸æ ç¾" align="center" prop="dictLabel" />
|
| | | <el-table-column label="åå
¸é®å¼" align="center" prop="dictValue" />
|
| | |
| | | </el-table-column>
|
| | | <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" |
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-edit"
|
| | | @click="handleUpdate(scope.row)"
|
| | | v-hasPermi="['system:dict:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | |
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { listData, getData, delData, addData, updateData } from "@/api/system/dict/data";
|
| | | import { listData, getData, delData, addData, updateData, exportData } from "@/api/system/dict/data";
|
| | | import { listType, getType } from "@/api/system/dict/type";
|
| | |
|
| | | export default {
|
| | |
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // é䏿°ç»
|
| | | ids: [],
|
| | | // éå个ç¦ç¨
|
| | | single: true,
|
| | | // éå¤ä¸ªç¦ç¨
|
| | | multiple: true,
|
| | | // æ»æ¡æ°
|
| | | total: 0,
|
| | | // åå
¸è¡¨æ ¼æ°æ®
|
| | | dataList: [],
|
| | | // é»è®¤åå
¸ç±»å
|
| | | defaultDictType: "",
|
| | | // å¼¹åºå±æ é¢
|
| | | title: "",
|
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå±
|
| | |
| | | getType(dictId) {
|
| | | getType(dictId).then(response => {
|
| | | this.queryParams.dictType = response.data.dictType;
|
| | | this.defaultDictType = response.data.dictType;
|
| | | this.getList();
|
| | | });
|
| | | },
|
| | |
| | | this.queryParams.pageNum = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** éç½®æé®æä½ */
|
| | | resetQuery() {
|
| | | this.resetForm("queryForm");
|
| | | this.queryParams.dictType = this.defaultDictType;
|
| | | this.handleQuery();
|
| | | },
|
| | | /** æ°å¢æé®æä½ */
|
| | | handleAdd() {
|
| | | this.reset();
|
| | |
| | | this.title = "æ·»å åå
¸æ°æ®";
|
| | | this.form.dictType = this.queryParams.dictType;
|
| | | },
|
| | | // å¤éæ¡é䏿°æ®
|
| | | handleSelectionChange(selection) {
|
| | | this.ids = selection.map(item => item.dictCode)
|
| | | this.single = selection.length!=1
|
| | | this.multiple = !selection.length
|
| | | },
|
| | | /** ä¿®æ¹æé®æä½ */
|
| | | handleUpdate(row) {
|
| | | this.reset();
|
| | | getData(row.dictCode).then(response => {
|
| | | const dictCode = row.dictCode || this.ids
|
| | | getData(dictCode).then(response => {
|
| | | this.form = response.data;
|
| | | this.open = true;
|
| | | this.title = "ä¿®æ¹åå
¸æ°æ®";
|
| | |
| | | },
|
| | | /** å é¤æé®æä½ */
|
| | | handleDelete(row) {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤å称为"' + row.dictLabel + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | const dictCodes = row.dictCode || this.ids;
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤åå
¸ç¼ç 为"' + dictCodes + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return delData(row.dictCode);
|
| | | return delData(dictCodes);
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("å 餿å");
|
| | | }).catch(function() {});
|
| | | },
|
| | | /** å¯¼åºæé®æä½ */
|
| | | handleExport() {
|
| | | const queryParams = this.queryParams;
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å¯¼åºæææ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return exportData(queryParams);
|
| | | }).then(response => {
|
| | | this.download(response.msg);
|
| | | }).catch(function() {});
|
| | | }
|
| | | }
|
| | | };
|
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :inline="true" label-width="68px">
|
| | | <el-form-item label="åå
¸åç§°">
|
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
| | | <el-form-item label="åå
¸åç§°" prop="dictName">
|
| | | <el-input
|
| | | v-model="queryParams.dictName"
|
| | | placeholder="请è¾å
¥åå
¸åç§°"
|
| | |
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="åå
¸ç±»å">
|
| | | <el-form-item label="åå
¸ç±»å" prop="dictType">
|
| | | <el-input
|
| | | v-model="queryParams.dictType"
|
| | | placeholder="请è¾å
¥åå
¸ç±»å"
|
| | |
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¶æ">
|
| | | <el-form-item label="ç¶æ" prop="status">
|
| | | <el-select
|
| | | v-model="queryParams.status"
|
| | | placeholder="åå
¸ç¶æ"
|
| | |
| | | </el-form-item>
|
| | | <el-form-item label="å建æ¶é´">
|
| | | <el-date-picker
|
| | | v-model="queryParams.createTime"
|
| | | v-model="dateRange"
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | value-format="yyyy-MM-dd"
|
| | |
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button>
|
| | | <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:dict:add']">æ°å¢</el-button>
|
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <el-table v-loading="loading" :data="typeList" style="width: 100%;">
|
| | | <el-table-column label="åå
¸ä¸»é®" align="center" prop="dictId" />
|
| | | <el-row :gutter="10" class="mb8">
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="primary"
|
| | | icon="el-icon-plus"
|
| | | size="mini"
|
| | | @click="handleAdd"
|
| | | v-hasPermi="['system:dict:add']"
|
| | | >æ°å¢</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="success"
|
| | | icon="el-icon-edit"
|
| | | size="mini"
|
| | | :disabled="single"
|
| | | @click="handleUpdate"
|
| | | v-hasPermi="['system:dict:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="danger"
|
| | | icon="el-icon-delete"
|
| | | size="mini"
|
| | | :disabled="multiple"
|
| | | @click="handleDelete"
|
| | | v-hasPermi="['system:dict:remove']"
|
| | | >å é¤</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="warning"
|
| | | icon="el-icon-download"
|
| | | size="mini"
|
| | | @click="handleExport"
|
| | | v-hasPermi="['system:dict:export']"
|
| | | >导åº</el-button>
|
| | | </el-col>
|
| | | </el-row>
|
| | |
|
| | | <el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="åå
¸ç¼å·" align="center" prop="dictId" />
|
| | | <el-table-column label="åå
¸åç§°" align="center" prop="dictName" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="åå
¸ç±»å" align="center">
|
| | | <el-table-column label="åå
¸ç±»å" align="center" :show-overflow-tooltip="true">
|
| | | <template slot-scope="scope">
|
| | | <router-link :to="'/dict/type/data/' + scope.row.dictId" class="link-type">
|
| | | <span>{{ scope.row.dictType }}</span>
|
| | |
| | | </el-table-column>
|
| | | <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" |
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-edit"
|
| | | @click="handleUpdate(scope.row)"
|
| | | v-hasPermi="['system:dict:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | |
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { listType, getType, delType, addType, updateType } from "@/api/system/dict/type";
|
| | | import { listType, getType, delType, addType, updateType, exportType } from "@/api/system/dict/type";
|
| | |
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // é䏿°ç»
|
| | | ids: [],
|
| | | // éå个ç¦ç¨
|
| | | single: true,
|
| | | // éå¤ä¸ªç¦ç¨
|
| | | multiple: true,
|
| | | // æ»æ¡æ°
|
| | | total: 0,
|
| | | // åå
¸è¡¨æ ¼æ°æ®
|
| | |
| | | /** æ¥è¯¢åå
¸ç±»åå表 */
|
| | | getList() {
|
| | | this.loading = true;
|
| | | listType(this.addDateRange(this.queryParams, this.dateRange)).then(
|
| | | response => {
|
| | | listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
| | | this.typeList = response.rows;
|
| | | this.total = response.total;
|
| | | this.loading = false;
|
| | |
| | | this.queryParams.pageNum = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** éç½®æé®æä½ */
|
| | | resetQuery() {
|
| | | this.dateRange = [];
|
| | | this.resetForm("queryForm");
|
| | | this.handleQuery();
|
| | | },
|
| | | /** æ°å¢æé®æä½ */
|
| | | handleAdd() {
|
| | | this.reset();
|
| | | this.open = true;
|
| | | this.title = "æ·»å åå
¸ç±»å";
|
| | | },
|
| | | // å¤éæ¡é䏿°æ®
|
| | | handleSelectionChange(selection) {
|
| | | this.ids = selection.map(item => item.dictId)
|
| | | this.single = selection.length!=1
|
| | | this.multiple = !selection.length
|
| | | },
|
| | | /** ä¿®æ¹æé®æä½ */
|
| | | handleUpdate(row) {
|
| | | this.reset();
|
| | | getType(row.dictId).then(response => {
|
| | | const dictId = row.dictId || this.ids
|
| | | getType(dictId).then(response => {
|
| | | this.form = response.data;
|
| | | this.open = true;
|
| | | this.title = "ä¿®æ¹åå
¸ç±»å";
|
| | |
| | | },
|
| | | /** å é¤æé®æä½ */
|
| | | handleDelete(row) {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤å称为"' + row.dictName + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | const dictIds = row.dictId || this.ids;
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤åå
¸ç¼å·ä¸º"' + dictIds + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return delType(row.dictId);
|
| | | return delType(dictIds);
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("å 餿å");
|
| | | }).catch(function() {});
|
| | | },
|
| | | /** å¯¼åºæé®æä½ */
|
| | | handleExport() {
|
| | | const queryParams = this.queryParams;
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å¯¼åºææç±»åæ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return exportType(queryParams);
|
| | | }).then(response => {
|
| | | this.download(response.msg);
|
| | | }).catch(function() {});
|
| | | }
|
| | | }
|
| | | };
|
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :inline="true" label-width="68px">
|
| | | <el-form-item label="å
¬åæ é¢">
|
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
| | | <el-form-item label="å
¬åæ é¢" prop="noticeTitle">
|
| | | <el-input
|
| | | v-model="queryParams.noticeTitle"
|
| | | placeholder="请è¾å
¥å
¬åæ é¢"
|
| | |
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="æä½äººå">
|
| | | <el-form-item label="æä½äººå" prop="createBy">
|
| | | <el-input
|
| | | v-model="queryParams.createBy"
|
| | | placeholder="请è¾å
¥æä½äººå"
|
| | |
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç±»å">
|
| | | <el-form-item label="ç±»å" prop="noticeType">
|
| | | <el-select v-model="queryParams.noticeType" placeholder="å
¬åç±»å" clearable size="small">
|
| | | <el-option
|
| | | v-for="dict in typeOptions"
|
| | |
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button>
|
| | | <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:notice:add']">æ°å¢</el-button>
|
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <el-table v-loading="loading" :data="noticeList">
|
| | | <el-row :gutter="10" class="mb8">
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="primary"
|
| | | icon="el-icon-plus"
|
| | | size="mini"
|
| | | @click="handleAdd"
|
| | | v-hasPermi="['system:notice:add']"
|
| | | >æ°å¢</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="success"
|
| | | icon="el-icon-edit"
|
| | | size="mini"
|
| | | :disabled="single"
|
| | | @click="handleUpdate"
|
| | | v-hasPermi="['system:notice:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="danger"
|
| | | icon="el-icon-delete"
|
| | | size="mini"
|
| | | :disabled="multiple"
|
| | | @click="handleDelete"
|
| | | v-hasPermi="['system:notice:remove']"
|
| | | >å é¤</el-button>
|
| | | </el-col>
|
| | | </el-row>
|
| | |
|
| | | <el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange">
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="åºå·" align="center" prop="noticeId" width="100" />
|
| | | <el-table-column
|
| | | label="å
¬åæ é¢"
|
| | |
| | | </el-table-column>
|
| | | <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" |
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-edit"
|
| | | @click="handleUpdate(scope.row)"
|
| | | v-hasPermi="['system:notice:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | |
| | | </el-col>
|
| | | <el-col :span="24">
|
| | | <el-form-item label="å
容">
|
| | | <Editor v-model="form.noticeContent"/>
|
| | | <Editor v-model="form.noticeContent" />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | </el-row>
|
| | |
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
|
| | | import { listNotice, getNotice, delNotice, addNotice, updateNotice, exportNotice } from "@/api/system/notice";
|
| | | import Editor from '@/components/Editor';
|
| | |
|
| | | export default {
|
| | |
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // é䏿°ç»
|
| | | ids: [],
|
| | | // éå个ç¦ç¨
|
| | | single: true,
|
| | | // éå¤ä¸ªç¦ç¨
|
| | | multiple: true,
|
| | | // æ»æ¡æ°
|
| | | total: 0,
|
| | | // å
¬åè¡¨æ ¼æ°æ®
|
| | |
| | | this.queryParams.pageNum = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** éç½®æé®æä½ */
|
| | | resetQuery() {
|
| | | this.resetForm("queryForm");
|
| | | this.handleQuery();
|
| | | },
|
| | | // å¤éæ¡é䏿°æ®
|
| | | handleSelectionChange(selection) {
|
| | | this.ids = selection.map(item => item.noticeId)
|
| | | this.single = selection.length!=1
|
| | | this.multiple = !selection.length
|
| | | },
|
| | | /** æ°å¢æé®æä½ */
|
| | | handleAdd() {
|
| | | this.reset();
|
| | |
| | | /** ä¿®æ¹æé®æä½ */
|
| | | handleUpdate(row) {
|
| | | this.reset();
|
| | | getNotice(row.noticeId).then(response => {
|
| | | const noticeId = row.noticeId || this.ids
|
| | | getNotice(noticeId).then(response => {
|
| | | this.form = response.data;
|
| | | this.open = true;
|
| | | this.title = "ä¿®æ¹å
Œ";
|
| | |
| | | },
|
| | | /** å é¤æé®æä½ */
|
| | | handleDelete(row) {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤å
¬åæ é¢ä¸º"' + row.noticeTitle + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | const noticeIds = row.noticeId || this.ids
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤å
¬åç¼å·ä¸º"' + noticeIds + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return delNotice(row.noticeId);
|
| | | return delNotice(noticeIds);
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("å 餿å");
|
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :inline="true" label-width="68px">
|
| | | <el-form-item label="å²ä½ç¼ç ">
|
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
| | | <el-form-item label="å²ä½ç¼ç " prop="postCode">
|
| | | <el-input
|
| | | v-model="queryParams.postCode"
|
| | | placeholder="请è¾å
¥å²ä½ç¼ç "
|
| | |
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="å²ä½åç§°">
|
| | | <el-form-item label="å²ä½åç§°" prop="postName">
|
| | | <el-input
|
| | | v-model="queryParams.postName"
|
| | | placeholder="请è¾å
¥å²ä½åç§°"
|
| | |
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¶æ">
|
| | | <el-form-item label="ç¶æ" prop="status">
|
| | | <el-select v-model="queryParams.status" placeholder="å²ä½ç¶æ" clearable size="small">
|
| | | <el-option
|
| | | v-for="dict in statusOptions"
|
| | |
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button>
|
| | | <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:post:add']">æ°å¢</el-button>
|
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <el-table v-loading="loading" :data="postList">
|
| | | <el-row :gutter="10" class="mb8">
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="primary"
|
| | | icon="el-icon-plus"
|
| | | size="mini"
|
| | | @click="handleAdd"
|
| | | v-hasPermi="['system:post:add']"
|
| | | >æ°å¢</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="success"
|
| | | icon="el-icon-edit"
|
| | | size="mini"
|
| | | :disabled="single"
|
| | | @click="handleUpdate"
|
| | | v-hasPermi="['system:post:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="danger"
|
| | | icon="el-icon-delete"
|
| | | size="mini"
|
| | | :disabled="multiple"
|
| | | @click="handleDelete"
|
| | | v-hasPermi="['system:post:remove']"
|
| | | >å é¤</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="warning"
|
| | | icon="el-icon-download"
|
| | | size="mini"
|
| | | @click="handleExport"
|
| | | v-hasPermi="['system:post:export']"
|
| | | >导åº</el-button>
|
| | | </el-col>
|
| | | </el-row>
|
| | |
|
| | | <el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="å²ä½ç¼å·" align="center" prop="postId" />
|
| | | <el-table-column label="å²ä½ç¼ç " align="center" prop="postCode" />
|
| | | <el-table-column label="å²ä½åç§°" align="center" prop="postName" />
|
| | |
| | | </el-table-column>
|
| | | <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" |
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-edit"
|
| | | @click="handleUpdate(scope.row)"
|
| | | v-hasPermi="['system:post:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | |
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | | |
| | | <pagination
|
| | | v-show="total>0"
|
| | | :total="total"
|
| | |
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { listPost, getPost, delPost, addPost, updatePost } from "@/api/system/post";
|
| | | import { listPost, getPost, delPost, addPost, updatePost, exportPost } from "@/api/system/post";
|
| | |
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // é䏿°ç»
|
| | | ids: [],
|
| | | // éå个ç¦ç¨
|
| | | single: true,
|
| | | // éå¤ä¸ªç¦ç¨
|
| | | multiple: true,
|
| | | // æ»æ¡æ°
|
| | | total: 0,
|
| | | // å²ä½è¡¨æ ¼æ°æ®
|
| | |
| | | this.queryParams.pageNum = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** éç½®æé®æä½ */
|
| | | resetQuery() {
|
| | | this.resetForm("queryForm");
|
| | | this.handleQuery();
|
| | | },
|
| | | // å¤éæ¡é䏿°æ®
|
| | | handleSelectionChange(selection) {
|
| | | this.ids = selection.map(item => item.postId)
|
| | | this.single = selection.length!=1
|
| | | this.multiple = !selection.length
|
| | | },
|
| | | /** æ°å¢æé®æä½ */
|
| | | handleAdd() {
|
| | | this.reset();
|
| | |
| | | /** ä¿®æ¹æé®æä½ */
|
| | | handleUpdate(row) {
|
| | | this.reset();
|
| | | getPost(row.postId).then(response => {
|
| | | const postId = row.postId || this.ids
|
| | | getPost(postId).then(response => {
|
| | | this.form = response.data;
|
| | | this.open = true;
|
| | | this.title = "ä¿®æ¹å²ä½";
|
| | |
| | | },
|
| | | /** å é¤æé®æä½ */
|
| | | handleDelete(row) {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤å²ä½å称为"' + row.postName + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | const postIds = row.postId || this.ids;
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤å²ä½ç¼å·ä¸º"' + postIds + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return delPost(row.postId);
|
| | | return delPost(postIds);
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("å 餿å");
|
| | | }).catch(function() {});
|
| | | },
|
| | | /** å¯¼åºæé®æä½ */
|
| | | handleExport() {
|
| | | const queryParams = this.queryParams;
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å¯¼åºææå²ä½æ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return exportPost(queryParams);
|
| | | }).then(response => {
|
| | | this.download(response.msg);
|
| | | }).catch(function() {});
|
| | | }
|
| | | }
|
| | | };
|
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :inline="true">
|
| | | <el-form-item label="è§è²åç§°">
|
| | | <el-form :model="queryParams" ref="queryForm" :inline="true">
|
| | | <el-form-item label="è§è²åç§°" prop="roleName">
|
| | | <el-input
|
| | | v-model="queryParams.roleName"
|
| | | placeholder="请è¾å
¥è§è²åç§°"
|
| | |
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="æéå符">
|
| | | <el-form-item label="æéå符" prop="roleKey">
|
| | | <el-input
|
| | | v-model="queryParams.roleKey"
|
| | | placeholder="请è¾å
¥æéå符"
|
| | |
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¶æ">
|
| | | <el-form-item label="ç¶æ" prop="status">
|
| | | <el-select
|
| | | v-model="queryParams.status"
|
| | | placeholder="è§è²ç¶æ"
|
| | |
| | | </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"
|
| | | icon="el-icon-plus"
|
| | |
| | | @click="handleAdd"
|
| | | v-hasPermi="['system:role:add']"
|
| | | >æ°å¢</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="success"
|
| | | icon="el-icon-edit"
|
| | | size="mini"
|
| | | :disabled="single"
|
| | | @click="handleUpdate"
|
| | | v-hasPermi="['system:role:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="danger"
|
| | | icon="el-icon-delete"
|
| | | size="mini"
|
| | | :disabled="multiple"
|
| | | @click="handleDelete"
|
| | | v-hasPermi="['system:role:remove']"
|
| | | >å é¤</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="warning"
|
| | | icon="el-icon-download"
|
| | | size="mini"
|
| | | @click="handleExport"
|
| | | v-hasPermi="['system:post:export']"
|
| | | >导åº</el-button>
|
| | | </el-col>
|
| | | </el-row>
|
| | |
|
| | | <el-table v-loading="loading" :data="roleList">
|
| | | <el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="è§è²ç¼å·" prop="roleId" width="120" />
|
| | | <el-table-column label="è§è²åç§°" prop="roleName" :show-overflow-tooltip="true" width="150" />
|
| | | <el-table-column label="æéå符" prop="roleKey" :show-overflow-tooltip="true" width="180" />
|
| | | <el-table-column label="æ¾ç¤ºé¡ºåº" prop="roleSort" width="120" />
|
| | | <el-table-column label="ç¶æ" align="center" width="120">
|
| | | <el-table-column label="æéå符" prop="roleKey" :show-overflow-tooltip="true" width="150" />
|
| | | <el-table-column label="æ¾ç¤ºé¡ºåº" prop="roleSort" width="100" />
|
| | | <el-table-column label="ç¶æ" align="center" width="100">
|
| | | <template slot-scope="scope">
|
| | | <el-switch
|
| | | v-model="scope.row.status"
|
| | |
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus } from "@/api/system/role";
|
| | | import { listRole, getRole, delRole, addRole, updateRole, exportRole, dataScope, changeRoleStatus } from "@/api/system/role";
|
| | | import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
|
| | | import { treeselect as deptTreeselect, roleDeptTreeselect } from "@/api/system/dept";
|
| | |
|
| | |
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // é䏿°ç»
|
| | | ids: [],
|
| | | // éå个ç¦ç¨
|
| | | single: true,
|
| | | // éå¤ä¸ªç¦ç¨
|
| | | multiple: true,
|
| | | // æ»æ¡æ°
|
| | | total: 0,
|
| | | // è§è²è¡¨æ ¼æ°æ®
|
| | |
| | | this.queryParams.pageNum = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** éç½®æé®æä½ */
|
| | | resetQuery() {
|
| | | this.dateRange = [];
|
| | | this.resetForm("queryForm");
|
| | | this.handleQuery();
|
| | | },
|
| | | // å¤éæ¡é䏿°æ®
|
| | | handleSelectionChange(selection) {
|
| | | this.ids = selection.map(item => item.roleId)
|
| | | this.single = selection.length!=1
|
| | | this.multiple = !selection.length
|
| | | },
|
| | | /** æ°å¢æé®æä½ */
|
| | | handleAdd() {
|
| | | this.reset();
|
| | |
| | | /** ä¿®æ¹æé®æä½ */
|
| | | handleUpdate(row) {
|
| | | this.reset();
|
| | | const roleId = row.roleId || this.ids
|
| | | this.$nextTick(() => {
|
| | | this.getRoleMenuTreeselect(row.roleId);
|
| | | this.getRoleMenuTreeselect(roleId);
|
| | | });
|
| | | getRole(row.roleId).then(response => {
|
| | | getRole(roleId).then(response => {
|
| | | this.form = response.data;
|
| | | this.open = true;
|
| | | this.title = "ä¿®æ¹è§è²";
|
| | |
| | | },
|
| | | /** å é¤æé®æä½ */
|
| | | handleDelete(row) {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤å称为"' + row.roleName + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | const roleIds = row.roleId || this.ids;
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤è§è²ç¼å·ä¸º"' + roleIds + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return delRole(row.roleId);
|
| | | return delRole(roleIds);
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("å 餿å");
|
| | | }).catch(function() {});
|
| | | },
|
| | | /** å¯¼åºæé®æä½ */
|
| | | handleExport() {
|
| | | const queryParams = this.queryParams;
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å¯¼åºææè§è²æ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return exportRole(queryParams);
|
| | | }).then(response => {
|
| | | this.download(response.msg);
|
| | | }).catch(function() {});
|
| | | }
|
| | | }
|
| | | };
|
| | |
| | | </el-col>
|
| | | <!--ç¨æ·æ°æ®-->
|
| | | <el-col :span="20" :xs="24">
|
| | | <el-form :inline="true" label-width="68px">
|
| | | <el-form-item label="ç¨æ·åç§°">
|
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
| | | <el-form-item label="ç¨æ·åç§°" prop="userName">
|
| | | <el-input
|
| | | v-model="queryParams.userName"
|
| | | placeholder="请è¾å
¥ç¨æ·åç§°"
|
| | |
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ææºå·ç ">
|
| | | <el-form-item label="ææºå·ç " prop="phonenumber">
|
| | | <el-input
|
| | | v-model="queryParams.phonenumber"
|
| | | placeholder="请è¾å
¥ææºå·ç "
|
| | |
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¶æ">
|
| | | <el-form-item label="ç¶æ" prop="status">
|
| | | <el-select
|
| | | v-model="queryParams.status"
|
| | | placeholder="ç¨æ·ç¶æ"
|
| | |
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button>
|
| | | <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:user:add']">æ°å¢</el-button>
|
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <el-table v-loading="loading" :data="userList">
|
| | | <el-row :gutter="10" class="mb8">
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="primary"
|
| | | icon="el-icon-plus"
|
| | | size="mini"
|
| | | @click="handleAdd"
|
| | | v-hasPermi="['system:user:add']"
|
| | | >æ°å¢</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="success"
|
| | | icon="el-icon-edit"
|
| | | size="mini"
|
| | | :disabled="single"
|
| | | @click="handleUpdate"
|
| | | v-hasPermi="['system:user:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="danger"
|
| | | icon="el-icon-delete"
|
| | | size="mini"
|
| | | :disabled="multiple"
|
| | | @click="handleDelete"
|
| | | v-hasPermi="['system:user:remove']"
|
| | | >å é¤</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="warning"
|
| | | icon="el-icon-download"
|
| | | size="mini"
|
| | | @click="handleExport"
|
| | | v-hasPermi="['system:user:export']"
|
| | | >导åº</el-button>
|
| | | </el-col>
|
| | | </el-row>
|
| | |
|
| | | <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
| | | <el-table-column type="selection" width="40" align="center" />
|
| | | <el-table-column label="ç¨æ·ç¼å·" align="center" prop="userId" />
|
| | | <el-table-column label="ç¨æ·åç§°" align="center" prop="userName" />
|
| | | <el-table-column label="ç¨æ·æµç§°" align="center" prop="nickName" />
|
| | |
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus } from "@/api/system/user";
|
| | | import { listUser, getUser, delUser, addUser, updateUser, exportUser, resetUserPwd, changeUserStatus } from "@/api/system/user";
|
| | | import { treeselect } from "@/api/system/dept";
|
| | | import { listPost } from "@/api/system/post";
|
| | | import { listRole } from "@/api/system/role";
|
| | |
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // é䏿°ç»
|
| | | ids: [],
|
| | | // éå个ç¦ç¨
|
| | | single: true,
|
| | | // éå¤ä¸ªç¦ç¨
|
| | | multiple: true,
|
| | | // æ»æ¡æ°
|
| | | total: 0,
|
| | | // ç¨æ·è¡¨æ ¼æ°æ®
|
| | |
| | | this.queryParams.page = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** éç½®æé®æä½ */
|
| | | resetQuery() {
|
| | | this.dateRange = [];
|
| | | this.resetForm("queryForm");
|
| | | this.handleQuery();
|
| | | },
|
| | | // å¤éæ¡é䏿°æ®
|
| | | handleSelectionChange(selection) {
|
| | | this.ids = selection.map(item => item.userId)
|
| | | this.single = selection.length!=1
|
| | | this.multiple = !selection.length
|
| | | },
|
| | | /** æ°å¢æé®æä½ */
|
| | | handleAdd() {
|
| | | this.reset();
|
| | |
| | | this.getTreeselect();
|
| | | this.getPosts();
|
| | | this.getRoles();
|
| | | getUser(row.userId).then(response => {
|
| | | const userId = row.userId || this.ids
|
| | | getUser(userId).then(response => {
|
| | | this.form = response.data;
|
| | | this.form.postIds = response.postIds;
|
| | | this.form.roleIds = response.roleIds;
|
| | |
| | | },
|
| | | /** å é¤æé®æä½ */
|
| | | handleDelete(row) {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤å称为"' + row.userName + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | const userIds = row.userId || this.ids;
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤ç¨æ·ç¼å·ä¸º"' + userIds + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return delUser(row.userId);
|
| | | return delUser(userIds);
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("å 餿å");
|
| | | }).catch(function() {});
|
| | | },
|
| | | /** å¯¼åºæé®æä½ */
|
| | | handleExport() {
|
| | | const queryParams = this.queryParams;
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å¯¼åºææç¨æ·æ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return exportUser(queryParams);
|
| | | }).then(response => {
|
| | | this.download(response.msg);
|
| | | }).catch(function() {});
|
| | | }
|
| | | }
|
| | | };
|
| | |
| | | // é¨ç½²ç产ç¯å¢åå¼åç¯å¢ä¸çURLã
|
| | | // é»è®¤æ
åµä¸ï¼Vue CLI ä¼åè®¾ä½ çåºç¨æ¯è¢«é¨ç½²å¨ä¸ä¸ªååçæ ¹è·¯å¾ä¸
|
| | | // ä¾å¦ https://www.ruoyi.vip/ã妿åºç¨è¢«é¨ç½²å¨ä¸ä¸ªåè·¯å¾ä¸ï¼ä½ å°±éè¦ç¨è¿ä¸ªé项æå®è¿ä¸ªåè·¯å¾ãä¾å¦ï¼å¦æä½ çåºç¨è¢«é¨ç½²å¨ https://www.ruoyi.vip/admin/ï¼å设置 baseUrl 为 /admin/ã
|
| | | publicPath: process.env.NODE_ENV === "production" ? "./" : "/",
|
| | | publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
|
| | | // å¨npm run build æ yarn build æ¶ ï¼çææä»¶çç®å½åç§°ï¼è¦åbaseUrlçç产ç¯å¢è·¯å¾ä¸è´ï¼ï¼é»è®¤distï¼
|
| | | outputDir: 'dist',
|
| | | // ç¨äºæ¾ç½®çæçéæèµæº (jsãcssãimgãfonts) çï¼ï¼é¡¹ç®æå
ä¹åï¼éæèµæºä¼æ¾å¨è¿ä¸ªæä»¶å¤¹ä¸ï¼
|
| | |
| | |
|
| | | <groupId>com.ruoyi</groupId>
|
| | | <artifactId>ruoyi</artifactId>
|
| | | <version>1.0</version>
|
| | | <version>1.1</version>
|
| | | <packaging>jar</packaging>
|
| | |
|
| | | <name>ruoyi</name>
|
| | |
| | | <bitwalker.version>1.19</bitwalker.version>
|
| | | <jwt.version>0.9.0</jwt.version>
|
| | | <swagger.version>2.9.2</swagger.version>
|
| | | <poi.version>3.17</poi.version>
|
| | | <oshi.version>3.9.1</oshi.version>
|
| | | </properties>
|
| | |
|
| | |
| | | <groupId>net.java.dev.jna</groupId>
|
| | | <artifactId>jna-platform</artifactId>
|
| | | </dependency>
|
| | | |
| | | <!-- excelå·¥å
· -->
|
| | | <dependency>
|
| | | <groupId>org.apache.poi</groupId>
|
| | | <artifactId>poi-ooxml</artifactId>
|
| | | <version>${poi.version}</version>
|
| | | </dependency>
|
| | |
|
| | | </dependencies>
|
| | |
|
ÎļþÃû´Ó ruoyi/sql/ry_20191008.sql ÐÞ¸Ä |
| | |
| | | path varchar(200) default '' comment 'è·¯ç±å°å',
|
| | | component varchar(255) default null comment 'ç»ä»¶è·¯å¾',
|
| | | is_frame int(1) default 1 comment 'æ¯å¦ä¸ºå¤é¾ï¼0æ¯ 1å¦ï¼',
|
| | | menu_type char(1) default '' comment 'èåç±»åï¼0ç®å½ 1èå 2æé®ï¼',
|
| | | menu_type char(1) default '' comment 'èåç±»åï¼Mç®å½ Cèå Fæé®ï¼',
|
| | | visible char(1) default 0 comment 'èåç¶æï¼0æ¾ç¤º 1éèï¼',
|
| | | perms varchar(100) default null comment 'æéæ è¯',
|
| | | icon varchar(100) default '#' comment 'èå徿 ',
|
| | |
| | | -- åå§å-èåä¿¡æ¯è¡¨æ°æ®
|
| | | -- ----------------------------
|
| | | -- ä¸çº§èå
|
| | | insert into sys_menu values('1', 'ç³»ç»ç®¡ç', '0', '1', 'system', null, 1, 'M', '0', '', 'system', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ç³»ç»ç®¡çç®å½');
|
| | | insert into sys_menu values('2', 'ç³»ç»çæ§', '0', '2', 'monitor', null, 1, 'M', '0', '', 'monitor', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ç³»ç»çæ§ç®å½');
|
| | | insert into sys_menu values('3', 'ç³»ç»å·¥å
·', '0', '3', 'tool', null, 1, 'M', '0', '', 'tool', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ç³»ç»å·¥å
·ç®å½');
|
| | | INSERT INTO sys_menu VALUES('4', 'è¥ä¾å®ç½', '0', '4', 'http://ruoyi.vip', NULL , 0, 'M', '0', '', 'guide', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'è¥ä¾å®ç½');
|
| | | insert into sys_menu values('1', 'ç³»ç»ç®¡ç', '0', '1', 'system', null, 1, 'M', '0', '', 'system', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ç³»ç»ç®¡çç®å½');
|
| | | insert into sys_menu values('2', 'ç³»ç»çæ§', '0', '2', 'monitor', null, 1, 'M', '0', '', 'monitor', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ç³»ç»çæ§ç®å½');
|
| | | insert into sys_menu values('3', 'ç³»ç»å·¥å
·', '0', '3', 'tool', null, 1, 'M', '0', '', 'tool', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ç³»ç»å·¥å
·ç®å½');
|
| | | insert into sys_menu values('4', 'è¥ä¾å®ç½', '0', '4', 'http://ruoyi.vip', null , 0, 'M', '0', '', 'guide', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'è¥ä¾å®ç½å°å');
|
| | | -- äºçº§èå
|
| | | insert into sys_menu values('100', 'ç¨æ·ç®¡ç', '1', '1', 'user', 'system/user/index', 1, 'C', '0', 'system:user:list', 'user', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ç¨æ·ç®¡çèå');
|
| | | insert into sys_menu values('101', 'è§è²ç®¡ç', '1', '2', 'role', 'system/role/index', 1, 'C', '0', 'system:role:list', 'peoples', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'è§è²ç®¡çèå');
|
| | |
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 15ãå¨çº¿ç¨æ·è®°å½
|
| | | -- ----------------------------
|
| | | drop table if exists sys_user_online;
|
| | | create table sys_user_online (
|
| | | sessionId varchar(50) default '' comment 'ç¨æ·ä¼è¯id',
|
| | | user_name varchar(50) default '' comment 'ç¨æ·è´¦å·',
|
| | | dept_name varchar(50) default '' comment 'é¨é¨åç§°',
|
| | | ipaddr varchar(50) default '' comment 'ç»å½IPå°å',
|
| | | login_location varchar(255) default '' comment 'ç»å½å°ç¹',
|
| | | browser varchar(50) default '' comment 'æµè§å¨ç±»å',
|
| | | os varchar(50) default '' comment 'æä½ç³»ç»',
|
| | | status varchar(10) default '' comment 'å¨çº¿ç¶æon_lineå¨çº¿off_line离线',
|
| | | start_timestamp datetime comment 'sessionå建æ¶é´',
|
| | | last_access_time datetime comment 'sessionæåè®¿é®æ¶é´',
|
| | | expire_time int(5) default 0 comment 'è¶
æ¶æ¶é´ï¼åä½ä¸ºåé',
|
| | | primary key (sessionId)
|
| | | ) engine=innodb comment = 'å¨çº¿ç¨æ·è®°å½';
|
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 16ã宿¶ä»»å¡è°åº¦è¡¨
|
| | | -- 15ã宿¶ä»»å¡è°åº¦è¡¨
|
| | | -- ----------------------------
|
| | | drop table if exists sys_job;
|
| | | create table sys_job (
|
| | |
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 17ã宿¶ä»»å¡è°åº¦æ¥å¿è¡¨
|
| | | -- 16ã宿¶ä»»å¡è°åº¦æ¥å¿è¡¨
|
| | | -- ----------------------------
|
| | | drop table if exists sys_job_log;
|
| | | create table sys_job_log (
|
| | |
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 18ãéç¥å
¬å表
|
| | | -- 17ãéç¥å
¬å表
|
| | | -- ----------------------------
|
| | | drop table if exists sys_notice;
|
| | | create table sys_notice (
|
| | |
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 19ã代ç çæä¸å¡è¡¨
|
| | | -- 18ã代ç çæä¸å¡è¡¨
|
| | | -- ----------------------------
|
| | | drop table if exists gen_table;
|
| | | create table gen_table (
|
| | |
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 20ã代ç çæä¸å¡è¡¨å段
|
| | | -- 19ã代ç çæä¸å¡è¡¨å段
|
| | | -- ----------------------------
|
| | | drop table if exists gen_table_column;
|
| | | create table gen_table_column (
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils.poi; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.lang.reflect.Field; |
| | | import java.lang.reflect.Method; |
| | | import java.math.BigDecimal; |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | import org.apache.poi.hssf.usermodel.HSSFDateUtil; |
| | | import org.apache.poi.ss.usermodel.BorderStyle; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.CellStyle; |
| | | import org.apache.poi.ss.usermodel.CellType; |
| | | import org.apache.poi.ss.usermodel.DataValidation; |
| | | import org.apache.poi.ss.usermodel.DataValidationConstraint; |
| | | import org.apache.poi.ss.usermodel.DataValidationHelper; |
| | | import org.apache.poi.ss.usermodel.DateUtil; |
| | | import org.apache.poi.ss.usermodel.FillPatternType; |
| | | import org.apache.poi.ss.usermodel.Font; |
| | | import org.apache.poi.ss.usermodel.HorizontalAlignment; |
| | | import org.apache.poi.ss.usermodel.IndexedColors; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.VerticalAlignment; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.ss.usermodel.WorkbookFactory; |
| | | import org.apache.poi.ss.util.CellRangeAddressList; |
| | | import org.apache.poi.xssf.streaming.SXSSFWorkbook; |
| | | import org.apache.poi.xssf.usermodel.XSSFDataValidation; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel.Type; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excels; |
| | | import com.ruoyi.framework.config.RuoYiConfig; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.text.Convert; |
| | | import com.ruoyi.common.exception.CustomException; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.reflect.ReflectUtils; |
| | | |
| | | /** |
| | | * Excelç¸å
³å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class ExcelUtil<T> |
| | | { |
| | | private static final Logger log = LoggerFactory.getLogger(ExcelUtil.class); |
| | | |
| | | /** |
| | | * Excel sheetæå¤§è¡æ°ï¼é»è®¤65536 |
| | | */ |
| | | public static final int sheetSize = 65536; |
| | | |
| | | /** |
| | | * å·¥ä½è¡¨åç§° |
| | | */ |
| | | private String sheetName; |
| | | |
| | | /** |
| | | * 导åºç±»åï¼EXPORT:å¯¼åºæ°æ®ï¼IMPORTï¼å¯¼å
¥æ¨¡æ¿ï¼ |
| | | */ |
| | | private Type type; |
| | | |
| | | /** |
| | | * å·¥ä½è对象 |
| | | */ |
| | | private Workbook wb; |
| | | |
| | | /** |
| | | * å·¥ä½è¡¨å¯¹è±¡ |
| | | */ |
| | | private Sheet sheet; |
| | | |
| | | /** |
| | | * æ ·å¼å表 |
| | | */ |
| | | private Map<String, CellStyle> styles; |
| | | |
| | | /** |
| | | * 导å
¥å¯¼åºæ°æ®å表 |
| | | */ |
| | | private List<T> list; |
| | | |
| | | /** |
| | | * 注解å表 |
| | | */ |
| | | private List<Object[]> fields; |
| | | |
| | | /** |
| | | * å®ä½å¯¹è±¡ |
| | | */ |
| | | public Class<T> clazz; |
| | | |
| | | public ExcelUtil(Class<T> clazz) |
| | | { |
| | | this.clazz = clazz; |
| | | } |
| | | |
| | | public void init(List<T> list, String sheetName, Type type) |
| | | { |
| | | if (list == null) |
| | | { |
| | | list = new ArrayList<T>(); |
| | | } |
| | | this.list = list; |
| | | this.sheetName = sheetName; |
| | | this.type = type; |
| | | createExcelField(); |
| | | createWorkbook(); |
| | | } |
| | | |
| | | /** |
| | | * 对excel表åé»è®¤ç¬¬ä¸ä¸ªç´¢å¼åè½¬æ¢ælist |
| | | * |
| | | * @param is è¾å
¥æµ |
| | | * @return 转æ¢åéå |
| | | */ |
| | | public List<T> importExcel(InputStream is) throws Exception |
| | | { |
| | | return importExcel(StringUtils.EMPTY, is); |
| | | } |
| | | |
| | | /** |
| | | * 对excel表åæå®è¡¨æ ¼ç´¢å¼åè½¬æ¢ælist |
| | | * |
| | | * @param sheetName è¡¨æ ¼ç´¢å¼å |
| | | * @param is è¾å
¥æµ |
| | | * @return 转æ¢åéå |
| | | */ |
| | | public List<T> importExcel(String sheetName, InputStream is) throws Exception |
| | | { |
| | | this.type = Type.IMPORT; |
| | | this.wb = WorkbookFactory.create(is); |
| | | List<T> list = new ArrayList<T>(); |
| | | Sheet sheet = null; |
| | | if (StringUtils.isNotEmpty(sheetName)) |
| | | { |
| | | // 妿æå®sheetå,ååæå®sheetä¸çå
容. |
| | | sheet = wb.getSheet(sheetName); |
| | | } |
| | | else |
| | | { |
| | | // å¦æä¼ å
¥çsheetåä¸åå¨åé»è®¤æå第1个sheet. |
| | | sheet = wb.getSheetAt(0); |
| | | } |
| | | |
| | | if (sheet == null) |
| | | { |
| | | throw new IOException("æä»¶sheetä¸åå¨"); |
| | | } |
| | | |
| | | int rows = sheet.getPhysicalNumberOfRows(); |
| | | |
| | | if (rows > 0) |
| | | { |
| | | // å®ä¹ä¸ä¸ªmapç¨äºåæ¾excelåçåºå·åfield. |
| | | Map<String, Integer> cellMap = new HashMap<String, Integer>(); |
| | | // è·å表头 |
| | | Row heard = sheet.getRow(0); |
| | | for (int i = 0; i < heard.getPhysicalNumberOfCells(); i++) |
| | | { |
| | | Cell cell = heard.getCell(i); |
| | | if (StringUtils.isNotNull(cell != null)) |
| | | { |
| | | String value = this.getCellValue(heard, i).toString(); |
| | | cellMap.put(value, i); |
| | | } |
| | | else |
| | | { |
| | | cellMap.put(null, i); |
| | | } |
| | | } |
| | | // ææ°æ®æ¶æå¤ç å¾å°ç±»çææfield. |
| | | Field[] allFields = clazz.getDeclaredFields(); |
| | | // å®ä¹ä¸ä¸ªmapç¨äºåæ¾åçåºå·åfield. |
| | | Map<Integer, Field> fieldsMap = new HashMap<Integer, Field>(); |
| | | for (int col = 0; col < allFields.length; col++) |
| | | { |
| | | Field field = allFields[col]; |
| | | Excel attr = field.getAnnotation(Excel.class); |
| | | if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) |
| | | { |
| | | // 设置类çç§æåæ®µå±æ§å¯è®¿é®. |
| | | field.setAccessible(true); |
| | | Integer column = cellMap.get(attr.name()); |
| | | fieldsMap.put(column, field); |
| | | } |
| | | } |
| | | for (int i = 1; i < rows; i++) |
| | | { |
| | | // ä»ç¬¬2è¡å¼å§åæ°æ®,é»è®¤ç¬¬ä¸è¡æ¯è¡¨å¤´. |
| | | Row row = sheet.getRow(i); |
| | | T entity = null; |
| | | for (Map.Entry<Integer, Field> entry : fieldsMap.entrySet()) |
| | | { |
| | | Object val = this.getCellValue(row, entry.getKey()); |
| | | |
| | | // 妿ä¸åå¨å®ä¾åæ°å»º. |
| | | entity = (entity == null ? clazz.newInstance() : entity); |
| | | // ä»mapä¸å¾å°å¯¹åºåçfield. |
| | | Field field = fieldsMap.get(entry.getKey()); |
| | | // åå¾ç±»å,å¹¶æ ¹æ®å¯¹è±¡ç±»å设置å¼. |
| | | Class<?> fieldType = field.getType(); |
| | | if (String.class == fieldType) |
| | | { |
| | | String s = Convert.toStr(val); |
| | | if (StringUtils.endsWith(s, ".0")) |
| | | { |
| | | val = StringUtils.substringBefore(s, ".0"); |
| | | } |
| | | else |
| | | { |
| | | val = Convert.toStr(val); |
| | | } |
| | | } |
| | | else if ((Integer.TYPE == fieldType) || (Integer.class == fieldType)) |
| | | { |
| | | val = Convert.toInt(val); |
| | | } |
| | | else if ((Long.TYPE == fieldType) || (Long.class == fieldType)) |
| | | { |
| | | val = Convert.toLong(val); |
| | | } |
| | | else if ((Double.TYPE == fieldType) || (Double.class == fieldType)) |
| | | { |
| | | val = Convert.toDouble(val); |
| | | } |
| | | else if ((Float.TYPE == fieldType) || (Float.class == fieldType)) |
| | | { |
| | | val = Convert.toFloat(val); |
| | | } |
| | | else if (BigDecimal.class == fieldType) |
| | | { |
| | | val = Convert.toBigDecimal(val); |
| | | } |
| | | else if (Date.class == fieldType) |
| | | { |
| | | if (val instanceof String) |
| | | { |
| | | val = DateUtils.parseDate(val); |
| | | } |
| | | else if (val instanceof Double) |
| | | { |
| | | val = DateUtil.getJavaDate((Double) val); |
| | | } |
| | | } |
| | | if (StringUtils.isNotNull(fieldType)) |
| | | { |
| | | Excel attr = field.getAnnotation(Excel.class); |
| | | String propertyName = field.getName(); |
| | | if (StringUtils.isNotEmpty(attr.targetAttr())) |
| | | { |
| | | propertyName = field.getName() + "." + attr.targetAttr(); |
| | | } |
| | | else if (StringUtils.isNotEmpty(attr.readConverterExp())) |
| | | { |
| | | val = reverseByExp(String.valueOf(val), attr.readConverterExp()); |
| | | } |
| | | ReflectUtils.invokeSetter(entity, propertyName, val); |
| | | } |
| | | } |
| | | list.add(entity); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 对listæ°æ®æºå°å
¶éé¢çæ°æ®å¯¼å
¥å°excel表å |
| | | * |
| | | * @param list å¯¼åºæ°æ®éå |
| | | * @param sheetName å·¥ä½è¡¨çåç§° |
| | | * @return ç»æ |
| | | */ |
| | | public AjaxResult exportExcel(List<T> list, String sheetName) |
| | | { |
| | | this.init(list, sheetName, Type.EXPORT); |
| | | return exportExcel(); |
| | | } |
| | | |
| | | /** |
| | | * 对listæ°æ®æºå°å
¶éé¢çæ°æ®å¯¼å
¥å°excel表å |
| | | * |
| | | * @param sheetName å·¥ä½è¡¨çåç§° |
| | | * @return ç»æ |
| | | */ |
| | | public AjaxResult importTemplateExcel(String sheetName) |
| | | { |
| | | this.init(null, sheetName, Type.IMPORT); |
| | | return exportExcel(); |
| | | } |
| | | |
| | | /** |
| | | * 对listæ°æ®æºå°å
¶éé¢çæ°æ®å¯¼å
¥å°excel表å |
| | | * |
| | | * @return ç»æ |
| | | */ |
| | | public AjaxResult exportExcel() |
| | | { |
| | | OutputStream out = null; |
| | | try |
| | | { |
| | | // ååºä¸å
±æå¤å°ä¸ªsheet. |
| | | double sheetNo = Math.ceil(list.size() / sheetSize); |
| | | for (int index = 0; index <= sheetNo; index++) |
| | | { |
| | | createSheet(sheetNo, index); |
| | | |
| | | // 产çä¸è¡ |
| | | Row row = sheet.createRow(0); |
| | | int column = 0; |
| | | // åå
¥åä¸ªåæ®µçå头åç§° |
| | | for (Object[] os : fields) |
| | | { |
| | | Excel excel = (Excel) os[1]; |
| | | this.createCell(excel, row, column++); |
| | | } |
| | | if (Type.EXPORT.equals(type)) |
| | | { |
| | | fillExcelData(index, row); |
| | | } |
| | | } |
| | | String filename = encodingFilename(sheetName); |
| | | out = new FileOutputStream(getAbsoluteFile(filename)); |
| | | wb.write(out); |
| | | return AjaxResult.success(filename); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | log.error("导åºExcelå¼å¸¸{}", e.getMessage()); |
| | | throw new CustomException("导åºExcel失败ï¼è¯·èç³»ç½ç«ç®¡çåï¼"); |
| | | } |
| | | finally |
| | | { |
| | | if (wb != null) |
| | | { |
| | | try |
| | | { |
| | | wb.close(); |
| | | } |
| | | catch (IOException e1) |
| | | { |
| | | e1.printStackTrace(); |
| | | } |
| | | } |
| | | if (out != null) |
| | | { |
| | | try |
| | | { |
| | | out.close(); |
| | | } |
| | | catch (IOException e1) |
| | | { |
| | | e1.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¡«å
excelæ°æ® |
| | | * |
| | | * @param index åºå· |
| | | * @param row åå
æ ¼è¡ |
| | | */ |
| | | public void fillExcelData(int index, Row row) |
| | | { |
| | | int startNo = index * sheetSize; |
| | | int endNo = Math.min(startNo + sheetSize, list.size()); |
| | | for (int i = startNo; i < endNo; i++) |
| | | { |
| | | row = sheet.createRow(i + 1 - startNo); |
| | | // å¾å°å¯¼åºå¯¹è±¡. |
| | | T vo = (T) list.get(i); |
| | | int column = 0; |
| | | for (Object[] os : fields) |
| | | { |
| | | Field field = (Field) os[0]; |
| | | Excel excel = (Excel) os[1]; |
| | | // 设置å®ä½ç±»ç§æå±æ§å¯è®¿é® |
| | | field.setAccessible(true); |
| | | this.addCell(excel, row, vo, field, column++); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åå»ºè¡¨æ ¼æ ·å¼ |
| | | * |
| | | * @param wb å·¥ä½è对象 |
| | | * @return æ ·å¼å表 |
| | | */ |
| | | private Map<String, CellStyle> createStyles(Workbook wb) |
| | | { |
| | | // åå
¥åæ¡è®°å½,æ¯æ¡è®°å½å¯¹åºexcel表ä¸çä¸è¡ |
| | | Map<String, CellStyle> styles = new HashMap<String, CellStyle>(); |
| | | CellStyle style = wb.createCellStyle(); |
| | | style.setAlignment(HorizontalAlignment.CENTER); |
| | | style.setVerticalAlignment(VerticalAlignment.CENTER); |
| | | style.setBorderRight(BorderStyle.THIN); |
| | | style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); |
| | | style.setBorderLeft(BorderStyle.THIN); |
| | | style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); |
| | | style.setBorderTop(BorderStyle.THIN); |
| | | style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); |
| | | style.setBorderBottom(BorderStyle.THIN); |
| | | style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); |
| | | Font dataFont = wb.createFont(); |
| | | dataFont.setFontName("Arial"); |
| | | dataFont.setFontHeightInPoints((short) 10); |
| | | style.setFont(dataFont); |
| | | styles.put("data", style); |
| | | |
| | | style = wb.createCellStyle(); |
| | | style.cloneStyleFrom(styles.get("data")); |
| | | style.setAlignment(HorizontalAlignment.CENTER); |
| | | style.setVerticalAlignment(VerticalAlignment.CENTER); |
| | | style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex()); |
| | | style.setFillPattern(FillPatternType.SOLID_FOREGROUND); |
| | | Font headerFont = wb.createFont(); |
| | | headerFont.setFontName("Arial"); |
| | | headerFont.setFontHeightInPoints((short) 10); |
| | | headerFont.setBold(true); |
| | | headerFont.setColor(IndexedColors.WHITE.getIndex()); |
| | | style.setFont(headerFont); |
| | | styles.put("header", style); |
| | | |
| | | return styles; |
| | | } |
| | | |
| | | /** |
| | | * å建åå
æ ¼ |
| | | */ |
| | | public Cell createCell(Excel attr, Row row, int column) |
| | | { |
| | | // å建å |
| | | Cell cell = row.createCell(column); |
| | | // åå
¥åä¿¡æ¯ |
| | | cell.setCellValue(attr.name()); |
| | | setDataValidation(attr, row, column); |
| | | cell.setCellStyle(styles.get("header")); |
| | | return cell; |
| | | } |
| | | |
| | | /** |
| | | * 设置åå
æ ¼ä¿¡æ¯ |
| | | * |
| | | * @param value åå
æ ¼å¼ |
| | | * @param attr 注解ç¸å
³ |
| | | * @param cell åå
æ ¼ä¿¡æ¯ |
| | | */ |
| | | public void setCellVo(Object value, Excel attr, Cell cell) |
| | | { |
| | | if (ColumnType.STRING == attr.cellType()) |
| | | { |
| | | cell.setCellType(CellType.NUMERIC); |
| | | cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : value + attr.suffix()); |
| | | } |
| | | else if (ColumnType.NUMERIC == attr.cellType()) |
| | | { |
| | | cell.setCellType(CellType.NUMERIC); |
| | | cell.setCellValue(Integer.parseInt(value + "")); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åå»ºè¡¨æ ¼æ ·å¼ |
| | | */ |
| | | public void setDataValidation(Excel attr, Row row, int column) |
| | | { |
| | | if (attr.name().indexOf("注ï¼") >= 0) |
| | | { |
| | | sheet.setColumnWidth(column, 6000); |
| | | } |
| | | else |
| | | { |
| | | // 设置å宽 |
| | | sheet.setColumnWidth(column, (int) ((attr.width() + 0.72) * 256)); |
| | | row.setHeight((short) (attr.height() * 20)); |
| | | } |
| | | // å¦æè®¾ç½®äºæç¤ºä¿¡æ¯åé¼ æ æ¾ä¸å»æç¤º. |
| | | if (StringUtils.isNotEmpty(attr.prompt())) |
| | | { |
| | | // è¿éé»è®¤è®¾äº2-101åæç¤º. |
| | | setXSSFPrompt(sheet, "", attr.prompt(), 1, 100, column, column); |
| | | } |
| | | // å¦æè®¾ç½®äºcombo屿§åæ¬ååªè½éæ©ä¸è½è¾å
¥ |
| | | if (attr.combo().length > 0) |
| | | { |
| | | // è¿éé»è®¤è®¾äº2-101ååªè½éæ©ä¸è½è¾å
¥. |
| | | setXSSFValidation(sheet, attr.combo(), 1, 100, column, column); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ·»å åå
æ ¼ |
| | | */ |
| | | public Cell addCell(Excel attr, Row row, T vo, Field field, int column) |
| | | { |
| | | Cell cell = null; |
| | | try |
| | | { |
| | | // 设置è¡é« |
| | | row.setHeight((short) (attr.height() * 20)); |
| | | // æ ¹æ®Excelä¸è®¾ç½®æ
åµå³å®æ¯å¦å¯¼åº,æäºæ
åµéè¦ä¿æä¸ºç©º,å¸æç¨æ·å¡«åè¿ä¸å. |
| | | if (attr.isExport()) |
| | | { |
| | | // å建cell |
| | | cell = row.createCell(column); |
| | | cell.setCellStyle(styles.get("data")); |
| | | |
| | | // ç¨äºè¯»å对象ä¸ç屿§ |
| | | Object value = getTargetValue(vo, field, attr); |
| | | String dateFormat = attr.dateFormat(); |
| | | String readConverterExp = attr.readConverterExp(); |
| | | if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value)) |
| | | { |
| | | cell.setCellValue(DateUtils.parseDateToStr(dateFormat, (Date) value)); |
| | | } |
| | | else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value)) |
| | | { |
| | | cell.setCellValue(convertByExp(String.valueOf(value), readConverterExp)); |
| | | } |
| | | else |
| | | { |
| | | // 设置åç±»å |
| | | setCellVo(value, attr, cell); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | log.error("导åºExcel失败{}", e); |
| | | } |
| | | return cell; |
| | | } |
| | | |
| | | /** |
| | | * 设置 POI XSSFSheet åå
æ ¼æç¤º |
| | | * |
| | | * @param sheet 表å |
| | | * @param promptTitle æç¤ºæ é¢ |
| | | * @param promptContent æç¤ºå
容 |
| | | * @param firstRow å¼å§è¡ |
| | | * @param endRow ç»æè¡ |
| | | * @param firstCol å¼å§å |
| | | * @param endCol ç»æå |
| | | */ |
| | | public void setXSSFPrompt(Sheet sheet, String promptTitle, String promptContent, int firstRow, int endRow, |
| | | int firstCol, int endCol) |
| | | { |
| | | DataValidationHelper helper = sheet.getDataValidationHelper(); |
| | | DataValidationConstraint constraint = helper.createCustomConstraint("DD1"); |
| | | CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); |
| | | DataValidation dataValidation = helper.createValidation(constraint, regions); |
| | | dataValidation.createPromptBox(promptTitle, promptContent); |
| | | dataValidation.setShowPromptBox(true); |
| | | sheet.addValidationData(dataValidation); |
| | | } |
| | | |
| | | /** |
| | | * 设置æäºåçå¼åªè½è¾å
¥é¢å¶çæ°æ®,æ¾ç¤ºä¸ææ¡. |
| | | * |
| | | * @param sheet è¦è®¾ç½®çsheet. |
| | | * @param textlist ä¸ææ¡æ¾ç¤ºçå
容 |
| | | * @param firstRow å¼å§è¡ |
| | | * @param endRow ç»æè¡ |
| | | * @param firstCol å¼å§å |
| | | * @param endCol ç»æå |
| | | * @return 设置好çsheet. |
| | | */ |
| | | public void setXSSFValidation(Sheet sheet, String[] textlist, int firstRow, int endRow, int firstCol, int endCol) |
| | | { |
| | | DataValidationHelper helper = sheet.getDataValidationHelper(); |
| | | // å è½½ä¸æå表å
容 |
| | | DataValidationConstraint constraint = helper.createExplicitListConstraint(textlist); |
| | | // è®¾ç½®æ°æ®æææ§å è½½å¨åªä¸ªåå
æ ¼ä¸,åä¸ªåæ°å嫿¯ï¼èµ·å§è¡ãç»æ¢è¡ãèµ·å§åãç»æ¢å |
| | | CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); |
| | | // æ°æ®æææ§å¯¹è±¡ |
| | | DataValidation dataValidation = helper.createValidation(constraint, regions); |
| | | // å¤çExcelå
¼å®¹æ§é®é¢ |
| | | if (dataValidation instanceof XSSFDataValidation) |
| | | { |
| | | dataValidation.setSuppressDropDownArrow(true); |
| | | dataValidation.setShowErrorBox(true); |
| | | } |
| | | else |
| | | { |
| | | dataValidation.setSuppressDropDownArrow(false); |
| | | } |
| | | |
| | | sheet.addValidationData(dataValidation); |
| | | } |
| | | |
| | | /** |
| | | * è§£æå¯¼åºå¼ 0=ç·,1=女,2=æªç¥ |
| | | * |
| | | * @param propertyValue åæ°å¼ |
| | | * @param converterExp ç¿»è¯æ³¨è§£ |
| | | * @return è§£æåå¼ |
| | | * @throws Exception |
| | | */ |
| | | public static String convertByExp(String propertyValue, String converterExp) throws Exception |
| | | { |
| | | try |
| | | { |
| | | String[] convertSource = converterExp.split(","); |
| | | for (String item : convertSource) |
| | | { |
| | | String[] itemArray = item.split("="); |
| | | if (itemArray[0].equals(propertyValue)) |
| | | { |
| | | return itemArray[1]; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw e; |
| | | } |
| | | return propertyValue; |
| | | } |
| | | |
| | | /** |
| | | * ååè§£æå¼ ç·=0,女=1,æªç¥=2 |
| | | * |
| | | * @param propertyValue åæ°å¼ |
| | | * @param converterExp ç¿»è¯æ³¨è§£ |
| | | * @return è§£æåå¼ |
| | | * @throws Exception |
| | | */ |
| | | public static String reverseByExp(String propertyValue, String converterExp) throws Exception |
| | | { |
| | | try |
| | | { |
| | | String[] convertSource = converterExp.split(","); |
| | | for (String item : convertSource) |
| | | { |
| | | String[] itemArray = item.split("="); |
| | | if (itemArray[1].equals(propertyValue)) |
| | | { |
| | | return itemArray[0]; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw e; |
| | | } |
| | | return propertyValue; |
| | | } |
| | | |
| | | /** |
| | | * ç¼ç æä»¶å |
| | | */ |
| | | public String encodingFilename(String filename) |
| | | { |
| | | filename = UUID.randomUUID().toString() + "_" + filename + ".xlsx"; |
| | | return filename; |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸è½½è·¯å¾ |
| | | * |
| | | * @param filename æä»¶åç§° |
| | | */ |
| | | public String getAbsoluteFile(String filename) |
| | | { |
| | | String downloadPath = RuoYiConfig.getDownloadPath() + filename; |
| | | File desc = new File(downloadPath); |
| | | if (!desc.getParentFile().exists()) |
| | | { |
| | | desc.getParentFile().mkdirs(); |
| | | } |
| | | return downloadPath; |
| | | } |
| | | |
| | | /** |
| | | * è·åbeanä¸ç屿§å¼ |
| | | * |
| | | * @param vo å®ä½å¯¹è±¡ |
| | | * @param field åæ®µ |
| | | * @param excel 注解 |
| | | * @return æç»ç屿§å¼ |
| | | * @throws Exception |
| | | */ |
| | | private Object getTargetValue(T vo, Field field, Excel excel) throws Exception |
| | | { |
| | | Object o = field.get(vo); |
| | | if (StringUtils.isNotEmpty(excel.targetAttr())) |
| | | { |
| | | String target = excel.targetAttr(); |
| | | if (target.indexOf(".") > -1) |
| | | { |
| | | String[] targets = target.split("[.]"); |
| | | for (String name : targets) |
| | | { |
| | | o = getValue(o, name); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | o = getValue(o, target); |
| | | } |
| | | } |
| | | return o; |
| | | } |
| | | |
| | | /** |
| | | * 以类ç屿§çgetæ¹æ³æ¹æ³å½¢å¼è·åå¼ |
| | | * |
| | | * @param o |
| | | * @param name |
| | | * @return value |
| | | * @throws Exception |
| | | */ |
| | | private Object getValue(Object o, String name) throws Exception |
| | | { |
| | | if (StringUtils.isNotEmpty(name)) |
| | | { |
| | | Class<?> clazz = o.getClass(); |
| | | String methodName = "get" + name.substring(0, 1).toUpperCase() + name.substring(1); |
| | | Method method = clazz.getMethod(methodName); |
| | | o = method.invoke(o); |
| | | } |
| | | return o; |
| | | } |
| | | |
| | | /** |
| | | * å¾å°ææå®ä¹å段 |
| | | */ |
| | | private void createExcelField() |
| | | { |
| | | this.fields = new ArrayList<Object[]>(); |
| | | List<Field> tempFields = new ArrayList<>(); |
| | | tempFields.addAll(Arrays.asList(clazz.getSuperclass().getDeclaredFields())); |
| | | tempFields.addAll(Arrays.asList(clazz.getDeclaredFields())); |
| | | for (Field field : tempFields) |
| | | { |
| | | // åæ³¨è§£ |
| | | if (field.isAnnotationPresent(Excel.class)) |
| | | { |
| | | putToField(field, field.getAnnotation(Excel.class)); |
| | | } |
| | | |
| | | // 夿³¨è§£ |
| | | if (field.isAnnotationPresent(Excels.class)) |
| | | { |
| | | Excels attrs = field.getAnnotation(Excels.class); |
| | | Excel[] excels = attrs.value(); |
| | | for (Excel excel : excels) |
| | | { |
| | | putToField(field, excel); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¾å°å段éåä¸ |
| | | */ |
| | | private void putToField(Field field, Excel attr) |
| | | { |
| | | if (attr != null && (attr.type() == Type.ALL || attr.type() == type)) |
| | | { |
| | | this.fields.add(new Object[] { field, attr }); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å建ä¸ä¸ªå·¥ä½ç°¿ |
| | | */ |
| | | public void createWorkbook() |
| | | { |
| | | this.wb = new SXSSFWorkbook(500); |
| | | } |
| | | |
| | | /** |
| | | * å建工ä½è¡¨ |
| | | * |
| | | * @param sheetNo sheetæ°é |
| | | * @param index åºå· |
| | | */ |
| | | public void createSheet(double sheetNo, int index) |
| | | { |
| | | this.sheet = wb.createSheet(); |
| | | this.styles = createStyles(wb); |
| | | // 设置工ä½è¡¨çåç§°. |
| | | if (sheetNo == 0) |
| | | { |
| | | wb.setSheetName(index, sheetName); |
| | | } |
| | | else |
| | | { |
| | | wb.setSheetName(index, sheetName + index); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·ååå
æ ¼å¼ |
| | | * |
| | | * @param row è·åçè¡ |
| | | * @param column è·ååå
æ ¼åå· |
| | | * @return åå
æ ¼å¼ |
| | | */ |
| | | public Object getCellValue(Row row, int column) |
| | | { |
| | | if (row == null) |
| | | { |
| | | return row; |
| | | } |
| | | Object val = ""; |
| | | try |
| | | { |
| | | Cell cell = row.getCell(column); |
| | | if (cell != null) |
| | | { |
| | | if (cell.getCellTypeEnum() == CellType.NUMERIC || cell.getCellTypeEnum() == CellType.FORMULA) |
| | | { |
| | | val = cell.getNumericCellValue(); |
| | | if (HSSFDateUtil.isCellDateFormatted(cell)) |
| | | { |
| | | val = DateUtil.getJavaDate((Double) val); // POI Excel æ¥ææ ¼å¼è½¬æ¢ |
| | | } |
| | | else |
| | | { |
| | | if ((Double) val % 1 > 0) |
| | | { |
| | | val = new DecimalFormat("0.00").format(val); |
| | | } |
| | | else |
| | | { |
| | | val = new DecimalFormat("0").format(val); |
| | | } |
| | | } |
| | | } |
| | | else if (cell.getCellTypeEnum() == CellType.STRING) |
| | | { |
| | | val = cell.getStringCellValue(); |
| | | } |
| | | else if (cell.getCellTypeEnum() == CellType.BOOLEAN) |
| | | { |
| | | val = cell.getBooleanCellValue(); |
| | | } |
| | | else if (cell.getCellTypeEnum() == CellType.ERROR) |
| | | { |
| | | val = cell.getErrorCellValue(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return val; |
| | | } |
| | | return val; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils.reflect; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.lang.reflect.InvocationTargetException; |
| | | import java.lang.reflect.Method; |
| | | import java.lang.reflect.Modifier; |
| | | import java.lang.reflect.ParameterizedType; |
| | | import java.lang.reflect.Type; |
| | | import java.util.Date; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.commons.lang3.Validate; |
| | | import org.apache.poi.ss.usermodel.DateUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.ruoyi.common.core.text.Convert; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | |
| | | /** |
| | | * åå°å·¥å
·ç±». æä¾è°ç¨getter/setteræ¹æ³, 访é®ç§æåé, è°ç¨ç§ææ¹æ³, è·åæ³åç±»åClass, 被AOPè¿ççå®ç±»çå·¥å
·å½æ°. |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @SuppressWarnings("rawtypes") |
| | | public class ReflectUtils |
| | | { |
| | | private static final String SETTER_PREFIX = "set"; |
| | | |
| | | private static final String GETTER_PREFIX = "get"; |
| | | |
| | | private static final String CGLIB_CLASS_SEPARATOR = "$$"; |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(ReflectUtils.class); |
| | | |
| | | /** |
| | | * è°ç¨Getteræ¹æ³. |
| | | * æ¯æå¤çº§ï¼å¦ï¼å¯¹è±¡å.对象å.æ¹æ³ |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public static <E> E invokeGetter(Object obj, String propertyName) |
| | | { |
| | | Object object = obj; |
| | | for (String name : StringUtils.split(propertyName, ".")) |
| | | { |
| | | String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(name); |
| | | object = invokeMethod(object, getterMethodName, new Class[] {}, new Object[] {}); |
| | | } |
| | | return (E) object; |
| | | } |
| | | |
| | | /** |
| | | * è°ç¨Setteræ¹æ³, ä»
å¹é
æ¹æ³åã |
| | | * æ¯æå¤çº§ï¼å¦ï¼å¯¹è±¡å.对象å.æ¹æ³ |
| | | */ |
| | | public static <E> void invokeSetter(Object obj, String propertyName, E value) |
| | | { |
| | | Object object = obj; |
| | | String[] names = StringUtils.split(propertyName, "."); |
| | | for (int i = 0; i < names.length; i++) |
| | | { |
| | | if (i < names.length - 1) |
| | | { |
| | | String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(names[i]); |
| | | object = invokeMethod(object, getterMethodName, new Class[] {}, new Object[] {}); |
| | | } |
| | | else |
| | | { |
| | | String setterMethodName = SETTER_PREFIX + StringUtils.capitalize(names[i]); |
| | | invokeMethodByName(object, setterMethodName, new Object[] { value }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ç´æ¥è¯»åå¯¹è±¡å±æ§å¼, æ è§private/protected修饰符, ä¸ç»è¿getter彿°. |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public static <E> E getFieldValue(final Object obj, final String fieldName) |
| | | { |
| | | Field field = getAccessibleField(obj, fieldName); |
| | | if (field == null) |
| | | { |
| | | logger.debug("å¨ [" + obj.getClass() + "] ä¸ï¼æ²¡ææ¾å° [" + fieldName + "] åæ®µ "); |
| | | return null; |
| | | } |
| | | E result = null; |
| | | try |
| | | { |
| | | result = (E) field.get(obj); |
| | | } |
| | | catch (IllegalAccessException e) |
| | | { |
| | | logger.error("ä¸å¯è½æåºçå¼å¸¸{}", e.getMessage()); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * ç´æ¥è®¾ç½®å¯¹è±¡å±æ§å¼, æ è§private/protected修饰符, ä¸ç»è¿setter彿°. |
| | | */ |
| | | public static <E> void setFieldValue(final Object obj, final String fieldName, final E value) |
| | | { |
| | | Field field = getAccessibleField(obj, fieldName); |
| | | if (field == null) |
| | | { |
| | | // throw new IllegalArgumentException("å¨ [" + obj.getClass() + "] ä¸ï¼æ²¡ææ¾å° [" + fieldName + "] åæ®µ "); |
| | | logger.debug("å¨ [" + obj.getClass() + "] ä¸ï¼æ²¡ææ¾å° [" + fieldName + "] åæ®µ "); |
| | | return; |
| | | } |
| | | try |
| | | { |
| | | field.set(obj, value); |
| | | } |
| | | catch (IllegalAccessException e) |
| | | { |
| | | logger.error("ä¸å¯è½æåºçå¼å¸¸: {}", e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ç´æ¥è°ç¨å¯¹è±¡æ¹æ³, æ è§private/protected修饰符. |
| | | * ç¨äºä¸æ¬¡æ§è°ç¨çæ
åµï¼å¦ååºä½¿ç¨getAccessibleMethod()彿°è·å¾Methodååå¤è°ç¨. |
| | | * åæ¶å¹é
æ¹æ³å+åæ°ç±»åï¼ |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public static <E> E invokeMethod(final Object obj, final String methodName, final Class<?>[] parameterTypes, |
| | | final Object[] args) |
| | | { |
| | | if (obj == null || methodName == null) |
| | | { |
| | | return null; |
| | | } |
| | | Method method = getAccessibleMethod(obj, methodName, parameterTypes); |
| | | if (method == null) |
| | | { |
| | | logger.debug("å¨ [" + obj.getClass() + "] ä¸ï¼æ²¡ææ¾å° [" + methodName + "] æ¹æ³ "); |
| | | return null; |
| | | } |
| | | try |
| | | { |
| | | return (E) method.invoke(obj, args); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | String msg = "method: " + method + ", obj: " + obj + ", args: " + args + ""; |
| | | throw convertReflectionExceptionToUnchecked(msg, e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ç´æ¥è°ç¨å¯¹è±¡æ¹æ³, æ è§private/protectedä¿®é¥°ç¬¦ï¼ |
| | | * ç¨äºä¸æ¬¡æ§è°ç¨çæ
åµï¼å¦ååºä½¿ç¨getAccessibleMethodByName()彿°è·å¾Methodååå¤è°ç¨. |
| | | * åªå¹é
彿°åï¼å¦ææå¤ä¸ªåå彿°è°ç¨ç¬¬ä¸ä¸ªã |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public static <E> E invokeMethodByName(final Object obj, final String methodName, final Object[] args) |
| | | { |
| | | Method method = getAccessibleMethodByName(obj, methodName, args.length); |
| | | if (method == null) |
| | | { |
| | | // å¦æä¸ºç©ºä¸æ¥éï¼ç´æ¥è¿å空ã |
| | | logger.debug("å¨ [" + obj.getClass() + "] ä¸ï¼æ²¡ææ¾å° [" + methodName + "] æ¹æ³ "); |
| | | return null; |
| | | } |
| | | try |
| | | { |
| | | // ç±»å转æ¢ï¼å°åæ°æ°æ®ç±»å转æ¢ä¸ºç®æ æ¹æ³åæ°ç±»åï¼ |
| | | Class<?>[] cs = method.getParameterTypes(); |
| | | for (int i = 0; i < cs.length; i++) |
| | | { |
| | | if (args[i] != null && !args[i].getClass().equals(cs[i])) |
| | | { |
| | | if (cs[i] == String.class) |
| | | { |
| | | args[i] = Convert.toStr(args[i]); |
| | | if (StringUtils.endsWith((String) args[i], ".0")) |
| | | { |
| | | args[i] = StringUtils.substringBefore((String) args[i], ".0"); |
| | | } |
| | | } |
| | | else if (cs[i] == Integer.class) |
| | | { |
| | | args[i] = Convert.toInt(args[i]); |
| | | } |
| | | else if (cs[i] == Long.class) |
| | | { |
| | | args[i] = Convert.toLong(args[i]); |
| | | } |
| | | else if (cs[i] == Double.class) |
| | | { |
| | | args[i] = Convert.toDouble(args[i]); |
| | | } |
| | | else if (cs[i] == Float.class) |
| | | { |
| | | args[i] = Convert.toFloat(args[i]); |
| | | } |
| | | else if (cs[i] == Date.class) |
| | | { |
| | | if (args[i] instanceof String) |
| | | { |
| | | args[i] = DateUtils.parseDate(args[i]); |
| | | } |
| | | else |
| | | { |
| | | args[i] = DateUtil.getJavaDate((Double) args[i]); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return (E) method.invoke(obj, args); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | String msg = "method: " + method + ", obj: " + obj + ", args: " + args + ""; |
| | | throw convertReflectionExceptionToUnchecked(msg, e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 循ç¯åä¸è½¬å, è·å对象çDeclaredField, 并强å¶è®¾ç½®ä¸ºå¯è®¿é®. |
| | | * å¦åä¸è½¬åå°Object仿 æ³æ¾å°, è¿ånull. |
| | | */ |
| | | public static Field getAccessibleField(final Object obj, final String fieldName) |
| | | { |
| | | // ä¸ºç©ºä¸æ¥éãç´æ¥è¿å null |
| | | if (obj == null) |
| | | { |
| | | return null; |
| | | } |
| | | Validate.notBlank(fieldName, "fieldName can't be blank"); |
| | | for (Class<?> superClass = obj.getClass(); superClass != Object.class; superClass = superClass.getSuperclass()) |
| | | { |
| | | try |
| | | { |
| | | Field field = superClass.getDeclaredField(fieldName); |
| | | makeAccessible(field); |
| | | return field; |
| | | } |
| | | catch (NoSuchFieldException e) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 循ç¯åä¸è½¬å, è·å对象çDeclaredMethod,并强å¶è®¾ç½®ä¸ºå¯è®¿é®. |
| | | * å¦åä¸è½¬åå°Object仿 æ³æ¾å°, è¿ånull. |
| | | * å¹é
彿°å+åæ°ç±»åã |
| | | * ç¨äºæ¹æ³éè¦è¢«å¤æ¬¡è°ç¨çæ
åµ. å
ä½¿ç¨æ¬å½æ°å
åå¾Method,ç¶åè°ç¨Method.invoke(Object obj, Object... args) |
| | | */ |
| | | public static Method getAccessibleMethod(final Object obj, final String methodName, |
| | | final Class<?>... parameterTypes) |
| | | { |
| | | // ä¸ºç©ºä¸æ¥éãç´æ¥è¿å null |
| | | if (obj == null) |
| | | { |
| | | return null; |
| | | } |
| | | Validate.notBlank(methodName, "methodName can't be blank"); |
| | | for (Class<?> searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass()) |
| | | { |
| | | try |
| | | { |
| | | Method method = searchType.getDeclaredMethod(methodName, parameterTypes); |
| | | makeAccessible(method); |
| | | return method; |
| | | } |
| | | catch (NoSuchMethodException e) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 循ç¯åä¸è½¬å, è·å对象çDeclaredMethod,并强å¶è®¾ç½®ä¸ºå¯è®¿é®. |
| | | * å¦åä¸è½¬åå°Object仿 æ³æ¾å°, è¿ånull. |
| | | * åªå¹é
彿°åã |
| | | * ç¨äºæ¹æ³éè¦è¢«å¤æ¬¡è°ç¨çæ
åµ. å
ä½¿ç¨æ¬å½æ°å
åå¾Method,ç¶åè°ç¨Method.invoke(Object obj, Object... args) |
| | | */ |
| | | public static Method getAccessibleMethodByName(final Object obj, final String methodName, int argsNum) |
| | | { |
| | | // ä¸ºç©ºä¸æ¥éãç´æ¥è¿å null |
| | | if (obj == null) |
| | | { |
| | | return null; |
| | | } |
| | | Validate.notBlank(methodName, "methodName can't be blank"); |
| | | for (Class<?> searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass()) |
| | | { |
| | | Method[] methods = searchType.getDeclaredMethods(); |
| | | for (Method method : methods) |
| | | { |
| | | if (method.getName().equals(methodName) && method.getParameterTypes().length == argsNum) |
| | | { |
| | | makeAccessible(method); |
| | | return method; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * æ¹åprivate/protectedçæ¹æ³ä¸ºpublicï¼å°½éä¸è°ç¨å®é
æ¹å¨çè¯å¥ï¼é¿å
JDKçSecurityManageræ±æ¨ã |
| | | */ |
| | | public static void makeAccessible(Method method) |
| | | { |
| | | if ((!Modifier.isPublic(method.getModifiers()) || !Modifier.isPublic(method.getDeclaringClass().getModifiers())) |
| | | && !method.isAccessible()) |
| | | { |
| | | method.setAccessible(true); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¹åprivate/protectedçæååé为publicï¼å°½éä¸è°ç¨å®é
æ¹å¨çè¯å¥ï¼é¿å
JDKçSecurityManageræ±æ¨ã |
| | | */ |
| | | public static void makeAccessible(Field field) |
| | | { |
| | | if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers()) |
| | | || Modifier.isFinal(field.getModifiers())) && !field.isAccessible()) |
| | | { |
| | | field.setAccessible(true); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * éè¿åå°, è·å¾Classå®ä¹ä¸å£°æçæ³ååæ°çç±»å, æ³¨ææ³åå¿
é¡»å®ä¹å¨ç¶ç±»å¤ |
| | | * 妿 æ³æ¾å°, è¿åObject.class. |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public static <T> Class<T> getClassGenricType(final Class clazz) |
| | | { |
| | | return getClassGenricType(clazz, 0); |
| | | } |
| | | |
| | | /** |
| | | * éè¿åå°, è·å¾Classå®ä¹ä¸å£°æçç¶ç±»çæ³ååæ°çç±»å. |
| | | * 妿 æ³æ¾å°, è¿åObject.class. |
| | | */ |
| | | public static Class getClassGenricType(final Class clazz, final int index) |
| | | { |
| | | Type genType = clazz.getGenericSuperclass(); |
| | | |
| | | if (!(genType instanceof ParameterizedType)) |
| | | { |
| | | logger.debug(clazz.getSimpleName() + "'s superclass not ParameterizedType"); |
| | | return Object.class; |
| | | } |
| | | |
| | | Type[] params = ((ParameterizedType) genType).getActualTypeArguments(); |
| | | |
| | | if (index >= params.length || index < 0) |
| | | { |
| | | logger.debug("Index: " + index + ", Size of " + clazz.getSimpleName() + "'s Parameterized Type: " |
| | | + params.length); |
| | | return Object.class; |
| | | } |
| | | if (!(params[index] instanceof Class)) |
| | | { |
| | | logger.debug(clazz.getSimpleName() + " not set the actual class on superclass generic parameter"); |
| | | return Object.class; |
| | | } |
| | | |
| | | return (Class) params[index]; |
| | | } |
| | | |
| | | public static Class<?> getUserClass(Object instance) |
| | | { |
| | | if (instance == null) |
| | | { |
| | | throw new RuntimeException("Instance must not be null"); |
| | | } |
| | | Class clazz = instance.getClass(); |
| | | if (clazz != null && clazz.getName().contains(CGLIB_CLASS_SEPARATOR)) |
| | | { |
| | | Class<?> superClass = clazz.getSuperclass(); |
| | | if (superClass != null && !Object.class.equals(superClass)) |
| | | { |
| | | return superClass; |
| | | } |
| | | } |
| | | return clazz; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * å°åå°æ¶çchecked exception转æ¢ä¸ºunchecked exception. |
| | | */ |
| | | public static RuntimeException convertReflectionExceptionToUnchecked(String msg, Exception e) |
| | | { |
| | | if (e instanceof IllegalAccessException || e instanceof IllegalArgumentException |
| | | || e instanceof NoSuchMethodException) |
| | | { |
| | | return new IllegalArgumentException(msg, e); |
| | | } |
| | | else if (e instanceof InvocationTargetException) |
| | | { |
| | | return new RuntimeException(msg, ((InvocationTargetException) e).getTargetException()); |
| | | } |
| | | return new RuntimeException(msg, e); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.aspectj.lang.annotation; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * èªå®ä¹å¯¼åºExcelæ°æ®æ³¨è§£ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Target(ElementType.FIELD) |
| | | public @interface Excel |
| | | { |
| | | /** |
| | | * 导åºå°Excelä¸çåå. |
| | | */ |
| | | public String name() default ""; |
| | | |
| | | /** |
| | | * æ¥ææ ¼å¼, å¦: yyyy-MM-dd |
| | | */ |
| | | public String dateFormat() default ""; |
| | | |
| | | /** |
| | | * 读åå
å®¹è½¬è¡¨è¾¾å¼ (å¦: 0=ç·,1=女,2=æªç¥) |
| | | */ |
| | | public String readConverterExp() default ""; |
| | | |
| | | /** |
| | | * 导åºç±»åï¼0æ°å 1åç¬¦ä¸²ï¼ |
| | | */ |
| | | public ColumnType cellType() default ColumnType.STRING; |
| | | |
| | | /** |
| | | * å¯¼åºæ¶å¨excel䏿¯ä¸ªåçé«åº¦ åä½ä¸ºå符 |
| | | */ |
| | | public double height() default 14; |
| | | |
| | | /** |
| | | * å¯¼åºæ¶å¨excel䏿¯ä¸ªåç宽 åä½ä¸ºå符 |
| | | */ |
| | | public double width() default 16; |
| | | |
| | | /** |
| | | * æååç¼,å¦% 90 åæ90% |
| | | */ |
| | | public String suffix() default ""; |
| | | |
| | | /** |
| | | * å½å¼ä¸ºç©ºæ¶,åæ®µçé»è®¤å¼ |
| | | */ |
| | | public String defaultValue() default ""; |
| | | |
| | | /** |
| | | * æç¤ºä¿¡æ¯ |
| | | */ |
| | | public String prompt() default ""; |
| | | |
| | | /** |
| | | * 设置åªè½éæ©ä¸è½è¾å
¥çåå
容. |
| | | */ |
| | | public String[] combo() default {}; |
| | | |
| | | /** |
| | | * æ¯å¦å¯¼åºæ°æ®,åºå¯¹éæ±:ææ¶æä»¬éè¦å¯¼åºä¸ä»½æ¨¡æ¿,è¿æ¯æ é¢éè¦ä½å
容éè¦ç¨æ·æå·¥å¡«å. |
| | | */ |
| | | public boolean isExport() default true; |
| | | |
| | | /** |
| | | * å¦ä¸ä¸ªç±»ä¸ç屿§åç§°,æ¯æå¤çº§è·å,以尿°ç¹éå¼ |
| | | */ |
| | | public String targetAttr() default ""; |
| | | |
| | | /** |
| | | * åæ®µç±»åï¼0ï¼å¯¼åºå¯¼å
¥ï¼1ï¼ä»
导åºï¼2ï¼ä»
导å
¥ï¼ |
| | | */ |
| | | Type type() default Type.ALL; |
| | | |
| | | public enum Type |
| | | { |
| | | ALL(0), EXPORT(1), IMPORT(2); |
| | | private final int value; |
| | | |
| | | Type(int value) |
| | | { |
| | | this.value = value; |
| | | } |
| | | |
| | | public int value() |
| | | { |
| | | return this.value; |
| | | } |
| | | } |
| | | |
| | | public enum ColumnType |
| | | { |
| | | NUMERIC(0), STRING(1); |
| | | private final int value; |
| | | |
| | | ColumnType(int value) |
| | | { |
| | | this.value = value; |
| | | } |
| | | |
| | | public int value() |
| | | { |
| | | return this.value; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.aspectj.lang.annotation; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * Excel注解é |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Target(ElementType.FIELD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface Excels |
| | | { |
| | | Excel[] value(); |
| | | } |
| | |
| | | "/**/*.js"
|
| | | ).permitAll()
|
| | | .antMatchers("/profile/**").anonymous()
|
| | | .antMatchers("/common/download**").anonymous()
|
| | | .antMatchers("/swagger-ui.html").anonymous()
|
| | | .antMatchers("/swagger-resources/**").anonymous()
|
| | | .antMatchers("/webjars/**").anonymous()
|
| | |
| | | package com.ruoyi.framework.config;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.context.annotation.Bean;
|
| | | import org.springframework.context.annotation.Configuration;
|
| | |
| | | import springfox.documentation.builders.PathSelectors;
|
| | | import springfox.documentation.builders.RequestHandlerSelectors;
|
| | | import springfox.documentation.service.ApiInfo;
|
| | | import springfox.documentation.service.ApiKey;
|
| | | import springfox.documentation.service.AuthorizationScope;
|
| | | import springfox.documentation.service.Contact;
|
| | | import springfox.documentation.service.SecurityReference;
|
| | | import springfox.documentation.spi.DocumentationType;
|
| | | import springfox.documentation.spi.service.contexts.SecurityContext;
|
| | | import springfox.documentation.spring.web.plugins.Docket;
|
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
| | |
|
| | |
| | | public Docket createRestApi()
|
| | | {
|
| | | return new Docket(DocumentationType.SWAGGER_2)
|
| | | .pathMapping("/dev-api")
|
| | | // ç¨æ¥å建该APIçåºæ¬ä¿¡æ¯ï¼å±ç¤ºå¨ææ¡£ç页é¢ä¸ï¼èªå®ä¹å±ç¤ºçä¿¡æ¯ï¼
|
| | | .apiInfo(apiInfo())
|
| | | // 设置åªäºæ¥å£æ´é²ç»Swaggerå±ç¤º
|
| | |
| | | //.apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger"))
|
| | | // æ«æææ .apis(RequestHandlerSelectors.any())
|
| | | .paths(PathSelectors.any())
|
| | | .build();
|
| | | .build()
|
| | | /* 设置å®å
¨æ¨¡å¼ï¼swaggerå¯ä»¥è®¾ç½®è®¿é®token */
|
| | | .securitySchemes(securitySchemes())
|
| | | .securityContexts(securityContexts());
|
| | | }
|
| | |
|
| | | /**
|
| | | * å®å
¨æ¨¡å¼ï¼è¿éæå®tokenéè¿Authorization头请æ±å¤´ä¼ é
|
| | | */
|
| | | private List<ApiKey> securitySchemes()
|
| | | {
|
| | | List<ApiKey> apiKeyList = new ArrayList<ApiKey>();
|
| | | apiKeyList.add(new ApiKey("Authorization", "Authorization", "header"));
|
| | | return apiKeyList;
|
| | | }
|
| | | |
| | | /**
|
| | | * å®å
¨ä¸ä¸æ
|
| | | */
|
| | | private List<SecurityContext> securityContexts()
|
| | | {
|
| | | List<SecurityContext> securityContexts = new ArrayList<>();
|
| | | securityContexts.add(
|
| | | SecurityContext.builder()
|
| | | .securityReferences(defaultAuth())
|
| | | .forPaths(PathSelectors.regex("^(?!auth).*$"))
|
| | | .build());
|
| | | return securityContexts;
|
| | | }
|
| | | |
| | | /**
|
| | | * é»è®¤çå®å
¨ä¸å¼ç¨
|
| | | */
|
| | | private List<SecurityReference> defaultAuth()
|
| | | {
|
| | | AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
|
| | | AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
|
| | | authorizationScopes[0] = authorizationScope;
|
| | | List<SecurityReference> securityReferences = new ArrayList<>();
|
| | | securityReferences.add(new SecurityReference("Authorization", authorizationScopes));
|
| | | return securityReferences;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | // ç¨ApiInfoBuilderè¿è¡å®å¶
|
| | | return new ApiInfoBuilder()
|
| | | // 设置æ é¢
|
| | | .title("æ é¢ï¼ä½å¿ç®¡çç³»ç»_æ¥å£ææ¡£")
|
| | | .title("æ é¢ï¼è¥ä¾ç®¡çç³»ç»_æ¥å£ææ¡£")
|
| | | // æè¿°
|
| | | .description("æè¿°ï¼ç¨äºç®¡çé墿ä¸å
¬å¸ç人åä¿¡æ¯,å
·ä½å
æ¬XXX,XXX模å...")
|
| | | // ä½è
ä¿¡æ¯
|
| | |
| | | import org.springframework.security.access.AccessDeniedException;
|
| | | import org.springframework.security.authentication.AccountExpiredException;
|
| | | import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
| | | import org.springframework.validation.BindException;
|
| | | import org.springframework.web.bind.MethodArgumentNotValidException;
|
| | | import org.springframework.web.bind.annotation.ExceptionHandler;
|
| | | import org.springframework.web.bind.annotation.RestControllerAdvice;
|
| | | import org.springframework.web.servlet.NoHandlerFoundException;
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * èªå®ä¹éªè¯å¼å¸¸
|
| | | */
|
| | | @ExceptionHandler(BindException.class)
|
| | | public AjaxResult validatedBindException(BindException e)
|
| | | {
|
| | | log.error(e.getMessage(), e);
|
| | | String message = e.getAllErrors().get(0).getDefaultMessage();
|
| | | return AjaxResult.error(message);
|
| | | }
|
| | |
|
| | | /**
|
| | | * èªå®ä¹éªè¯å¼å¸¸
|
| | | */
|
| | | @ExceptionHandler(MethodArgumentNotValidException.class)
|
| | | public Object validExceptionHandler(MethodArgumentNotValidException e)
|
| | | {
|
| | | log.error(e.getMessage(), e);
|
| | | String message = e.getBindingResult().getFieldError().getDefaultMessage();
|
| | | return AjaxResult.error(message);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¼ç¤ºæ¨¡å¼å¼å¸¸
|
| | | */
|
| | | @ExceptionHandler(DemoModeException.class)
|
| | |
| | | package com.ruoyi.project.common;
|
| | |
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | | import org.slf4j.Logger;
|
| | | import org.slf4j.LoggerFactory;
|
| | | 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.RestController;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.common.utils.file.FileUploadUtils;
|
| | | import com.ruoyi.common.utils.file.FileUtils;
|
| | | import com.ruoyi.framework.config.RuoYiConfig;
|
| | | import com.ruoyi.framework.config.ServerConfig;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | |
| | | @RestController
|
| | | public class CommonController
|
| | | {
|
| | | private static final Logger log = LoggerFactory.getLogger(CommonController.class);
|
| | |
|
| | | @Autowired
|
| | | private ServerConfig serverConfig;
|
| | |
|
| | | /**
|
| | | * éç¨ä¸è½½è¯·æ±
|
| | | * |
| | | * @param fileName æä»¶åç§°
|
| | | * @param delete æ¯å¦å é¤
|
| | | */
|
| | | @GetMapping("common/download")
|
| | | public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
|
| | | {
|
| | | try
|
| | | {
|
| | | if (!FileUtils.isValidFilename(fileName))
|
| | | {
|
| | | throw new Exception(StringUtils.format("æä»¶åç§°({})éæ³ï¼ä¸å
许ä¸è½½ã ", fileName));
|
| | | }
|
| | | String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
| | | String filePath = RuoYiConfig.getDownloadPath() + fileName;
|
| | |
|
| | | response.setCharacterEncoding("utf-8");
|
| | | response.setContentType("multipart/form-data");
|
| | | response.setHeader("Content-Disposition",
|
| | | "attachment;fileName=" + FileUtils.setFileDownloadHeader(request, realFileName));
|
| | | FileUtils.writeBytes(filePath, response.getOutputStream());
|
| | | if (delete)
|
| | | {
|
| | | FileUtils.deleteFile(filePath);
|
| | | }
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | log.error("ä¸è½½æä»¶å¤±è´¥", e);
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * éç¨ä¸ä¼ 请æ±
|
| | | */
|
| | | @PostMapping("/common/upload")
|
| | |
| | | import java.util.List;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.framework.web.page.TableDataInfo;
|
| | | import com.ruoyi.project.monitor.domain.SysLogininfor;
|
| | | import com.ruoyi.project.monitor.service.ISysLogininforService;
|
| | |
| | | List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | @Log(title = "ç»éæ¥å¿", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')")
|
| | | @GetMapping("/export")
|
| | | public AjaxResult export(SysLogininfor logininfor)
|
| | | {
|
| | | List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
|
| | | ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class);
|
| | | return util.exportExcel(list, "ç»éæ¥å¿");
|
| | | }
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
|
| | | @Log(title = "ç»éæ¥å¿", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{infoIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] infoIds)
|
| | | {
|
| | | return toAjax(logininforService.deleteLogininforByIds(infoIds));
|
| | | }
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
|
| | | @Log(title = "ç»éæ¥å¿", businessType = BusinessType.CLEAN)
|
| | | @DeleteMapping("/clean")
|
| | | public AjaxResult clean()
|
| | | {
|
| | | logininforService.cleanLogininfor();
|
| | | return AjaxResult.success();
|
| | | }
|
| | | }
|
| | |
| | | import java.util.List;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.framework.web.page.TableDataInfo;
|
| | | import com.ruoyi.project.monitor.domain.SysOperLog;
|
| | | import com.ruoyi.project.monitor.service.ISysOperLogService;
|
| | |
| | | List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | @Log(title = "æä½æ¥å¿", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:export')")
|
| | | @GetMapping("/export")
|
| | | public AjaxResult export(SysOperLog operLog)
|
| | | {
|
| | | List<SysOperLog> list = operLogService.selectOperLogList(operLog);
|
| | | ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
|
| | | return util.exportExcel(list, "æä½æ¥å¿");
|
| | | }
|
| | |
|
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
|
| | | @DeleteMapping("/{operIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] operIds)
|
| | | {
|
| | | return toAjax(operLogService.deleteOperLogByIds(operIds));
|
| | | }
|
| | |
|
| | | @Log(title = "æä½æ¥å¿", businessType = BusinessType.CLEAN)
|
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
|
| | | @DeleteMapping("/clean")
|
| | | public AjaxResult clean()
|
| | | {
|
| | | operLogService.cleanOperLog();
|
| | | return AjaxResult.success();
|
| | | }
|
| | | }
|
| | |
| | | package com.ruoyi.project.monitor.domain;
|
| | |
|
| | | import java.util.Date;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
|
| | | import com.ruoyi.framework.web.domain.BaseEntity;
|
| | |
|
| | | /**
|
| | |
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | /** ID */
|
| | | @Excel(name = "åºå·", cellType = ColumnType.NUMERIC)
|
| | | private Long infoId;
|
| | |
|
| | | /** ç¨æ·è´¦å· */
|
| | | @Excel(name = "ç¨æ·è´¦å·")
|
| | | private String userName;
|
| | |
|
| | | /** ç»å½ç¶æ 0æå 1失败 */
|
| | | @Excel(name = "ç»å½ç¶æ", readConverterExp = "0=æå,1=失败")
|
| | | private String status;
|
| | |
|
| | | /** ç»å½IPå°å */
|
| | | @Excel(name = "ç»å½å°å")
|
| | | private String ipaddr;
|
| | |
|
| | | /** ç»å½å°ç¹ */
|
| | | @Excel(name = "ç»å½å°ç¹")
|
| | | private String loginLocation;
|
| | |
|
| | | /** æµè§å¨ç±»å */
|
| | | @Excel(name = "æµè§å¨")
|
| | | private String browser;
|
| | |
|
| | | /** æä½ç³»ç» */
|
| | | @Excel(name = "æä½ç³»ç»")
|
| | | private String os;
|
| | |
|
| | | /** æç¤ºæ¶æ¯ */
|
| | | @Excel(name = "æç¤ºæ¶æ¯")
|
| | | private String msg;
|
| | |
|
| | | /** è®¿é®æ¶é´ */
|
| | | @Excel(name = "è®¿é®æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
| | | private Date loginTime;
|
| | |
|
| | | public Long getInfoId()
|
| | |
| | | package com.ruoyi.project.monitor.domain;
|
| | |
|
| | | import java.util.Date;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
|
| | | import com.ruoyi.framework.web.domain.BaseEntity;
|
| | |
|
| | | /**
|
| | |
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | /** æ¥å¿ä¸»é® */
|
| | | @Excel(name = "æä½åºå·", cellType = ColumnType.NUMERIC)
|
| | | private Long operId;
|
| | |
|
| | | /** æä½æ¨¡å */
|
| | | @Excel(name = "æä½æ¨¡å")
|
| | | private String title;
|
| | |
|
| | | /** ä¸å¡ç±»åï¼0å
¶å® 1æ°å¢ 2ä¿®æ¹ 3å é¤ï¼ */
|
| | | @Excel(name = "ä¸å¡ç±»å", readConverterExp = "0=å
¶å®,1=æ°å¢,2=ä¿®æ¹,3=å é¤,4=ææ,5=导åº,6=导å
¥,7=强é,8=çæä»£ç ,9=æ¸
ç©ºæ°æ®")
|
| | | private Integer businessType;
|
| | |
|
| | | /** ä¸å¡ç±»åæ°ç» */
|
| | | private Integer[] businessTypes;
|
| | |
|
| | | /** è¯·æ±æ¹æ³ */
|
| | | @Excel(name = "è¯·æ±æ¹æ³")
|
| | | private String method;
|
| | |
|
| | | /** è¯·æ±æ¹å¼ */
|
| | | @Excel(name = "è¯·æ±æ¹å¼")
|
| | | private String requestMethod;
|
| | |
|
| | | /** æä½ç±»å«ï¼0å
¶å® 1åå°ç¨æ· 2ææºç«¯ç¨æ·ï¼ */
|
| | | @Excel(name = "æä½ç±»å«", readConverterExp = "0=å
¶å®,1=åå°ç¨æ·,2=ææºç«¯ç¨æ·")
|
| | | private Integer operatorType;
|
| | |
|
| | | /** æä½äººå */
|
| | | @Excel(name = "æä½äººå")
|
| | | private String operName;
|
| | |
|
| | | /** é¨é¨åç§° */
|
| | | @Excel(name = "é¨é¨åç§°")
|
| | | private String deptName;
|
| | |
|
| | | /** 请æ±url */
|
| | | @Excel(name = "请æ±å°å")
|
| | | private String operUrl;
|
| | |
|
| | | /** æä½å°å */
|
| | | @Excel(name = "æä½å°å")
|
| | | private String operIp;
|
| | |
|
| | | /** æä½å°ç¹ */
|
| | | @Excel(name = "æä½å°ç¹")
|
| | | private String operLocation;
|
| | |
|
| | | /** 请æ±åæ° */
|
| | | @Excel(name = "请æ±åæ°")
|
| | | private String operParam;
|
| | |
|
| | | /** è¿ååæ° */
|
| | | @Excel(name = "è¿ååæ°")
|
| | | private String jsonResult;
|
| | |
|
| | | /** æä½ç¶æï¼0æ£å¸¸ 1å¼å¸¸ï¼ */
|
| | | @Excel(name = "ç¶æ", readConverterExp = "0=æ£å¸¸,1=å¼å¸¸")
|
| | | private Integer status;
|
| | |
|
| | | /** éè¯¯æ¶æ¯ */
|
| | | @Excel(name = "éè¯¯æ¶æ¯")
|
| | | private String errorMsg;
|
| | |
|
| | | /** æä½æ¶é´ */
|
| | | @Excel(name = "æä½æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
| | | private Date operTime;
|
| | |
|
| | | public Long getOperId()
|
| | |
| | | /**
|
| | | * æ¹éå é¤ç³»ç»ç»å½æ¥å¿
|
| | | *
|
| | | * @param ids éè¦å é¤çæ°æ®
|
| | | * @param infoIds éè¦å é¤çç»å½æ¥å¿ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteLogininforByIds(String[] ids);
|
| | | public int deleteLogininforByIds(Long[] infoIds);
|
| | |
|
| | | /**
|
| | | * æ¸
空系ç»ç»å½æ¥å¿
|
| | |
| | | /**
|
| | | * æ¹éå é¤ç³»ç»æä½æ¥å¿
|
| | | *
|
| | | * @param ids éè¦å é¤çæ°æ®
|
| | | * @param operIds éè¦å é¤çæä½æ¥å¿ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteOperLogByIds(String[] ids);
|
| | | public int deleteOperLogByIds(Long[] operIds);
|
| | |
|
| | | /**
|
| | | * æ¥è¯¢æä½æ¥å¿è¯¦ç»
|
| | |
| | | /**
|
| | | * æ¹éå é¤ç³»ç»ç»å½æ¥å¿
|
| | | *
|
| | | * @param ids éè¦å é¤çæ°æ®
|
| | | * @param infoIds éè¦å é¤çç»å½æ¥å¿ID
|
| | | * @return
|
| | | */
|
| | | public int deleteLogininforByIds(String ids);
|
| | | public int deleteLogininforByIds(Long[] infoIds);
|
| | |
|
| | | /**
|
| | | * æ¸
空系ç»ç»å½æ¥å¿
|
| | |
| | | /**
|
| | | * æ¹éå é¤ç³»ç»æä½æ¥å¿
|
| | | *
|
| | | * @param ids éè¦å é¤çæ°æ®
|
| | | * @param operIds éè¦å é¤çæä½æ¥å¿ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteOperLogByIds(String ids);
|
| | | public int deleteOperLogByIds(Long[] operIds);
|
| | |
|
| | | /**
|
| | | * æ¥è¯¢æä½æ¥å¿è¯¦ç»
|
| | |
| | | import java.util.List;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | | import com.ruoyi.common.core.text.Convert;
|
| | | import com.ruoyi.project.monitor.domain.SysLogininfor;
|
| | | import com.ruoyi.project.monitor.mapper.SysLogininforMapper;
|
| | | import com.ruoyi.project.monitor.service.ISysLogininforService;
|
| | |
| | | /**
|
| | | * æ¹éå é¤ç³»ç»ç»å½æ¥å¿
|
| | | *
|
| | | * @param ids éè¦å é¤çæ°æ®
|
| | | * @param infoIds éè¦å é¤çç»å½æ¥å¿ID
|
| | | * @return
|
| | | */
|
| | | @Override
|
| | | public int deleteLogininforByIds(String ids)
|
| | | public int deleteLogininforByIds(Long[] infoIds)
|
| | | {
|
| | | return logininforMapper.deleteLogininforByIds(Convert.toStrArray(ids));
|
| | | return logininforMapper.deleteLogininforByIds(infoIds);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | import java.util.List;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | | import com.ruoyi.common.core.text.Convert;
|
| | | import com.ruoyi.project.monitor.domain.SysOperLog;
|
| | | import com.ruoyi.project.monitor.mapper.SysOperLogMapper;
|
| | | import com.ruoyi.project.monitor.service.ISysOperLogService;
|
| | |
| | | /**
|
| | | * æ¹éå é¤ç³»ç»æä½æ¥å¿
|
| | | *
|
| | | * @param ids éè¦å é¤çæ°æ®
|
| | | * @return
|
| | | * @param operIds éè¦å é¤çæä½æ¥å¿ID
|
| | | * @return ç»æ
|
| | | */
|
| | | @Override
|
| | | public int deleteOperLogByIds(String ids)
|
| | | public int deleteOperLogByIds(Long[] operIds)
|
| | | {
|
| | | return operLogMapper.deleteOperLogByIds(Convert.toStrArray(ids));
|
| | | return operLogMapper.deleteOperLogByIds(operIds);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | import java.util.List;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | |
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.constant.UserConstants;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | |
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize("@ss.hasPermi('system:config:export')")
|
| | | @GetMapping("/export")
|
| | | public AjaxResult export(SysConfig config)
|
| | | {
|
| | | List<SysConfig> list = configService.selectConfigList(config);
|
| | | ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
|
| | | return util.exportExcel(list, "åæ°æ°æ®");
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ ¹æ®åæ°ç¼å·è·å详ç»ä¿¡æ¯
|
| | | */
|
| | |
| | | @PreAuthorize("@ss.hasPermi('system:config:add')")
|
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@RequestBody SysConfig config)
|
| | | public AjaxResult add(@Validated @RequestBody SysConfig config)
|
| | | {
|
| | | if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
|
| | | {
|
| | |
| | | @PreAuthorize("@ss.hasPermi('system:config:edit')")
|
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@RequestBody SysConfig config)
|
| | | public AjaxResult edit(@Validated @RequestBody SysConfig config)
|
| | | {
|
| | | if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
|
| | | {
|
| | |
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:config:remove')")
|
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{configId}")
|
| | | public AjaxResult remove(@PathVariable Long configId)
|
| | | @DeleteMapping("/{configIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] configIds)
|
| | | {
|
| | | return toAjax(configService.deleteConfigById(configId));
|
| | | return toAjax(configService.deleteConfigByIds(configIds));
|
| | | }
|
| | | }
|
| | |
| | | import java.util.List;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | |
| | | import org.springframework.web.bind.annotation.PutMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.ResponseBody;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.constant.UserConstants;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | |
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:dept:query')")
|
| | | @GetMapping(value = "/roleDeptTreeselect/{roleId}")
|
| | | @ResponseBody
|
| | | public AjaxResult roleDeptTreeselect(@PathVariable("roleId") Long roleId)
|
| | | {
|
| | | return AjaxResult.success(deptService.selectDeptListByRoleId(roleId));
|
| | |
| | | @PreAuthorize("@ss.hasPermi('system:dept:add')")
|
| | | @Log(title = "é¨é¨ç®¡ç", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@RequestBody SysDept dept)
|
| | | public AjaxResult add(@Validated @RequestBody SysDept dept)
|
| | | {
|
| | | if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
|
| | | {
|
| | |
| | | @PreAuthorize("@ss.hasPermi('system:dept:edit')")
|
| | | @Log(title = "é¨é¨ç®¡ç", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@RequestBody SysDept dept)
|
| | | public AjaxResult edit(@Validated @RequestBody SysDept dept)
|
| | | {
|
| | | if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
|
| | | {
|
| | |
| | | import java.util.List;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | |
| | | import org.springframework.web.bind.annotation.PutMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.ResponseBody;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | |
| | |
|
| | | @PreAuthorize("@ss.hasPermi('system:dict:list')")
|
| | | @GetMapping("/list")
|
| | | @ResponseBody
|
| | | public TableDataInfo list(SysDictData dictData)
|
| | | {
|
| | | startPage();
|
| | | List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | @Log(title = "åå
¸æ°æ®", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize("@ss.hasPermi('system:dict:export')")
|
| | | @GetMapping("/export")
|
| | | public AjaxResult export(SysDictData dictData)
|
| | | {
|
| | | List<SysDictData> list = dictDataService.selectDictDataList(dictData);
|
| | | ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
|
| | | return util.exportExcel(list, "åå
¸æ°æ®");
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | @PreAuthorize("@ss.hasPermi('system:dict:add')")
|
| | | @Log(title = "åå
¸æ°æ®", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@RequestBody SysDictData dict)
|
| | | public AjaxResult add(@Validated @RequestBody SysDictData dict)
|
| | | {
|
| | | dict.setCreateBy(SecurityUtils.getUsername());
|
| | | return toAjax(dictDataService.insertDictData(dict));
|
| | |
| | | @PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
| | | @Log(title = "åå
¸æ°æ®", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@RequestBody SysDictData dict)
|
| | | public AjaxResult edit(@Validated @RequestBody SysDictData dict)
|
| | | {
|
| | | dict.setUpdateBy(SecurityUtils.getUsername());
|
| | | return toAjax(dictDataService.updateDictData(dict));
|
| | |
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{dictCode}")
|
| | | public AjaxResult remove(@PathVariable Long dictCode)
|
| | | @DeleteMapping("/{dictCodes}")
|
| | | public AjaxResult remove(@PathVariable Long[] dictCodes)
|
| | | {
|
| | | return toAjax(dictDataService.deleteDictDataById(dictCode));
|
| | | return toAjax(dictDataService.deleteDictDataByIds(dictCodes));
|
| | | }
|
| | | }
|
| | |
| | | import java.util.List;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | |
| | | import org.springframework.web.bind.annotation.PutMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.ResponseBody;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.constant.UserConstants;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | |
| | |
|
| | | @PreAuthorize("@ss.hasPermi('system:dict:list')")
|
| | | @GetMapping("/list")
|
| | | @ResponseBody
|
| | | public TableDataInfo list(SysDictType dictType)
|
| | | {
|
| | | startPage();
|
| | | List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize("@ss.hasPermi('system:dict:export')")
|
| | | @GetMapping("/export")
|
| | | public AjaxResult export(SysDictType dictType)
|
| | | {
|
| | | List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
|
| | | ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
|
| | | return util.exportExcel(list, "åå
¸ç±»å");
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | @PreAuthorize("@ss.hasPermi('system:dict:add')")
|
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@RequestBody SysDictType dict)
|
| | | public AjaxResult add(@Validated @RequestBody SysDictType dict)
|
| | | {
|
| | | if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
|
| | | {
|
| | |
| | | @PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@RequestBody SysDictType dict)
|
| | | public AjaxResult edit(@Validated @RequestBody SysDictType dict)
|
| | | {
|
| | | if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
|
| | | {
|
| | |
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{dictId}")
|
| | | public AjaxResult remove(@PathVariable Long dictId)
|
| | | @DeleteMapping("/{dictIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] dictIds)
|
| | | {
|
| | | return toAjax(dictTypeService.deleteDictTypeById(dictId));
|
| | | return toAjax(dictTypeService.deleteDictTypeByIds(dictIds));
|
| | | }
|
| | | }
|
| | |
| | | import org.springframework.web.bind.annotation.PutMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.ResponseBody;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.constant.UserConstants;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | |
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:menu:query')")
|
| | | @GetMapping(value = "/roleMenuTreeselect/{roleId}")
|
| | | @ResponseBody
|
| | | public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId)
|
| | | {
|
| | | return AjaxResult.success(menuService.selectMenuListByRoleId(roleId));
|
| | |
| | | @PreAuthorize("@ss.hasPermi('system:menu:add')")
|
| | | @Log(title = "èå管ç", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@RequestBody @Validated SysMenu menu)
|
| | | public AjaxResult add(@Validated @RequestBody SysMenu menu)
|
| | | {
|
| | | if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu)))
|
| | | {
|
| | |
| | | @PreAuthorize("@ss.hasPermi('system:menu:edit')")
|
| | | @Log(title = "èå管ç", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@RequestBody SysMenu menu)
|
| | | public AjaxResult edit(@Validated @RequestBody SysMenu menu)
|
| | | {
|
| | | if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu)))
|
| | | {
|
| | |
| | | import java.util.List;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | |
| | | @PreAuthorize("@ss.hasPermi('system:notice:add')")
|
| | | @Log(title = "éç¥å
Œ", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@RequestBody SysNotice notice)
|
| | | public AjaxResult add(@Validated @RequestBody SysNotice notice)
|
| | | {
|
| | | notice.setCreateBy(SecurityUtils.getUsername());
|
| | | return toAjax(noticeService.insertNotice(notice));
|
| | |
| | | @PreAuthorize("@ss.hasPermi('system:notice:edit')")
|
| | | @Log(title = "éç¥å
Œ", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@RequestBody SysNotice notice)
|
| | | public AjaxResult edit(@Validated @RequestBody SysNotice notice)
|
| | | {
|
| | | notice.setUpdateBy(SecurityUtils.getUsername());
|
| | | return toAjax(noticeService.updateNotice(notice));
|
| | |
| | | import java.util.List;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | |
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.constant.UserConstants;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | |
| | | List<SysPost> list = postService.selectPostList(post);
|
| | | return getDataTable(list);
|
| | | }
|
| | | |
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize("@ss.hasPermi('system:config:export')")
|
| | | @GetMapping("/export")
|
| | | public AjaxResult export(SysPost post)
|
| | | {
|
| | | List<SysPost> list = postService.selectPostList(post);
|
| | | ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
|
| | | return util.exportExcel(list, "å²ä½æ°æ®");
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ ¹æ®å²ä½ç¼å·è·å详ç»ä¿¡æ¯
|
| | |
| | | @PreAuthorize("@ss.hasPermi('system:post:add')")
|
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@RequestBody SysPost post)
|
| | | public AjaxResult add(@Validated @RequestBody SysPost post)
|
| | | {
|
| | | if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
|
| | | {
|
| | |
| | | @PreAuthorize("@ss.hasPermi('system:post:edit')")
|
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@RequestBody SysPost post)
|
| | | public AjaxResult edit(@Validated @RequestBody SysPost post)
|
| | | {
|
| | | if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
|
| | | {
|
| | |
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:post:remove')")
|
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{postId}")
|
| | | public AjaxResult remove(@PathVariable Long postId)
|
| | | @DeleteMapping("/{postIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] postIds)
|
| | | {
|
| | | return toAjax(postService.deletePostById(postId));
|
| | | return toAjax(postService.deletePostByIds(postIds));
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | import java.util.List;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | |
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.constant.UserConstants;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | |
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize("@ss.hasPermi('system:role:export')")
|
| | | @GetMapping("/export")
|
| | | public AjaxResult export(SysRole role)
|
| | | {
|
| | | List<SysRole> list = roleService.selectRoleList(role);
|
| | | ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
|
| | | return util.exportExcel(list, "è§è²æ°æ®");
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ ¹æ®è§è²ç¼å·è·å详ç»ä¿¡æ¯
|
| | | */
|
| | |
| | | @PreAuthorize("@ss.hasPermi('system:role:add')")
|
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@RequestBody SysRole role)
|
| | | public AjaxResult add(@Validated @RequestBody SysRole role)
|
| | | {
|
| | | if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
|
| | | {
|
| | |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')")
|
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@RequestBody SysRole role)
|
| | | public AjaxResult edit(@Validated @RequestBody SysRole role)
|
| | | {
|
| | | roleService.checkRoleAllowed(role);
|
| | | if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * å é¤å²ä½
|
| | | * å é¤è§è²
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:role:remove')")
|
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{roleId}")
|
| | | public AjaxResult remove(@PathVariable Long roleId)
|
| | | @DeleteMapping("/{roleIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] roleIds)
|
| | | {
|
| | | roleService.checkRoleAllowed(new SysRole(roleId));
|
| | | return toAjax(roleService.deleteRoleById(roleId));
|
| | | return toAjax(roleService.deleteRoleByIds(roleIds));
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | import java.util.List;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | | import org.springframework.web.bind.annotation.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | |
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.constant.UserConstants;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | |
| | | return getDataTable(list);
|
| | | }
|
| | |
|
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize("@ss.hasPermi('system:user:export')")
|
| | | @GetMapping("/export")
|
| | | public AjaxResult export(SysUser user)
|
| | | {
|
| | | List<SysUser> list = userService.selectUserList(user);
|
| | | ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
| | | return util.exportExcel(list, "ç¨æ·æ°æ®");
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ ¹æ®ç¨æ·ç¼å·è·å详ç»ä¿¡æ¯
|
| | | */
|
| | |
| | | @PreAuthorize("@ss.hasPermi('system:user:add')")
|
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@RequestBody SysUser user)
|
| | | public AjaxResult add(@Validated @RequestBody SysUser user)
|
| | | {
|
| | | if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName())))
|
| | | {
|
| | |
| | | @PreAuthorize("@ss.hasPermi('system:user:edit')")
|
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@RequestBody SysUser user)
|
| | | public AjaxResult edit(@Validated @RequestBody SysUser user)
|
| | | {
|
| | | userService.checkUserAllowed(user);
|
| | | if (UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
| | |
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:user:remove')")
|
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{userId}")
|
| | | public AjaxResult remove(@PathVariable Long userId)
|
| | | @DeleteMapping("/{userIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] userIds)
|
| | | {
|
| | | userService.checkUserAllowed(new SysUser(userId));
|
| | | return toAjax(userService.deleteUserById(userId));
|
| | | return toAjax(userService.deleteUserByIds(userIds));
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | import javax.validation.constraints.NotBlank;
|
| | | import javax.validation.constraints.Size;
|
| | | import org.apache.commons.lang3.builder.ToStringBuilder;
|
| | | import org.apache.commons.lang3.builder.ToStringStyle;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
|
| | | import com.ruoyi.framework.web.domain.BaseEntity;
|
| | |
|
| | | /**
|
| | |
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | /** åæ°ä¸»é® */
|
| | | @Excel(name = "忰䏻é®", cellType = ColumnType.NUMERIC)
|
| | | private Long configId;
|
| | |
|
| | | /** åæ°åç§° */
|
| | | @Excel(name = "åæ°åç§°")
|
| | | private String configName;
|
| | |
|
| | | /** åæ°é®å */
|
| | | @Excel(name = "åæ°é®å")
|
| | | private String configKey;
|
| | |
|
| | | /** åæ°é®å¼ */
|
| | | @Excel(name = "åæ°é®å¼")
|
| | | private String configValue;
|
| | |
|
| | | /** ç³»ç»å
ç½®ï¼Yæ¯ Nå¦ï¼ */
|
| | | @Excel(name = "ç³»ç»å
ç½®", readConverterExp = "Y=æ¯,N=å¦")
|
| | | private String configType;
|
| | |
|
| | | public Long getConfigId()
|
| | |
| | | {
|
| | | this.configType = configType;
|
| | | }
|
| | | |
| | | @Override
|
| | | public String toString() {
|
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
| | | .append("configId", getConfigId())
|
| | | .append("configName", getConfigName())
|
| | | .append("configKey", getConfigKey())
|
| | | .append("configValue", getConfigValue())
|
| | | .append("configType", getConfigType())
|
| | | .append("createBy", getCreateBy())
|
| | | .append("createTime", getCreateTime())
|
| | | .append("updateBy", getUpdateBy())
|
| | | .append("updateTime", getUpdateTime())
|
| | | .append("remark", getRemark())
|
| | | .toString();
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import javax.validation.constraints.Email;
|
| | | import javax.validation.constraints.NotBlank;
|
| | | import javax.validation.constraints.Size;
|
| | | import org.apache.commons.lang3.builder.ToStringBuilder;
|
| | | import org.apache.commons.lang3.builder.ToStringStyle;
|
| | | import com.ruoyi.framework.web.domain.BaseEntity;
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | /** ç¶é¨é¨åç§° */
|
| | | private String parentName;
|
| | |
|
| | | |
| | | /** åé¨é¨ */
|
| | | private List<SysDept> children = new ArrayList<SysDept>();
|
| | |
|
| | |
| | | this.ancestors = ancestors;
|
| | | }
|
| | |
|
| | | @NotBlank(message = "é¨é¨åç§°ä¸è½ä¸ºç©º")
|
| | | @Size(min = 0, max = 30, message = "é¨é¨åç§°é¿åº¦ä¸è½è¶
è¿30个å符")
|
| | | public String getDeptName()
|
| | | {
|
| | | return deptName;
|
| | |
| | | this.deptName = deptName;
|
| | | }
|
| | |
|
| | | @NotBlank(message = "æ¾ç¤ºé¡ºåºä¸è½ä¸ºç©º")
|
| | | public String getOrderNum()
|
| | | {
|
| | | return orderNum;
|
| | |
| | | this.leader = leader;
|
| | | }
|
| | |
|
| | | @Size(min = 0, max = 11, message = "èç³»çµè¯é¿åº¦ä¸è½è¶
è¿11个å符")
|
| | | public String getPhone()
|
| | | {
|
| | | return phone;
|
| | |
| | | this.phone = phone;
|
| | | }
|
| | |
|
| | | @Email(message = "é®ç®±æ ¼å¼ä¸æ£ç¡®")
|
| | | @Size(min = 0, max = 50, message = "é®ç®±é¿åº¦ä¸è½è¶
è¿50个å符")
|
| | | public String getEmail()
|
| | | {
|
| | | return email;
|
| | |
| | | {
|
| | | this.children = children;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String toString() {
|
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
| | | .append("deptId", getDeptId())
|
| | | .append("parentId", getParentId())
|
| | | .append("ancestors", getAncestors())
|
| | | .append("deptName", getDeptName())
|
| | | .append("orderNum", getOrderNum())
|
| | | .append("leader", getLeader())
|
| | | .append("phone", getPhone())
|
| | | .append("email", getEmail())
|
| | | .append("status", getStatus())
|
| | | .append("delFlag", getDelFlag())
|
| | | .append("createBy", getCreateBy())
|
| | | .append("createTime", getCreateTime())
|
| | | .append("updateBy", getUpdateBy())
|
| | | .append("updateTime", getUpdateTime())
|
| | | .toString();
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | import javax.validation.constraints.NotBlank;
|
| | | import javax.validation.constraints.Size;
|
| | | import org.apache.commons.lang3.builder.ToStringBuilder;
|
| | | import org.apache.commons.lang3.builder.ToStringStyle;
|
| | | import com.ruoyi.common.constant.UserConstants;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
|
| | | import com.ruoyi.framework.web.domain.BaseEntity;
|
| | |
|
| | | /**
|
| | |
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | /** åå
¸ç¼ç */
|
| | | @Excel(name = "åå
¸ç¼ç ", cellType = ColumnType.NUMERIC)
|
| | | private Long dictCode;
|
| | |
|
| | | /** åå
¸æåº */
|
| | | @Excel(name = "åå
¸æåº", cellType = ColumnType.NUMERIC)
|
| | | private Long dictSort;
|
| | |
|
| | | /** åå
¸æ ç¾ */
|
| | | @Excel(name = "åå
¸æ ç¾")
|
| | | private String dictLabel;
|
| | |
|
| | | /** åå
¸é®å¼ */
|
| | | @Excel(name = "åå
¸é®å¼")
|
| | | private String dictValue;
|
| | |
|
| | | /** åå
¸ç±»å */
|
| | | @Excel(name = "åå
¸ç±»å")
|
| | | private String dictType;
|
| | |
|
| | | /** æ ·å¼å±æ§ï¼å
¶ä»æ ·å¼æ©å±ï¼ */
|
| | |
| | | private String listClass;
|
| | |
|
| | | /** æ¯å¦é»è®¤ï¼Yæ¯ Nå¦ï¼ */
|
| | | @Excel(name = "æ¯å¦é»è®¤", readConverterExp = "Y=æ¯,N=å¦")
|
| | | private String isDefault;
|
| | |
|
| | | /** ç¶æï¼0æ£å¸¸ 1åç¨ï¼ */
|
| | | @Excel(name = "ç¶æ", readConverterExp = "0=æ£å¸¸,1=åç¨")
|
| | | private String status;
|
| | |
|
| | | public Long getDictCode()
|
| | |
| | | {
|
| | | this.status = status;
|
| | | }
|
| | | |
| | | @Override
|
| | | public String toString() {
|
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
| | | .append("dictCode", getDictCode())
|
| | | .append("dictSort", getDictSort())
|
| | | .append("dictLabel", getDictLabel())
|
| | | .append("dictValue", getDictValue())
|
| | | .append("dictType", getDictType())
|
| | | .append("cssClass", getCssClass())
|
| | | .append("listClass", getListClass())
|
| | | .append("isDefault", getIsDefault())
|
| | | .append("status", getStatus())
|
| | | .append("createBy", getCreateBy())
|
| | | .append("createTime", getCreateTime())
|
| | | .append("updateBy", getUpdateBy())
|
| | | .append("updateTime", getUpdateTime())
|
| | | .append("remark", getRemark())
|
| | | .toString();
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | import javax.validation.constraints.NotBlank;
|
| | | import javax.validation.constraints.Size;
|
| | | import org.apache.commons.lang3.builder.ToStringBuilder;
|
| | | import org.apache.commons.lang3.builder.ToStringStyle;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
|
| | | import com.ruoyi.framework.web.domain.BaseEntity;
|
| | |
|
| | | /**
|
| | |
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | /** åå
¸ä¸»é® */
|
| | | @Excel(name = "åå
¸ä¸»é®", cellType = ColumnType.NUMERIC)
|
| | | private Long dictId;
|
| | |
|
| | | /** åå
¸åç§° */
|
| | | @Excel(name = "åå
¸åç§°")
|
| | | private String dictName;
|
| | |
|
| | | /** åå
¸ç±»å */
|
| | | @Excel(name = "åå
¸ç±»å")
|
| | | private String dictType;
|
| | |
|
| | | /** ç¶æï¼0æ£å¸¸ 1åç¨ï¼ */
|
| | | @Excel(name = "ç¶æ", readConverterExp = "0=æ£å¸¸,1=åç¨")
|
| | | private String status;
|
| | |
|
| | | public Long getDictId()
|
| | |
| | | {
|
| | | this.status = status;
|
| | | }
|
| | | |
| | | @Override
|
| | | public String toString() {
|
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
| | | .append("dictId", getDictId())
|
| | | .append("dictName", getDictName())
|
| | | .append("dictType", getDictType())
|
| | | .append("status", getStatus())
|
| | | .append("createBy", getCreateBy())
|
| | | .append("createTime", getCreateTime())
|
| | | .append("updateBy", getUpdateBy())
|
| | | .append("updateTime", getUpdateTime())
|
| | | .append("remark", getRemark())
|
| | | .toString();
|
| | | }
|
| | | }
|
| | |
| | | package com.ruoyi.project.system.domain;
|
| | |
|
| | | import java.util.List;
|
| | | import com.ruoyi.framework.web.domain.BaseEntity;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import javax.validation.constraints.NotBlank;
|
| | | import javax.validation.constraints.Size;
|
| | | import org.apache.commons.lang3.builder.ToStringBuilder;
|
| | | import org.apache.commons.lang3.builder.ToStringStyle;
|
| | | import com.ruoyi.framework.web.domain.BaseEntity;
|
| | |
|
| | | /**
|
| | | * èåæé表 sys_menu
|
| | |
| | | this.menuId = menuId;
|
| | | }
|
| | |
|
| | | @NotBlank(message = "èååç§°ä¸è½ä¸ºç©º")
|
| | | @Size(min = 0, max = 50, message = "èååç§°é¿åº¦ä¸è½è¶
è¿50个å符")
|
| | | public String getMenuName()
|
| | | {
|
| | | return menuName;
|
| | |
| | | this.parentId = parentId;
|
| | | }
|
| | |
|
| | | @NotBlank(message = "æ¾ç¤ºé¡ºåºä¸è½ä¸ºç©º")
|
| | | public String getOrderNum()
|
| | | {
|
| | | return orderNum;
|
| | |
| | | this.orderNum = orderNum;
|
| | | }
|
| | |
|
| | | @Size(min = 0, max = 200, message = "è·¯ç±å°åä¸è½è¶
è¿200个å符")
|
| | | public String getPath()
|
| | | {
|
| | | return path;
|
| | |
| | | this.path = path;
|
| | | }
|
| | |
|
| | | @Size(min = 0, max = 200, message = "ç»ä»¶è·¯å¾ä¸è½è¶
è¿255个å符")
|
| | | public String getComponent()
|
| | | {
|
| | | return component;
|
| | |
| | | this.isFrame = isFrame;
|
| | | }
|
| | |
|
| | | @NotBlank(message = "èåç±»åä¸è½ä¸ºç©º")
|
| | | public String getMenuType()
|
| | | {
|
| | | return menuType;
|
| | |
| | | this.visible = visible;
|
| | | }
|
| | |
|
| | | @Size(min = 0, max = 100, message = "æéæ è¯é¿åº¦ä¸è½è¶
è¿100个å符")
|
| | | public String getPerms()
|
| | | {
|
| | | return perms;
|
| | |
| | | {
|
| | | this.children = children;
|
| | | }
|
| | | |
| | | @Override
|
| | | public String toString() {
|
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
| | | .append("menuId", getMenuId())
|
| | | .append("menuName", getMenuName())
|
| | | .append("parentId", getParentId())
|
| | | .append("orderNum", getOrderNum())
|
| | | .append("path", getPath())
|
| | | .append("component", getComponent())
|
| | | .append("isFrame", getIsFrame())
|
| | | .append("menuType", getMenuType())
|
| | | .append("visible", getVisible())
|
| | | .append("perms", getPerms())
|
| | | .append("icon", getIcon())
|
| | | .append("createBy", getCreateBy())
|
| | | .append("createTime", getCreateTime())
|
| | | .append("updateBy", getUpdateBy())
|
| | | .append("updateTime", getUpdateTime())
|
| | | .append("remark", getRemark())
|
| | | .toString();
|
| | | }
|
| | | }
|
| | |
| | | package com.ruoyi.project.system.domain;
|
| | |
|
| | | import javax.validation.constraints.NotBlank;
|
| | | import javax.validation.constraints.Size;
|
| | | import org.apache.commons.lang3.builder.ToStringBuilder;
|
| | | import org.apache.commons.lang3.builder.ToStringStyle;
|
| | | import com.ruoyi.framework.web.domain.BaseEntity;
|
| | |
|
| | | /**
|
| | |
| | | this.noticeTitle = noticeTitle;
|
| | | }
|
| | |
|
| | | @NotBlank(message = "å
¬åæ é¢ä¸è½ä¸ºç©º")
|
| | | @Size(min = 0, max = 50, message = "å
¬åæ é¢ä¸è½è¶
è¿50个å符")
|
| | | public String getNoticeTitle()
|
| | | {
|
| | | return noticeTitle;
|
| | |
| | | {
|
| | | return status;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String toString() {
|
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
| | | .append("noticeId", getNoticeId())
|
| | | .append("noticeTitle", getNoticeTitle())
|
| | | .append("noticeType", getNoticeType())
|
| | | .append("noticeContent", getNoticeContent())
|
| | | .append("status", getStatus())
|
| | | .append("createBy", getCreateBy())
|
| | | .append("createTime", getCreateTime())
|
| | | .append("updateBy", getUpdateBy())
|
| | | .append("updateTime", getUpdateTime())
|
| | | .append("remark", getRemark())
|
| | | .toString();
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | import javax.validation.constraints.NotBlank;
|
| | | import javax.validation.constraints.Size;
|
| | | import org.apache.commons.lang3.builder.ToStringBuilder;
|
| | | import org.apache.commons.lang3.builder.ToStringStyle;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
|
| | | import com.ruoyi.framework.web.domain.BaseEntity;
|
| | |
|
| | | /**
|
| | |
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | /** å²ä½åºå· */
|
| | | @Excel(name = "å²ä½åºå·", cellType = ColumnType.NUMERIC)
|
| | | private Long postId;
|
| | |
|
| | | /** å²ä½ç¼ç */
|
| | | @Excel(name = "å²ä½ç¼ç ")
|
| | | private String postCode;
|
| | |
|
| | | /** å²ä½åç§° */
|
| | | @Excel(name = "å²ä½åç§°")
|
| | | private String postName;
|
| | |
|
| | | /** å²ä½æåº */
|
| | | @Excel(name = "å²ä½æåº")
|
| | | private String postSort;
|
| | |
|
| | | /** ç¶æï¼0æ£å¸¸ 1åç¨ï¼ */
|
| | | @Excel(name = "ç¶æ", readConverterExp = "0=æ£å¸¸,1=åç¨")
|
| | | private String status;
|
| | |
|
| | | /** ç¨æ·æ¯å¦å卿¤å²ä½æ è¯ é»è®¤ä¸åå¨ */
|
| | |
| | | {
|
| | | this.flag = flag;
|
| | | }
|
| | | |
| | | @Override
|
| | | public String toString() {
|
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
| | | .append("postId", getPostId())
|
| | | .append("postCode", getPostCode())
|
| | | .append("postName", getPostName())
|
| | | .append("postSort", getPostSort())
|
| | | .append("status", getStatus())
|
| | | .append("createBy", getCreateBy())
|
| | | .append("createTime", getCreateTime())
|
| | | .append("updateBy", getUpdateBy())
|
| | | .append("updateTime", getUpdateTime())
|
| | | .append("remark", getRemark())
|
| | | .toString();
|
| | | }
|
| | | }
|
| | |
| | | package com.ruoyi.project.system.domain;
|
| | |
|
| | | import javax.validation.constraints.NotBlank;
|
| | | import javax.validation.constraints.Size;
|
| | | import org.apache.commons.lang3.builder.ToStringBuilder;
|
| | | import org.apache.commons.lang3.builder.ToStringStyle;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
|
| | | import com.ruoyi.framework.web.domain.BaseEntity;
|
| | |
|
| | | /**
|
| | |
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | /** è§è²ID */
|
| | | @Excel(name = "è§è²åºå·", cellType = ColumnType.NUMERIC)
|
| | | private Long roleId;
|
| | |
|
| | | /** è§è²åç§° */
|
| | | @Excel(name = "è§è²åç§°")
|
| | | private String roleName;
|
| | |
|
| | | /** è§è²æé */
|
| | | @Excel(name = "è§è²æé")
|
| | | private String roleKey;
|
| | |
|
| | | /** è§è²æåº */
|
| | | @Excel(name = "è§è²æåº")
|
| | | private String roleSort;
|
| | |
|
| | | /** æ°æ®èå´ */
|
| | | /** æ°æ®èå´ï¼1ï¼æææ°æ®æéï¼2ï¼èªå®ä¹æ°æ®æéï¼3ï¼æ¬é¨é¨æ°æ®æéï¼4ï¼æ¬é¨é¨å以䏿°æ®æéï¼ */
|
| | | @Excel(name = "æ°æ®èå´", readConverterExp = "1=æææ°æ®æé,2=èªå®ä¹æ°æ®æé,3=æ¬é¨é¨æ°æ®æé,4=æ¬é¨é¨å以䏿°æ®æé")
|
| | | private String dataScope;
|
| | |
|
| | | /** è§è²ç¶æï¼0æ£å¸¸ 1åç¨ï¼ */
|
| | | @Excel(name = "è§è²ç¶æ", readConverterExp = "0=æ£å¸¸,1=åç¨")
|
| | | private String status;
|
| | |
|
| | | /** å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼ */
|
| | |
| | | return roleId != null && 1L == roleId;
|
| | | }
|
| | |
|
| | | @NotBlank(message = "è§è²åç§°ä¸è½ä¸ºç©º")
|
| | | @Size(min = 0, max = 30, message = "è§è²åç§°é¿åº¦ä¸è½è¶
è¿30个å符")
|
| | | public String getRoleName()
|
| | | {
|
| | | return roleName;
|
| | |
| | | this.roleName = roleName;
|
| | | }
|
| | |
|
| | | @NotBlank(message = "æéå符ä¸è½ä¸ºç©º")
|
| | | @Size(min = 0, max = 100, message = "æéå符é¿åº¦ä¸è½è¶
è¿100个å符")
|
| | | public String getRoleKey()
|
| | | {
|
| | | return roleKey;
|
| | |
| | | this.roleKey = roleKey;
|
| | | }
|
| | |
|
| | | @NotBlank(message = "æ¾ç¤ºé¡ºåºä¸è½ä¸ºç©º")
|
| | | public String getRoleSort()
|
| | | {
|
| | | return roleSort;
|
| | |
| | | {
|
| | | this.deptIds = deptIds;
|
| | | }
|
| | | |
| | | public String toString() {
|
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
| | | .append("roleId", getRoleId())
|
| | | .append("roleName", getRoleName())
|
| | | .append("roleKey", getRoleKey())
|
| | | .append("roleSort", getRoleSort())
|
| | | .append("dataScope", getDataScope())
|
| | | .append("status", getStatus())
|
| | | .append("delFlag", getDelFlag())
|
| | | .append("createBy", getCreateBy())
|
| | | .append("createTime", getCreateTime())
|
| | | .append("updateBy", getUpdateBy())
|
| | | .append("updateTime", getUpdateTime())
|
| | | .append("remark", getRemark())
|
| | | .toString();
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import javax.validation.constraints.Email;
|
| | | import javax.validation.constraints.NotBlank;
|
| | | import javax.validation.constraints.Size;
|
| | | import org.apache.commons.lang3.builder.ToStringBuilder;
|
| | | import org.apache.commons.lang3.builder.ToStringStyle;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excels;
|
| | | import com.ruoyi.framework.web.domain.BaseEntity;
|
| | |
|
| | | /**
|
| | |
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | /** ç¨æ·ID */
|
| | | @Excel(name = "ç¨æ·åºå·", cellType = ColumnType.NUMERIC, prompt = "ç¨æ·ç¼å·")
|
| | | private Long userId;
|
| | |
|
| | | /** é¨é¨ID */
|
| | | private Long deptId;
|
| | |
|
| | | /** ç¨æ·è´¦å· */
|
| | | @Excel(name = "ç»å½åç§°")
|
| | | private String userName;
|
| | |
|
| | | /** ç¨æ·æµç§° */
|
| | | @Excel(name = "ç¨æ·åç§°")
|
| | | private String nickName;
|
| | |
|
| | | /** ç¨æ·é®ç®± */
|
| | | @Excel(name = "ç¨æ·é®ç®±")
|
| | | private String email;
|
| | |
|
| | | /** ææºå·ç */
|
| | | @Excel(name = "ææºå·ç ")
|
| | | private String phonenumber;
|
| | |
|
| | | /** ç¨æ·æ§å« */
|
| | | @Excel(name = "ç¨æ·æ§å«", readConverterExp = "0=ç·,1=女,2=æªç¥")
|
| | | private String sex;
|
| | |
|
| | | /** ç¨æ·å¤´å */
|
| | |
| | | private String salt;
|
| | |
|
| | | /** å¸å·ç¶æï¼0æ£å¸¸ 1åç¨ï¼ */
|
| | | @Excel(name = "å¸å·ç¶æ", readConverterExp = "0=æ£å¸¸,1=åç¨")
|
| | | private String status;
|
| | |
|
| | | /** å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼ */
|
| | | private String delFlag;
|
| | |
|
| | | /** æåç»éIP */
|
| | | @Excel(name = "æåç»éIP")
|
| | | private String loginIp;
|
| | |
|
| | | /** æåç»éæ¶é´ */
|
| | | @Excel(name = "æåç»éæ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
| | | private Date loginDate;
|
| | |
|
| | | /** é¨é¨å¯¹è±¡ */
|
| | | @Excels({ @Excel(name = "é¨é¨åç§°", targetAttr = "deptName"), @Excel(name = "é¨é¨è´è´£äºº", targetAttr = "leader") })
|
| | | private SysDept dept;
|
| | |
|
| | | /** è§è²å¯¹è±¡ */
|
| | |
| | | this.deptId = deptId;
|
| | | }
|
| | |
|
| | | @Size(min = 0, max = 30, message = "ç¨æ·æµç§°é¿åº¦ä¸è½è¶
è¿30个å符")
|
| | | public String getNickName()
|
| | | {
|
| | | return nickName;
|
| | |
| | | this.nickName = nickName;
|
| | | }
|
| | |
|
| | | @NotBlank(message = "ç¨æ·è´¦å·ä¸è½ä¸ºç©º")
|
| | | @Size(min = 0, max = 30, message = "ç¨æ·è´¦å·é¿åº¦ä¸è½è¶
è¿30个å符")
|
| | | public String getUserName()
|
| | | {
|
| | | return userName;
|
| | |
| | | this.userName = userName;
|
| | | }
|
| | |
|
| | | @Email(message = "é®ç®±æ ¼å¼ä¸æ£ç¡®")
|
| | | @Size(min = 0, max = 50, message = "é®ç®±é¿åº¦ä¸è½è¶
è¿50个å符")
|
| | | public String getEmail()
|
| | | {
|
| | | return email;
|
| | |
| | | this.email = email;
|
| | | }
|
| | |
|
| | | @Size(min = 0, max = 11, message = "ææºå·ç é¿åº¦ä¸è½è¶
è¿11个å符")
|
| | | public String getPhonenumber()
|
| | | {
|
| | | return phonenumber;
|
| | |
| | | {
|
| | | this.postIds = postIds;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public String toString() {
|
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
| | | .append("userId", getUserId())
|
| | | .append("deptId", getDeptId())
|
| | | .append("userName", getUserName())
|
| | | .append("nickName", getNickName())
|
| | | .append("email", getEmail())
|
| | | .append("phonenumber", getPhonenumber())
|
| | | .append("sex", getSex())
|
| | | .append("avatar", getAvatar())
|
| | | .append("password", getPassword())
|
| | | .append("salt", getSalt())
|
| | | .append("status", getStatus())
|
| | | .append("delFlag", getDelFlag())
|
| | | .append("loginIp", getLoginIp())
|
| | | .append("loginDate", getLoginDate())
|
| | | .append("createBy", getCreateBy())
|
| | | .append("createTime", getCreateTime())
|
| | | .append("updateBy", getUpdateBy())
|
| | | .append("updateTime", getUpdateTime())
|
| | | .append("remark", getRemark())
|
| | | .append("dept", getDept())
|
| | | .toString();
|
| | | }
|
| | | }
|
| | |
| | | /**
|
| | | * å é¤åæ°é
ç½®
|
| | | *
|
| | | * @param configId éè¦å é¤çæ°æ®ID
|
| | | * @param configId åæ°ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteConfigById(Long configId);
|
| | |
|
| | | /**
|
| | | * æ¹éå é¤åæ°ä¿¡æ¯
|
| | | * |
| | | * @param configIds éè¦å é¤çåæ°ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteConfigByIds(Long[] configIds);
|
| | | } |
| | |
| | | public int deleteDictDataById(Long dictCode);
|
| | |
|
| | | /**
|
| | | * æ¹éå é¤åå
¸æ°æ®ä¿¡æ¯
|
| | | * |
| | | * @param dictCodes éè¦å é¤çåå
¸æ°æ®ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteDictDataByIds(Long[] dictCodes);
|
| | |
|
| | | /**
|
| | | * æ°å¢åå
¸æ°æ®ä¿¡æ¯
|
| | | *
|
| | | * @param dictData åå
¸æ°æ®ä¿¡æ¯
|
| | |
| | | public int deleteDictTypeById(Long dictId);
|
| | |
|
| | | /**
|
| | | * æ¹éå é¤åå
¸ç±»åä¿¡æ¯
|
| | | * |
| | | * @param dictIds éè¦å é¤çåå
¸ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteDictTypeByIds(Long[] dictIds);
|
| | |
|
| | | /**
|
| | | * æ°å¢åå
¸ç±»åä¿¡æ¯
|
| | | *
|
| | | * @param dictType åå
¸ç±»åä¿¡æ¯
|
| | |
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteNoticeById(Long noticeId);
|
| | |
|
| | | /**
|
| | | * æ¹éå é¤å
¬åä¿¡æ¯
|
| | | * |
| | | * @param noticeIds éè¦å é¤çå
ŒID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteNoticeByIds(Long noticeIds);
|
| | | } |
| | |
| | | public int deletePostById(Long postId);
|
| | |
|
| | | /**
|
| | | * æ¹éå é¤å²ä½ä¿¡æ¯
|
| | | * |
| | | * @param postIds éè¦å é¤çå²ä½ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deletePostByIds(Long[] postIds);
|
| | |
|
| | | /**
|
| | | * ä¿®æ¹å²ä½ä¿¡æ¯
|
| | | *
|
| | | * @param post å²ä½ä¿¡æ¯
|
| | |
| | | */
|
| | | public int deleteRoleById(Long roleId);
|
| | |
|
| | | /**
|
| | | * æ¹éå é¤è§è²ä¿¡æ¯
|
| | | * |
| | | * @param roleIds éè¦å é¤çè§è²ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteRoleByIds(Long[] roleIds);
|
| | | }
|
| | |
| | | public int deleteUserById(Long userId);
|
| | |
|
| | | /**
|
| | | * æ¹éå é¤ç¨æ·ä¿¡æ¯
|
| | | * |
| | | * @param userIds éè¦å é¤çç¨æ·ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteUserByIds(Long[] userIds);
|
| | |
|
| | | /**
|
| | | * æ ¡éªç¨æ·åç§°æ¯å¦å¯ä¸
|
| | | *
|
| | | * @param userName ç¨æ·åç§°
|
| | |
| | | /**
|
| | | * å é¤åæ°é
置信æ¯
|
| | | *
|
| | | * @param configId éè¦å é¤çæ°æ®ID
|
| | | * @param configId åæ°ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteConfigById(Long configId);
|
| | |
|
| | | /**
|
| | | * æ¹éå é¤åæ°ä¿¡æ¯
|
| | | * |
| | | * @param configIds éè¦å é¤çåæ°ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteConfigByIds(Long[] configIds);
|
| | |
|
| | | /**
|
| | | * æ ¡éªåæ°é®åæ¯å¦å¯ä¸
|
| | | *
|
| | | * @param config åæ°ä¿¡æ¯
|
| | |
| | | public int deleteDictDataById(Long dictCode);
|
| | |
|
| | | /**
|
| | | * æ¹éå é¤åå
¸æ°æ®ä¿¡æ¯
|
| | | * |
| | | * @param dictCodes éè¦å é¤çåå
¸æ°æ®ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteDictDataByIds(Long[] dictCodes);
|
| | |
|
| | | /**
|
| | | * æ°å¢ä¿ååå
¸æ°æ®ä¿¡æ¯
|
| | | *
|
| | | * @param dictData åå
¸æ°æ®ä¿¡æ¯
|
| | |
| | | public int deleteDictTypeById(Long dictId);
|
| | |
|
| | | /**
|
| | | * æ¹éå é¤åå
¸ä¿¡æ¯
|
| | | * |
| | | * @param dictIds éè¦å é¤çåå
¸ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteDictTypeByIds(Long[] dictIds);
|
| | |
|
| | | /**
|
| | | * æ°å¢ä¿ååå
¸ç±»åä¿¡æ¯
|
| | | *
|
| | | * @param dictType åå
¸ç±»åä¿¡æ¯
|
| | |
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteNoticeById(Long noticeId);
|
| | | |
| | | /**
|
| | | * æ¹éå é¤å
¬åä¿¡æ¯
|
| | | * |
| | | * @param noticeIds éè¦å é¤çå
ŒID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteNoticeByIds(Long noticeIds);
|
| | | }
|
| | |
| | | public String checkPostCodeUnique(SysPost post);
|
| | |
|
| | | /**
|
| | | * éè¿å²ä½IDæ¥è¯¢å²ä½ä½¿ç¨æ°é
|
| | | * |
| | | * @param postId å²ä½ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int countUserPostById(Long postId);
|
| | |
|
| | | /**
|
| | | * å é¤å²ä½ä¿¡æ¯
|
| | | *
|
| | | * @param postId å²ä½ID
|
| | |
| | | public int deletePostById(Long postId);
|
| | |
|
| | | /**
|
| | | * æ¹éå é¤å²ä½ä¿¡æ¯
|
| | | * |
| | | * @param postIds éè¦å é¤çå²ä½ID
|
| | | * @return ç»æ
|
| | | * @throws Exception å¼å¸¸
|
| | | */
|
| | | public int deletePostByIds(Long[] postIds);
|
| | |
|
| | | /**
|
| | | * æ°å¢ä¿åå²ä½ä¿¡æ¯
|
| | | *
|
| | | * @param post å²ä½ä¿¡æ¯
|
| | |
| | | public void checkRoleAllowed(SysRole role);
|
| | |
|
| | | /**
|
| | | * éè¿è§è²IDæ¥è¯¢è§è²ä½¿ç¨æ°é
|
| | | * |
| | | * @param roleId è§è²ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int countUserRoleByRoleId(Long roleId);
|
| | |
|
| | | /**
|
| | | * æ°å¢ä¿åè§è²ä¿¡æ¯
|
| | | *
|
| | | * @param role è§è²ä¿¡æ¯
|
| | |
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteRoleById(Long roleId);
|
| | |
|
| | | /**
|
| | | * æ¹éå é¤è§è²ä¿¡æ¯
|
| | | * |
| | | * @param roleIds éè¦å é¤çè§è²ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteRoleByIds(Long[] roleIds);
|
| | | }
|
| | |
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteUserById(Long userId);
|
| | |
|
| | | /**
|
| | | * æ¹éå é¤ç¨æ·ä¿¡æ¯
|
| | | * |
| | | * @param userIds éè¦å é¤çç¨æ·ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteUserByIds(Long[] userIds);
|
| | | }
|
| | |
| | | /**
|
| | | * å é¤åæ°é
置信æ¯
|
| | | *
|
| | | * @param configId éè¦å é¤çæ°æ®ID
|
| | | * @param configId åæ°ID
|
| | | * @return ç»æ
|
| | | */
|
| | | @Override
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * æ¹éå é¤åæ°ä¿¡æ¯
|
| | | * |
| | | * @param configIds éè¦å é¤çåæ°ID
|
| | | * @return ç»æ
|
| | | */
|
| | | @Override
|
| | | public int deleteConfigByIds(Long[] configIds)
|
| | | {
|
| | | return configMapper.deleteConfigByIds(configIds);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ ¡éªåæ°é®åæ¯å¦å¯ä¸
|
| | | *
|
| | | * @param config åæ°é
置信æ¯
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * æ¹éå é¤åå
¸æ°æ®ä¿¡æ¯
|
| | | * |
| | | * @param dictCodes éè¦å é¤çåå
¸æ°æ®ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteDictDataByIds(Long[] dictCodes)
|
| | | {
|
| | | return dictDataMapper.deleteDictDataByIds(dictCodes);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ°å¢ä¿ååå
¸æ°æ®ä¿¡æ¯
|
| | | *
|
| | | * @param dictData åå
¸æ°æ®ä¿¡æ¯
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * æ¹éå é¤åå
¸ç±»åä¿¡æ¯
|
| | | * |
| | | * @param dictIds éè¦å é¤çåå
¸ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteDictTypeByIds(Long[] dictIds)
|
| | | {
|
| | | return dictTypeMapper.deleteDictTypeByIds(dictIds);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ°å¢ä¿ååå
¸ç±»åä¿¡æ¯
|
| | | *
|
| | | * @param dictType åå
¸ç±»åä¿¡æ¯
|
| | |
| | | {
|
| | | return noticeMapper.deleteNoticeById(noticeId);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¹éå é¤å
¬åä¿¡æ¯
|
| | | * |
| | | * @param noticeIds éè¦å é¤çå
ŒID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteNoticeByIds(Long noticeIds)
|
| | | {
|
| | | return noticeMapper.deleteNoticeByIds(noticeIds);
|
| | | }
|
| | | }
|
| | |
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | | import com.ruoyi.common.constant.UserConstants;
|
| | | import com.ruoyi.common.exception.CustomException;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.project.system.domain.SysPost;
|
| | | import com.ruoyi.project.system.mapper.SysPostMapper;
|
| | | import com.ruoyi.project.system.mapper.SysUserPostMapper;
|
| | | import com.ruoyi.project.system.service.ISysPostService;
|
| | |
|
| | | /**
|
| | |
| | | {
|
| | | @Autowired
|
| | | private SysPostMapper postMapper;
|
| | |
|
| | | @Autowired
|
| | | private SysUserPostMapper userPostMapper;
|
| | |
|
| | | /**
|
| | | * æ¥è¯¢å²ä½ä¿¡æ¯éå
|
| | |
| | | return postMapper.selectPostListByUserId(userId);
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * æ ¡éªå²ä½åç§°æ¯å¦å¯ä¸
|
| | | *
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * éè¿å²ä½IDæ¥è¯¢å²ä½ä½¿ç¨æ°é
|
| | | * |
| | | * @param postId å²ä½ID
|
| | | * @return ç»æ
|
| | | */
|
| | | @Override
|
| | | public int countUserPostById(Long postId)
|
| | | {
|
| | | return userPostMapper.countUserPostById(postId);
|
| | | }
|
| | |
|
| | | /**
|
| | | * å é¤å²ä½ä¿¡æ¯
|
| | | *
|
| | | * @param postId å²ä½ID
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * æ¹éå é¤å²ä½ä¿¡æ¯
|
| | | * |
| | | * @param postIds éè¦å é¤çå²ä½ID
|
| | | * @return ç»æ
|
| | | * @throws Exception å¼å¸¸
|
| | | */
|
| | | public int deletePostByIds(Long[] postIds)
|
| | | {
|
| | | for (Long postId : postIds)
|
| | | {
|
| | | SysPost post = selectPostById(postId);
|
| | | if (countUserPostById(postId) > 0)
|
| | | {
|
| | | throw new CustomException(String.format("%1$så·²åé
,ä¸è½å é¤", post.getPostName()));
|
| | | }
|
| | | }
|
| | | return postMapper.deletePostByIds(postIds);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ°å¢ä¿åå²ä½ä¿¡æ¯
|
| | | *
|
| | | * @param post å²ä½ä¿¡æ¯
|
| | |
| | | import com.ruoyi.project.system.mapper.SysRoleDeptMapper;
|
| | | import com.ruoyi.project.system.mapper.SysRoleMapper;
|
| | | import com.ruoyi.project.system.mapper.SysRoleMenuMapper;
|
| | | import com.ruoyi.project.system.mapper.SysUserRoleMapper;
|
| | | import com.ruoyi.project.system.service.ISysRoleService;
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | @Autowired
|
| | | private SysRoleMenuMapper roleMenuMapper;
|
| | |
|
| | | @Autowired
|
| | | private SysUserRoleMapper userRoleMapper;
|
| | |
|
| | | @Autowired
|
| | | private SysRoleDeptMapper roleDeptMapper;
|
| | |
| | | {
|
| | | throw new CustomException("ä¸å
许æä½è¶
级管çåè§è²");
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * éè¿è§è²IDæ¥è¯¢è§è²ä½¿ç¨æ°é
|
| | | * |
| | | * @param roleId è§è²ID
|
| | | * @return ç»æ
|
| | | */
|
| | | @Override
|
| | | public int countUserRoleByRoleId(Long roleId)
|
| | | {
|
| | | return userRoleMapper.countUserRoleByRoleId(roleId);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | {
|
| | | return roleMapper.deleteRoleById(roleId);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¹éå é¤è§è²ä¿¡æ¯
|
| | | * |
| | | * @param roleIds éè¦å é¤çè§è²ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteRoleByIds(Long[] roleIds)
|
| | | {
|
| | | for (Long roleId : roleIds)
|
| | | {
|
| | | checkRoleAllowed(new SysRole(roleId));
|
| | | SysRole role = selectRoleById(roleId);
|
| | | if (countUserRoleByRoleId(roleId) > 0)
|
| | | {
|
| | | throw new CustomException(String.format("%1$så·²åé
,ä¸è½å é¤", role.getRoleName()));
|
| | | }
|
| | | }
|
| | | return roleMapper.deleteRoleByIds(roleIds);
|
| | | }
|
| | | }
|
| | |
| | | userPostMapper.deleteUserPostByUserId(userId);
|
| | | return userMapper.deleteUserById(userId);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¹éå é¤ç¨æ·ä¿¡æ¯
|
| | | * |
| | | * @param userIds éè¦å é¤çç¨æ·ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public int deleteUserByIds(Long[] userIds)
|
| | | {
|
| | | for (Long userId : userIds)
|
| | | {
|
| | | checkUserAllowed(new SysUser(userId));
|
| | | }
|
| | | return userMapper.deleteUserByIds(userIds);
|
| | | }
|
| | | }
|
| | |
| | | # åç§°
|
| | | name: RuoYi
|
| | | # çæ¬
|
| | | version: 1.0.0
|
| | | version: 1.1.0
|
| | | # çæå¹´ä»½
|
| | | copyrightYear: 2019
|
| | | # å®ä¾æ¼ç¤ºå¼å
³
|
| | |
| | | </where>
|
| | | </select>
|
| | |
|
| | | <delete id="deleteLogininforByIds" parameterType="String">
|
| | | <delete id="deleteLogininforByIds" parameterType="Long">
|
| | | delete from sys_logininfor where info_id in
|
| | | <foreach collection="array" item="infoId" open="(" separator="," close=")">
|
| | | #{infoId}
|
| | |
| | | </where>
|
| | | </select>
|
| | |
|
| | | <delete id="deleteOperLogByIds" parameterType="String">
|
| | | <delete id="deleteOperLogByIds" parameterType="Long">
|
| | | delete from sys_oper_log where oper_id in
|
| | | <foreach collection="array" item="operId" open="(" separator="," close=")">
|
| | | #{operId}
|
| | |
| | | delete from sys_config where config_id = #{configId}
|
| | | </delete>
|
| | |
|
| | | <delete id="deleteConfigByIds" parameterType="Long">
|
| | | delete from sys_config where config_id in |
| | | <foreach item="configId" collection="array" open="(" separator="," close=")">
|
| | | #{configId}
|
| | | </foreach>
|
| | | </delete>
|
| | | |
| | | </mapper> |
| | |
| | | <delete id="deleteDictDataById" parameterType="Long">
|
| | | delete from sys_dict_data where dict_code = #{dictCode}
|
| | | </delete>
|
| | | |
| | | <delete id="deleteDictDataByIds" parameterType="Long">
|
| | | delete from sys_dict_data where dict_code in
|
| | | <foreach collection="array" item="dictCode" open="(" separator="," close=")">
|
| | | #{dictCode}
|
| | | </foreach> |
| | | </delete>
|
| | |
|
| | | <update id="updateDictData" parameterType="SysDictData">
|
| | | update sys_dict_data
|
| | |
| | | <delete id="deleteDictTypeById" parameterType="Long">
|
| | | delete from sys_dict_type where dict_id = #{dictId}
|
| | | </delete>
|
| | | |
| | | <delete id="deleteDictTypeByIds" parameterType="Long">
|
| | | delete from sys_dict_type where dict_id in
|
| | | <foreach collection="array" item="dictId" open="(" separator="," close=")">
|
| | | #{dictId}
|
| | | </foreach> |
| | | </delete>
|
| | |
|
| | | <update id="updateDictType" parameterType="SysDictType">
|
| | | update sys_dict_type
|
| | |
| | | delete from sys_notice where notice_id = #{noticeId}
|
| | | </delete>
|
| | |
|
| | | <delete id="deleteNoticeByIds" parameterType="Long">
|
| | | delete from sys_notice where notice_id in |
| | | <foreach item="noticeId" collection="array" open="(" separator="," close=")">
|
| | | #{noticeId}
|
| | | </foreach>
|
| | | </delete>
|
| | | |
| | | </mapper> |
| | |
| | | <delete id="deletePostById" parameterType="Long">
|
| | | delete from sys_post where post_id = #{postId}
|
| | | </delete>
|
| | | |
| | | <delete id="deletePostByIds" parameterType="Long">
|
| | | delete from sys_post where post_id in
|
| | | <foreach collection="array" item="postId" open="(" separator="," close=")">
|
| | | #{postId}
|
| | | </foreach> |
| | | </delete>
|
| | |
|
| | | </mapper> |
| | |
| | | delete from sys_role where role_id = #{roleId}
|
| | | </delete>
|
| | |
|
| | | <delete id="deleteRoleByIds" parameterType="Long">
|
| | | update sys_role set del_flag = '2' where role_id in
|
| | | <foreach collection="array" item="roleId" open="(" separator="," close=")">
|
| | | #{roleId}
|
| | | </foreach> |
| | | </delete>
|
| | | |
| | | </mapper> |
| | |
| | | <delete id="deleteUserById" parameterType="Long">
|
| | | delete from sys_user where user_id = #{userId}
|
| | | </delete>
|
| | | |
| | | <delete id="deleteUserByIds" parameterType="Long">
|
| | | update sys_user set del_flag = '2' where user_id in
|
| | | <foreach collection="array" item="userId" open="(" separator="," close=")">
|
| | | #{userId}
|
| | | </foreach> |
| | | </delete>
|
| | |
|
| | | </mapper> |