当前位置: 首页 > wzjs >正文

网站建设的新闻网站开发与技术维护

网站建设的新闻,网站开发与技术维护,哪个公司做的网站好,好的国外设计网站推荐更多ruoyi-nbcio功能请看演示系统 gitee源代码地址 前后端代码: https://gitee.com/nbacheng/ruoyi-nbcio 演示地址:RuoYi-Nbcio后台管理系统 这个部分是这个单元最后内容了,就是点击消息更多的一些代码与逻辑。 1、需要在我的个人中心里…

更多ruoyi-nbcio功能请看演示系统

gitee源代码地址

前后端代码: https://gitee.com/nbacheng/ruoyi-nbcio

演示地址:RuoYi-Nbcio后台管理系统

这个部分是这个单元最后内容了,就是点击消息更多的一些代码与逻辑。

1、需要在我的个人中心里增加一个菜单我的消息

2、同时角色里进行授权给相应用户

3、增加后端代码

   首先因为需要联合多表查询,所以需要进行一个新的数据结构如下:

/***   NoticeSendModel 用户通告阅读标记表**  @author nbacheng*  @date 2023-09-20*/
@Data
public class NoticeSendModel {/**id*/private java.lang.Long sendId;/**通告id*/private java.lang.Long noticeId;/**用户id*/private java.lang.Long userId;/**标题*/private java.lang.String noticeTitle;/**内容*/private java.lang.String noticeContent;/**发布人*/private java.lang.String sender;/**优先级(L低,M中,H高)*/private java.lang.String priority;/**阅读状态*/private java.lang.String readFlag;/**发布时间*/@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")private java.util.Date sendTime;/**页数*/private java.lang.Integer pageNo;/**大小*/private java.lang.Integer pageSize;/*** 消息类型1:通知公告2:系统消息3:待办*/private java.lang.String noticeType;
}

同时mapper.xml文件需要增加下面sql联合查询

    <resultMap id="NoticeSendModel" type="com.ruoyi.system.model.NoticeSendModel" ><result column="send_id" property="sendId" jdbcType="BIGINT"/><result column="notice_id" property="noticeId" jdbcType="BIGINT"/><result column="user_id" property="userId" jdbcType="BIGINT"/><result column="notice_title" property="noticeTitle" jdbcType="VARCHAR"/><result column="notice_content" property="noticeContent" jdbcType="VARCHAR"/><result column="sender" property="sender" jdbcType="VARCHAR"/><result column="priority" property="priority" jdbcType="VARCHAR"/><result column="notice_type" property="noticeType" jdbcType="VARCHAR"/><result column="send_time" property="sendTime" jdbcType="TIMESTAMP"/></resultMap><select id="getMyNoticeSendList" parameterType="Object"  resultMap="NoticeSendModel">selectsns.send_id,sns.notice_id,sns.user_id,sns.read_flag,sa.notice_title as notice_title,sa.notice_content as notice_content,sa.sender as sender,sa.priority as priority,sa.notice_type as notice_type,sa.send_time as send_timefrom sys_notice_send snsleft join sys_notice sa ON sns.notice_id = sa.notice_idwhere sa.send_status = '1'and sa.status = '0'and sns.user_id = #{noticeSendModel.userId}<if test="noticeSendModel.noticeTitle !=null and noticeSendModel.noticeTitle != ''">and sa.notice_title LIKE concat(concat('%',#{noticeSendModel.noticeTitle}),'%')</if><if test="noticeSendModel.sender !=null and noticeSendModel.sender != ''">and sa.sender LIKE concat(concat('%',#{noticeSendModel.sender}),'%')</if><if test="noticeSendModel.readFlag !=null and noticeSendModel.readFlag != ''">and sns.read_flag = #{noticeSendModel.readFlag}</if><if test="noticeSendModel.noticeType !=null and noticeSendModel.noticeType != ''">and sa.notice_type = #{noticeSendModel.noticeType}</if>order by sns.read_flag,sa.send_time desc</select>

 control接口层增加下面代码

/*** 获取我的消息* @return*/@SaCheckPermission("system:noticeSend:list")@PostMapping(value = "/getMyNoticeSend")public  R<Page<NoticeSendModel>> getMyNoticeSend(@RequestBody JSONObject json) {	LoginUser loginUser = commonService.getLoginUser();Long userId = loginUser.getUserId();Integer pageNum = json.getInteger("pageNum");Integer pageSize = json.getInteger("pageSize");	NoticeSendModel noticeSendModel = new NoticeSendModel();noticeSendModel.setUserId(userId);noticeSendModel.setPageNo((pageNum-1)*pageSize);noticeSendModel.setPageSize(pageSize);Page<NoticeSendModel> pageList = new Page<NoticeSendModel>(pageNum,pageSize);pageList = iSysNoticeSendService.getMyNoticeSendPage(pageList, noticeSendModel);return R.ok(pageList);}

对应的实现就是调用mapper里sql

@Overridepublic Page<NoticeSendModel> getMyNoticeSendPage(Page<NoticeSendModel> pageList, NoticeSendModel noticeSendModel) {return pageList.setRecords(baseMapper.getMyNoticeSendList(pageList, noticeSendModel));}

因为上面noticeSendModel是个sql参数,所以需要注意mapper接口层的写法如下,需要增加一个@Param("noticeSendModel")这样的参数:

/*** 用户公告阅读标记Mapper接口** @author nbacheng* @date 2023-09-21*/
public interface SysNoticeSendMapper extends BaseMapperPlus<SysNoticeSendMapper, SysNoticeSend, SysNoticeSendVo> {List<NoticeSendModel> getMyNoticeSendList(Page<NoticeSendModel> pageList, @Param("noticeSendModel")NoticeSendModel noticeSendModel);}

4、前端增加

我的消息页面

<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="公告标题" prop="noticeTitle"><el-inputv-model="queryParams.noticeTitle"placeholder="请输入公告标题"clearable@keyup.enter.native="handleQuery"/></el-form-item><el-form-item label="操作人员" prop="createBy"><el-inputv-model="queryParams.createBy"placeholder="请输入操作人员"clearable@keyup.enter.native="handleQuery"/></el-form-item><el-form-item label="类型" prop="noticeType"><el-select v-model="queryParams.noticeType" placeholder="公告类型" clearable><el-optionv-for="dict in dict.type.sys_notice_type":key="dict.value":label="dict.label":value="dict.value"/></el-select></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-buttontype="success"plainicon="el-icon-edit"size="mini":disabled="single"@click=""v-hasPermi="['system:noticeSend:list']">全部标注已读</el-button></el-col><right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar></el-row><el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange"><el-table-column type="selection" width="55" align="center" /><el-table-column label="序号" align="center" prop="noticeId" width="100" /><el-table-columnlabel="消息标题"align="center"prop="noticeTitle":show-overflow-tooltip="true"/><el-table-column label="消息类型" align="center" prop="noticeType" width="100"><template slot-scope="scope"><dict-tag :options="dict.type.sys_notice_type" :value="scope.row.noticeType"/></template></el-table-column><el-table-column label="发布人" align="center" prop="sender" width="100" /><el-table-column label="发布时间" align="center" prop="sendTime" width="100" /><el-table-column label="优先级" align="center" prop="priority" width="100"><template slot-scope="scope"><dict-tag :options="dict.type.sys_priority" :value="scope.row.priority"/></template></el-table-column><el-table-column label="阅读状态" align="center" prop="readFlag" width="100"><template slot-scope="scope"><dict-tag :options="dict.type.sys_readflag" :value="scope.row.readFlag"/></template></el-table-column><el-table-column label="操作" align="center" class-name="small-padding fixed-width"><template slot-scope="scope"><el-buttonsize="mini"type="text"icon="el-icon-view"@click="handleSee(scope.row)"v-hasPermi="['system:noticeSend:list']">查看</el-button></template></el-table-column></el-table><paginationv-show="total>0":total="total":page.sync="queryParams.pageNum":limit.sync="queryParams.pageSize"@pagination="getList"/><!-- 添加或修改公告对话框 --><el-dialog :title="title" :visible.sync="open" width="780px" append-to-body><el-form ref="form" :model="form" :rules="rules" label-width="80px"><el-row><el-col :span="12"><el-form-item label="公告标题" prop="noticeTitle"><el-input v-model="form.noticeTitle" placeholder="请输入公告标题" /></el-form-item></el-col><el-col :span="12"><el-form-item label="公告类型" prop="noticeType"><el-select v-model="form.noticeType" placeholder="请选择公告类型"><el-optionv-for="dict in dict.type.sys_notice_type":key="dict.value":label="dict.label":value="dict.value"></el-option></el-select></el-form-item></el-col><el-col :span="24"><el-form-item label="状态"><el-radio-group v-model="form.status"><el-radiov-for="dict in dict.type.sys_notice_status":key="dict.value":label="dict.value">{{dict.label}}</el-radio></el-radio-group></el-form-item></el-col><el-col :span="24"><el-form-item label="内容"><editor v-model="form.noticeContent" :min-height="192"/></el-form-item></el-col></el-row></el-form><div slot="footer" class="dialog-footer"><el-button type="primary" @click="">确 定</el-button><el-button @click="cancel">取 消</el-button></div></el-dialog></div>
</template><script>
import { listNotice, getMyNoticeSend, getNotice, updateNotice } from "@/api/system/notice";export default {name: "MyNotice",dicts: ['sys_readflag', 'sys_notice_type','sys_priority'],data() {return {// 遮罩层loading: true,// 选中数组ids: [],// 非单个禁用single: true,// 非多个禁用multiple: true,// 显示搜索条件showSearch: true,// 总条数total: 0,// 公告表格数据noticeList: [],// 弹出层标题title: "",// 是否显示弹出层open: false,// 查询参数queryParams: {noticeSendModel: {},pageNum: 1,pageSize: 10},// 表单参数form: {},// 表单校验rules: {noticeTitle: [{ required: true, message: "公告标题不能为空", trigger: "blur" }],noticeType: [{ required: true, message: "公告类型不能为空", trigger: "change" }]}};},created() {this.getList();},methods: {/** 查询公告列表 */getList() {this.loading = true;console.log("this.queryParams",this.queryParams);getMyNoticeSend(this.queryParams).then(res => {console.log("getMyNoticeSend res", res);this.noticeList = res.data.records;this.total = res.data.total;this.loading = false;});},// 取消按钮cancel() {this.open = false;this.reset();},// 表单重置reset() {this.form = {noticeId: undefined,noticeTitle: undefined,noticeType: undefined,noticeContent: undefined,status: "0"};this.resetForm("form");},handleSee(row) {},/** 搜索按钮操作 */handleQuery() {this.queryParams.pageNum = 1;this.getList();},/** 重置按钮操作 */resetQuery() {this.resetForm("queryForm");this.handleQuery();},// 多选框选中数据handleSelectionChange(selection) {this.ids = selection.map(item => item.noticeId)this.single = selection.length!=1this.multiple = !selection.length}}
};
</script>

点击更多的跳转工作如下:

toMyNotice() {this.$router.push({path: '/personal/mynotice'});},


5、效果如下:


文章转载自:

http://JvC6aw2x.txysr.cn
http://LYcW0Yqe.txysr.cn
http://sDENk2AN.txysr.cn
http://xnjrMclu.txysr.cn
http://G0kxxL6S.txysr.cn
http://Jf1OHb5P.txysr.cn
http://ue2xjHAl.txysr.cn
http://rNM8Vq5p.txysr.cn
http://fdYWzDsC.txysr.cn
http://ZuVKbu9D.txysr.cn
http://VhbLDhio.txysr.cn
http://sUESiuTu.txysr.cn
http://qtemga72.txysr.cn
http://q5gccPOl.txysr.cn
http://3fZak4aS.txysr.cn
http://aT5O6yfb.txysr.cn
http://MnYvde2w.txysr.cn
http://MFRaAPFF.txysr.cn
http://DzpbnsI6.txysr.cn
http://VNno7sQ6.txysr.cn
http://p7NUqFhe.txysr.cn
http://rvVS54JV.txysr.cn
http://1wCvA7bQ.txysr.cn
http://78xxy9Av.txysr.cn
http://7s9uUkvt.txysr.cn
http://TuX90jb2.txysr.cn
http://mYpAaozW.txysr.cn
http://RmobzhcX.txysr.cn
http://AJKy1ksp.txysr.cn
http://rr0jznnE.txysr.cn
http://www.dtcms.com/wzjs/626653.html

相关文章:

  • CQ网站建设网站开发后端待遇
  • 无锡网站设计哪家公司好网络专题策划书模板
  • 做简历那些网站比较好广告网站建设及推广
  • 免费做淘客cms网站视频推广软件排名帝搜软件
  • 企业网站搜索优化个人怎么制作公众号
  • 网站建设周志200字深圳注册公司地址可以是住宅吗
  • 长春网站优化页面培训网站方案
  • 自建网站怎么做后台管理系统柯城建设局网站
  • 做电影网站如何规避版权加快信用网站建设
  • 德清县小城镇建设网站怎么在vk网站上做推广
  • 海南网站建设推广公司哪家好网站建设深圳哪里学
  • 做招聘网站毕业设计网站建设主题大全
  • 统一管理网站系统好发信息网-网站建设
  • 广东企业微信网站建设怎么在百度提交自己的网站
  • 招聘网站续费怎么做分录网店运营培训哪里好
  • 网站运营工作具体做啥网站关闭与域名备案
  • 九江新闻厦门网站优化建设
  • 网站查外链搜索引擎推广试题
  • 网站服务器平台企业网站开发哪家专业
  • 手机制作网站软件下载如何做网校网站
  • tag 网站托管公司wordpress调用菜单函数
  • 建网站平台 优帮云运营策划
  • 制作网站的商家域名服务器的作用
  • 医院为什么要做门户网站建设wordpress xmlseo
  • 杭州餐饮团购网站建设旅游网站建设经费预算
  • 做网站新科网站建设网站建设与管理适合女生吗
  • 单产品网站模板医疗今科云平台网站建设技术开发
  • 建设公司网站需要什么技术个人怎么免费注册公司流程
  • ps做网站首页怎么运用起来做论坛网站需要什么备案
  • 做钢材的都用什么网站企业wap网站模板