lsw il y a 1 an
Parent
commit
16419d8dfd

+ 8 - 7
admin-ui/src/components/editor.vue

@@ -6,7 +6,7 @@
 import { uploadFile } from '@/api/common';
 export default {
   props: {
-    readonly:{
+    readonly: {
       type: Boolean,
       default: false
     },
@@ -26,22 +26,23 @@ export default {
       setting: {
         menubar: false,
         ProgressState: true,
-        readonly:this.readonly,
+        readonly: this.readonly,
         toolbar:
           'fullscreen preview code | undo redo | lineheight bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | numlist bullist | upfile image axupimgs media importword table | formatselect fontselect fontsizeselect forecolor backcolor | indent outdent | superscript subscript | removeformat | wordcount | help',
         toolbar_drawer: 'sliding',
         quickbars_selection_toolbar: 'removeformat | bold italic underline strikethrough | fontsizeselect forecolor backcolor',
-        plugins: 'preview code lineheight wordcount upfile image axupimgs imagetools media table lists fullscreen quickbars help',
+        plugins: 'paste preview code lineheight wordcount upfile image axupimgs imagetools media table lists fullscreen quickbars help',
         language: 'zh_CN',
         content_style: 'img {max-width:100%;}', //编辑器内限制图片大小
         convert_urls: false,
         height: this.height,
+        paste_data_images: true,
         //图片上传
         images_upload_handler: (blobInfo, succFun, failFun) => {
           let formData = new FormData();
           formData.append('file', blobInfo.blob());
           uploadFile(formData)
-            .then(response => {
+            .then((response) => {
               this.$modal.msgSuccess('上传成功');
               succFun(this.baseUrl + response.fileName);
             })
@@ -51,7 +52,7 @@ export default {
           let formData = new FormData();
           formData.append('file', file);
           uploadFile(formData)
-            .then(response => {
+            .then((response) => {
               this.$modal.msgSuccess('上传成功');
               succFun(this.baseUrl + response.fileName);
             })
@@ -82,7 +83,7 @@ export default {
             let formData = new FormData();
             formData.append('file', file, file.name);
             uploadFile(formData)
-              .then(response => {
+              .then((response) => {
                 this.$modal.msgSuccess('上传成功');
                 callback(this.baseUrl + response.fileName);
               })
@@ -120,6 +121,6 @@ export default {
 }
 .tox-shadowhost.tox-fullscreen,
 .tox.tox-tinymce.tox-fullscreen {
-  z-index: 1200000!important;
+  z-index: 1200000 !important;
 }
 </style>

+ 15 - 1
admin-ui/src/router/index.js

@@ -97,11 +97,25 @@ export const constantRoutes = [
       {
         path: 'notification',
         component: () => import('@/views/work/notice/notification'),
-        name: 'Index',
+        name: 'Notification',
         meta: { title: '通知消息', icon: 'dashboard'}
       }
     ]
   },
+  {
+    path: '',
+    component: Layout,
+    redirect: 'help',
+    hidden: true,
+    children: [
+      {
+        path: 'help',
+        component: () => import('@/views/work/feedback/help'),
+        name: 'Help',
+        meta: { title: '问题反馈', icon: 'dashboard'}
+      }
+    ]
+  },
 ]
 
 // 动态路由,基于用户权限动态去加载

+ 1 - 1
admin-ui/src/views/dashboard/yrows.vue

@@ -114,7 +114,7 @@
         </router-link>
       </div>
       <div class="yr" style="width: 20%">
-        <router-link to="/notice">
+        <router-link to="/help">
           <div class="rout">
             <div class="rint" style="text-align: center; cursor: pointer">
               <span class="icon" style="float: none; color: #ff5722">&#xe6d5;</span>

+ 0 - 6
admin-ui/src/views/work/contract/edit.vue

@@ -4,12 +4,6 @@
       <el-form-item label="合同名称" prop="name">
         <el-input v-model="form.name" placeholder="请输入合同名称" clearable />
       </el-form-item>
-      <el-form-item label="合同状态" prop="state">
-        <el-select v-model="form.state" placeholder="请选择">
-          <el-option label="启用" :value="0"></el-option>
-          <el-option label="关闭" :value="1"></el-option>
-        </el-select>
-      </el-form-item>
       <el-form-item label="上传合同">
         <file-upload v-model="form.url" :accept="'.doc, .docx, .pdf'" :fileSize="20" :limit="1" />
       </el-form-item>

+ 0 - 4
admin-ui/src/views/work/contract/index.vue

@@ -10,7 +10,6 @@
       </el-form-item>
     </el-form>
     <el-row :gutter="10" class="mb8">
-      <el-button type="primary" icon="el-icon-plus" :disabled="ids.length > 0" @click="op('add')" v-hasPermi="['work:contract:add']">新增</el-button>
       <el-button type="success" icon="el-icon-edit" :disabled="ids.length != 1" @click="op('edit', ids)" v-hasPermi="['work:contract:edit']">修改</el-button>
       <el-button type="danger" icon="el-icon-delete" :disabled="ids.length == 0" @click="del" v-hasPermi="['work:contract:remove']">删除{{ ids.length > 0 ? '(' + ids.length + ')' : '' }}</el-button>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -80,9 +79,6 @@ export default {
       this.ids = rows.map((item) => item.id);
     },
     op(tag, row) {
-      if (tag == 'add') {
-        this.iframe({ obj: edit, param: {}, title: '新增合同', width: '35%', height: '40%' });
-      }
       if (tag == 'edit') {
         const id = row.id || this.ids[0];
         this.iframe({ obj: edit, param: { id: id }, title: '编辑合同', width: '35%', height: '40%' });

+ 82 - 0
admin-ui/src/views/work/feedback/edit.vue

@@ -0,0 +1,82 @@
+<template>
+  <div class="cmain">
+    <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+      <el-row>
+        <el-col :span="16">
+          <el-form-item label="反馈标题" prop="title">
+            <el-input v-model="form.title" placeholder="请输入反馈标题" clearable :disabled="param.detail" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="反馈类型" prop="type">
+            <el-select v-model="form.type" placeholder="请选择类型" :disabled="param.detail">
+              <el-option v-for="dict in dict.type.feedback" :key="dict.value" :label="dict.label" :value="dict.value" clearable></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-form-item label="反馈内容" prop="contents">
+        <editor v-model="form.contents" placeholder="请输入内容" :readonly="param.detail"></editor>
+      </el-form-item>
+    </el-form>
+    <div class="mfooter" v-if="!param.detail">
+      <el-button type="primary" @click="submitForm">确 定</el-button>
+      <el-button @click="$layer.close(layerid)">取 消</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  dicts: ['feedback'],
+  data() {
+    return {
+      form: {},
+      rules: {
+        title: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        type: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        contents: [{ required: true, message: '不能为空', trigger: 'blur' }]
+      }
+    };
+  },
+  props: {
+    param: {
+      type: Object,
+      default: () => {
+        return {};
+      }
+    },
+    layerid: {
+      type: String
+    }
+  },
+  mounted() {
+    if (this.param.id) {
+      this.ajax({ url: '/work/feedback/detail/' + this.param.id }).then((response) => {
+        this.form = response.data;
+      });
+    }
+  },
+  methods: {
+    submitForm() {
+      this.$refs['form'].validate((valid) => {
+        if (valid) {
+          if (this.form.id) {
+            this.ajax({ method: 'post', url: '/work/feedback/edit', data: this.form }).then((response) => {
+              this.$modal.msgSuccess('修改成功');
+              this.$layer.close(this.layerid);
+              this.$parent.getList();
+            });
+          } else {
+            this.ajax({ method: 'post', url: '/work/feedback/add', data: this.form }).then((response) => {
+              this.$modal.msgSuccess('提交成功');
+              this.$layer.close(this.layerid);
+              this.$parent.getList();
+            });
+          }
+        }
+      });
+    }
+  }
+};
+</script>

+ 97 - 0
admin-ui/src/views/work/feedback/help.vue

@@ -0,0 +1,97 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
+      <el-form-item label="反馈类型" prop="type">
+        <el-select v-model="queryParams.type" placeholder="请选择类型" @change="change" clearable>
+          <el-option v-for="dict in dict.type.feedback" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-button type="primary" icon="el-icon-plus" @click="op('add')" style="float: right">提交问题</el-button>
+    </el-form>
+    <el-table :data="response.rows" border height="calc(100vh - 233px)">
+      <el-table-column type="index" label="序号" align="center" width="80" />
+      <el-table-column label="反馈标题" align="left" prop="title" />
+      <el-table-column label="反馈类型" align="center" prop="type" width="180" />
+      <el-table-column label="反馈状态" align="center" prop="state" width="140">
+        <template slot-scope="scope">
+          <el-tag type="danger" v-if="scope.row.state == 0">待处理</el-tag>
+          <el-popover placement="top-start" v-if="scope.row.state == 1" title="回复内容" width="200" trigger="hover" :content="scope.row.msg">
+            <div slot="reference" :title="'回复时间:' + scope.row.updateTime">
+              <el-tag type="success">已处理</el-tag>
+              <i class="el-icon-warning"></i>
+            </div>
+          </el-popover>
+        </template>
+      </el-table-column>
+      <el-table-column label="创建时间" align="center" prop="createTime" width="200" />
+      <el-table-column label="操作" align="center" width="200">
+        <template slot-scope="scope">
+          <el-button size="mini" type="text" icon="el-icon-view" @click="op('detail', scope.row)">详情</el-button>
+          <el-button size="mini" type="text" icon="el-icon-delete" @click="del(scope.row)">删除</el-button>
+        </template>
+      </el-table-column>
+      <template slot="empty">
+        <el-empty></el-empty>
+      </template>
+    </el-table>
+    <pagination v-if="response.total > 0" :total="response.total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
+  </div>
+</template>
+
+<script>
+import edit from './edit';
+export default {
+  dicts: ['feedback'],
+  name: 'Feedback',
+  data() {
+    return {
+      showSearch: true,
+      response: {},
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        type: null,
+        orderByColumn: 'id',
+        isAsc: 'desc'
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    getList() {
+      this.ajax({ url: '/work/feedback/list', data: this.queryParams }).then((response) => {
+        this.response = response;
+      });
+    },
+    change() {
+      this.getList();
+    },
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    resetQuery() {
+      this.resetForm('queryForm');
+      this.handleQuery();
+    },
+    op(tag, row) {
+      if (tag == 'add') {
+        this.iframe({ obj: edit, param: {}, title: '提交问题', width: '58%', height: '67%' });
+      }
+      if (tag == 'detail') {
+        this.iframe({ obj: edit, param: { id: row.id, detail: true }, title: '查看详情', width: '58%', height: '67%' });
+      }
+    },
+    del(row) {
+      this.$confirm('是否确认删除选中数据?', '警告', { type: 'warning' }).then(() => {
+        this.get({ url: '/work/feedback/delByUser/' + row.id }).then((response) => {
+          this.$modal.msgSuccess('删除成功');
+          this.getList();
+        });
+      });
+    }
+  }
+};
+</script>

+ 130 - 0
admin-ui/src/views/work/feedback/index.vue

@@ -0,0 +1,130 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent v-show="showSearch">
+      <el-form-item label="反馈标题" prop="title">
+        <el-input v-model="queryParams.title" placeholder="请输入反馈标题" @keyup.enter.native="handleQuery" clearable />
+      </el-form-item>
+      <el-form-item label="反馈类型" prop="type">
+        <el-select v-model="queryParams.type" placeholder="请选择类型">
+          <el-option v-for="dict in dict.type.feedback" :key="dict.value" :label="dict.label" :value="dict.value" clearable></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="反馈状态" prop="state">
+        <el-select v-model="queryParams.state" placeholder="请选择状态" clearable class="inp">
+          <el-option value="0" label="待处理"></el-option>
+          <el-option value="1" label="已处理"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <el-row :gutter="10" class="mb8">
+      <el-button type="success" icon="el-icon-edit" :disabled="ids.length != 1" @click="op('edit', ids)" v-hasPermi="['work:feedback:edit']">回复</el-button>
+      <el-button type="danger" icon="el-icon-delete" :disabled="ids.length == 0" @click="del" v-hasPermi="['work:feedback:remove']">删除{{ ids.length > 0 ? '(' + ids.length + ')' : '' }}</el-button>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table :data="response.rows" border @selection-change="selects" height="calc(100vh - 270px)">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="反馈标题" align="left" prop="title" />
+      <el-table-column label="反馈类型" align="center" prop="type" width="180" />
+      <el-table-column label="反馈状态" align="center" prop="state" width="140">
+        <template slot-scope="scope">
+          <el-tag type="danger" v-if="scope.row.state == 0">待处理</el-tag>
+          <el-popover placement="top-start" v-if="scope.row.state == 1" title="回复内容" width="200" trigger="hover" :content="scope.row.msg">
+            <div slot="reference" :title="'回复时间:' + scope.row.updateTime">
+              <el-tag type="success">已处理</el-tag>
+              <i class="el-icon-warning"></i>
+            </div>
+          </el-popover>
+        </template>
+      </el-table-column>
+      <el-table-column label="创建时间" align="center" prop="createTime" width="200" />
+      <el-table-column label="操作" align="center" width="200">
+        <template slot-scope="scope">
+          <el-button size="mini" type="text" icon="el-icon-view" @click="op('detail', scope.row)" v-hasPermi="['work:project:list']">详情</el-button>
+          <el-button size="mini" type="text" icon="el-icon-edit" @click="op('edit', scope.row)" v-hasPermi="['work:feedback:edit']" v-if="scope.row.state == 0">回复</el-button>
+          <el-button size="mini" type="text" icon="el-icon-delete" @click="del(scope.row)" v-hasPermi="['work:feedback:remove']">删除</el-button>
+        </template>
+      </el-table-column>
+      <template slot="empty">
+        <el-empty></el-empty>
+      </template>
+    </el-table>
+    <pagination v-if="response.total > 0" :total="response.total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
+  </div>
+</template>
+
+<script>
+import edit from './edit';
+export default {
+  dicts: ['feedback'],
+  name: 'Feedback',
+  data() {
+    return {
+      ids: [],
+      showSearch: true,
+      response: {},
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        title: null,
+        type: null,
+        state: null,
+        orderByColumn: 'id',
+        isAsc: 'desc'
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    getList() {
+      this.ajax({ url: '/work/feedback/list', data: this.queryParams }).then((response) => {
+        this.response = response;
+      });
+    },
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    resetQuery() {
+      this.resetForm('queryForm');
+      this.handleQuery();
+    },
+    selects(rows) {
+      this.ids = rows.map((item) => item.id);
+    },
+    op(tag, row) {
+      if (tag == 'detail') {
+        this.iframe({ obj: edit, param: { id: row.id, detail: true }, title: '查看详情', width: '58%', height: '67%' });
+      }
+      if (tag == 'edit') {
+        this.$prompt('确定处理', {
+          type: 'warning',
+          showInput: true,
+          inputType: 'textarea',
+          inputPlaceholder: '回复消息',
+          inputValidator: (value) => {}
+        }).then(({ value }) => {
+          this.ajax({ method: 'post', url: '/work/feedback/edit', data: { id: row.id, msg: value } }).then((response) => {
+            this.$modal.msgSuccess('处理成功');
+            this.getList();
+          });
+        });
+      }
+    },
+    del(row) {
+      this.$confirm('是否确认删除选中数据?', '警告', { type: 'warning' }).then(() => {
+        this.get({ url: '/work/feedback/remove/' + (row.id || this.ids) }).then((response) => {
+          this.$modal.msgSuccess('删除成功');
+          this.getList();
+        });
+      });
+    }
+  }
+};
+</script>

+ 73 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/FeedbackController.java

@@ -0,0 +1,73 @@
+package com.ruoyi.web.work.controller;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.web.work.domain.Feedback;
+import com.ruoyi.web.work.service.IFeedbackService;
+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.*;
+
+import java.rmi.ServerException;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 问题反馈
+ *
+ * @author lsw
+ * @date 2024-04-24
+ */
+@RestController
+@RequestMapping("/work/feedback")
+public class FeedbackController extends BaseController {
+    @Autowired
+    private IFeedbackService feedbackService;
+
+    @GetMapping("/list")
+    public TableDataInfo list(Feedback feedback) {
+        feedback.setCompanyId(getLoginUser().getUser().getCompanyId());
+        if (getLoginUser().getUser().getType() == 1) {
+            feedback.setUserId(getUserId());
+        }
+        startPage();
+        List<Feedback> list = feedbackService.selectList(feedback);
+        return getDataTable(list);
+    }
+
+    @GetMapping(value = "/detail/{id}")
+    public AjaxResult detail(@PathVariable("id") Long id) {
+        return AjaxResult.success(feedbackService.getById(id));
+    }
+
+    @Log(title = "提交问题反馈", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@Validated @RequestBody Feedback feedback) throws ServerException {
+        return feedbackService.add(feedback);
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:feedback:edit')")
+    @Log(title = "问题反馈", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    public AjaxResult edit(@RequestBody Feedback feedback) {
+        feedback.setState(1);
+        return toAjax(feedbackService.updateById(feedback));
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:feedback:remove')")
+    @Log(title = "删除问题反馈", businessType = BusinessType.DELETE)
+    @GetMapping("/remove/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(feedbackService.removeByIds(Arrays.asList(ids)));
+    }
+
+    @Log(title = "删除问题反馈", businessType = BusinessType.DELETE)
+    @GetMapping("/delByUser/{id}")
+    public AjaxResult delByUser(@PathVariable Long id) {
+        return toAjax(feedbackService.delByUser(id));
+    }
+}

+ 66 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/Feedback.java

@@ -0,0 +1,66 @@
+package com.ruoyi.web.work.domain;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
+import java.util.Date;
+/**
+ * @author lsw
+ * @date 2024-04-24
+ */
+@Data
+@TableName(value = "tb_feedback")
+@Accessors(chain = true)
+public class Feedback{
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    @NotBlank(message = "反馈标题不能为空")
+    @Size(max = 30, message = "反馈标题长度不能超过30个字符")
+    @ApiModelProperty(value = "反馈标题")
+    private String title;
+
+    @NotBlank(message = "反馈类型不能为空")
+    @ApiModelProperty(value = "反馈类型")
+    private String type;
+
+    @NotBlank(message = "反馈内容不能为空")
+    @ApiModelProperty(value = "反馈内容")
+    private String contents;
+
+    @ApiModelProperty(value = "状态:0=待回复,1=已回复")
+    private Integer state;
+
+    @ApiModelProperty(value = "回复内容")
+    private String msg;
+
+    @ApiModelProperty(value = "关联企业")
+    private Long companyId;
+
+    @ApiModelProperty(value = "关联用户")
+    private Long userId;
+
+    @TableField(fill = FieldFill.INSERT)
+    private String createBy;
+
+    @TableField(fill = FieldFill.INSERT)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    @TableField(fill = FieldFill.UPDATE)
+    private String updateBy;
+
+    @TableField(fill = FieldFill.UPDATE)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+
+}

+ 18 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/FeedbackMapper.java

@@ -0,0 +1,18 @@
+package com.ruoyi.web.work.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.web.work.domain.Feedback;
+import org.apache.ibatis.annotations.Delete;
+
+import java.util.List;
+
+/**
+ * @author lsw
+ * @date 2024-04-24
+ */
+public interface FeedbackMapper extends BaseMapper<Feedback> {
+    List<Feedback> selectList(Feedback feedback);
+
+    @Delete("DELETE  FROM tb_feedback WHERE user_id=#{userId} AND id=#{id}")
+    boolean delByUser(Feedback feedback);
+}

+ 20 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IFeedbackService.java

@@ -0,0 +1,20 @@
+package com.ruoyi.web.work.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.web.work.domain.Feedback;
+
+import java.rmi.ServerException;
+import java.util.List;
+
+/**
+ * @author lsw
+ * @date 2024-04-24
+ */
+public interface IFeedbackService extends IService<Feedback>{
+    List<Feedback> selectList(Feedback feedback);
+
+    AjaxResult add(Feedback feedback) throws ServerException;
+
+    boolean delByUser(Long id);
+}

+ 48 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/FeedbackServiceImpl.java

@@ -0,0 +1,48 @@
+package com.ruoyi.web.work.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.web.work.domain.Feedback;
+import com.ruoyi.web.work.mapper.FeedbackMapper;
+import com.ruoyi.web.work.service.IFeedbackService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.rmi.ServerException;
+import java.util.List;
+
+/**
+ * @author lsw
+ * @date 2024-04-24
+ */
+@Service
+public class FeedbackServiceImpl extends ServiceImpl<FeedbackMapper, Feedback> implements IFeedbackService {
+    @Autowired
+    private FeedbackMapper feedbackMapper;
+
+    @Override
+    public List<Feedback> selectList(Feedback feedback) {
+        return feedbackMapper.selectList(feedback);
+    }
+
+    @Override
+    public AjaxResult add(Feedback feedback) throws ServerException {
+        feedback.setUserId(SecurityUtils.getLoginUser().getUser().getUserId());
+        feedback.setCompanyId(SecurityUtils.getLoginUser().getUser().getCompanyId());
+        feedback.setState(0);
+        feedback.setMsg(null);
+        if (!save(feedback)) {
+            throw new ServerException("提交问题失败,请联系平台");
+        }
+        return AjaxResult.success();
+    }
+
+    @Override
+    public boolean delByUser(Long id) {
+        Feedback feedback = new Feedback();
+        feedback.setId(id);
+        feedback.setUserId(SecurityUtils.getLoginUser().getUser().getUserId());
+        return feedbackMapper.delByUser(feedback);
+    }
+}

+ 18 - 0
ruoyi-admin/src/main/resources/mapper/work/FeedbackMapper.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.web.work.mapper.FeedbackMapper">
+    
+    <select id="selectList" resultType="com.ruoyi.web.work.domain.Feedback">
+        select * from tb_feedback
+        <where>  
+            <if test="title != null  and title != ''"> and title like concat('%', #{title}, '%')</if>
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+            <if test="state != null "> and state = #{state}</if>
+            <if test="companyId != null "> and company_id = #{companyId}</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
+        </where>
+    </select>
+
+</mapper>