1
0
Kaynağa Gözat

fix:优化医生端小程序

lsw 8 ay önce
ebeveyn
işleme
349275565c

+ 91 - 0
admin-ui/src/views/work/notice/edit.vue

@@ -0,0 +1,91 @@
+<template>
+  <div class="cmain">
+    <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+      <el-form-item label="通知标题" prop="title">
+        <el-input v-model="form.title" placeholder="请输入标题" clearable maxlength="30" show-word-limit />
+      </el-form-item>
+      <el-form-item label="通知内容" prop="contents">
+        <editor v-model="form.contents" placeholder="请输入内容"></editor>
+      </el-form-item>
+      <el-row>
+        <el-col :span="12">
+          <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-col>
+        <el-col :span="12">
+          <el-form-item label="通知置顶" prop="top">
+            <el-select v-model="form.top" placeholder="请选择">
+              <el-option label="否" :value="0"></el-option>
+              <el-option label="是" :value="1"></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <div class="mfooter">
+      <el-button type="primary" @click="submitForm">确 定</el-button>
+      <el-button @click="$layer.close(layerid)">取 消</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      form: { state: 0, top: 0 },
+      rules: {
+        title: [{ required: true, message: '标题不能为空', trigger: 'blur' }],
+        type: [{ required: true, message: '类型不能为空', trigger: 'blur' }],
+        contents: [{ required: true, message: '内容不能为空', trigger: 'blur' }],
+        top: [{ required: true, message: '是否置顶不能为空', trigger: 'blur' }],
+        state: [{ required: true, message: '状态不能为空', trigger: 'blur' }]
+      }
+    };
+  },
+  props: {
+    param: {
+      type: Object,
+      default: () => {
+        return {};
+      }
+    },
+    layerid: {
+      type: String
+    }
+  },
+  mounted() {
+    if (this.param.id) {
+      this.ajax({ url: '/work/notice/detail/' + this.param.id }).then((response) => {
+        this.form = response.data;
+        this.form.contents = response.data.contents.replace(new RegExp('/profile/upload/', 'g'), this.baseUrl + '/profile/upload/');
+      });
+    }
+  },
+  methods: {
+    submitForm() {
+      this.$refs['form'].validate((valid) => {
+        if (valid) {
+          if (this.form.id) {
+            this.ajax({ method: 'post', url: '/work/notice/edit', data: this.form }).then((response) => {
+              this.$modal.msgSuccess('修改成功');
+              this.$layer.close(this.layerid);
+              this.$parent.getList();
+            });
+          } else {
+            this.ajax({ method: 'post', url: '/work/notice/add', data: this.form }).then((response) => {
+              this.$modal.msgSuccess('新增成功');
+              this.$layer.close(this.layerid);
+              this.$parent.getList();
+            });
+          }
+        }
+      });
+    }
+  }
+};
+</script>

+ 109 - 0
admin-ui/src/views/work/notice/index.vue

@@ -0,0 +1,109 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
+      <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="state">
+        <el-select v-model="queryParams.state" placeholder="状态" class="se" clearable>
+          <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="primary" icon="el-icon-plus" :disabled="ids.length > 0" @click="op('add')" v-hasPermi="['work:notice:add']">新增</el-button>
+      <el-button type="success" icon="el-icon-edit" :disabled="ids.length != 1" @click="op('edit', ids)" v-hasPermi="['work:notice:edit']">修改</el-button>
+      <el-button type="danger" icon="el-icon-delete" :disabled="ids.length == 0" @click="del" v-hasPermi="['work:notice:remove']">删除{{ ids.length > 0 ? '(' + ids.length + ')' : '' }}</el-button>
+    </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="center" prop="title" />
+      <el-table-column label="是否置顶" align="center" prop="top" width="140">
+        <template slot-scope="scope">
+          <el-tag type="success" v-if="scope.row.top == 1">是</el-tag>
+          <el-tag type="info" v-else>否</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="通知状态" align="center" prop="state" width="140">
+        <template slot-scope="scope">
+          <el-tag type="success" v-if="scope.row.state == 0">启用</el-tag>
+          <el-tag type="danger" v-if="scope.row.state == 1">停用</el-tag>
+        </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-edit" @click="op('edit', scope.row)" v-hasPermi="['work:notice:edit']">修改</el-button>
+          <el-button size="mini" type="text" icon="el-icon-delete" @click="del(scope.row)" v-hasPermi="['work:notice: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 {
+  name: 'Notice',
+  data() {
+    return {
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        title: null,
+        top: null,
+        state: null,
+        orderByColumn: 'id', //排序字段
+        isAsc: 'desc' //排序方式
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    getList() {
+      this.ajax({ url: '/work/notice/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 == 'add') {
+        this.iframe({ obj: edit, param: {}, title: '新增', width: '58%', height: '65%' });
+      }
+      if (tag == 'edit') {
+        const id = row.id || this.ids[0];
+        this.iframe({ obj: edit, param: { id: id }, title: '编辑', width: '58%', height: '65%' });
+      }
+    },
+    del(row) {
+      this.$confirm('是否确认删除选中数据?', '警告', { type: 'warning' }).then(() => {
+        this.get({ url: '/work/notice/remove/' + (row.id || this.ids) }).then((response) => {
+          this.$modal.msgSuccess('删除成功');
+          this.getList();
+        });
+      });
+    }
+  }
+};
+</script>

+ 1 - 1
app/App.vue

@@ -30,7 +30,7 @@ button::after {
 /**挂载iconfont字体图标*/
 @font-face {
 	font-family: 'iconfont';
-	src: url('https://at.alicdn.com/t/c/font_4620946_udvs6xxd1c.ttf?t=1723780287473') format('truetype');
+	src: url('https://at.alicdn.com/t/c/font_4620946_wjo0wa9j5yc.ttf?t=1724155918797') format('truetype');
 	/* src: url('~@/static/font/iconfont.ttf') format('truetype'); */
 }
 .icon {

+ 21 - 5
app/pages.json

@@ -142,7 +142,8 @@
 			"path" : "pages/user/loginDoctor",
 			"style" : 
 			{
-				"navigationBarTitleText" : "医生登录"
+				"navigationBarTitleText" : "医生登录",
+				"navigationStyle": "custom"
 			}
 		},
 		{
@@ -181,15 +182,30 @@
 			}
 		},
 		{
-			"path": "pages/visit/doctor/selectUser",
+			"path": "components/u-avatar-cropper/u-avatar-cropper",
 			"style": {
-				"navigationBarTitleText": "选择患者"
+				"navigationBarTitleText": "图片裁剪",
+				"navigationBarBackgroundColor": "#000000"
 			}
 		},
 		{
-			"path": "pages/visit/doctor/list",
+			"path": "pages/user/pass",
 			"style": {
-				"navigationBarTitleText": "患者就诊记录"
+				"navigationBarTitleText": "修改密码"
+			}
+		},
+		{
+			"path" : "pages/notice/index",
+			"style" : 
+			{
+				"navigationBarTitleText" : "通知公告"
+			}
+		},
+		{
+			"path" : "pages/notice/detail",
+			"style" : 
+			{
+				"navigationBarTitleText" : "公告详情"
 			}
 		}
 	],

+ 2 - 1
app/pages/index/index.vue

@@ -97,7 +97,7 @@ export default {
 	data() {
 		return {
 			ip: this.http.ip,
-			noticeList: ['医院开通线上小程序啦,快来体验吧', '首次使用如何绑定就诊卡'],
+			noticeList: [],
 			expertList: [],
 			knowledgeList: []
 		};
@@ -112,6 +112,7 @@ export default {
 				success: (res) => {
 					this.knowledgeList = res.data.data.knowledgeList;
 					this.expertList = res.data.data.expertList;
+					this.noticeList = res.data.data.noticeList.map((item) => item.title);
 				}
 			});
 		},

+ 87 - 0
app/pages/notice/detail.vue

@@ -0,0 +1,87 @@
+<template>
+	<view class="main">
+		<view class="content">
+			<view class="title">{{ item.title }}</view>
+			<view class="desc">
+				<text class="time">发布于:{{ item.createTime }}</text>
+				<button class="fx" open-type="share">
+					<text class="icon">&#xe637;</text>
+					<text>分享</text>
+				</button>
+			</view>
+			<view class="con">
+				<u-divider :dot="true"></u-divider>
+				<u-parse :content="item.contents"></u-parse>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			item: {}
+		};
+	},
+	onLoad(e) {
+		this.http.request({
+			url: '/app/notice/detail/' + e.id,
+			success: (res) => {
+				this.item = res.data.data;
+				this.item.contents = res.data.data.contents.replace(new RegExp('/profile/upload/', 'g'), this.http.ip + '/profile/upload/');
+			}
+		});
+	},
+	methods: {},
+	//分享
+	onShareAppMessage: function (res) {
+		return {
+			title: this.item.title,
+			path: '/pages/notice/detail?id=' + this.item.id,
+			success: (res) => {},
+			fail: (res) => {}
+		};
+	}
+};
+</script>
+
+<style lang="scss">
+.main {
+	padding: 0px 10px 10px 10px;
+}
+.content {
+	padding: 15px;
+	background-color: white;
+	border-radius: 8px;
+	.title {
+		font-size: 18px;
+	}
+	.desc {
+		padding-top: 15px;
+		font-size: 13px;
+		color: #7c8388;
+		.time {
+			padding-right: 25px;
+		}
+		.fx {
+			background-color: white;
+			float: right;
+			font-size: 15px;
+			margin-right: -14px;
+			margin-top: -13px;
+			color: $main-color;
+			.icon{
+				padding-right: 3px;
+			}
+		}
+	}
+	.con {
+		font-size: 14px;
+		line-height: 23px;
+		image {
+			border-radius: 5px !important;
+		}
+	}
+}
+</style>

+ 98 - 0
app/pages/notice/index.vue

@@ -0,0 +1,98 @@
+<template>
+	<view class="list">
+		<view class="item" v-for="(item, index) in list" :key="index" @click="go('/pages/notice/detail?id=' + item.id)">
+			<view class="title omit">
+				<text class="icon" v-if="item.top === 1">&#xe620;</text>
+				<text>{{ item.title }}</text>
+			</view>
+			<view class="desc">
+				<text>发布于 {{ item.createTime }}</text>
+			</view>
+		</view>
+		<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
+		<u-empty v-if="!loadMore && list.length == 0"></u-empty>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			list: [],
+			param: { pageNum: 1, pageSize: 10, type: '小程序通知' },
+			loadMore: true
+		};
+	},
+	onLoad(e) {
+		this.getData();
+	},
+	methods: {
+		getData() {
+			this.http.request({
+				url: '/app/notice/list',
+				data: this.param,
+				loading: 'false',
+				success: (res) => {
+					this.loadMore = res.data.pages > this.param.pageNum ? true : false;
+					res.data.rows.forEach((item) => {
+						item.createTime = uni.$u.timeFrom(Date.parse(item.createTime));
+						this.list.push(item);
+					});
+				}
+			});
+		},
+		go(url) {
+			uni.navigateTo({ url: url });
+		},
+		//刷新数据
+		refresh() {
+			this.loadMore = true;
+			this.param.pageNum = 1;
+			this.list = [];
+			this.getData();
+		}
+	},
+	//下拉刷新
+	onPullDownRefresh() {
+		setTimeout(() => {
+			this.refresh();
+			uni.stopPullDownRefresh();
+		}, 1000);
+	},
+	//上拉加载
+	onReachBottom() {
+		if (this.loadMore) {
+			this.param.pageNum++;
+			this.getData();
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+.list {
+	padding: 5px 12px 12px 12px;
+	.item {
+		background-color: white;
+		border-radius: 5px;
+		padding: 12px;
+		margin-bottom: 10px;
+		.title {
+			font-size: 15px;
+			font-weight: bold;
+			.icon {
+				color: orangered;
+				padding-right: 3px;
+			}
+		}
+		.desc {
+			font-size: 14px;
+			color: $font-c;
+			padding-top: 7px;
+			text {
+				padding-right: 20px;
+			}
+		}
+	}
+}
+</style>

+ 12 - 5
app/pages/user/index.vue

@@ -1,13 +1,13 @@
 <template>
 	<view class="main">
-		<view class="user">
-			<image :src="user.avatar ? ip + user.avatar : '../../static/favicon.png'"></image>
+		<view class="user" @click="go(user.doctor ? '/pages/user/info' : '/pages/user/bind/index')">
+			<image :src="user.avatar ? ip + user.avatar : '../../static/favicon.png'" :class="user.avatar ? 'head' : ''"></image>
 			<view class="con" v-if="user.id || user.token">
-				<view v-if="user.doctor" @click="go('/pages/user/info')">
+				<view v-if="user.doctor">
 					<view class="nickName">{{ user.nickName }}</view>
 					<view class="welcome">{{ user.dept.deptName || '欢迎使用岑溪人民医院小程序' }}</view>
 				</view>
-				<view v-else @click="go('/pages/user/bind/index')">
+				<view v-else>
 					<view class="nickName">
 						<text>{{ user.patientName ? user.patientName : '还未绑定就诊人' }}</text>
 						<text class="icon" v-if="user.bindUserList && user.bindUserList.length > 1" @click.stop="show = true">&#xe6a7;切换就诊人</text>
@@ -15,7 +15,7 @@
 					<view class="welcome">欢迎使用岑溪人民医院小程序</view>
 				</view>
 			</view>
-			<view class="con" v-else @click="go('/pages/user/info')">
+			<view class="con" v-else>
 				<view class="nickName">你还没登录</view>
 				<view class="welcome">欢迎使用岑溪人民医院小程序</view>
 			</view>
@@ -56,11 +56,13 @@
 					<text class="icon ic" style="color: #03a9f4">&#xe6a3;</text>
 					<text class="title">复诊提醒</text>
 					<text class="icon arrow">&#xe62b;</text>
+					<view class="bage" v-if="user.remind > 0">{{ user.remind > 99 ? '99+' : user.remind }}</view>
 				</view>
 				<view class="s_item" @click="go('/pages/follow/index')">
 					<text class="icon ic" style="color: #607d8b">&#xe60b;</text>
 					<text class="title">我的随访</text>
 					<text class="icon arrow">&#xe62b;</text>
+					<view class="bage" v-if="user.follow > 0">{{ user.follow > 99 ? '99+' : user.follow }}</view>
 				</view>
 				<view class="s_item" @click="go('/pages/visit/index')">
 					<text class="icon ic" style="color: #03a9f4">&#xe685;</text>
@@ -167,6 +169,11 @@ export default {
 			height: 60px;
 			border-radius: 50%;
 		}
+		.head {
+			width: 40px;
+			height: 60px;
+			border-radius: 3px;
+		}
 		.con {
 			float: left;
 			padding-left: 15px;

+ 5 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/api/Api_HomeController.java

@@ -3,6 +3,7 @@ package com.ruoyi.web.work.api;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.web.work.service.IKnowledgeService;
+import com.ruoyi.web.work.service.INoticeService;
 import com.ruoyi.web.work.service.IUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -22,6 +23,9 @@ public class Api_HomeController extends BaseController {
     private IKnowledgeService knowledgeService;
 
     @Autowired
+    private INoticeService noticeService;
+
+    @Autowired
     IUserService userService;
 
     @GetMapping("/index")
@@ -29,6 +33,7 @@ public class Api_HomeController extends BaseController {
         AjaxResult result = new AjaxResult();
         result.put("knowledgeList", knowledgeService.indexList());
         result.put("expertList", userService.selectExpert());
+        result.put("noticeList", noticeService.indexList());
         return AjaxResult.success(result);
     }
 

+ 42 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/api/Api_NoticeController.java

@@ -0,0 +1,42 @@
+package com.ruoyi.web.work.api;
+
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.web.work.domain.Notice;
+import com.ruoyi.web.work.domain.vo.NoticeVoList;
+import com.ruoyi.web.work.service.INoticeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 通知公告
+ *
+ * @author lsw
+ * @date 2024-08-20
+ */
+@RestController
+@RequestMapping("/app/notice")
+public class Api_NoticeController extends BaseController {
+    @Autowired
+    private INoticeService noticeService;
+
+    @GetMapping("/list")
+    public TableDataInfo list(Notice notice) {
+        notice.setState(0);
+        startPage();
+        List<NoticeVoList> list = noticeService.selectList(notice);
+        return getDataTable(list);
+    }
+
+    @GetMapping(value = "/detail/{id}")
+    public AjaxResult detail(@PathVariable("id") Long id) {
+        return AjaxResult.success(noticeService.getById(id));
+    }
+
+}

+ 1 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/api/config/InterceptorConfig.java

@@ -22,6 +22,7 @@ public class InterceptorConfig implements WebMvcConfigurer {
         registration.addPathPatterns("/app/**");
         registration.excludePathPatterns("/app/user/login"); //排除
         registration.excludePathPatterns("/app/home/**"); //排除
+        registration.excludePathPatterns("/app/notice/**"); //排除
         registration.excludePathPatterns("/app/knowledge/**"); //排除
         registration.excludePathPatterns("/app/doctor/**"); //排除
         registration.excludePathPatterns("/app/department/**"); //排除

+ 63 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/NoticeController.java

@@ -0,0 +1,63 @@
+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.Notice;
+import com.ruoyi.web.work.domain.vo.NoticeVoList;
+import com.ruoyi.web.work.service.INoticeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 通知公告
+ * @author lsw
+ * @date 2024-08-20
+ */
+@RestController
+@RequestMapping("/work/notice")
+public class NoticeController extends BaseController {
+    @Autowired
+    private INoticeService noticeService;
+
+    @PreAuthorize("@ss.hasPermi('work:notice:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(Notice notice){
+        startPage();
+        List<NoticeVoList> list = noticeService.selectList(notice);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:notice:query')")
+    @GetMapping(value = "/detail/{id}")
+    public AjaxResult detail(@PathVariable("id") Long id){
+        return AjaxResult.success(noticeService.getById(id));
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:notice:add')")
+    @Log(title = "通知公告", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@RequestBody Notice notice){
+        return toAjax(noticeService.save(notice));
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:notice:edit')")
+    @Log(title = "通知公告", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    public AjaxResult edit(@RequestBody Notice notice){
+        return toAjax(noticeService.updateById(notice));
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:notice:remove')")
+    @Log(title = "通知公告", businessType = BusinessType.DELETE)
+    @GetMapping("/remove/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids){
+        return toAjax(noticeService.removeByIds(Arrays.asList(ids)));
+    }
+}

+ 50 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/Notice.java

@@ -0,0 +1,50 @@
+package com.ruoyi.web.work.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.experimental.Accessors;
+/**
+ * @author lsw
+ * @date 2024-08-20
+ */
+@Data
+@TableName(value = "tb_notice")
+@Accessors(chain = true)
+public class Notice{
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    @ApiModelProperty(value = "标题")
+    private String title;
+
+    @ApiModelProperty(value = "内容")
+    private String contents;
+
+    @ApiModelProperty(value = "是否置顶:1=是,0=否")
+    private Integer top;
+
+    @ApiModelProperty(value = "状态:1=正常,0=停用")
+    private Integer state;
+
+    @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;
+
+
+}

+ 32 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/vo/NoticeVoList.java

@@ -0,0 +1,32 @@
+package com.ruoyi.web.work.domain.vo;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+
+/**
+ * @author lsw
+ * @date 2024-08-20
+ */
+@Data
+@Accessors(chain = true)
+public class NoticeVoList {
+
+    private Long id;
+
+    @ApiModelProperty(value = "标题")
+    private String title;
+
+    @ApiModelProperty(value = "是否置顶:1=是,0=否")
+    private Integer top;
+
+    @TableField(fill = FieldFill.INSERT)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+}

+ 17 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/NoticeMapper.java

@@ -0,0 +1,17 @@
+package com.ruoyi.web.work.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.web.work.domain.Notice;
+import com.ruoyi.web.work.domain.vo.NoticeVoList;
+
+import java.util.List;
+
+/**
+ * @author lsw
+ * @date 2024-08-20
+ */
+public interface NoticeMapper extends BaseMapper<Notice> {
+    List<NoticeVoList> selectList(Notice notice);
+
+    List<Notice> indexList();
+}

+ 0 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IKnowledgeService.java

@@ -18,11 +18,5 @@ public interface IKnowledgeService extends IService<Knowledge> {
 
     List<KnowledgeVoList> selectAppList(Knowledge knowledge);
 
-    /**
-     * 知识详情
-     *
-     * @param id
-     * @return
-     */
     AjaxResult detail(Long id);
 }

+ 17 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/INoticeService.java

@@ -0,0 +1,17 @@
+package com.ruoyi.web.work.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.web.work.domain.Notice;
+import com.ruoyi.web.work.domain.vo.NoticeVoList;
+
+import java.util.List;
+
+/**
+ * @author lsw
+ * @date 2024-08-20
+ */
+public interface INoticeService extends IService<Notice>{
+    List<NoticeVoList> selectList(Notice notice);
+
+    List<Notice> indexList();
+}

+ 31 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/NoticeServiceImpl.java

@@ -0,0 +1,31 @@
+package com.ruoyi.web.work.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.web.work.domain.Notice;
+import com.ruoyi.web.work.domain.vo.NoticeVoList;
+import com.ruoyi.web.work.mapper.NoticeMapper;
+import com.ruoyi.web.work.service.INoticeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author lsw
+ * @date 2024-08-20
+ */
+@Service
+public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> implements INoticeService {
+    @Autowired
+    private NoticeMapper noticeMapper;
+
+    @Override
+    public List<NoticeVoList> selectList(Notice notice) {
+        return noticeMapper.selectList(notice);
+    }
+
+    @Override
+    public List<Notice> indexList() {
+        return noticeMapper.indexList();
+    }
+}

+ 6 - 1
ruoyi-admin/src/main/resources/mapper/work/KnowledgeMapper.xml

@@ -6,7 +6,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <select id="selectList" resultType="com.ruoyi.web.work.domain.Knowledge">
         SELECT
-        k.*,
+        k.id,
+        k.title,
+        k.type,
+        k.create_time,
+        k.create_by,
+        k.state,
         d.dept_name AS deptName
         FROM
         tb_knowledge k

+ 20 - 0
ruoyi-admin/src/main/resources/mapper/work/NoticeMapper.xml

@@ -0,0 +1,20 @@
+<?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.NoticeMapper">
+    
+    <select id="selectList" resultType="com.ruoyi.web.work.domain.Notice">
+        select id,title,top,state,create_time,create_by from tb_notice
+        <where>
+            <if test="title != null  and title != ''"> and title like concat('%', #{title}, '%')</if>
+            <if test="top != null "> and top = #{top}</if>
+            <if test="state != null "> and state = #{state}</if>
+        </where>
+    </select>
+
+    <select id="indexList" resultType="com.ruoyi.web.work.domain.vo.NoticeVoList">
+        SELECT id,top,title,create_time FROM tb_notice WHERE state=0 ORDER BY top DESC,id DESC LIMIT 5
+    </select>
+
+</mapper>

+ 4 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java

@@ -67,6 +67,10 @@ public class SysUser extends BaseEntity {
 
     private String password;
 
+    private Integer shows;
+
+    private Integer views;
+
     @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
     private String status;
 

+ 4 - 1
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -12,6 +12,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="email"        column="email"        />
         <result property="phonenumber"  column="phonenumber"  />
         <result property="sex"          column="sex"          />
+		<result property="shows"        column="shows"       />
+		<result property="views"        column="views"       />
+		<result property="sex"          column="sex"          />
         <result property="avatar"       column="avatar"       />
         <result property="password"     column="password"     />
         <result property="status"       column="status"       />
@@ -48,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 	
 	<sql id="selectUserVo">
-        select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.introduce,
+        select u.user_id,u.views,u.shows, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.introduce,
         d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
         r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
         from sys_user u