Commit 5505e4dc4a80c2e7b59393fd3aa851957524783e

Authored by 2c
1 parent ff15fa29

文件资料,廉政风险点,廉洁教育

Showing 23 changed files with 2035 additions and 252 deletions
trash-common/pom.xml
... ... @@ -139,6 +139,13 @@
139 139 <artifactId>mybatis-plus-boot-starter</artifactId>
140 140 <version>3.4.1</version>
141 141 </dependency>
  142 +
  143 + <dependency>
  144 + <groupId>com.google.code.gson</groupId>
  145 + <artifactId>gson</artifactId>
  146 + <version>2.3.1</version>
  147 + </dependency>
  148 +
142 149 </dependencies>
143 150  
144 151 </project>
145 152 \ No newline at end of file
... ...
trash-ui/src/api/other/incorruptEducation.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +// 查询廉洁教育列表
  4 +export function listIncorruptEducation(query) {
  5 + return request({
  6 + url: '/other/IncorruptEducation/list',
  7 + method: 'get',
  8 + params: query
  9 + })
  10 +}
  11 +
  12 +// 查询廉洁教育详细
  13 +export function getIncorruptEducation(id) {
  14 + return request({
  15 + url: '/other/IncorruptEducation/' + id,
  16 + method: 'get'
  17 + })
  18 +}
  19 +
  20 +// 新增廉洁教育
  21 +export function addIncorruptEducation(data) {
  22 + return request({
  23 + url: '/other/IncorruptEducation',
  24 + method: 'post',
  25 + data: data
  26 + })
  27 +}
  28 +
  29 +// 修改廉洁教育
  30 +export function updateIncorruptEducation(data) {
  31 + return request({
  32 + url: '/other/IncorruptEducation',
  33 + method: 'put',
  34 + data: data
  35 + })
  36 +}
  37 +
  38 +// 删除廉洁教育
  39 +export function delIncorruptEducation(id) {
  40 + return request({
  41 + url: '/other/IncorruptEducation/' + id,
  42 + method: 'delete'
  43 + })
  44 +}
  45 +
  46 +// 导出廉洁教育
  47 +export function exportIncorruptEducation(query) {
  48 + return request({
  49 + url: '/other/IncorruptEducation/export',
  50 + method: 'get',
  51 + params: query
  52 + })
  53 +}
... ...
trash-ui/src/api/other/incorruptGovernment.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +
  3 +// 查询廉政风险点列表
  4 +export function listIncorruptGovernment(query) {
  5 + return request({
  6 + url: '/other/IncorruptGovernment/list',
  7 + method: 'get',
  8 + params: query
  9 + })
  10 +}
  11 +
  12 +// 查询廉政风险点详细
  13 +export function getIncorruptGovernment(id) {
  14 + return request({
  15 + url: '/other/IncorruptGovernment/' + id,
  16 + method: 'get'
  17 + })
  18 +}
  19 +
  20 +// 新增廉政风险点
  21 +export function addIncorruptGovernment(data) {
  22 + return request({
  23 + url: '/other/IncorruptGovernment',
  24 + method: 'post',
  25 + data: data
  26 + })
  27 +}
  28 +
  29 +// 修改廉政风险点
  30 +export function updateIncorruptGovernment(data) {
  31 + return request({
  32 + url: '/other/IncorruptGovernment',
  33 + method: 'put',
  34 + data: data
  35 + })
  36 +}
  37 +
  38 +// 删除廉政风险点
  39 +export function delIncorruptGovernment(id) {
  40 + return request({
  41 + url: '/other/IncorruptGovernment/' + id,
  42 + method: 'delete'
  43 + })
  44 +}
  45 +
  46 +// 导出廉政风险点
  47 +export function exportIncorruptGovernment(query) {
  48 + return request({
  49 + url: '/other/IncorruptGovernment/export',
  50 + method: 'get',
  51 + params: query
  52 + })
  53 +}
... ...
trash-ui/src/layout/index.vue
1 1 <template>
  2 + <div :class="classObj" class="app-wrapper">
  3 + <sidebar class="sidebar-container" />
  4 + <div :class="{ hasTagsView: false }" class="main-container">
  5 + <tags-view v-if="needTagsView" />
2 6 <app-main />
  7 +
  8 + </div>
  9 + </div>
3 10 </template>
4 11  
5 12 <script>
6 13 import RightPanel from '@/components/RightPanel'
  14 +import { mapState } from 'vuex'
7 15 import { AppMain, Navbar, Settings, Sidebar, TagsView } from './components'
8 16 import ResizeMixin from './mixin/ResizeHandler'
9   -import { mapState } from 'vuex'
10 17  
11 18 export default {
12 19 name: 'Layout',
... ... @@ -38,15 +45,23 @@ export default {
38 45 },
39 46 methods: {
40 47 handleClickOutside() {
41   - this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
  48 + this.$store.dispatch('app/closeSideBar', {withoutAnimation: false})
42 49 }
43 50 }
44 51 }
45 52 </script>
46 53  
47 54 <style lang="scss" scoped>
48   - @import "~@/assets/styles/mixin.scss";
49   - @import "~@/assets/styles/variables.scss";
  55 +@import "~@/assets/styles/mixin.scss";
  56 +@import "~@/assets/styles/variables.scss";
  57 +@import "~@/assets/styles/mixin.scss";
  58 +@import "~@/assets/styles/variables.scss";
  59 +
  60 +.app-wrapper {
  61 + @include clearfix;
  62 + position: relative;
  63 + height: 100%;
  64 + width: 100%;
50 65  
51 66 .app-wrapper {
52 67 @include clearfix;
... ... @@ -60,30 +75,75 @@ export default {
60 75 }
61 76 }
62 77  
63   - .drawer-bg {
64   - background: #000;
65   - opacity: 0.3;
66   - width: 100%;
67   - top: 0;
68   - height: 100%;
69   - position: absolute;
70   - z-index: 999;
71   - }
72   -
73   - .fixed-header {
  78 + &.mobile.openSidebar {
74 79 position: fixed;
75 80 top: 0;
76   - right: 0;
77   - z-index: 9;
78   - width: calc(100% - #{$sideBarWidth});
79   - transition: width 0.28s;
80 81 }
  82 +}
81 83  
82   - .hideSidebar .fixed-header {
83   - width: calc(100% - 54px)
84   - }
  84 +.drawer-bg {
  85 + background: #000;
  86 + opacity: 0.3;
  87 + width: 100%;
  88 + top: 0;
  89 + height: 100%;
  90 + position: absolute;
  91 + z-index: 999;
  92 +}
85 93  
86   - .mobile .fixed-header {
87   - width: 100%;
88   - }
  94 +.drawer-bg {
  95 + background: #000;
  96 + opacity: 0.3;
  97 + width: 100%;
  98 + top: 0;
  99 + height: 100%;
  100 + position: absolute;
  101 + z-index: 999;
  102 +}
  103 +
  104 +.fixed-header {
  105 + position: fixed;
  106 + top: 0;
  107 + right: 0;
  108 + z-index: 9;
  109 + width: calc(100% - #{$sideBarWidth});
  110 + transition: width 0.28s;
  111 +}
  112 +
  113 +.fixed-header {
  114 + position: fixed;
  115 + top: 0;
  116 + right: 0;
  117 + z-index: 9;
  118 + width: calc(100% - #{$sideBarWidth});
  119 + transition: width 0.28s;
  120 +}
  121 +
  122 +.hideSidebar .fixed-header {
  123 + width: calc(100% - 54px)
  124 +}
  125 +
  126 +.hideSidebar .fixed-header {
  127 + width: calc(100% - 54px)
  128 +}
  129 +
  130 +.mobile .fixed-header {
  131 + width: 100%;
  132 +}
  133 +
  134 +.preview figure {
  135 + float: left;
  136 + width: 30%;
  137 + height: calc(30vw - 0px);
  138 + margin: 1.5%;
  139 +}
  140 +
  141 +.preview figure img {
  142 + width: 400px;
  143 +}
  144 +
  145 +.mobile .fixed-header {
  146 + width: 100%;
  147 +}
89 148 </style>
  149 +
... ...
trash-ui/src/router/index.js
... ... @@ -194,6 +194,20 @@ export const constantRoutes = [
194 194 hidden: true,
195 195 meta: { title: '查看详情' }
196 196 },
  197 + {
  198 + path: '/IncorruptGovernment/info',
  199 + component: (resolve) => require(['@/views/other/incorruptGovernment/info'], resolve),
  200 + name: '查看详情',
  201 + hidden: true,
  202 + meta: { title: '查看详情' }
  203 + },
  204 + {
  205 + path: '/IncorruptEducation/info',
  206 + component: (resolve) => require(['@/views/other/incorruptEducation/info'], resolve),
  207 + name: '查看详情',
  208 + hidden: true,
  209 + meta: { title: '查看详情' }
  210 + },
197 211 ]
198 212 },
199 213 {
... ...
trash-ui/src/views/other/documentData/info.vue
... ... @@ -14,8 +14,8 @@
14 14 </el-col>
15 15 </el-row>
16 16 <el-row>
17   - <el-col>
18   - <div class="info_content" v-html="info.content"></div>
  17 + <el-col :offset="3" :span="18">
  18 + <div class="info_content ql-editor" v-html="info.content"></div>
19 19 </el-col>
20 20 </el-row>
21 21 </div>
... ... @@ -30,7 +30,8 @@ import {
30 30 listDocumentData,
31 31 updateDocumentData
32 32 } from "@/api/other/documentData";
33   -import Editor from '@/components/ZcEditor';
  33 +import Editor from '@/components/2cEditor';
  34 +import "quill/dist/quill.core.css";
34 35 import {parseTime} from "../../../utils/trash";
35 36  
36 37 export default {
... ... @@ -84,10 +85,4 @@ export default {
84 85 .info_author span:nth-child(2){
85 86 margin-right: 20px;
86 87 }
87   -.info_content{
88   - display: flex;
89   - justify-content: center;
90   - align-items: center;
91   - height: 100%;
92   -}
93 88 </style>
... ...
trash-ui/src/views/other/incorruptEducation/index.vue
1 1 <template>
2 2 <div class="app-container">
  3 + <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4 + <el-form-item label="标题" prop="title">
  5 + <el-input
  6 + v-model="queryParams.title"
  7 + placeholder="请输入标题"
  8 + clearable
  9 + size="small"
  10 + @keyup.enter.native="handleQuery"
  11 + />
  12 + </el-form-item>
  13 + <el-form-item>
  14 + <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  15 + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  16 + </el-form-item>
  17 + </el-form>
  18 +
3 19 <el-row :gutter="10" class="mb8">
4 20 <el-col :span="1.5">
5   - <el-upload
6   - ref="upload"
7   - action=""
8   - accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp"
9   - :on-change="fileChange"
10   - :auto-upload="false"
11   - :show-file-list="false"
12   - multiple
13   - :file-list="file">
14   - <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
15   - </el-upload>
  21 + <el-button
  22 + type="primary"
  23 + icon="el-icon-plus"
  24 + size="mini"
  25 + @click="handleAdd"
  26 + v-hasPermi="['other:IncorruptEducation:add']"
  27 + >新增
  28 + </el-button>
  29 + </el-col>
  30 + <el-col :span="1.5">
  31 + <el-button
  32 + type="success"
  33 + icon="el-icon-edit"
  34 + size="mini"
  35 + :disabled="single"
  36 + @click="handleUpdate"
  37 + v-hasPermi="['other:IncorruptEducation:edit']"
  38 + >修改
  39 + </el-button>
16 40 </el-col>
17 41 <el-col :span="1.5">
18   - <el-button size="small" type="primary" @click="file=[]">删除附件</el-button>
  42 + <el-button
  43 + type="danger"
  44 + icon="el-icon-delete"
  45 + size="mini"
  46 + :disabled="multiple"
  47 + @click="handleDelete"
  48 + v-hasPermi="['other:IncorruptEducation:remove']"
  49 + >删除
  50 + </el-button>
19 51 </el-col>
20 52 <el-col :span="1.5">
21   - <el-button size="small" type="primary" @click="submitForm">提交</el-button>
  53 + <el-button
  54 + type="warning"
  55 + icon="el-icon-download"
  56 + size="mini"
  57 + @click="handleExport"
  58 + v-hasPermi="['other:IncorruptEducation:export']"
  59 + >导出
  60 + </el-button>
22 61 </el-col>
  62 + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
23 63 </el-row>
24   - <el-image v-if="file.length!=0" style=""
25   - :src="createUrl(file[0])"
26   - :preview-src-list="[createUrl(file[0])]"
27   - :z-index="999">
28   - </el-image>
  64 +
  65 + <el-table v-loading="loading" :data="IncorruptEducationList" @selection-change="handleSelectionChange">
  66 + <el-table-column type="selection" width="55" align="center"/>
  67 + <el-table-column label="标题" align="center" prop="title">
  68 + <template slot-scope="scope">
  69 + <a href="javascript:;" style="color:#0000EE;" @click="toInfo(scope.row)">{{scope.row.title}}</a>
  70 + </template>
  71 + </el-table-column>
  72 + <el-table-column label="时间" align="center" prop="createTime">
  73 + <template slot-scope="scope">
  74 + <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}:{s}") }}</span>
  75 + </template>
  76 + </el-table-column>
  77 + <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  78 + <template slot-scope="scope">
  79 + <el-button
  80 + size="mini"
  81 + type="text"
  82 + icon="el-icon-edit"
  83 + @click="handleUpdate(scope.row)"
  84 + v-hasPermi="['other:IncorruptEducation:edit']"
  85 + >修改
  86 + </el-button>
  87 + <el-button
  88 + size="mini"
  89 + type="text"
  90 + icon="el-icon-delete"
  91 + @click="handleDelete(scope.row)"
  92 + v-hasPermi="['other:IncorruptEducation:remove']"
  93 + >删除
  94 + </el-button>
  95 + </template>
  96 + </el-table-column>
  97 + </el-table>
  98 +
  99 + <pagination
  100 + v-show="total>0"
  101 + :total="total"
  102 + :page.sync="queryParams.pageNum"
  103 + :limit.sync="queryParams.pageSize"
  104 + @pagination="getList"
  105 + />
  106 +
  107 + <!-- 添加或修改文件资料对话框 -->
  108 + <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
  109 + <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  110 + <el-form-item label="标题" prop="title">
  111 + <el-input v-model="form.title" placeholder="请输入标题"/>
  112 + </el-form-item>
  113 + <el-form-item label="内容" prop="content">
  114 + <editor v-model="form.content" :min-height="368"/>
  115 + </el-form-item>
  116 + <el-row>
  117 + <el-col :span="12">
  118 + <el-form-item label="录入时间">
  119 + <el-input v-model="form.createTime" disabled="disabled"/>
  120 + </el-form-item>
  121 + </el-col>
  122 + <el-col :span="12">
  123 + <el-form-item label="录入人">
  124 + <el-input v-model="form.createBy" disabled="disabled"/>
  125 + </el-form-item>
  126 + </el-col>
  127 + </el-row>
  128 +
  129 + </el-form>
  130 + <div slot="footer" class="dialog-footer">
  131 + <el-button type="primary" @click="submitForm">确 定</el-button>
  132 + <el-button @click="cancel">取 消</el-button>
  133 + </div>
  134 + </el-dialog>
29 135 </div>
30 136 </template>
31 137  
32 138 <script>
33   -import {addIncorruptData, listIncorruptData} from "@/api/other/incorruptData";
  139 +import {
  140 + addIncorruptEducation,
  141 + delIncorruptEducation,
  142 + exportIncorruptEducation,
  143 + getIncorruptEducation,
  144 + listIncorruptEducation,
  145 + updateIncorruptEducation
  146 +} from "@/api/other/incorruptEducation";
  147 +import Editor from '@/components/2cEditor';
  148 +import {parseTime} from "../../../utils/trash";
34 149  
35 150 export default {
36   - name: "incorruptEducation",
  151 + name: "IncorruptEducation",
  152 + components: {Editor},
37 153 data() {
38 154 return {
39   - file: [],
  155 + // 遮罩层
  156 + loading: true,
  157 + // 选中数组
  158 + ids: [],
  159 + // 非单个禁用
  160 + single: true,
  161 + // 非多个禁用
  162 + multiple: true,
  163 + // 显示搜索条件
  164 + showSearch: true,
  165 + // 总条数
  166 + total: 0,
  167 + // 文件资料表格数据
  168 + IncorruptEducationList: [],
  169 + // 弹出层标题
  170 + title: "",
  171 + // 是否显示弹出层
  172 + open: false,
  173 + // 查询参数
  174 + queryParams: {
  175 + pageNum: 1,
  176 + pageSize: 10,
  177 + title: null,
  178 + content: null,
  179 + files: null,
  180 + },
  181 + // 表单参数
  182 + form: {},
  183 + // 表单校验
  184 + rules: {
  185 + title: [
  186 + {required: true, message: "请输入标题", trigger: "blur"},
  187 + {min: 1, max: 100, message: "长度在 1 到 100 个字符", trigger: "blur"}
  188 + ],
  189 + content: [
  190 + {required: true, message: "请输入内容", trigger: "blur"},
  191 + {min: 1, max: 10000, message: "长度在 1 到 10000 个字符", trigger: "blur"}
  192 + ],
  193 + files: [
  194 + {required: true, message: "请上传附件", trigger: "blur"}
  195 + ]
  196 + },
  197 + fileEntityList: [],
40 198 };
41 199 },
42 200 created() {
43 201 this.getList();
44 202 },
45 203 methods: {
  204 + toInfo(row){
  205 + //打开当日报修页签
  206 + this.$tab.openPage("查看详情","/IncorruptEducation/info",{"IncorruptEducation":row})
  207 + },
46 208 /** 查询文件资料列表 */
47 209 getList() {
48 210 this.loading = true;
49   - listIncorruptData("education").then(response => {
50   - this.file = [{
51   - url:response[0].filePath,
52   - name:response[0].fileName,
53   - }];
  211 + listIncorruptEducation(this.queryParams).then(response => {
  212 + this.IncorruptEducationList = response.rows;
  213 + this.total = response.total;
  214 + this.loading = false;
54 215 });
55 216 },
56   - delFile(){
57   - this.file=[];
  217 + // 取消按钮
  218 + cancel() {
  219 + this.open = false;
  220 + this.reset();
58 221 },
59   - /** 提交按钮 */
60   - submitForm() {
61   -
62   - let formData = new FormData();
63   - let form = {
  222 + // 表单重置
  223 + reset() {
  224 + this.form = {
  225 + id: null,
  226 + title: null,
  227 + content: null,
64 228 files: null,
65   - tableName: "education",
  229 + createTime: null,
  230 + createBy: null,
  231 + updateTime: null,
  232 + updateBy: null
66 233 };
67   -
68   - this.file.forEach(item => {
69   - if (item.raw != null) {
70   - formData.append('files', item.raw)
71   - } else {
72   - //将原有的附件拼接到form中
73   - form.files = form.files !== null ? form.files + ";" + item.url : item.url;
  234 + this.fileEntityList = [];
  235 + this.resetForm("form");
  236 + },
  237 + /** 搜索按钮操作 */
  238 + handleQuery() {
  239 + this.queryParams.pageNum = 1;
  240 + this.getList();
  241 + },
  242 + /** 重置按钮操作 */
  243 + resetQuery() {
  244 + this.resetForm("queryForm");
  245 + this.handleQuery();
  246 + },
  247 + // 多选框选中数据
  248 + handleSelectionChange(selection) {
  249 + this.ids = selection.map(item => item.id)
  250 + this.single = selection.length !== 1
  251 + this.multiple = !selection.length
  252 + },
  253 + /** 新增按钮操作 */
  254 + handleAdd() {
  255 + this.reset();
  256 + //yyyy-MM-dd HH:mm:ss
  257 + this.form.createTime = parseTime(new Date(), "{y}-{m}-{d} {h}:{i}:{s}");
  258 + this.form.createBy = this.$store.getters.name;
  259 + this.open = true;
  260 + this.title = "添加文件资料";
  261 + },
  262 + /** 修改按钮操作 */
  263 + handleUpdate(row) {
  264 + this.reset();
  265 + const id = row.id || this.ids
  266 + getIncorruptEducation(id).then(response => {
  267 + this.form = response.data;
  268 + //将附件转换为前端可视化数组
  269 + if (this.form.files != null && this.form.files !== "") {
  270 + let fileList = this.form.files.split(";");
  271 + fileList.map(item => {
  272 + let name = item.substring(item.lastIndexOf("/") + 1);
  273 + this.fileEntityList.push({name: name, url: item})
  274 + })
74 275 }
75   - })
76   -
77   - for (let key in form) {
78   - formData.append(key, form[key] == null ? "" : form[key])
79   - }
80   -
81   - addIncorruptData(formData).then(response => {
82   - this.msgSuccess("新增成功");
83   - this.open = false;
84   - this.getList();
  276 + this.open = true;
  277 + this.title = "修改文件资料";
85 278 });
86 279 },
87   - /**
88   - * 文件改变时,限制文件上传格式和大小
89   - * 文件格式只能为docx/doc/pdf/png/jpeg/png/jpg
90   - * 大小不超过20M
91   - * */
92   - fileChange(file, fileList) {
93   - let count = 0;
94   - if(fileList.length>1){
95   - this.$message({
96   - message: '只能上传一张图片!',
97   - type: 'warning'
98   - });
99   - return false;
100   - }
101   - for (let i = 0; i < fileList.length; i++) {
102   - // console.log(fileList.length)
103   - // console.log(this.fileEntityList[i].name+"111"+file.name)
104   - if (fileList[i].name == file.name) {
105   - count++;
106   - if (count == 2) {
107   - this.$message({
108   - message: '已存在此文件!',
109   - type: 'warning'
  280 + /** 提交按钮 */
  281 + submitForm() {
  282 + this.$refs["form"].validate(valid => {
  283 + if (valid) {
  284 + let formData = new FormData();
  285 + let form = this.form;
  286 + //去掉params属性
  287 + delete form.params;
  288 +
  289 + for (let key in form) {
  290 + formData.append(key, form[key] == null ? "" : form[key])
  291 + }
  292 +
  293 + if (this.form.id != null) {
  294 + updateIncorruptEducation(formData).then(response => {
  295 + this.msgSuccess("修改成功");
  296 + this.open = false;
  297 + this.getList();
  298 + });
  299 + } else {
  300 + addIncorruptEducation(formData).then(response => {
  301 + this.msgSuccess("新增成功");
  302 + this.open = false;
  303 + this.getList();
110 304 });
111   - for (let j = fileList.length; j > 0; j--) {
112   - //如果存在此文件,去除新选择的重复文件
113   - if (fileList[j - 1].name == file.name) {
114   - fileList.splice(j - 1, 1);
115   - i--;
116   - return false;
117   - }
118   - }
119 305 }
120 306 }
121   - }
122   - let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
123   - //格式符合后判断大小
124   - if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp".indexOf(fileType) != -1) {
125   - let max5M = file.size / 1024 / 1024 < 100;
126   - if (!max5M) {
127   - this.$message({
128   - message: '上传文件大小不得超过100M!',
129   - type: 'warning'
130   - });
131   - fileList = fileList.splice(fileList.length - 1, 1);
132   - } else {
133   - //符合条件后进行添加
134   - this.file = fileList
135   - }
136   - } else {
137   - this.$message({
138   - message: '上传文件只能是 jpg,jpeg,png,gif,jfif,pjpeg,pjp格式!',
139   - type: 'warning'
140   - });
141   - fileList = fileList.splice(fileList.length - 1, 1);
142   - }
  307 + });
  308 + },
  309 + /** 删除按钮操作 */
  310 + handleDelete(row) {
  311 + const ids = row.id || this.ids;
  312 + this.$confirm('是否确认删除文件资料编号为"' + ids + '"的数据项?', "警告", {
  313 + confirmButtonText: "确定",
  314 + cancelButtonText: "取消",
  315 + type: "warning"
  316 + }).then(function () {
  317 + return delIncorruptEducation(ids);
  318 + }).then(() => {
  319 + this.getList();
  320 + this.msgSuccess("删除成功");
  321 + })
  322 + },
  323 + /** 导出按钮操作 */
  324 + handleExport() {
  325 + const queryParams = this.queryParams;
  326 + this.$confirm('是否确认导出所有文件资料数据项?', "警告", {
  327 + confirmButtonText: "确定",
  328 + cancelButtonText: "取消",
  329 + type: "warning"
  330 + }).then(function () {
  331 + return exportIncorruptEducation(queryParams);
  332 + }).then(response => {
  333 + this.download(response.msg);
  334 + })
143 335 },
144 336 createUrl(file) {
145 337 if (file.raw != null) {
... ...
trash-ui/src/views/other/incorruptEducation/info.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 + <el-row>
  4 + <el-col :offset="3" :span="18">
  5 + <h1 class="info_title">{{ info.title }}</h1>
  6 + </el-col>
  7 + </el-row>
  8 + <el-row>
  9 + <el-col :offset="3" :span="18">
  10 + <div class="info_author">
  11 + <span>作者:</span><span>{{ info.createBy }}</span>
  12 + <span>发表时间:</span><span>{{ info.createTime }}</span>
  13 + </div>
  14 + </el-col>
  15 + </el-row>
  16 + <el-row>
  17 + <el-col :offset="3" :span="18">
  18 + <div class="info_content ql-editor" v-html="info.content"></div>
  19 + </el-col>
  20 + </el-row>
  21 + </div>
  22 +</template>
  23 +
  24 +<script>
  25 +import {
  26 + addDocumentData,
  27 + delDocumentData,
  28 + exportDocumentData,
  29 + getDocumentData,
  30 + listDocumentData,
  31 + updateDocumentData
  32 +} from "@/api/other/documentData";
  33 +import Editor from '@/components/2cEditor';
  34 +import "quill/dist/quill.core.css";
  35 +import {parseTime} from "../../../utils/trash";
  36 +
  37 +export default {
  38 + name: "DocumentData",
  39 + components: {Editor},
  40 + data() {
  41 + return {
  42 + // 遮罩层
  43 + loading: true,
  44 + info: {
  45 + title:null,
  46 + createBy:null,
  47 + createTime:null,
  48 + content:null
  49 + },
  50 + };
  51 + },
  52 + created() {
  53 + this.initData();
  54 + },
  55 + watch:{
  56 + '$route.query.IncorruptEducation':'initData'
  57 + },
  58 + methods: {
  59 + initData(){
  60 + if(this.$route.query.IncorruptEducation){
  61 + this.info = this.$route.query.IncorruptEducation;
  62 + }
  63 +
  64 + }
  65 + }
  66 +};
  67 +</script>
  68 +<style lang="scss" scoped>
  69 +.info_title{
  70 + display: flex;
  71 + justify-content: center;
  72 + align-items: center;
  73 + height: 100%;
  74 +}
  75 +.info_author{
  76 + display: flex;
  77 + justify-content: center;
  78 + align-items: center;
  79 + height: 26px;
  80 + font-size:14px;
  81 + color: #616977;
  82 + border-bottom: 1px solid #ddd;
  83 + box-shadow: 0px 20px 20px -20px #5E5E5E;
  84 +}
  85 +.info_author span:nth-child(2){
  86 + margin-right: 20px;
  87 +}
  88 +</style>
... ...
trash-ui/src/views/other/incorruptGovernment/index.vue
1 1 <template>
2 2 <div class="app-container">
3   -
  3 + <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4 + <el-form-item label="标题" prop="title">
  5 + <el-input
  6 + v-model="queryParams.title"
  7 + placeholder="请输入标题"
  8 + clearable
  9 + size="small"
  10 + @keyup.enter.native="handleQuery"
  11 + />
  12 + </el-form-item>
  13 + <el-form-item>
  14 + <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  15 + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  16 + </el-form-item>
  17 + </el-form>
4 18  
5 19 <el-row :gutter="10" class="mb8">
6 20 <el-col :span="1.5">
7   - <el-upload
8   - ref="upload"
9   - action=""
10   - accept=".jpg,.jpeg,.png,.gif,.jfif,.pjpeg,.pjp"
11   - :on-change="fileChange"
12   - :auto-upload="false"
13   - :show-file-list="false"
14   - multiple
15   - :file-list="file">
16   - <el-button size="small" type="primary" icon="el-icon-upload">上传附件</el-button>
17   - </el-upload>
  21 + <el-button
  22 + type="primary"
  23 + icon="el-icon-plus"
  24 + size="mini"
  25 + @click="handleAdd"
  26 + v-hasPermi="['other:IncorruptGovernment:add']"
  27 + >新增
  28 + </el-button>
  29 + </el-col>
  30 + <el-col :span="1.5">
  31 + <el-button
  32 + type="success"
  33 + icon="el-icon-edit"
  34 + size="mini"
  35 + :disabled="single"
  36 + @click="handleUpdate"
  37 + v-hasPermi="['other:IncorruptGovernment:edit']"
  38 + >修改
  39 + </el-button>
18 40 </el-col>
19 41 <el-col :span="1.5">
20   - <el-button size="small" type="primary" @click="file=[]">删除附件</el-button>
  42 + <el-button
  43 + type="danger"
  44 + icon="el-icon-delete"
  45 + size="mini"
  46 + :disabled="multiple"
  47 + @click="handleDelete"
  48 + v-hasPermi="['other:IncorruptGovernment:remove']"
  49 + >删除
  50 + </el-button>
21 51 </el-col>
22 52 <el-col :span="1.5">
23   - <el-button size="small" type="primary" @click="submitForm">提交</el-button>
  53 + <el-button
  54 + type="warning"
  55 + icon="el-icon-download"
  56 + size="mini"
  57 + @click="handleExport"
  58 + v-hasPermi="['other:IncorruptGovernment:export']"
  59 + >导出
  60 + </el-button>
24 61 </el-col>
  62 + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
25 63 </el-row>
26   - <el-image v-if="file.length!=0" style=""
27   - :src="createUrl(file[0])"
28   - :preview-src-list="[createUrl(file[0])]"
29   - :z-index="999">
30   - </el-image>
  64 +
  65 + <el-table v-loading="loading" :data="IncorruptGovernmentList" @selection-change="handleSelectionChange">
  66 + <el-table-column type="selection" width="55" align="center"/>
  67 + <el-table-column label="标题" align="center" prop="title">
  68 + <template slot-scope="scope">
  69 + <a href="javascript:;" style="color:#0000EE;" @click="toInfo(scope.row)">{{scope.row.title}}</a>
  70 + </template>
  71 + </el-table-column>
  72 + <el-table-column label="时间" align="center" prop="createTime">
  73 + <template slot-scope="scope">
  74 + <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}:{s}") }}</span>
  75 + </template>
  76 + </el-table-column>
  77 + <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  78 + <template slot-scope="scope">
  79 + <el-button
  80 + size="mini"
  81 + type="text"
  82 + icon="el-icon-edit"
  83 + @click="handleUpdate(scope.row)"
  84 + v-hasPermi="['other:IncorruptGovernment:edit']"
  85 + >修改
  86 + </el-button>
  87 + <el-button
  88 + size="mini"
  89 + type="text"
  90 + icon="el-icon-delete"
  91 + @click="handleDelete(scope.row)"
  92 + v-hasPermi="['other:IncorruptGovernment:remove']"
  93 + >删除
  94 + </el-button>
  95 + </template>
  96 + </el-table-column>
  97 + </el-table>
  98 +
  99 + <pagination
  100 + v-show="total>0"
  101 + :total="total"
  102 + :page.sync="queryParams.pageNum"
  103 + :limit.sync="queryParams.pageSize"
  104 + @pagination="getList"
  105 + />
  106 +
  107 + <!-- 添加或修改文件资料对话框 -->
  108 + <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
  109 + <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  110 + <el-form-item label="标题" prop="title">
  111 + <el-input v-model="form.title" placeholder="请输入标题"/>
  112 + </el-form-item>
  113 + <el-form-item label="内容" prop="content">
  114 + <editor v-model="form.content" :min-height="368"/>
  115 + </el-form-item>
  116 + <el-row>
  117 + <el-col :span="12">
  118 + <el-form-item label="录入时间">
  119 + <el-input v-model="form.createTime" disabled="disabled"/>
  120 + </el-form-item>
  121 + </el-col>
  122 + <el-col :span="12">
  123 + <el-form-item label="录入人">
  124 + <el-input v-model="form.createBy" disabled="disabled"/>
  125 + </el-form-item>
  126 + </el-col>
  127 + </el-row>
  128 +
  129 + </el-form>
  130 + <div slot="footer" class="dialog-footer">
  131 + <el-button type="primary" @click="submitForm">确 定</el-button>
  132 + <el-button @click="cancel">取 消</el-button>
  133 + </div>
  134 + </el-dialog>
31 135 </div>
32 136 </template>
33 137  
34 138 <script>
35   -import {addIncorruptData, listIncorruptData} from "@/api/other/incorruptData";
  139 +import {
  140 + addIncorruptGovernment,
  141 + delIncorruptGovernment,
  142 + exportIncorruptGovernment,
  143 + getIncorruptGovernment,
  144 + listIncorruptGovernment,
  145 + updateIncorruptGovernment
  146 +} from "@/api/other/incorruptGovernment";
  147 +import Editor from '@/components/2cEditor';
  148 +import {parseTime} from "../../../utils/trash";
36 149  
37 150 export default {
38   - name: "incorruptGovernment",
  151 + name: "IncorruptGovernment",
  152 + components: {Editor},
39 153 data() {
40 154 return {
41   - file: [],
  155 + // 遮罩层
  156 + loading: true,
  157 + // 选中数组
  158 + ids: [],
  159 + // 非单个禁用
  160 + single: true,
  161 + // 非多个禁用
  162 + multiple: true,
  163 + // 显示搜索条件
  164 + showSearch: true,
  165 + // 总条数
  166 + total: 0,
  167 + // 文件资料表格数据
  168 + IncorruptGovernmentList: [],
  169 + // 弹出层标题
  170 + title: "",
  171 + // 是否显示弹出层
  172 + open: false,
  173 + // 查询参数
  174 + queryParams: {
  175 + pageNum: 1,
  176 + pageSize: 10,
  177 + title: null,
  178 + content: null,
  179 + files: null,
  180 + },
  181 + // 表单参数
  182 + form: {},
  183 + // 表单校验
  184 + rules: {
  185 + title: [
  186 + {required: true, message: "请输入标题", trigger: "blur"},
  187 + {min: 1, max: 100, message: "长度在 1 到 100 个字符", trigger: "blur"}
  188 + ],
  189 + content: [
  190 + {required: true, message: "请输入内容", trigger: "blur"},
  191 + {min: 1, max: 10000, message: "长度在 1 到 10000 个字符", trigger: "blur"}
  192 + ],
  193 + files: [
  194 + {required: true, message: "请上传附件", trigger: "blur"}
  195 + ]
  196 + },
  197 + fileEntityList: [],
42 198 };
43 199 },
44 200 created() {
45 201 this.getList();
46 202 },
47 203 methods: {
  204 + toInfo(row){
  205 + //打开当日报修页签
  206 + this.$tab.openPage("查看详情","/IncorruptGovernment/info",{"IncorruptGovernment":row})
  207 + },
48 208 /** 查询文件资料列表 */
49 209 getList() {
50 210 this.loading = true;
51   - listIncorruptData("government").then(response => {
52   - this.file = [{
53   - url:response[0].filePath,
54   - name:response[0].fileName,
55   - }];
  211 + listIncorruptGovernment(this.queryParams).then(response => {
  212 + this.IncorruptGovernmentList = response.rows;
  213 + this.total = response.total;
  214 + this.loading = false;
56 215 });
57 216 },
58   - delFile(){
59   - this.file=[];
  217 + // 取消按钮
  218 + cancel() {
  219 + this.open = false;
  220 + this.reset();
60 221 },
61   - /** 提交按钮 */
62   - submitForm() {
63   -
64   - let formData = new FormData();
65   - let form = {
  222 + // 表单重置
  223 + reset() {
  224 + this.form = {
  225 + id: null,
  226 + title: null,
  227 + content: null,
66 228 files: null,
67   - tableName: "government",
  229 + createTime: null,
  230 + createBy: null,
  231 + updateTime: null,
  232 + updateBy: null
68 233 };
69   -
70   - this.file.forEach(item => {
71   - if (item.raw != null) {
72   - formData.append('files', item.raw)
73   - } else {
74   - //将原有的附件拼接到form中
75   - form.files = form.files !== null ? form.files + ";" + item.url : item.url;
  234 + this.fileEntityList = [];
  235 + this.resetForm("form");
  236 + },
  237 + /** 搜索按钮操作 */
  238 + handleQuery() {
  239 + this.queryParams.pageNum = 1;
  240 + this.getList();
  241 + },
  242 + /** 重置按钮操作 */
  243 + resetQuery() {
  244 + this.resetForm("queryForm");
  245 + this.handleQuery();
  246 + },
  247 + // 多选框选中数据
  248 + handleSelectionChange(selection) {
  249 + this.ids = selection.map(item => item.id)
  250 + this.single = selection.length !== 1
  251 + this.multiple = !selection.length
  252 + },
  253 + /** 新增按钮操作 */
  254 + handleAdd() {
  255 + this.reset();
  256 + //yyyy-MM-dd HH:mm:ss
  257 + this.form.createTime = parseTime(new Date(), "{y}-{m}-{d} {h}:{i}:{s}");
  258 + this.form.createBy = this.$store.getters.name;
  259 + this.open = true;
  260 + this.title = "添加文件资料";
  261 + },
  262 + /** 修改按钮操作 */
  263 + handleUpdate(row) {
  264 + this.reset();
  265 + const id = row.id || this.ids
  266 + getIncorruptGovernment(id).then(response => {
  267 + this.form = response.data;
  268 + //将附件转换为前端可视化数组
  269 + if (this.form.files != null && this.form.files !== "") {
  270 + let fileList = this.form.files.split(";");
  271 + fileList.map(item => {
  272 + let name = item.substring(item.lastIndexOf("/") + 1);
  273 + this.fileEntityList.push({name: name, url: item})
  274 + })
76 275 }
77   - })
78   -
79   - for (let key in form) {
80   - formData.append(key, form[key] == null ? "" : form[key])
81   - }
82   -
83   - addIncorruptData(formData).then(response => {
84   - this.msgSuccess("新增成功");
85   - this.open = false;
86   - this.getList();
  276 + this.open = true;
  277 + this.title = "修改文件资料";
87 278 });
88 279 },
89   - /**
90   - * 文件改变时,限制文件上传格式和大小
91   - * 文件格式只能为docx/doc/pdf/png/jpeg/png/jpg
92   - * 大小不超过20M
93   - * */
94   - fileChange(file, fileList) {
95   - let count = 0;
96   - if(fileList.length>1){
97   - this.$message({
98   - message: '只能上传一张图片!',
99   - type: 'warning'
100   - });
101   - return false;
102   - }
103   - for (let i = 0; i < fileList.length; i++) {
104   - // console.log(fileList.length)
105   - // console.log(this.fileEntityList[i].name+"111"+file.name)
106   - if (fileList[i].name == file.name) {
107   - count++;
108   - if (count == 2) {
109   - this.$message({
110   - message: '已存在此文件!',
111   - type: 'warning'
  280 + /** 提交按钮 */
  281 + submitForm() {
  282 + this.$refs["form"].validate(valid => {
  283 + if (valid) {
  284 + let formData = new FormData();
  285 + let form = this.form;
  286 + //去掉params属性
  287 + delete form.params;
  288 +
  289 + for (let key in form) {
  290 + formData.append(key, form[key] == null ? "" : form[key])
  291 + }
  292 +
  293 + if (this.form.id != null) {
  294 + updateIncorruptGovernment(formData).then(response => {
  295 + this.msgSuccess("修改成功");
  296 + this.open = false;
  297 + this.getList();
  298 + });
  299 + } else {
  300 + addIncorruptGovernment(formData).then(response => {
  301 + this.msgSuccess("新增成功");
  302 + this.open = false;
  303 + this.getList();
112 304 });
113   - for (let j = fileList.length; j > 0; j--) {
114   - //如果存在此文件,去除新选择的重复文件
115   - if (fileList[j - 1].name == file.name) {
116   - fileList.splice(j - 1, 1);
117   - i--;
118   - return false;
119   - }
120   - }
121 305 }
122 306 }
123   - }
124   - let fileType = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
125   - //格式符合后判断大小
126   - if ("jpg,jpeg,png,gif,jfif,pjpeg,pjp".indexOf(fileType) != -1) {
127   - let max5M = file.size / 1024 / 1024 < 100;
128   - if (!max5M) {
129   - this.$message({
130   - message: '上传文件大小不得超过100M!',
131   - type: 'warning'
132   - });
133   - fileList = fileList.splice(fileList.length - 1, 1);
134   - } else {
135   - //符合条件后进行添加
136   - this.file = fileList
137   - }
138   - } else {
139   - this.$message({
140   - message: '上传文件只能是 jpg,jpeg,png,gif,jfif,pjpeg,pjp格式!',
141   - type: 'warning'
142   - });
143   - fileList = fileList.splice(fileList.length - 1, 1);
144   - }
  307 + });
  308 + },
  309 + /** 删除按钮操作 */
  310 + handleDelete(row) {
  311 + const ids = row.id || this.ids;
  312 + this.$confirm('是否确认删除文件资料编号为"' + ids + '"的数据项?', "警告", {
  313 + confirmButtonText: "确定",
  314 + cancelButtonText: "取消",
  315 + type: "warning"
  316 + }).then(function () {
  317 + return delIncorruptGovernment(ids);
  318 + }).then(() => {
  319 + this.getList();
  320 + this.msgSuccess("删除成功");
  321 + })
  322 + },
  323 + /** 导出按钮操作 */
  324 + handleExport() {
  325 + const queryParams = this.queryParams;
  326 + this.$confirm('是否确认导出所有文件资料数据项?', "警告", {
  327 + confirmButtonText: "确定",
  328 + cancelButtonText: "取消",
  329 + type: "warning"
  330 + }).then(function () {
  331 + return exportIncorruptGovernment(queryParams);
  332 + }).then(response => {
  333 + this.download(response.msg);
  334 + })
145 335 },
146 336 createUrl(file) {
147 337 if (file.raw != null) {
... ...
trash-ui/src/views/other/incorruptGovernment/info.vue 0 → 100644
  1 +<template>
  2 + <div class="app-container">
  3 + <el-row>
  4 + <el-col :offset="3" :span="18">
  5 + <h1 class="info_title">{{ info.title }}</h1>
  6 + </el-col>
  7 + </el-row>
  8 + <el-row>
  9 + <el-col :offset="3" :span="18">
  10 + <div class="info_author">
  11 + <span>作者:</span><span>{{ info.createBy }}</span>
  12 + <span>发表时间:</span><span>{{ info.createTime }}</span>
  13 + </div>
  14 + </el-col>
  15 + </el-row>
  16 + <el-row>
  17 + <el-col :offset="3" :span="18">
  18 + <div class="info_content ql-editor" v-html="info.content"></div>
  19 + </el-col>
  20 + </el-row>
  21 + </div>
  22 +</template>
  23 +
  24 +<script>
  25 +import {
  26 + addDocumentData,
  27 + delDocumentData,
  28 + exportDocumentData,
  29 + getDocumentData,
  30 + listDocumentData,
  31 + updateDocumentData
  32 +} from "@/api/other/documentData";
  33 +import Editor from '@/components/2cEditor';
  34 +import "quill/dist/quill.core.css";
  35 +import {parseTime} from "../../../utils/trash";
  36 +
  37 +export default {
  38 + name: "DocumentData",
  39 + components: {Editor},
  40 + data() {
  41 + return {
  42 + // 遮罩层
  43 + loading: true,
  44 + info: {
  45 + title:null,
  46 + createBy:null,
  47 + createTime:null,
  48 + content:null
  49 + },
  50 + };
  51 + },
  52 + created() {
  53 + this.initData();
  54 + },
  55 + watch:{
  56 + '$route.query.IncorruptGovernment':'initData'
  57 + },
  58 + methods: {
  59 + initData(){
  60 + if(this.$route.query.IncorruptGovernment){
  61 + this.info = this.$route.query.IncorruptGovernment;
  62 + }
  63 +
  64 + }
  65 + }
  66 +};
  67 +</script>
  68 +<style lang="scss" scoped>
  69 +.info_title{
  70 + display: flex;
  71 + justify-content: center;
  72 + align-items: center;
  73 + height: 100%;
  74 +}
  75 +.info_author{
  76 + display: flex;
  77 + justify-content: center;
  78 + align-items: center;
  79 + height: 26px;
  80 + font-size:14px;
  81 + color: #616977;
  82 + border-bottom: 1px solid #ddd;
  83 + box-shadow: 0px 20px 20px -20px #5E5E5E;
  84 +}
  85 +.info_author span:nth-child(2){
  86 + margin-right: 20px;
  87 +}
  88 +</style>
... ...
trash-workFlow/pom.xml
... ... @@ -16,24 +16,19 @@
16 16 <groupId>com.trash</groupId>
17 17 <artifactId>trash-activiti</artifactId>
18 18 </dependency>
19   -
  19 +
20 20 <dependency>
21 21 <groupId>com.trash</groupId>
22 22 <artifactId>trash-common</artifactId>
23 23 </dependency>
24   - <dependency>
25   - <groupId>com.google.code.gson</groupId>
26   - <artifactId>gson</artifactId>
27   - <version>2.3.1</version>
28   - </dependency>
29   -
  24 +
30 25 <!-- kafka -->
31 26 <dependency>
32 27 <groupId>org.springframework.kafka</groupId>
33 28 <artifactId>spring-kafka</artifactId>
34 29 <version>1.1.1.RELEASE</version>
35 30 </dependency>
36   -
37   -
  31 +
  32 +
38 33 </dependencies>
39 34 </project>
40 35 \ No newline at end of file
... ...
trash-workFlow/src/main/java/com/trash/other/controller/IncorruptEducationController.java 0 → 100644
  1 +package com.trash.other.controller;
  2 +
  3 +import com.trash.common.annotation.Log;
  4 +import com.trash.common.core.controller.BaseController;
  5 +import com.trash.common.core.domain.AjaxResult;
  6 +import com.trash.common.core.page.TableDataInfo;
  7 +import com.trash.common.enums.BusinessType;
  8 +import com.trash.common.utils.poi.ExcelUtil;
  9 +import com.trash.other.domain.IncorruptEducation;
  10 +import com.trash.other.service.IIncorruptEducationService;
  11 +import org.springframework.beans.factory.annotation.Autowired;
  12 +import org.springframework.security.access.prepost.PreAuthorize;
  13 +import org.springframework.web.bind.annotation.*;
  14 +import org.springframework.web.multipart.MultipartFile;
  15 +
  16 +import java.io.IOException;
  17 +import java.util.List;
  18 +
  19 +/**
  20 + * 廉洁教育Controller
  21 + *
  22 + * @author trash
  23 + * @date 2023-11-28
  24 + */
  25 +@RestController
  26 +@RequestMapping("/other/IncorruptEducation")
  27 +public class IncorruptEducationController extends BaseController
  28 +{
  29 + @Autowired
  30 + private IIncorruptEducationService IncorruptEducationService;
  31 +
  32 + /**
  33 + * 查询廉洁教育列表
  34 + */
  35 + @PreAuthorize("@ss.hasPermi('other:IncorruptEducation:list')")
  36 + @GetMapping("/list")
  37 + public TableDataInfo list(IncorruptEducation IncorruptEducation)
  38 + {
  39 + startPage();
  40 + List<IncorruptEducation> list = IncorruptEducationService.selectIncorruptEducationList(IncorruptEducation);
  41 + return getDataTable(list);
  42 + }
  43 +
  44 + /**
  45 + * 导出廉洁教育列表
  46 + */
  47 + @PreAuthorize("@ss.hasPermi('other:IncorruptEducation:export')")
  48 + @Log(title = "廉洁教育", businessType = BusinessType.EXPORT)
  49 + @GetMapping("/export")
  50 + public AjaxResult export(IncorruptEducation IncorruptEducation)
  51 + {
  52 + List<IncorruptEducation> list = IncorruptEducationService.selectIncorruptEducationList(IncorruptEducation);
  53 + ExcelUtil<IncorruptEducation> util = new ExcelUtil<IncorruptEducation>(IncorruptEducation.class);
  54 + return util.exportExcel(list, "IncorruptEducation");
  55 + }
  56 +
  57 + /**
  58 + * 获取廉洁教育详细信息
  59 + */
  60 + @PreAuthorize("@ss.hasPermi('other:IncorruptEducation:query')")
  61 + @GetMapping(value = "/{id}")
  62 + public AjaxResult getInfo(@PathVariable("id") Long id)
  63 + {
  64 + return AjaxResult.success(IncorruptEducationService.selectIncorruptEducationById(id));
  65 + }
  66 +
  67 + /**
  68 + * 新增廉洁教育
  69 + */
  70 + @PreAuthorize("@ss.hasPermi('other:IncorruptEducation:add')")
  71 + @Log(title = "廉洁教育", businessType = BusinessType.INSERT)
  72 + @PostMapping
  73 + public AjaxResult add(@RequestParam(value = "fileList") MultipartFile[] files, IncorruptEducation IncorruptEducation) throws IOException {
  74 + return toAjax(IncorruptEducationService.insertIncorruptEducation(files, IncorruptEducation));
  75 + }
  76 +
  77 + /**
  78 + * 修改廉洁教育
  79 + */
  80 + @PreAuthorize("@ss.hasPermi('other:IncorruptEducation:edit')")
  81 + @Log(title = "廉洁教育", businessType = BusinessType.UPDATE)
  82 + @PutMapping
  83 + public AjaxResult edit(@RequestParam(value = "fileList") MultipartFile[] files,IncorruptEducation IncorruptEducation) throws IOException {
  84 + return toAjax(IncorruptEducationService.updateIncorruptEducation(files, IncorruptEducation));
  85 + }
  86 +
  87 + /**
  88 + * 删除廉洁教育
  89 + */
  90 + @PreAuthorize("@ss.hasPermi('other:IncorruptEducation:remove')")
  91 + @Log(title = "廉洁教育", businessType = BusinessType.DELETE)
  92 + @DeleteMapping("/{ids}")
  93 + public AjaxResult remove(@PathVariable Long[] ids)
  94 + {
  95 + return toAjax(IncorruptEducationService.deleteIncorruptEducationByIds(ids));
  96 + }
  97 +}
... ...
trash-workFlow/src/main/java/com/trash/other/controller/IncorruptGovernmentController.java 0 → 100644
  1 +package com.trash.other.controller;
  2 +
  3 +import com.trash.common.annotation.Log;
  4 +import com.trash.common.core.controller.BaseController;
  5 +import com.trash.common.core.domain.AjaxResult;
  6 +import com.trash.common.core.page.TableDataInfo;
  7 +import com.trash.common.enums.BusinessType;
  8 +import com.trash.common.utils.poi.ExcelUtil;
  9 +import com.trash.other.domain.IncorruptGovernment;
  10 +import com.trash.other.service.IIncorruptGovernmentService;
  11 +import org.springframework.beans.factory.annotation.Autowired;
  12 +import org.springframework.security.access.prepost.PreAuthorize;
  13 +import org.springframework.web.bind.annotation.*;
  14 +import org.springframework.web.multipart.MultipartFile;
  15 +
  16 +import java.io.IOException;
  17 +import java.util.List;
  18 +
  19 +/**
  20 + * 廉政风险点Controller
  21 + *
  22 + * @author trash
  23 + * @date 2023-11-28
  24 + */
  25 +@RestController
  26 +@RequestMapping("/other/IncorruptGovernment")
  27 +public class IncorruptGovernmentController extends BaseController
  28 +{
  29 + @Autowired
  30 + private IIncorruptGovernmentService IncorruptGovernmentService;
  31 +
  32 + /**
  33 + * 查询廉政风险点列表
  34 + */
  35 + @PreAuthorize("@ss.hasPermi('other:IncorruptGovernment:list')")
  36 + @GetMapping("/list")
  37 + public TableDataInfo list(IncorruptGovernment IncorruptGovernment)
  38 + {
  39 + startPage();
  40 + List<IncorruptGovernment> list = IncorruptGovernmentService.selectIncorruptGovernmentList(IncorruptGovernment);
  41 + return getDataTable(list);
  42 + }
  43 +
  44 + /**
  45 + * 导出廉政风险点列表
  46 + */
  47 + @PreAuthorize("@ss.hasPermi('other:IncorruptGovernment:export')")
  48 + @Log(title = "廉政风险点", businessType = BusinessType.EXPORT)
  49 + @GetMapping("/export")
  50 + public AjaxResult export(IncorruptGovernment IncorruptGovernment)
  51 + {
  52 + List<IncorruptGovernment> list = IncorruptGovernmentService.selectIncorruptGovernmentList(IncorruptGovernment);
  53 + ExcelUtil<IncorruptGovernment> util = new ExcelUtil<IncorruptGovernment>(IncorruptGovernment.class);
  54 + return util.exportExcel(list, "IncorruptGovernment");
  55 + }
  56 +
  57 + /**
  58 + * 获取廉政风险点详细信息
  59 + */
  60 + @PreAuthorize("@ss.hasPermi('other:IncorruptGovernment:query')")
  61 + @GetMapping(value = "/{id}")
  62 + public AjaxResult getInfo(@PathVariable("id") Long id)
  63 + {
  64 + return AjaxResult.success(IncorruptGovernmentService.selectIncorruptGovernmentById(id));
  65 + }
  66 +
  67 + /**
  68 + * 新增廉政风险点
  69 + */
  70 + @PreAuthorize("@ss.hasPermi('other:IncorruptGovernment:add')")
  71 + @Log(title = "廉政风险点", businessType = BusinessType.INSERT)
  72 + @PostMapping
  73 + public AjaxResult add(@RequestParam(value = "fileList") MultipartFile[] files, IncorruptGovernment IncorruptGovernment) throws IOException {
  74 + return toAjax(IncorruptGovernmentService.insertIncorruptGovernment(files, IncorruptGovernment));
  75 + }
  76 +
  77 + /**
  78 + * 修改廉政风险点
  79 + */
  80 + @PreAuthorize("@ss.hasPermi('other:IncorruptGovernment:edit')")
  81 + @Log(title = "廉政风险点", businessType = BusinessType.UPDATE)
  82 + @PutMapping
  83 + public AjaxResult edit(@RequestParam(value = "fileList") MultipartFile[] files,IncorruptGovernment IncorruptGovernment) throws IOException {
  84 + return toAjax(IncorruptGovernmentService.updateIncorruptGovernment(files, IncorruptGovernment));
  85 + }
  86 +
  87 + /**
  88 + * 删除廉政风险点
  89 + */
  90 + @PreAuthorize("@ss.hasPermi('other:IncorruptGovernment:remove')")
  91 + @Log(title = "廉政风险点", businessType = BusinessType.DELETE)
  92 + @DeleteMapping("/{ids}")
  93 + public AjaxResult remove(@PathVariable Long[] ids)
  94 + {
  95 + return toAjax(IncorruptGovernmentService.deleteIncorruptGovernmentByIds(ids));
  96 + }
  97 +}
... ...
trash-workFlow/src/main/java/com/trash/other/domain/IncorruptEducation.java 0 → 100644
  1 +package com.trash.other.domain;
  2 +
  3 +import com.trash.common.annotation.Excel;
  4 +import com.trash.common.core.domain.BaseEntity;
  5 +import org.apache.commons.lang3.builder.ToStringBuilder;
  6 +import org.apache.commons.lang3.builder.ToStringStyle;
  7 +
  8 +/**
  9 + * 廉洁教育对象 document_data
  10 + *
  11 + * @author trash
  12 + * @date 2023-11-28
  13 + */
  14 +public class IncorruptEducation extends BaseEntity
  15 +{
  16 + private static final long serialVersionUID = 1L;
  17 +
  18 + /** $column.columnComment */
  19 + private Long id;
  20 +
  21 + /** 标题 */
  22 + @Excel(name = "标题")
  23 + private String title;
  24 +
  25 + /** 内容 */
  26 + @Excel(name = "内容")
  27 + private String content;
  28 +
  29 + /** 附件 */
  30 + @Excel(name = "附件")
  31 + private String files;
  32 +
  33 + public void setId(Long id)
  34 + {
  35 + this.id = id;
  36 + }
  37 +
  38 + public Long getId()
  39 + {
  40 + return id;
  41 + }
  42 + public void setTitle(String title)
  43 + {
  44 + this.title = title;
  45 + }
  46 +
  47 + public String getTitle()
  48 + {
  49 + return title;
  50 + }
  51 + public void setContent(String content)
  52 + {
  53 + this.content = content;
  54 + }
  55 +
  56 + public String getContent()
  57 + {
  58 + return content;
  59 + }
  60 + public void setFiles(String files)
  61 + {
  62 + this.files = files;
  63 + }
  64 +
  65 + public String getFiles()
  66 + {
  67 + return files;
  68 + }
  69 +
  70 + @Override
  71 + public String toString() {
  72 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  73 + .append("id", getId())
  74 + .append("title", getTitle())
  75 + .append("content", getContent())
  76 + .append("files", getFiles())
  77 + .append("createTime", getCreateTime())
  78 + .append("createBy", getCreateBy())
  79 + .append("updateTime", getUpdateTime())
  80 + .append("updateBy", getUpdateBy())
  81 + .toString();
  82 + }
  83 +}
... ...
trash-workFlow/src/main/java/com/trash/other/domain/IncorruptGovernment.java 0 → 100644
  1 +package com.trash.other.domain;
  2 +
  3 +import com.trash.common.annotation.Excel;
  4 +import com.trash.common.core.domain.BaseEntity;
  5 +import org.apache.commons.lang3.builder.ToStringBuilder;
  6 +import org.apache.commons.lang3.builder.ToStringStyle;
  7 +
  8 +/**
  9 + * 廉政风险点对象 document_data
  10 + *
  11 + * @author trash
  12 + * @date 2023-11-28
  13 + */
  14 +public class IncorruptGovernment extends BaseEntity
  15 +{
  16 + private static final long serialVersionUID = 1L;
  17 +
  18 + /** $column.columnComment */
  19 + private Long id;
  20 +
  21 + /** 标题 */
  22 + @Excel(name = "标题")
  23 + private String title;
  24 +
  25 + /** 内容 */
  26 + @Excel(name = "内容")
  27 + private String content;
  28 +
  29 + /** 附件 */
  30 + @Excel(name = "附件")
  31 + private String files;
  32 +
  33 + public void setId(Long id)
  34 + {
  35 + this.id = id;
  36 + }
  37 +
  38 + public Long getId()
  39 + {
  40 + return id;
  41 + }
  42 + public void setTitle(String title)
  43 + {
  44 + this.title = title;
  45 + }
  46 +
  47 + public String getTitle()
  48 + {
  49 + return title;
  50 + }
  51 + public void setContent(String content)
  52 + {
  53 + this.content = content;
  54 + }
  55 +
  56 + public String getContent()
  57 + {
  58 + return content;
  59 + }
  60 + public void setFiles(String files)
  61 + {
  62 + this.files = files;
  63 + }
  64 +
  65 + public String getFiles()
  66 + {
  67 + return files;
  68 + }
  69 +
  70 + @Override
  71 + public String toString() {
  72 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  73 + .append("id", getId())
  74 + .append("title", getTitle())
  75 + .append("content", getContent())
  76 + .append("files", getFiles())
  77 + .append("createTime", getCreateTime())
  78 + .append("createBy", getCreateBy())
  79 + .append("updateTime", getUpdateTime())
  80 + .append("updateBy", getUpdateBy())
  81 + .toString();
  82 + }
  83 +}
... ...
trash-workFlow/src/main/java/com/trash/other/mapper/IncorruptEducationMapper.java 0 → 100644
  1 +package com.trash.other.mapper;
  2 +
  3 +import com.trash.other.domain.IncorruptEducation;
  4 +
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * 廉洁教育Mapper接口
  9 + *
  10 + * @author trash
  11 + * @date 2023-11-28
  12 + */
  13 +public interface IncorruptEducationMapper
  14 +{
  15 + /**
  16 + * 查询廉洁教育
  17 + *
  18 + * @param id 廉洁教育ID
  19 + * @return 廉洁教育
  20 + */
  21 + IncorruptEducation selectIncorruptEducationById(Long id);
  22 +
  23 + /**
  24 + * 查询廉洁教育列表
  25 + *
  26 + * @param IncorruptEducation 廉洁教育
  27 + * @return 廉洁教育集合
  28 + */
  29 + List<IncorruptEducation> selectIncorruptEducationList(IncorruptEducation IncorruptEducation);
  30 +
  31 + /**
  32 + * 新增廉洁教育
  33 + *
  34 + * @param IncorruptEducation 廉洁教育
  35 + * @return 结果
  36 + */
  37 + int insertIncorruptEducation(IncorruptEducation IncorruptEducation);
  38 +
  39 + /**
  40 + * 修改廉洁教育
  41 + *
  42 + * @param IncorruptEducation 廉洁教育
  43 + * @return 结果
  44 + */
  45 + int updateIncorruptEducation(IncorruptEducation IncorruptEducation);
  46 +
  47 + /**
  48 + * 删除廉洁教育
  49 + *
  50 + * @param id 廉洁教育ID
  51 + * @return 结果
  52 + */
  53 + int deleteIncorruptEducationById(Long id);
  54 +
  55 + /**
  56 + * 批量删除廉洁教育
  57 + *
  58 + * @param ids 需要删除的数据ID
  59 + * @return 结果
  60 + */
  61 + int deleteIncorruptEducationByIds(Long[] ids);
  62 +}
... ...
trash-workFlow/src/main/java/com/trash/other/mapper/IncorruptGovernmentMapper.java 0 → 100644
  1 +package com.trash.other.mapper;
  2 +
  3 +import com.trash.other.domain.IncorruptGovernment;
  4 +
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * 廉政风险点Mapper接口
  9 + *
  10 + * @author trash
  11 + * @date 2023-11-28
  12 + */
  13 +public interface IncorruptGovernmentMapper
  14 +{
  15 + /**
  16 + * 查询廉政风险点
  17 + *
  18 + * @param id 廉政风险点ID
  19 + * @return 廉政风险点
  20 + */
  21 + IncorruptGovernment selectIncorruptGovernmentById(Long id);
  22 +
  23 + /**
  24 + * 查询廉政风险点列表
  25 + *
  26 + * @param IncorruptGovernment 廉政风险点
  27 + * @return 廉政风险点集合
  28 + */
  29 + List<IncorruptGovernment> selectIncorruptGovernmentList(IncorruptGovernment IncorruptGovernment);
  30 +
  31 + /**
  32 + * 新增廉政风险点
  33 + *
  34 + * @param IncorruptGovernment 廉政风险点
  35 + * @return 结果
  36 + */
  37 + int insertIncorruptGovernment(IncorruptGovernment IncorruptGovernment);
  38 +
  39 + /**
  40 + * 修改廉政风险点
  41 + *
  42 + * @param IncorruptGovernment 廉政风险点
  43 + * @return 结果
  44 + */
  45 + int updateIncorruptGovernment(IncorruptGovernment IncorruptGovernment);
  46 +
  47 + /**
  48 + * 删除廉政风险点
  49 + *
  50 + * @param id 廉政风险点ID
  51 + * @return 结果
  52 + */
  53 + int deleteIncorruptGovernmentById(Long id);
  54 +
  55 + /**
  56 + * 批量删除廉政风险点
  57 + *
  58 + * @param ids 需要删除的数据ID
  59 + * @return 结果
  60 + */
  61 + int deleteIncorruptGovernmentByIds(Long[] ids);
  62 +}
... ...
trash-workFlow/src/main/java/com/trash/other/service/IIncorruptEducationService.java 0 → 100644
  1 +package com.trash.other.service;
  2 +
  3 +import com.trash.other.domain.IncorruptEducation;
  4 +import org.springframework.web.multipart.MultipartFile;
  5 +
  6 +import java.io.IOException;
  7 +import java.util.List;
  8 +
  9 +/**
  10 + * 廉洁教育Service接口
  11 + *
  12 + * @author trash
  13 + * @date 2023-11-28
  14 + */
  15 +public interface IIncorruptEducationService
  16 +{
  17 + /**
  18 + * 查询廉洁教育
  19 + *
  20 + * @param id 廉洁教育ID
  21 + * @return 廉洁教育
  22 + */
  23 + IncorruptEducation selectIncorruptEducationById(Long id);
  24 +
  25 + /**
  26 + * 查询廉洁教育列表
  27 + *
  28 + * @param IncorruptEducation 廉洁教育
  29 + * @return 廉洁教育集合
  30 + */
  31 + List<IncorruptEducation> selectIncorruptEducationList(IncorruptEducation IncorruptEducation);
  32 +
  33 + /**
  34 + * 新增廉洁教育
  35 + *
  36 + * @param files
  37 + * @param IncorruptEducation 廉洁教育
  38 + * @return 结果
  39 + */
  40 + int insertIncorruptEducation(MultipartFile[] files, IncorruptEducation IncorruptEducation) throws IOException;
  41 +
  42 + /**
  43 + * 修改廉洁教育
  44 + *
  45 + * @param files
  46 + * @param IncorruptEducation 廉洁教育
  47 + * @return 结果
  48 + */
  49 + int updateIncorruptEducation(MultipartFile[] files,IncorruptEducation IncorruptEducation) throws IOException;
  50 +
  51 + /**
  52 + * 批量删除廉洁教育
  53 + *
  54 + * @param ids 需要删除的廉洁教育ID
  55 + * @return 结果
  56 + */
  57 + int deleteIncorruptEducationByIds(Long[] ids);
  58 +
  59 + /**
  60 + * 删除廉洁教育信息
  61 + *
  62 + * @param id 廉洁教育ID
  63 + * @return 结果
  64 + */
  65 + int deleteIncorruptEducationById(Long id);
  66 +}
... ...
trash-workFlow/src/main/java/com/trash/other/service/IIncorruptGovernmentService.java 0 → 100644
  1 +package com.trash.other.service;
  2 +
  3 +import com.trash.other.domain.IncorruptGovernment;
  4 +import org.springframework.web.multipart.MultipartFile;
  5 +
  6 +import java.io.IOException;
  7 +import java.util.List;
  8 +
  9 +/**
  10 + * 廉政风险点Service接口
  11 + *
  12 + * @author trash
  13 + * @date 2023-11-28
  14 + */
  15 +public interface IIncorruptGovernmentService
  16 +{
  17 + /**
  18 + * 查询廉政风险点
  19 + *
  20 + * @param id 廉政风险点ID
  21 + * @return 廉政风险点
  22 + */
  23 + IncorruptGovernment selectIncorruptGovernmentById(Long id);
  24 +
  25 + /**
  26 + * 查询廉政风险点列表
  27 + *
  28 + * @param IncorruptGovernment 廉政风险点
  29 + * @return 廉政风险点集合
  30 + */
  31 + List<IncorruptGovernment> selectIncorruptGovernmentList(IncorruptGovernment IncorruptGovernment);
  32 +
  33 + /**
  34 + * 新增廉政风险点
  35 + *
  36 + * @param files
  37 + * @param IncorruptGovernment 廉政风险点
  38 + * @return 结果
  39 + */
  40 + int insertIncorruptGovernment(MultipartFile[] files, IncorruptGovernment IncorruptGovernment) throws IOException;
  41 +
  42 + /**
  43 + * 修改廉政风险点
  44 + *
  45 + * @param files
  46 + * @param IncorruptGovernment 廉政风险点
  47 + * @return 结果
  48 + */
  49 + int updateIncorruptGovernment(MultipartFile[] files,IncorruptGovernment IncorruptGovernment) throws IOException;
  50 +
  51 + /**
  52 + * 批量删除廉政风险点
  53 + *
  54 + * @param ids 需要删除的廉政风险点ID
  55 + * @return 结果
  56 + */
  57 + int deleteIncorruptGovernmentByIds(Long[] ids);
  58 +
  59 + /**
  60 + * 删除廉政风险点信息
  61 + *
  62 + * @param id 廉政风险点ID
  63 + * @return 结果
  64 + */
  65 + int deleteIncorruptGovernmentById(Long id);
  66 +}
... ...
trash-workFlow/src/main/java/com/trash/other/service/impl/IncorruptEducationServiceImpl.java 0 → 100644
  1 +package com.trash.other.service.impl;
  2 +
  3 +import com.trash.common.config.trashConfig;
  4 +import com.trash.common.utils.DateUtils;
  5 +import com.trash.common.utils.SecurityUtils;
  6 +import com.trash.other.domain.IncorruptEducation;
  7 +import com.trash.other.mapper.IncorruptEducationMapper;
  8 +import com.trash.other.service.IIncorruptEducationService;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.stereotype.Service;
  11 +import org.springframework.web.multipart.MultipartFile;
  12 +
  13 +import java.io.IOException;
  14 +import java.util.List;
  15 +
  16 +import static com.trash.common.utils.file.FileUploadUtils.upload;
  17 +
  18 +/**
  19 + * 廉洁教育Service业务层处理
  20 + *
  21 + * @author trash
  22 + * @date 2023-11-28
  23 + */
  24 +@Service
  25 +public class IncorruptEducationServiceImpl implements IIncorruptEducationService
  26 +{
  27 + @Autowired
  28 + private IncorruptEducationMapper IncorruptEducationMapper;
  29 +
  30 + /**
  31 + * 查询廉洁教育
  32 + *
  33 + * @param id 廉洁教育ID
  34 + * @return 廉洁教育
  35 + */
  36 + @Override
  37 + public IncorruptEducation selectIncorruptEducationById(Long id)
  38 + {
  39 + return IncorruptEducationMapper.selectIncorruptEducationById(id);
  40 + }
  41 +
  42 + /**
  43 + * 查询廉洁教育列表
  44 + *
  45 + * @param IncorruptEducation 廉洁教育
  46 + * @return 廉洁教育
  47 + */
  48 + @Override
  49 + public List<IncorruptEducation> selectIncorruptEducationList(IncorruptEducation IncorruptEducation)
  50 + {
  51 + return IncorruptEducationMapper.selectIncorruptEducationList(IncorruptEducation);
  52 + }
  53 +
  54 + /**
  55 + * 新增廉洁教育
  56 + *
  57 + * @param files
  58 + * @param IncorruptEducation 廉洁教育
  59 + * @return 结果
  60 + */
  61 + @Override
  62 + public int insertIncorruptEducation(MultipartFile[] files, IncorruptEducation IncorruptEducation) throws IOException {
  63 + for (MultipartFile file:files){
  64 + IncorruptEducation.setFiles(IncorruptEducation.getFiles()!=null?IncorruptEducation.getFiles()+";"+uploadFile(file):uploadFile(file));
  65 + }
  66 + IncorruptEducation.setFiles(removeSemicolon(IncorruptEducation.getFiles()));
  67 + return IncorruptEducationMapper.insertIncorruptEducation(IncorruptEducation);
  68 + }
  69 +
  70 + /**
  71 + * 修改廉洁教育
  72 + *
  73 + * @param files
  74 + * @param IncorruptEducation 廉洁教育
  75 + * @return 结果
  76 + */
  77 + @Override
  78 + public int updateIncorruptEducation(MultipartFile[] files, IncorruptEducation IncorruptEducation) throws IOException {
  79 + IncorruptEducation.setUpdateTime(DateUtils.getNowDate());
  80 + IncorruptEducation.setUpdateBy(SecurityUtils.getUsername());
  81 + for (MultipartFile file:files){
  82 + IncorruptEducation.setFiles(IncorruptEducation.getFiles()!=null?IncorruptEducation.getFiles()+";"+uploadFile(file):uploadFile(file));
  83 + }
  84 + IncorruptEducation.setFiles(removeSemicolon(IncorruptEducation.getFiles()));
  85 + return IncorruptEducationMapper.updateIncorruptEducation(IncorruptEducation);
  86 + }
  87 +
  88 + /**
  89 + * 批量删除廉洁教育
  90 + *
  91 + * @param ids 需要删除的廉洁教育ID
  92 + * @return 结果
  93 + */
  94 + @Override
  95 + public int deleteIncorruptEducationByIds(Long[] ids)
  96 + {
  97 + return IncorruptEducationMapper.deleteIncorruptEducationByIds(ids);
  98 + }
  99 +
  100 + /**
  101 + * 删除廉洁教育信息
  102 + *
  103 + * @param id 廉洁教育ID
  104 + * @return 结果
  105 + */
  106 + @Override
  107 + public int deleteIncorruptEducationById(Long id)
  108 + {
  109 + return IncorruptEducationMapper.deleteIncorruptEducationById(id);
  110 + }
  111 +
  112 + /**
  113 + * 文件上传
  114 + *
  115 + * @param file
  116 + * @author 2c
  117 + */
  118 + public static String uploadFile(MultipartFile file) throws IOException {
  119 + // 上传文件路径
  120 + String filePath = trashConfig.getUploadPath();
  121 + // 上传并返回新文件名称
  122 + String newFileName = upload(filePath, file);
  123 + return newFileName;
  124 + }
  125 +
  126 + //去掉第一个分号,如果有的话
  127 + public String removeSemicolon(String str){
  128 + if (str.startsWith(";"))
  129 + str = str.substring(1);
  130 + return str;
  131 + }
  132 +}
... ...
trash-workFlow/src/main/java/com/trash/other/service/impl/IncorruptGovernmentServiceImpl.java 0 → 100644
  1 +package com.trash.other.service.impl;
  2 +
  3 +import com.trash.common.config.trashConfig;
  4 +import com.trash.common.utils.DateUtils;
  5 +import com.trash.common.utils.SecurityUtils;
  6 +import com.trash.other.domain.IncorruptGovernment;
  7 +import com.trash.other.mapper.IncorruptGovernmentMapper;
  8 +import com.trash.other.service.IIncorruptGovernmentService;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.stereotype.Service;
  11 +import org.springframework.web.multipart.MultipartFile;
  12 +
  13 +import java.io.IOException;
  14 +import java.util.List;
  15 +
  16 +import static com.trash.common.utils.file.FileUploadUtils.upload;
  17 +
  18 +/**
  19 + * 廉政风险点Service业务层处理
  20 + *
  21 + * @author trash
  22 + * @date 2023-11-28
  23 + */
  24 +@Service
  25 +public class IncorruptGovernmentServiceImpl implements IIncorruptGovernmentService
  26 +{
  27 + @Autowired
  28 + private IncorruptGovernmentMapper IncorruptGovernmentMapper;
  29 +
  30 + /**
  31 + * 查询廉政风险点
  32 + *
  33 + * @param id 廉政风险点ID
  34 + * @return 廉政风险点
  35 + */
  36 + @Override
  37 + public IncorruptGovernment selectIncorruptGovernmentById(Long id)
  38 + {
  39 + return IncorruptGovernmentMapper.selectIncorruptGovernmentById(id);
  40 + }
  41 +
  42 + /**
  43 + * 查询廉政风险点列表
  44 + *
  45 + * @param IncorruptGovernment 廉政风险点
  46 + * @return 廉政风险点
  47 + */
  48 + @Override
  49 + public List<IncorruptGovernment> selectIncorruptGovernmentList(IncorruptGovernment IncorruptGovernment)
  50 + {
  51 + return IncorruptGovernmentMapper.selectIncorruptGovernmentList(IncorruptGovernment);
  52 + }
  53 +
  54 + /**
  55 + * 新增廉政风险点
  56 + *
  57 + * @param files
  58 + * @param IncorruptGovernment 廉政风险点
  59 + * @return 结果
  60 + */
  61 + @Override
  62 + public int insertIncorruptGovernment(MultipartFile[] files, IncorruptGovernment IncorruptGovernment) throws IOException {
  63 + for (MultipartFile file:files){
  64 + IncorruptGovernment.setFiles(IncorruptGovernment.getFiles()!=null?IncorruptGovernment.getFiles()+";"+uploadFile(file):uploadFile(file));
  65 + }
  66 + IncorruptGovernment.setFiles(removeSemicolon(IncorruptGovernment.getFiles()));
  67 + return IncorruptGovernmentMapper.insertIncorruptGovernment(IncorruptGovernment);
  68 + }
  69 +
  70 + /**
  71 + * 修改廉政风险点
  72 + *
  73 + * @param files
  74 + * @param IncorruptGovernment 廉政风险点
  75 + * @return 结果
  76 + */
  77 + @Override
  78 + public int updateIncorruptGovernment(MultipartFile[] files, IncorruptGovernment IncorruptGovernment) throws IOException {
  79 + IncorruptGovernment.setUpdateTime(DateUtils.getNowDate());
  80 + IncorruptGovernment.setUpdateBy(SecurityUtils.getUsername());
  81 + for (MultipartFile file:files){
  82 + IncorruptGovernment.setFiles(IncorruptGovernment.getFiles()!=null?IncorruptGovernment.getFiles()+";"+uploadFile(file):uploadFile(file));
  83 + }
  84 + IncorruptGovernment.setFiles(removeSemicolon(IncorruptGovernment.getFiles()));
  85 + return IncorruptGovernmentMapper.updateIncorruptGovernment(IncorruptGovernment);
  86 + }
  87 +
  88 + /**
  89 + * 批量删除廉政风险点
  90 + *
  91 + * @param ids 需要删除的廉政风险点ID
  92 + * @return 结果
  93 + */
  94 + @Override
  95 + public int deleteIncorruptGovernmentByIds(Long[] ids)
  96 + {
  97 + return IncorruptGovernmentMapper.deleteIncorruptGovernmentByIds(ids);
  98 + }
  99 +
  100 + /**
  101 + * 删除廉政风险点信息
  102 + *
  103 + * @param id 廉政风险点ID
  104 + * @return 结果
  105 + */
  106 + @Override
  107 + public int deleteIncorruptGovernmentById(Long id)
  108 + {
  109 + return IncorruptGovernmentMapper.deleteIncorruptGovernmentById(id);
  110 + }
  111 +
  112 + /**
  113 + * 文件上传
  114 + *
  115 + * @param file
  116 + * @author 2c
  117 + */
  118 + public static String uploadFile(MultipartFile file) throws IOException {
  119 + // 上传文件路径
  120 + String filePath = trashConfig.getUploadPath();
  121 + // 上传并返回新文件名称
  122 + String newFileName = upload(filePath, file);
  123 + return newFileName;
  124 + }
  125 +
  126 + //去掉第一个分号,如果有的话
  127 + public String removeSemicolon(String str){
  128 + if (str.startsWith(";"))
  129 + str = str.substring(1);
  130 + return str;
  131 + }
  132 +}
... ...
trash-workFlow/src/main/resources/mapper/other/IncorruptEducationMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper
  3 +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4 +"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5 +<mapper namespace="com.trash.other.mapper.IncorruptEducationMapper">
  6 +
  7 + <resultMap type="IncorruptEducation" id="IncorruptEducationResult">
  8 + <result property="id" column="id" />
  9 + <result property="title" column="title" />
  10 + <result property="content" column="content" />
  11 + <result property="files" column="files" />
  12 + <result property="createTime" column="create_time" />
  13 + <result property="createBy" column="create_by" />
  14 + <result property="updateTime" column="update_time" />
  15 + <result property="updateBy" column="update_by" />
  16 + </resultMap>
  17 +
  18 + <sql id="selectIncorruptEducationVo">
  19 + select id, title, content, files, create_time, create_by, update_time, update_by from IncorruptEducation
  20 + </sql>
  21 +
  22 + <select id="selectIncorruptEducationList" parameterType="IncorruptEducation" resultMap="IncorruptEducationResult">
  23 + <include refid="selectIncorruptEducationVo"/>
  24 + <where>
  25 + <if test="title != null and title != ''"> and title like concat('%',#{title},'%')</if>
  26 + <if test="content != null and content != ''"> and content = #{content}</if>
  27 + <if test="files != null and files != ''"> and files = #{files}</if>
  28 + </where>
  29 + order by create_time desc
  30 + </select>
  31 +
  32 + <select id="selectIncorruptEducationById" parameterType="Long" resultMap="IncorruptEducationResult">
  33 + <include refid="selectIncorruptEducationVo"/>
  34 + where id = #{id}
  35 + </select>
  36 +
  37 + <insert id="insertIncorruptEducation" parameterType="IncorruptEducation" useGeneratedKeys="true" keyProperty="id">
  38 + insert into IncorruptEducation
  39 + <trim prefix="(" suffix=")" suffixOverrides=",">
  40 + <if test="title != null">title,</if>
  41 + <if test="content != null">content,</if>
  42 + <if test="files != null">files,</if>
  43 + <if test="createTime != null">create_time,</if>
  44 + <if test="createBy != null">create_by,</if>
  45 + <if test="updateTime != null">update_time,</if>
  46 + <if test="updateBy != null">update_by,</if>
  47 + </trim>
  48 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  49 + <if test="title != null">#{title},</if>
  50 + <if test="content != null">#{content},</if>
  51 + <if test="files != null">#{files},</if>
  52 + <if test="createTime != null">#{createTime},</if>
  53 + <if test="createBy != null">#{createBy},</if>
  54 + <if test="updateTime != null">#{updateTime},</if>
  55 + <if test="updateBy != null">#{updateBy},</if>
  56 + </trim>
  57 + </insert>
  58 +
  59 + <update id="updateIncorruptEducation" parameterType="IncorruptEducation">
  60 + update IncorruptEducation
  61 + <trim prefix="SET" suffixOverrides=",">
  62 + <if test="title != null">title = #{title},</if>
  63 + <if test="content != null">content = #{content},</if>
  64 + <if test="files != null">files = #{files},</if>
  65 + <if test="createTime != null">create_time = #{createTime},</if>
  66 + <if test="createBy != null">create_by = #{createBy},</if>
  67 + <if test="updateTime != null">update_time = #{updateTime},</if>
  68 + <if test="updateBy != null">update_by = #{updateBy},</if>
  69 + </trim>
  70 + where id = #{id}
  71 + </update>
  72 +
  73 + <delete id="deleteIncorruptEducationById" parameterType="Long">
  74 + delete from IncorruptEducation where id = #{id}
  75 + </delete>
  76 +
  77 + <delete id="deleteIncorruptEducationByIds" parameterType="String">
  78 + delete from IncorruptEducation where id in
  79 + <foreach item="id" collection="array" open="(" separator="," close=")">
  80 + #{id}
  81 + </foreach>
  82 + </delete>
  83 +
  84 +</mapper>
0 85 \ No newline at end of file
... ...
trash-workFlow/src/main/resources/mapper/other/IncorruptGovernmentMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper
  3 +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4 +"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5 +<mapper namespace="com.trash.other.mapper.IncorruptGovernmentMapper">
  6 +
  7 + <resultMap type="IncorruptGovernment" id="IncorruptGovernmentResult">
  8 + <result property="id" column="id" />
  9 + <result property="title" column="title" />
  10 + <result property="content" column="content" />
  11 + <result property="files" column="files" />
  12 + <result property="createTime" column="create_time" />
  13 + <result property="createBy" column="create_by" />
  14 + <result property="updateTime" column="update_time" />
  15 + <result property="updateBy" column="update_by" />
  16 + </resultMap>
  17 +
  18 + <sql id="selectIncorruptGovernmentVo">
  19 + select id, title, content, files, create_time, create_by, update_time, update_by from IncorruptGovernment
  20 + </sql>
  21 +
  22 + <select id="selectIncorruptGovernmentList" parameterType="IncorruptGovernment" resultMap="IncorruptGovernmentResult">
  23 + <include refid="selectIncorruptGovernmentVo"/>
  24 + <where>
  25 + <if test="title != null and title != ''"> and title like concat('%',#{title},'%')</if>
  26 + <if test="content != null and content != ''"> and content = #{content}</if>
  27 + <if test="files != null and files != ''"> and files = #{files}</if>
  28 + </where>
  29 + order by create_time desc
  30 + </select>
  31 +
  32 + <select id="selectIncorruptGovernmentById" parameterType="Long" resultMap="IncorruptGovernmentResult">
  33 + <include refid="selectIncorruptGovernmentVo"/>
  34 + where id = #{id}
  35 + </select>
  36 +
  37 + <insert id="insertIncorruptGovernment" parameterType="IncorruptGovernment" useGeneratedKeys="true" keyProperty="id">
  38 + insert into IncorruptGovernment
  39 + <trim prefix="(" suffix=")" suffixOverrides=",">
  40 + <if test="title != null">title,</if>
  41 + <if test="content != null">content,</if>
  42 + <if test="files != null">files,</if>
  43 + <if test="createTime != null">create_time,</if>
  44 + <if test="createBy != null">create_by,</if>
  45 + <if test="updateTime != null">update_time,</if>
  46 + <if test="updateBy != null">update_by,</if>
  47 + </trim>
  48 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  49 + <if test="title != null">#{title},</if>
  50 + <if test="content != null">#{content},</if>
  51 + <if test="files != null">#{files},</if>
  52 + <if test="createTime != null">#{createTime},</if>
  53 + <if test="createBy != null">#{createBy},</if>
  54 + <if test="updateTime != null">#{updateTime},</if>
  55 + <if test="updateBy != null">#{updateBy},</if>
  56 + </trim>
  57 + </insert>
  58 +
  59 + <update id="updateIncorruptGovernment" parameterType="IncorruptGovernment">
  60 + update IncorruptGovernment
  61 + <trim prefix="SET" suffixOverrides=",">
  62 + <if test="title != null">title = #{title},</if>
  63 + <if test="content != null">content = #{content},</if>
  64 + <if test="files != null">files = #{files},</if>
  65 + <if test="createTime != null">create_time = #{createTime},</if>
  66 + <if test="createBy != null">create_by = #{createBy},</if>
  67 + <if test="updateTime != null">update_time = #{updateTime},</if>
  68 + <if test="updateBy != null">update_by = #{updateBy},</if>
  69 + </trim>
  70 + where id = #{id}
  71 + </update>
  72 +
  73 + <delete id="deleteIncorruptGovernmentById" parameterType="Long">
  74 + delete from IncorruptGovernment where id = #{id}
  75 + </delete>
  76 +
  77 + <delete id="deleteIncorruptGovernmentByIds" parameterType="String">
  78 + delete from IncorruptGovernment where id in
  79 + <foreach item="id" collection="array" open="(" separator="," close=")">
  80 + #{id}
  81 + </foreach>
  82 + </delete>
  83 +
  84 +</mapper>
0 85 \ No newline at end of file
... ...