共创管理-留言反馈模块提交

master
elliott 2 years ago
parent b247bd5e9c
commit 2c8bcb98a3

@ -0,0 +1,122 @@
package com.flossom.hzMapper.domain;
import com.flossom.common.core.annotation.Excel;
import com.flossom.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* - ct_leave_message
*
* @author flossom
* @date 2023-12-11
*/
public class CtLeaveMessage extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 来源 1-我的模块 */
@Excel(name = "来源 1-我的模块 ")
private Integer source;
/** 来源名称 */
@Excel(name = "来源名称")
private String sourceName;
/** 用户头像 */
@Excel(name = "用户头像")
private String userImg;
/** 用户昵称 */
@Excel(name = "用户昵称")
private String userName;
/** 用户手机号码 */
@Excel(name = "用户手机号码")
private String userPhone;
/** 用户留言 */
@Excel(name = "用户留言")
private String messageInfo;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setSource(Integer source)
{
this.source = source;
}
public Integer getSource()
{
return source;
}
public void setSourceName(String sourceName)
{
this.sourceName = sourceName;
}
public String getSourceName()
{
return sourceName;
}
public void setUserImg(String userImg)
{
this.userImg = userImg;
}
public String getUserImg()
{
return userImg;
}
public void setUserName(String userName)
{
this.userName = userName;
}
public String getUserName()
{
return userName;
}
public void setUserPhone(String userPhone)
{
this.userPhone = userPhone;
}
public String getUserPhone()
{
return userPhone;
}
public void setMessageInfo(String messageInfo)
{
this.messageInfo = messageInfo;
}
public String getMessageInfo()
{
return messageInfo;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("source", getSource())
.append("sourceName", getSourceName())
.append("userImg", getUserImg())
.append("userName", getUserName())
.append("userPhone", getUserPhone())
.append("messageInfo", getMessageInfo())
.append("createTime", getCreateTime())
.toString();
}
}

@ -0,0 +1,62 @@
package com.flossom.hzMapper.mapper;
import com.flossom.hzMapper.domain.CtLeaveMessage;
import java.util.List;
/**
* -Mapper
*
* @author flossom
* @date 2023-12-11
*/
public interface CtLeaveMessageMapper
{
/**
* -
*
* @param id -
* @return -
*/
public CtLeaveMessage selectCtLeaveMessageById(Long id);
/**
* -
*
* @param ctLeaveMessage -
* @return -
*/
public List<CtLeaveMessage> selectCtLeaveMessageList(CtLeaveMessage ctLeaveMessage);
/**
* -
*
* @param ctLeaveMessage -
* @return
*/
public int insertCtLeaveMessage(CtLeaveMessage ctLeaveMessage);
/**
* -
*
* @param ctLeaveMessage -
* @return
*/
public int updateCtLeaveMessage(CtLeaveMessage ctLeaveMessage);
/**
* -
*
* @param id -
* @return
*/
public int deleteCtLeaveMessageById(Long id);
/**
* -
*
* @param ids
* @return
*/
public int deleteCtLeaveMessageByIds(Long[] ids);
}

@ -0,0 +1,85 @@
<?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.flossom.hzMapper.mapper.CtLeaveMessageMapper">
<resultMap type="CtLeaveMessage" id="CtLeaveMessageResult">
<result property="id" column="id" />
<result property="source" column="source" />
<result property="sourceName" column="source_name" />
<result property="userImg" column="user_img" />
<result property="userName" column="user_name" />
<result property="userPhone" column="user_phone" />
<result property="messageInfo" column="message_info" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectCtLeaveMessageVo">
select id, source, source_name, user_img, user_name, user_phone, message_info, create_time from ct_leave_message
</sql>
<select id="selectCtLeaveMessageList" parameterType="CtLeaveMessage" resultMap="CtLeaveMessageResult">
<include refid="selectCtLeaveMessageVo"/>
<where>
<if test="source != null "> and source = #{source}</if>
<if test="sourceName != null and sourceName != ''"> and source_name like concat('%', #{sourceName}, '%')</if>
<if test="userImg != null and userImg != ''"> and user_img = #{userImg}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="userPhone != null and userPhone != ''"> and user_phone = #{userPhone}</if>
<if test="messageInfo != null and messageInfo != ''"> and message_info = #{messageInfo}</if>
</where>
</select>
<select id="selectCtLeaveMessageById" parameterType="Long" resultMap="CtLeaveMessageResult">
<include refid="selectCtLeaveMessageVo"/>
where id = #{id}
</select>
<insert id="insertCtLeaveMessage" parameterType="CtLeaveMessage" useGeneratedKeys="true" keyProperty="id">
insert into ct_leave_message
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="source != null">source,</if>
<if test="sourceName != null">source_name,</if>
<if test="userImg != null">user_img,</if>
<if test="userName != null">user_name,</if>
<if test="userPhone != null">user_phone,</if>
<if test="messageInfo != null">message_info,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="source != null">#{source},</if>
<if test="sourceName != null">#{sourceName},</if>
<if test="userImg != null">#{userImg},</if>
<if test="userName != null">#{userName},</if>
<if test="userPhone != null">#{userPhone},</if>
<if test="messageInfo != null">#{messageInfo},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateCtLeaveMessage" parameterType="CtLeaveMessage">
update ct_leave_message
<trim prefix="SET" suffixOverrides=",">
<if test="source != null">source = #{source},</if>
<if test="sourceName != null">source_name = #{sourceName},</if>
<if test="userImg != null">user_img = #{userImg},</if>
<if test="userName != null">user_name = #{userName},</if>
<if test="userPhone != null">user_phone = #{userPhone},</if>
<if test="messageInfo != null">message_info = #{messageInfo},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteCtLeaveMessageById" parameterType="Long">
delete from ct_leave_message where id = #{id}
</delete>
<delete id="deleteCtLeaveMessageByIds" parameterType="String">
delete from ct_leave_message where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -0,0 +1,105 @@
package com.flossom.system.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.flossom.common.core.utils.poi.ExcelUtil;
import com.flossom.common.core.web.controller.BaseController;
import com.flossom.common.core.web.domain.AjaxResult;
import com.flossom.common.core.web.page.TableDataInfo;
import com.flossom.common.log.annotation.Log;
import com.flossom.common.log.enums.BusinessType;
import com.flossom.common.security.annotation.RequiresPermissions;
import com.flossom.hzMapper.domain.CtLeaveMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.flossom.system.service.ICtLeaveMessageService;
/**
* -Controller
*
* @author flossom
* @date 2023-12-11
*/
@RestController
@RequestMapping("/leaveMessage")
public class CtLeaveMessageController extends BaseController
{
@Autowired
private ICtLeaveMessageService ctLeaveMessageService;
/**
* -
*/
@RequiresPermissions("system:leaveMessage:list")
@GetMapping("/list")
public TableDataInfo list(CtLeaveMessage ctLeaveMessage)
{
startPage();
List<CtLeaveMessage> list = ctLeaveMessageService.selectCtLeaveMessageList(ctLeaveMessage);
return getDataTable(list);
}
/**
* -
*/
@RequiresPermissions("system:leaveMessage:export")
@Log(title = "共创管理-留言管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CtLeaveMessage ctLeaveMessage)
{
List<CtLeaveMessage> list = ctLeaveMessageService.selectCtLeaveMessageList(ctLeaveMessage);
ExcelUtil<CtLeaveMessage> util = new ExcelUtil<CtLeaveMessage>(CtLeaveMessage.class);
util.exportExcel(response, list, "共创管理-留言管理数据");
}
/**
* -
*/
@RequiresPermissions("system:leaveMessage:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(ctLeaveMessageService.selectCtLeaveMessageById(id));
}
/**
* -
*/
@RequiresPermissions("system:leaveMessage:add")
@Log(title = "共创管理-留言管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CtLeaveMessage ctLeaveMessage)
{
return toAjax(ctLeaveMessageService.insertCtLeaveMessage(ctLeaveMessage));
}
/**
* -
*/
@RequiresPermissions("system:leaveMessage:edit")
@Log(title = "共创管理-留言管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CtLeaveMessage ctLeaveMessage)
{
return toAjax(ctLeaveMessageService.updateCtLeaveMessage(ctLeaveMessage));
}
/**
* -
*/
@RequiresPermissions("system:leaveMessage:remove")
@Log(title = "共创管理-留言管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(ctLeaveMessageService.deleteCtLeaveMessageByIds(ids));
}
}

@ -0,0 +1,62 @@
package com.flossom.system.service;
import com.flossom.hzMapper.domain.CtLeaveMessage;
import java.util.List;
/**
* -Service
*
* @author flossom
* @date 2023-12-11
*/
public interface ICtLeaveMessageService
{
/**
* -
*
* @param id -
* @return -
*/
public CtLeaveMessage selectCtLeaveMessageById(Long id);
/**
* -
*
* @param ctLeaveMessage -
* @return -
*/
public List<CtLeaveMessage> selectCtLeaveMessageList(CtLeaveMessage ctLeaveMessage);
/**
* -
*
* @param ctLeaveMessage -
* @return
*/
public int insertCtLeaveMessage(CtLeaveMessage ctLeaveMessage);
/**
* -
*
* @param ctLeaveMessage -
* @return
*/
public int updateCtLeaveMessage(CtLeaveMessage ctLeaveMessage);
/**
* -
*
* @param ids -
* @return
*/
public int deleteCtLeaveMessageByIds(Long[] ids);
/**
* -
*
* @param id -
* @return
*/
public int deleteCtLeaveMessageById(Long id);
}

@ -0,0 +1,96 @@
package com.flossom.system.service.impl;
import java.util.List;
import com.flossom.common.core.utils.DateUtils;
import com.flossom.hzMapper.domain.CtLeaveMessage;
import com.flossom.hzMapper.mapper.CtLeaveMessageMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.flossom.system.service.ICtLeaveMessageService;
/**
* -Service
*
* @author flossom
* @date 2023-12-11
*/
@Service
public class CtLeaveMessageServiceImpl implements ICtLeaveMessageService
{
@Autowired
private CtLeaveMessageMapper ctLeaveMessageMapper;
/**
* -
*
* @param id -
* @return -
*/
@Override
public CtLeaveMessage selectCtLeaveMessageById(Long id)
{
return ctLeaveMessageMapper.selectCtLeaveMessageById(id);
}
/**
* -
*
* @param ctLeaveMessage -
* @return -
*/
@Override
public List<CtLeaveMessage> selectCtLeaveMessageList(CtLeaveMessage ctLeaveMessage)
{
return ctLeaveMessageMapper.selectCtLeaveMessageList(ctLeaveMessage);
}
/**
* -
*
* @param ctLeaveMessage -
* @return
*/
@Override
public int insertCtLeaveMessage(CtLeaveMessage ctLeaveMessage)
{
ctLeaveMessage.setCreateTime(DateUtils.getNowDate());
return ctLeaveMessageMapper.insertCtLeaveMessage(ctLeaveMessage);
}
/**
* -
*
* @param ctLeaveMessage -
* @return
*/
@Override
public int updateCtLeaveMessage(CtLeaveMessage ctLeaveMessage)
{
return ctLeaveMessageMapper.updateCtLeaveMessage(ctLeaveMessage);
}
/**
* -
*
* @param ids -
* @return
*/
@Override
public int deleteCtLeaveMessageByIds(Long[] ids)
{
return ctLeaveMessageMapper.deleteCtLeaveMessageByIds(ids);
}
/**
* -
*
* @param id -
* @return
*/
@Override
public int deleteCtLeaveMessageById(Long id)
{
return ctLeaveMessageMapper.deleteCtLeaveMessageById(id);
}
}

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询共创管理-留言管理列表
export function listMessage(query) {
return request({
url: '/system/leaveMessage/list',
method: 'get',
params: query
})
}
// 查询共创管理-留言管理详细
export function getMessage(id) {
return request({
url: '/system/leaveMessage/' + id,
method: 'get'
})
}
// 新增共创管理-留言管理
export function addMessage(data) {
return request({
url: '/system/leaveMessage',
method: 'post',
data: data
})
}
// 修改共创管理-留言管理
export function updateMessage(data) {
return request({
url: '/system/leaveMessage',
method: 'put',
data: data
})
}
// 删除共创管理-留言管理
export function delMessage(id) {
return request({
url: '/system/leaveMessage/' + id,
method: 'delete'
})
}

@ -0,0 +1,308 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="来源 1-我的模块 " prop="source">
<el-input
v-model="queryParams.source"
placeholder="请输入来源 1-我的模块 "
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="来源名称" prop="sourceName">
<el-input
v-model="queryParams.sourceName"
placeholder="请输入来源名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户头像" prop="userImg">
<el-input
v-model="queryParams.userImg"
placeholder="请输入用户头像"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户昵称" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户昵称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户手机号码" prop="userPhone">
<el-input
v-model="queryParams.userPhone"
placeholder="请输入用户手机号码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:leaveMessage:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:leaveMessage:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:leaveMessage:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:leaveMessage:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="messageList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键ID" align="center" prop="id" />
<el-table-column label="来源 1-我的模块 " align="center" prop="source" />
<el-table-column label="来源名称" align="center" prop="sourceName" />
<el-table-column label="用户头像" align="center" prop="userImg" />
<el-table-column label="用户昵称" align="center" prop="userName" />
<el-table-column label="用户手机号码" align="center" prop="userPhone" />
<el-table-column label="用户留言" align="center" prop="messageInfo" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:leaveMessage:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:leaveMessage:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改共创管理-留言管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="来源 1-我的模块 " prop="source">
<el-input v-model="form.source" placeholder="请输入来源 1-我的模块 " />
</el-form-item>
<el-form-item label="来源名称" prop="sourceName">
<el-input v-model="form.sourceName" placeholder="请输入来源名称" />
</el-form-item>
<el-form-item label="用户头像" prop="userImg">
<el-input v-model="form.userImg" placeholder="请输入用户头像" />
</el-form-item>
<el-form-item label="用户昵称" prop="userName">
<el-input v-model="form.userName" placeholder="请输入用户昵称" />
</el-form-item>
<el-form-item label="用户手机号码" prop="userPhone">
<el-input v-model="form.userPhone" placeholder="请输入用户手机号码" />
</el-form-item>
<el-form-item label="用户留言" prop="messageInfo">
<el-input v-model="form.messageInfo" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listMessage, getMessage, delMessage, addMessage, updateMessage } from "@/api/system/leaveMessage";
export default {
name: "Message",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// -
messageList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
source: null,
sourceName: null,
userImg: null,
userName: null,
userPhone: null,
messageInfo: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询共创管理-留言管理列表 */
getList() {
this.loading = true;
listMessage(this.queryParams).then(response => {
this.messageList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
source: null,
sourceName: null,
userImg: null,
userName: null,
userPhone: null,
messageInfo: null,
createTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加共创管理-留言管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getMessage(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改共创管理-留言管理";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateMessage(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addMessage(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除共创管理-留言管理编号为"' + ids + '"的数据项?').then(function() {
return delMessage(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/message/export', {
...this.queryParams
}, `message_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save