feat: add dynamic nursing news/information management
- Backend: create RlzNursingArticle CRUD (entity, mapper, service, controller) - Backend: replace hardcoded data in getAppIndexInfo with DB query - Admin UI: add nursing article management page under 系统管理 - Android: fetch nursing info from API instead of hardcoded data - SQL: create rlz_nursing_article table with menu and permissions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,8 @@ package com.ruilaizi.service.main.find.entity;
|
||||
|
||||
public class homeListBean {
|
||||
private String pic;
|
||||
private String content;
|
||||
private String url;
|
||||
|
||||
public String getPic() {
|
||||
return pic;
|
||||
@@ -19,5 +21,11 @@ public class homeListBean {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
private String content;
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ruilaizi.service.main.kehu.Bean;
|
||||
|
||||
|
||||
import com.ruilaizi.service.base.BaseModel;
|
||||
import com.ruilaizi.service.main.find.entity.homeListBean;
|
||||
import com.ruilaizi.service.main.my.entity.receiveOrderListBean;
|
||||
|
||||
import java.util.List;
|
||||
@@ -34,6 +35,14 @@ public class robCustomerInfoBean extends BaseModel {
|
||||
|
||||
String attestation; //认证状态 0 未认证 1认证通过 2审核中 3审核失败
|
||||
|
||||
List<homeListBean> nursingInfoList;
|
||||
|
||||
public List<homeListBean> getNursingInfoList() {
|
||||
return nursingInfoList;
|
||||
}
|
||||
|
||||
public void setNursingInfoList(List<homeListBean> nursingInfoList) {
|
||||
this.nursingInfoList = nursingInfoList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,10 @@ import com.lzy.okgo.model.Response;
|
||||
import com.lzy.okrx2.adapter.ObservableResponse;
|
||||
import com.ruilaizi.service.R;
|
||||
import com.ruilaizi.service.base.BaseFragment;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruilaizi.service.main.find.entity.homeListBean;
|
||||
import com.ruilaizi.service.main.kehu.Bean.robCustomerInfoBean;
|
||||
import com.ruilaizi.service.main.kehu.adapter.MenuAdapter;
|
||||
import com.ruilaizi.service.main.my.entity.appUserInfoBean;
|
||||
@@ -31,6 +35,7 @@ import com.ruilaizi.service.okgonet.HttpConstants;
|
||||
import com.ruilaizi.service.utils.JsonUtils;
|
||||
import com.ruilaizi.service.utils.checkVersionsUtils.ProfileSpUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
@@ -68,6 +73,7 @@ public class HomeFragment extends BaseFragment {
|
||||
if(ProfileSpUtils.getInstance().isLogin()) {
|
||||
getAppUserInfo();
|
||||
}
|
||||
initNursingInfo();
|
||||
return mContentView;
|
||||
}
|
||||
|
||||
@@ -133,6 +139,56 @@ public class HomeFragment extends BaseFragment {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取护理资讯
|
||||
*/
|
||||
private void initNursingInfo() {
|
||||
OkGo.<String>get(HttpConstants.URi_system_getAppIndexInfo)
|
||||
.converter(new StringConvert())
|
||||
.cacheMode(CacheMode.NO_CACHE)
|
||||
.adapt(new ObservableResponse<String>())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new io.reactivex.Observer<Response<String>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull Response<String> response) {
|
||||
String body = (String) response.body();
|
||||
Log.e("护理资讯", body);
|
||||
JSONObject json = JSON.parseObject(body);
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
if (data != null) {
|
||||
JSONArray realTimeInfoList = data.getJSONArray("realTimeInfoList");
|
||||
if (realTimeInfoList != null) {
|
||||
List<homeListBean> list = new ArrayList<>();
|
||||
for (int i = 0; i < realTimeInfoList.size(); i++) {
|
||||
JSONObject item = realTimeInfoList.getJSONObject(i);
|
||||
homeListBean bean = new homeListBean();
|
||||
bean.setContent(item.getString("title"));
|
||||
bean.setPic(item.getString("realTimeInfoImage"));
|
||||
bean.setUrl(item.getString("realTimeInfoUrl"));
|
||||
list.add(bean);
|
||||
}
|
||||
robCustomerInfoBean.setNursingInfoList(list);
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*获取个人信息(查看认证状态)
|
||||
*/
|
||||
|
||||
@@ -45,23 +45,11 @@ public class ViewHolderFive extends AbstractViewTypeHolder {
|
||||
//护理资讯
|
||||
LinearLayoutManager manager = new LinearLayoutManager(mContext);
|
||||
style_recyleview.setLayoutManager(manager);
|
||||
List<homeListBean> data = new ArrayList<>();
|
||||
homeListBean homeListBean = new homeListBean();
|
||||
homeListBean.setContent("病室适宜的温度、湿度应保持在多少?");
|
||||
homeListBean.setPic("111");
|
||||
data.add(homeListBean);
|
||||
homeListBean homeListBeann = new homeListBean();
|
||||
homeListBeann.setContent("人人关注肾健康——吾爱吾肾、知识强肾");
|
||||
homeListBeann.setPic("222");
|
||||
data.add(homeListBeann);
|
||||
homeListBean homeListBeannn = new homeListBean();
|
||||
homeListBeannn.setContent("人人关注肾健康——吾爱吾肾、知识强肾");
|
||||
homeListBeannn.setPic("222");
|
||||
data.add(homeListBeannn);
|
||||
homeListBean homeListBeannnn = new homeListBean();
|
||||
homeListBeannnn.setContent("人人关注肾健康——吾爱吾肾、知识强肾");
|
||||
homeListBeannnn.setPic("222");
|
||||
data.add(homeListBeannnn);
|
||||
List<homeListBean> data = dataBean.getNursingInfoList();
|
||||
if (data == null) {
|
||||
data = new ArrayList<>();
|
||||
}
|
||||
final List<homeListBean> finalData = data;
|
||||
style_recyleview.setAdapter(new BaseQuickAdapter<homeListBean, BaseViewHolder>(R.layout.home_list_item, data) {
|
||||
@Override
|
||||
protected void convert(final BaseViewHolder helper, final homeListBean item) {
|
||||
@@ -76,7 +64,12 @@ public class ViewHolderFive extends AbstractViewTypeHolder {
|
||||
mContext.startActivity(intent);
|
||||
return;
|
||||
}
|
||||
XfiveWebActivity.runActivity(mContext, "了解陪护", "file:///android_asset/privacy.html");
|
||||
String url = item.getUrl();
|
||||
if (url != null && !url.isEmpty()) {
|
||||
XfiveWebActivity.runActivity(mContext, "了解陪护", url);
|
||||
} else {
|
||||
XfiveWebActivity.runActivity(mContext, "了解陪护", "file:///android_asset/privacy.html");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -31,6 +31,11 @@ public class HttpConstants {
|
||||
*/
|
||||
public static String URi_system_getAppUserInfo = URiBase + "/system/user/getAppUserInfo";
|
||||
|
||||
/**
|
||||
* 首页护理资讯
|
||||
*/
|
||||
public static String URi_system_getAppIndexInfo = URiBase + "/system/user/getAppIndexInfo";
|
||||
|
||||
/**
|
||||
* 上传图片
|
||||
*/
|
||||
|
||||
44
rlz-ui/src/api/system/nursing.js
Normal file
44
rlz-ui/src/api/system/nursing.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询护理资讯列表
|
||||
export function listNursing(query) {
|
||||
return request({
|
||||
url: '/system/nursing/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询护理资讯详细
|
||||
export function getNursing(id) {
|
||||
return request({
|
||||
url: '/system/nursing/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增护理资讯
|
||||
export function addNursing(data) {
|
||||
return request({
|
||||
url: '/system/nursing',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改护理资讯
|
||||
export function updateNursing(data) {
|
||||
return request({
|
||||
url: '/system/nursing',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除护理资讯
|
||||
export function delNursing(id) {
|
||||
return request({
|
||||
url: '/system/nursing/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
278
rlz-ui/src/views/system/nursing/index.vue
Normal file
278
rlz-ui/src/views/system/nursing/index.vue
Normal file
@@ -0,0 +1,278 @@
|
||||
<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="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
placeholder="请输入标题"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
||||
<el-option label="发布" value="0" />
|
||||
<el-option label="隐藏" value="1" />
|
||||
</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-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:nursing: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:nursing: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:nursing: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:nursing:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="nursingList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="排序" align="center" prop="sortOrder" width="60" />
|
||||
<el-table-column label="标题" align="center" prop="title" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="封面图片" align="center" prop="imageUrl" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-image v-if="scope.row.imageUrl" :src="scope.row.imageUrl" style="width:50px;height:50px;" fit="cover" />
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="文章链接" align="center" prop="articleUrl" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="状态" align="center" prop="status" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.status == '0' ? 'success' : 'danger'" size="small">
|
||||
{{ scope.row.status == '0' ? '发布' : '隐藏' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:nursing:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:nursing: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="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入标题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="封面图片" prop="imageUrl">
|
||||
<el-input v-model="form.imageUrl" placeholder="请输入图片URL地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文章链接" prop="articleUrl">
|
||||
<el-input v-model="form.articleUrl" placeholder="请输入文章链接URL地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sortOrder">
|
||||
<el-input-number v-model="form.sortOrder" :min="0" style="width: 100%" placeholder="请输入排序号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio label="0">发布</el-radio>
|
||||
<el-radio label="1">隐藏</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" :rows="2" 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 { listNursing, getNursing, delNursing, addNursing, updateNursing } from "@/api/system/nursing";
|
||||
|
||||
export default {
|
||||
name: "Nursing",
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
nursingList: [],
|
||||
title: "",
|
||||
open: false,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
title: null,
|
||||
status: null,
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
title: [
|
||||
{ required: true, message: "标题不能为空", trigger: "blur" }
|
||||
],
|
||||
imageUrl: [
|
||||
{ required: true, message: "封面图片不能为空", trigger: "blur" }
|
||||
],
|
||||
articleUrl: [
|
||||
{ required: true, message: "文章链接不能为空", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "请选择状态", trigger: "change" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listNursing(this.queryParams).then(response => {
|
||||
this.nursingList = response.data;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
title: null,
|
||||
imageUrl: null,
|
||||
articleUrl: null,
|
||||
sortOrder: 0,
|
||||
status: '0',
|
||||
remark: 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
|
||||
getNursing(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) {
|
||||
updateNursing(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addNursing(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids.join(',');
|
||||
this.$modal.confirm('是否确认删除该护理资讯?').then(function() {
|
||||
return delNursing(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleExport() {
|
||||
this.download('system/nursing/export', {
|
||||
...this.queryParams
|
||||
}, `nursing_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -12,7 +12,9 @@ import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.system.domain.SysUserRenzheng;
|
||||
import com.ruoyi.system.service.ISysUserRenzhengService;
|
||||
import com.ruoyi.system.domain.RlzNursingArticle;
|
||||
import com.ruoyi.system.service.IRlzOrderService;
|
||||
import com.ruoyi.system.service.IRlzNursingArticleService;
|
||||
import com.ruoyi.web.controller.tool.Rijndael;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -63,6 +65,8 @@ public class SysUserController extends BaseController
|
||||
private ISysUserRenzhengService sysUserRenzhengService;
|
||||
@Autowired
|
||||
private IRlzOrderService rlzOrderService;
|
||||
@Autowired
|
||||
private IRlzNursingArticleService rlzNursingArticleService;
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
@@ -377,21 +381,16 @@ public class SysUserController extends BaseController
|
||||
JSONObject data=new JSONObject();
|
||||
JSONObject receiveOrder=new JSONObject();//新消息, 新订单是orderId和orderCreteTime,服务中 name,phonenumber,headimage
|
||||
JSONArray realTimeInfoList= new JSONArray(); //护理咨询
|
||||
JSONObject realTimeInfo1=new JSONObject();
|
||||
realTimeInfo1.put("title","陪诊是一门运用科学,分为家庭护理和有偿护理。");//标题
|
||||
realTimeInfo1.put("realTimeInfoUrl","http://ruilaizipj.com/ljpz.html");//地址
|
||||
realTimeInfo1.put("realTimeInfoImage","/profile/avatar/2022/07/08/blob_20220708142648A004.jpeg");//护理咨询图片
|
||||
JSONObject realTimeInfo2=new JSONObject();
|
||||
realTimeInfo2.put("title","自有人类以来就有护理,护理是人们谋求生存的本能和需要。");//标题
|
||||
realTimeInfo2.put("realTimeInfoUrl","http://ruilaizipj.com/ljpz.html");//地址
|
||||
realTimeInfo2.put("realTimeInfoImage","/profile/avatar/2022/07/08/blob_20220708142648A004.jpeg");//护理咨询图片
|
||||
JSONObject realTimeInfo3=new JSONObject();
|
||||
realTimeInfo3.put("title","医护为一体是古代护理的特点之一,19世纪之前,世界各国都没有护理专业。");//标题
|
||||
realTimeInfo3.put("realTimeInfoUrl","http://ruilaizipj.com/ljpz.html");//地址
|
||||
realTimeInfo3.put("realTimeInfoImage","/dev-api/profile/avatar/2022/07/08/blob_20220708142648A004.jpeg");//护理咨询图片
|
||||
realTimeInfoList.add(realTimeInfo1);
|
||||
realTimeInfoList.add(realTimeInfo2);
|
||||
realTimeInfoList.add(realTimeInfo3);
|
||||
List<RlzNursingArticle> articles = rlzNursingArticleService.selectPublishedList();
|
||||
if (articles != null) {
|
||||
for (RlzNursingArticle article : articles) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("title", article.getTitle());
|
||||
item.put("realTimeInfoUrl", article.getArticleUrl());
|
||||
item.put("realTimeInfoImage", article.getImageUrl());
|
||||
realTimeInfoList.add(item);
|
||||
}
|
||||
}
|
||||
data.put("monthOrderCount",21);//本月接单数量
|
||||
data.put("liaojiepeizhen","http://ruilaizipj.com/ljpz.html");//了解陪诊
|
||||
data.put("fuwubiaozhun","http://ruilaizipj.com/fwbz.html");//服务标准
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
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.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.RlzNursingArticle;
|
||||
import com.ruoyi.system.service.IRlzNursingArticleService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 护理资讯Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-05-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/nursing")
|
||||
public class RlzNursingArticleController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRlzNursingArticleService rlzNursingArticleService;
|
||||
|
||||
/**
|
||||
* 查询护理资讯列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:nursing:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RlzNursingArticle rlzNursingArticle)
|
||||
{
|
||||
startPage();
|
||||
List<RlzNursingArticle> list = rlzNursingArticleService.selectRlzNursingArticleList(rlzNursingArticle);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出护理资讯列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:nursing:export')")
|
||||
@Log(title = "护理资讯", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RlzNursingArticle rlzNursingArticle)
|
||||
{
|
||||
List<RlzNursingArticle> list = rlzNursingArticleService.selectRlzNursingArticleList(rlzNursingArticle);
|
||||
ExcelUtil<RlzNursingArticle> util = new ExcelUtil<RlzNursingArticle>(RlzNursingArticle.class);
|
||||
util.exportExcel(response, list, "护理资讯数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取护理资讯详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:nursing:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(rlzNursingArticleService.selectRlzNursingArticleById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增护理资讯
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:nursing:add')")
|
||||
@Log(title = "护理资讯", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RlzNursingArticle rlzNursingArticle)
|
||||
{
|
||||
return toAjax(rlzNursingArticleService.insertRlzNursingArticle(rlzNursingArticle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改护理资讯
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:nursing:edit')")
|
||||
@Log(title = "护理资讯", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RlzNursingArticle rlzNursingArticle)
|
||||
{
|
||||
return toAjax(rlzNursingArticleService.updateRlzNursingArticle(rlzNursingArticle));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除护理资讯
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:nursing:remove')")
|
||||
@Log(title = "护理资讯", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rlzNursingArticleService.deleteRlzNursingArticleByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 护理资讯对象 rlz_nursing_article
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-05-22
|
||||
*/
|
||||
public class RlzNursingArticle extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 标题 */
|
||||
@Excel(name = "标题")
|
||||
private String title;
|
||||
|
||||
/** 封面图片URL */
|
||||
@Excel(name = "封面图片")
|
||||
private String imageUrl;
|
||||
|
||||
/** 文章链接URL */
|
||||
@Excel(name = "文章链接")
|
||||
private String articleUrl;
|
||||
|
||||
/** 排序 */
|
||||
private Integer sortOrder;
|
||||
|
||||
/** 状态: 0=发布 1=隐藏 */
|
||||
@Excel(name = "状态", readConverterExp = "0=发布,1=隐藏")
|
||||
private String status;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setTitle(String title)
|
||||
{
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setImageUrl(String imageUrl)
|
||||
{
|
||||
this.imageUrl = imageUrl;
|
||||
}
|
||||
|
||||
public String getImageUrl()
|
||||
{
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
public void setArticleUrl(String articleUrl)
|
||||
{
|
||||
this.articleUrl = articleUrl;
|
||||
}
|
||||
|
||||
public String getArticleUrl()
|
||||
{
|
||||
return articleUrl;
|
||||
}
|
||||
|
||||
public void setSortOrder(Integer sortOrder)
|
||||
{
|
||||
this.sortOrder = sortOrder;
|
||||
}
|
||||
|
||||
public Integer getSortOrder()
|
||||
{
|
||||
return sortOrder;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("title", getTitle())
|
||||
.append("imageUrl", getImageUrl())
|
||||
.append("articleUrl", getArticleUrl())
|
||||
.append("sortOrder", getSortOrder())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.RlzNursingArticle;
|
||||
|
||||
/**
|
||||
* 护理资讯Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-05-22
|
||||
*/
|
||||
public interface RlzNursingArticleMapper
|
||||
{
|
||||
public RlzNursingArticle selectRlzNursingArticleById(Long id);
|
||||
|
||||
public List<RlzNursingArticle> selectRlzNursingArticleList(RlzNursingArticle rlzNursingArticle);
|
||||
|
||||
public List<RlzNursingArticle> selectPublishedList();
|
||||
|
||||
public int insertRlzNursingArticle(RlzNursingArticle rlzNursingArticle);
|
||||
|
||||
public int updateRlzNursingArticle(RlzNursingArticle rlzNursingArticle);
|
||||
|
||||
public int deleteRlzNursingArticleById(Long id);
|
||||
|
||||
public int deleteRlzNursingArticleByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.RlzNursingArticle;
|
||||
|
||||
/**
|
||||
* 护理资讯Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-05-22
|
||||
*/
|
||||
public interface IRlzNursingArticleService
|
||||
{
|
||||
public RlzNursingArticle selectRlzNursingArticleById(Long id);
|
||||
|
||||
public List<RlzNursingArticle> selectRlzNursingArticleList(RlzNursingArticle rlzNursingArticle);
|
||||
|
||||
public List<RlzNursingArticle> selectPublishedList();
|
||||
|
||||
public int insertRlzNursingArticle(RlzNursingArticle rlzNursingArticle);
|
||||
|
||||
public int updateRlzNursingArticle(RlzNursingArticle rlzNursingArticle);
|
||||
|
||||
public int deleteRlzNursingArticleByIds(Long[] ids);
|
||||
|
||||
public int deleteRlzNursingArticleById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.RlzNursingArticleMapper;
|
||||
import com.ruoyi.system.domain.RlzNursingArticle;
|
||||
import com.ruoyi.system.service.IRlzNursingArticleService;
|
||||
|
||||
/**
|
||||
* 护理资讯Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-05-22
|
||||
*/
|
||||
@Service
|
||||
public class RlzNursingArticleServiceImpl implements IRlzNursingArticleService
|
||||
{
|
||||
@Autowired
|
||||
private RlzNursingArticleMapper rlzNursingArticleMapper;
|
||||
|
||||
@Override
|
||||
public RlzNursingArticle selectRlzNursingArticleById(Long id)
|
||||
{
|
||||
return rlzNursingArticleMapper.selectRlzNursingArticleById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RlzNursingArticle> selectRlzNursingArticleList(RlzNursingArticle rlzNursingArticle)
|
||||
{
|
||||
return rlzNursingArticleMapper.selectRlzNursingArticleList(rlzNursingArticle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RlzNursingArticle> selectPublishedList()
|
||||
{
|
||||
return rlzNursingArticleMapper.selectPublishedList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertRlzNursingArticle(RlzNursingArticle rlzNursingArticle)
|
||||
{
|
||||
rlzNursingArticle.setCreateTime(DateUtils.getNowDate());
|
||||
return rlzNursingArticleMapper.insertRlzNursingArticle(rlzNursingArticle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateRlzNursingArticle(RlzNursingArticle rlzNursingArticle)
|
||||
{
|
||||
rlzNursingArticle.setUpdateTime(DateUtils.getNowDate());
|
||||
return rlzNursingArticleMapper.updateRlzNursingArticle(rlzNursingArticle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteRlzNursingArticleByIds(Long[] ids)
|
||||
{
|
||||
return rlzNursingArticleMapper.deleteRlzNursingArticleByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteRlzNursingArticleById(Long id)
|
||||
{
|
||||
return rlzNursingArticleMapper.deleteRlzNursingArticleById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
<?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.system.mapper.RlzNursingArticleMapper">
|
||||
|
||||
<resultMap type="RlzNursingArticle" id="RlzNursingArticleResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="title" column="title" />
|
||||
<result property="imageUrl" column="image_url" />
|
||||
<result property="articleUrl" column="article_url" />
|
||||
<result property="sortOrder" column="sort_order" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRlzNursingArticleVo">
|
||||
select id, title, image_url, article_url, sort_order, status,
|
||||
create_by, create_time, update_by, update_time, remark
|
||||
from rlz_nursing_article
|
||||
</sql>
|
||||
|
||||
<select id="selectRlzNursingArticleList" parameterType="RlzNursingArticle" resultMap="RlzNursingArticleResult">
|
||||
<include refid="selectRlzNursingArticleVo"/>
|
||||
<where>
|
||||
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
order by sort_order asc
|
||||
</select>
|
||||
|
||||
<select id="selectPublishedList" resultMap="RlzNursingArticleResult">
|
||||
<include refid="selectRlzNursingArticleVo"/>
|
||||
where status = '0'
|
||||
order by sort_order asc
|
||||
</select>
|
||||
|
||||
<select id="selectRlzNursingArticleById" parameterType="Long" resultMap="RlzNursingArticleResult">
|
||||
<include refid="selectRlzNursingArticleVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRlzNursingArticle" parameterType="RlzNursingArticle" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rlz_nursing_article
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="title != null">title,</if>
|
||||
<if test="imageUrl != null">image_url,</if>
|
||||
<if test="articleUrl != null">article_url,</if>
|
||||
<if test="sortOrder != null">sort_order,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="title != null">#{title},</if>
|
||||
<if test="imageUrl != null">#{imageUrl},</if>
|
||||
<if test="articleUrl != null">#{articleUrl},</if>
|
||||
<if test="sortOrder != null">#{sortOrder},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRlzNursingArticle" parameterType="RlzNursingArticle">
|
||||
update rlz_nursing_article
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="title != null">title = #{title},</if>
|
||||
<if test="imageUrl != null">image_url = #{imageUrl},</if>
|
||||
<if test="articleUrl != null">article_url = #{articleUrl},</if>
|
||||
<if test="sortOrder != null">sort_order = #{sortOrder},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRlzNursingArticleById" parameterType="Long">
|
||||
delete from rlz_nursing_article where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRlzNursingArticleByIds" parameterType="String">
|
||||
delete from rlz_nursing_article where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
69
rlz/sql/nursing_article.sql
Normal file
69
rlz/sql/nursing_article.sql
Normal file
@@ -0,0 +1,69 @@
|
||||
-- 护理资讯表
|
||||
DROP TABLE IF EXISTS rlz_nursing_article;
|
||||
CREATE TABLE rlz_nursing_article (
|
||||
id BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
title VARCHAR(200) DEFAULT NULL COMMENT '标题',
|
||||
image_url VARCHAR(500) DEFAULT NULL COMMENT '封面图片URL',
|
||||
article_url VARCHAR(500) DEFAULT NULL COMMENT '文章链接URL',
|
||||
sort_order INT(4) DEFAULT 0 COMMENT '排序',
|
||||
status CHAR(1) DEFAULT '0' COMMENT '状态: 0=发布 1=隐藏',
|
||||
create_by VARCHAR(64) DEFAULT '' COMMENT '创建者',
|
||||
create_time DATETIME COMMENT '创建时间',
|
||||
update_by VARCHAR(64) DEFAULT '' COMMENT '更新者',
|
||||
update_time DATETIME COMMENT '更新时间',
|
||||
remark VARCHAR(500) DEFAULT NULL COMMENT '备注',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE=InnoDB COMMENT='护理资讯表';
|
||||
|
||||
-- 插入默认示例数据
|
||||
INSERT INTO rlz_nursing_article (title, image_url, article_url, sort_order, status, create_by, create_time) VALUES
|
||||
('陪诊是一门运用科学,分为家庭护理和有偿护理。', '/profile/avatar/2022/07/08/blob_20220708142648A004.jpeg', 'http://ruilaizipj.com/ljpz.html', 1, '0', 'admin', NOW()),
|
||||
('自有人类以来就有护理,护理是人们谋求生存的本能和需要。', '/profile/avatar/2022/07/08/blob_20220708142648A004.jpeg', 'http://ruilaizipj.com/ljpz.html', 2, '0', 'admin', NOW()),
|
||||
('医护为一体是古代护理的特点之一,19世纪之前,世界各国都没有护理专业。', '/profile/avatar/2022/07/08/blob_20220708142648A004.jpeg', 'http://ruilaizipj.com/ljpz.html', 3, '0', 'admin', NOW());
|
||||
|
||||
-- 插入菜单: 护理资讯 (父级: 系统管理, parent_id 需要根据实际系统管理菜单ID调整)
|
||||
-- 假设"系统管理"菜单ID为1,如果没有则通过子查询获取
|
||||
SET @parent_id = (SELECT menu_id FROM sys_menu WHERE menu_name = '系统管理' AND parent_id = 0 LIMIT 1);
|
||||
|
||||
INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
|
||||
SELECT '护理资讯', IFNULL(@parent_id, 1), 6, 'nursing', 'system/nursing/index', NULL, NULL, 1, 0, 'C', '0', '0', 'system:nursing:list', 'education', 'admin', NOW()
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_name = '护理资讯' AND parent_id = IFNULL(@parent_id, 1));
|
||||
|
||||
-- 插入按钮权限: 查询/新增/修改/删除/导出
|
||||
SET @nursing_menu_id = (SELECT menu_id FROM sys_menu WHERE menu_name = '护理资讯' AND parent_id = IFNULL(@parent_id, 1) LIMIT 1);
|
||||
|
||||
INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
|
||||
SELECT '护理资讯查询', @nursing_menu_id, 1, '#', NULL, 1, 0, 'F', '0', '0', 'system:nursing:query', '#', 'admin', NOW()
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE perms = 'system:nursing:query')
|
||||
AND @nursing_menu_id IS NOT NULL;
|
||||
|
||||
INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
|
||||
SELECT '护理资讯新增', @nursing_menu_id, 2, '#', NULL, 1, 0, 'F', '0', '0', 'system:nursing:add', '#', 'admin', NOW()
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE perms = 'system:nursing:add')
|
||||
AND @nursing_menu_id IS NOT NULL;
|
||||
|
||||
INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
|
||||
SELECT '护理资讯修改', @nursing_menu_id, 3, '#', NULL, 1, 0, 'F', '0', '0', 'system:nursing:edit', '#', 'admin', NOW()
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE perms = 'system:nursing:edit')
|
||||
AND @nursing_menu_id IS NOT NULL;
|
||||
|
||||
INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
|
||||
SELECT '护理资讯删除', @nursing_menu_id, 4, '#', NULL, 1, 0, 'F', '0', '0', 'system:nursing:remove', '#', 'admin', NOW()
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE perms = 'system:nursing:remove')
|
||||
AND @nursing_menu_id IS NOT NULL;
|
||||
|
||||
INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
|
||||
SELECT '护理资讯导出', @nursing_menu_id, 5, '#', NULL, 1, 0, 'F', '0', '0', 'system:nursing:export', '#', 'admin', NOW()
|
||||
FROM DUAL
|
||||
WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE perms = 'system:nursing:export')
|
||||
AND @nursing_menu_id IS NOT NULL;
|
||||
|
||||
-- 给超级管理员角色(role_id=1)分配权限
|
||||
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||
SELECT 1, menu_id FROM sys_menu WHERE perms LIKE 'system:nursing:%'
|
||||
AND menu_id NOT IN (SELECT menu_id FROM sys_role_menu WHERE role_id = 1);
|
||||
Reference in New Issue
Block a user