Commit c8bfc69f authored by 王晓旭's avatar 王晓旭
parents 1c9f8114 28757503
......@@ -3,5 +3,7 @@
-- ----------------------------
ALTER TABLE mortals_xhx_user ADD COLUMN `staffId` varchar(64) COMMENT '员工Id,关联用户员工表';
ALTER TABLE mortals_xhx_user ADD COLUMN `openId` varchar(64) COMMENT '微信openId';
ALTER TABLE mortals_xhx_user ADD COLUMN `serviceAprParams` varchar(1024) default '' COMMENT '事件服务接口请求参数';
ALTER TABLE mortals_xhx_user ADD COLUMN `customerId` bigint(20) COMMENT '客户ID';
ALTER TABLE mortals_xhx_user ADD COLUMN `shareCode` varchar(64) COMMENT '员工分享码';
\ No newline at end of file
......@@ -258,3 +258,79 @@ INSERT INTO `mortals_xhx_param` VALUES (null, '反馈类型 ', 'Feedback', 'feed
INSERT INTO `mortals_xhx_param` VALUES (null, '反馈类型 ', 'Feedback', 'feedbackType', '3', '表扬', 1, 4, 0, 'feedbackType', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '处理状态', 'Feedback', 'processStatus', '1', '未处理', 1, 4, 0, 'processStatus', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '处理状态', 'Feedback', 'processStatus', '2', '已处理', 1, 4, 0, 'processStatus', NULL, NULL, NULL);
-- ----------------------------
-- 页面信息菜单 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_menu` VALUES (null, '页面信息', '/page/list', 0,'', 1, 1, 0, 0,'',NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL);
-- ----------------------------
-- 页面信息资源路径 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_resource` VALUES (null, '页面信息-菜单管理-查看', '/page/list,/page/view,/page/info,/page/export,/page/exportExcel,/page/downloadTemplate,/page/download', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (null, '页面信息-菜单管理-维护', '/page/add,/page/edit,/page/delete,/page/logicDelete,/page/save,/page/importData', 3, 0, NULL, NULL, NULL, 0);
-- ----------------------------
-- 页面信息参数 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_param` VALUES (null, '页面类型', 'Page', 'pageType', '1', '首页', 1, 4, 0, 'pageType', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '页面类型', 'Page', 'pageType', '2', '产品详情', 1, 4, 0, 'pageType', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '页面类型', 'Page', 'pageType', '3', '文章详情', 1, 4, 0, 'pageType', NULL, NULL, NULL);
-- ----------------------------
-- 收藏页面菜单 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_menu` VALUES (null, '收藏页面', '/favorites/pages/list', 0,'', 1, 1, 0, 0,'',NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL);
-- ----------------------------
-- 收藏页面资源路径 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_resource` VALUES (null, '收藏页面-菜单管理-查看', '/favorites/pages/list,/favorites/pages/view,/favorites/pages/info,/favorites/pages/export,/favorites/pages/exportExcel,/favorites/pages/downloadTemplate,/favorites/pages/download', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (null, '收藏页面-菜单管理-维护', '/favorites/pages/add,/favorites/pages/edit,/favorites/pages/delete,/favorites/pages/logicDelete,/favorites/pages/save,/favorites/pages/importData', 3, 0, NULL, NULL, NULL, 0);
-- ----------------------------
-- 收藏页面参数 SQL
-- ----------------------------
-- ----------------------------
-- 收藏产品菜单 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_menu` VALUES (null, '收藏产品', '/favorites/product/list', 0,'', 1, 1, 0, 0,'',NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL);
-- ----------------------------
-- 收藏产品资源路径 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_resource` VALUES (null, '收藏产品-菜单管理-查看', '/favorites/product/list,/favorites/product/view,/favorites/product/info,/favorites/product/export,/favorites/product/exportExcel,/favorites/product/downloadTemplate,/favorites/product/download', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (null, '收藏产品-菜单管理-维护', '/favorites/product/add,/favorites/product/edit,/favorites/product/delete,/favorites/product/logicDelete,/favorites/product/save,/favorites/product/importData', 3, 0, NULL, NULL, NULL, 0);
-- ----------------------------
-- 收藏产品参数 SQL
-- ----------------------------
-- ----------------------------
-- 收藏新闻菜单 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_menu` VALUES (null, '收藏新闻', '/favorites/news/list', 0,'', 1, 1, 0, 0,'',NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL);
-- ----------------------------
-- 收藏新闻资源路径 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_resource` VALUES (null, '收藏新闻-菜单管理-查看', '/favorites/news/list,/favorites/news/view,/favorites/news/info,/favorites/news/export,/favorites/news/exportExcel,/favorites/news/downloadTemplate,/favorites/news/download', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (null, '收藏新闻-菜单管理-维护', '/favorites/news/add,/favorites/news/edit,/favorites/news/delete,/favorites/news/logicDelete,/favorites/news/save,/favorites/news/importData', 3, 0, NULL, NULL, NULL, 0);
-- ----------------------------
-- 收藏新闻参数 SQL
-- ----------------------------
-- ----------------------------
-- 收藏名片菜单 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_menu` VALUES (null, '收藏名片', '/favorites/businesscard/list', 0,'', 1, 1, 0, 0,'',NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL);
-- ----------------------------
-- 收藏名片资源路径 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_resource` VALUES (null, '收藏名片-菜单管理-查看', '/favorites/businesscard/list,/favorites/businesscard/view,/favorites/businesscard/info,/favorites/businesscard/export,/favorites/businesscard/exportExcel,/favorites/businesscard/downloadTemplate,/favorites/businesscard/download', 3, 0, NULL, NULL, NULL, 0);
INSERT INTO `mortals_xhx_resource` VALUES (null, '收藏名片-菜单管理-维护', '/favorites/businesscard/add,/favorites/businesscard/edit,/favorites/businesscard/delete,/favorites/businesscard/logicDelete,/favorites/businesscard/save,/favorites/businesscard/importData', 3, 0, NULL, NULL, NULL, 0);
-- ----------------------------
-- 收藏名片参数 SQL
-- ----------------------------
......@@ -338,6 +338,7 @@ CREATE TABLE mortals_xhx_news_share(
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='新闻分享记录信息';
-- ----------------------------
-- 反馈信息表
-- ----------------------------
......@@ -348,14 +349,22 @@ CREATE TABLE mortals_xhx_feedback(
`content` mediumtext COMMENT '内容',
`isShow` tinyint(2) NOT NULL DEFAULT '0' COMMENT '是否公开 (0.否,1.是)',
`feedbackName` varchar(64) NOT NULL COMMENT '反馈人姓名',
`companyName` varchar(64) NOT NULL COMMENT '单位名称',
`contactInfo` varchar(64) NOT NULL COMMENT '联系方式',
`idCard` varchar(64) NOT NULL COMMENT '身份证号',
`Address` varchar(64) NOT NULL COMMENT '地址',
`address` varchar(64) NOT NULL COMMENT '地址',
`email` varchar(64) NOT NULL COMMENT '邮箱地址',
`reply` tinyint(2) NOT NULL DEFAULT '0' COMMENT '是否回复 (0.否,1.是)',
`replyPerson` varchar(64) NOT NULL COMMENT '回复人',
`replyContent` varchar(64) NOT NULL COMMENT '回复',
`deptId` bigint(20) COMMENT '所属部门',
`deptName` varchar(128) COMMENT '所属部门名称',
`feedbackType` tinyint(2) NOT NULL DEFAULT '1' COMMENT '反馈类型 (1.建议,2.问题,3.表扬)',
`fileName` varchar(64) NOT NULL COMMENT '附件名称,多个逗号分割',
`filePath` varchar(128) COMMENT '附件地址,多个逗号分割',
`replyFileName` varchar(64) NOT NULL COMMENT '回复附件名称,多个逗号分割',
`replyFilePath` varchar(128) COMMENT '回复附件地址,多个逗号分割',
`replyTime` datetime COMMENT '回复时间',
`processId` bigint(20) COMMENT '处理人id',
`processName` varchar(64) COMMENT '处理人名称',
`processStatus` tinyint(1) DEFAULT '1' COMMENT '处理状态(1.未处理,2.已处理)',
......@@ -370,6 +379,10 @@ PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='反馈信息';
-- ----------------------------
-- 公司产品表
-- ----------------------------
......@@ -387,3 +400,88 @@ CREATE TABLE mortals_xhx_company_product(
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公司产品';
-- ----------------------------
-- 页面信息表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_page`;
CREATE TABLE mortals_xhx_page(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`pageName` varchar(64) NOT NULL COMMENT '页面名称',
`pageType` tinyint(2) COMMENT '页面类型(1.首页,2.产品详情,3.文章详情)',
`pageUrl` varchar(64) NOT NULL COMMENT '页面短链接',
`otherDetail` varchar(2048) COMMENT '可以是一个包含其他页面信息的JSON对象或单独的字段,根据页面的具体需求来设计',
`remark` varchar(255) COMMENT '备注',
`favoriteTime` datetime NOT NULL COMMENT '收藏时间',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='页面信息';
-- ----------------------------
-- 收藏页面表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_favorites_pages`;
CREATE TABLE mortals_xhx_favorites_pages(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`userId` bigint(20) NOT NULL COMMENT '用户ID,',
`pageId` bigint(20) NOT NULL COMMENT '页面ID, 关联到用户表中的ID,表示哪个用户收藏了这个页面',
`remark` varchar(255) COMMENT '备注',
`favoriteTime` datetime NOT NULL COMMENT '收藏时间',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='收藏页面';
-- ----------------------------
-- 收藏产品表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_favorites_product`;
CREATE TABLE mortals_xhx_favorites_product(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`userId` bigint(20) NOT NULL COMMENT '用户ID,',
`productId` bigint(20) NOT NULL COMMENT '产品ID, 关联到产品表中的ID,表示这是哪个产品的收藏',
`remark` varchar(255) COMMENT '备注',
`favoriteTime` datetime NOT NULL COMMENT '收藏时间',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='收藏产品';
-- ----------------------------
-- 收藏新闻表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_favorites_news`;
CREATE TABLE mortals_xhx_favorites_news(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`userId` bigint(20) NOT NULL COMMENT '用户ID,',
`newsId` bigint(20) NOT NULL COMMENT '新闻ID, 关联到新闻表中的ID,表示这是哪个新闻的收藏',
`remark` varchar(255) COMMENT '备注',
`favoriteTime` datetime NOT NULL COMMENT '收藏时间',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='收藏新闻';
-- ----------------------------
-- 收藏名片表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_favorites_businesscard`;
CREATE TABLE mortals_xhx_favorites_businesscard(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`userId` bigint(20) NOT NULL COMMENT '用户ID,',
`staffId` bigint(20) NOT NULL COMMENT '员工ID, 关联到员工表中的ID,表示这是哪个名片的收藏',
`remark` varchar(255) COMMENT '备注',
`favoriteTime` datetime NOT NULL COMMENT '收藏时间',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='收藏名片';
......@@ -58,6 +58,14 @@ const router = new Router({
...restBuilder('news/category', 'news/category'),//新闻频道分类
...restBuilder("dept", "dept"), //部门
...restBuilder('page', 'page'),//页面
...restBuilder('favorites/pages', 'favorites/pages'),//收藏页面
...restBuilder('favorites/product', 'favorites/product'),//收藏产品
...restBuilder('favorites/news', 'favorites/news'),//收藏新闻
...restBuilder('favorites/businesscard', 'favorites/businesscard'),//收藏名片
//以下为基础路由配置
builder('/', 'Home'),
builder('/home', 'Home'),
......
<template>
<!-- 弹出框表单 -->
<el-drawer
:title="title"
:visible.sync="open"
:direction="direction"
:destroy-on-close="true"
size="50%">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<Field label="用户ID," prop="userId" v-model="form.userId" placeholder="请输入用户ID,"/>
<Field label="员工ID, 关联到员工表中的ID,表示这是哪个名片的收藏" prop="staffId" v-model="form.staffId" placeholder="请输入员工ID, 关联到员工表中的ID,表示这是哪个名片的收藏"/>
<Field label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注"/>
<Field label="收藏时间" prop="favoriteTime" v-model="form.favoriteTime" type="date" />
</el-row>
<form-buttons @submit='submitForm' v-if="pageInfo.type!='view'" noCancelBtn />
</el-form>
</el-drawer>
</template>
<script>
import form from "@/assets/mixins/formdialog";
export default {
name: "FavoritesBusinesscardDetail",
mixins: [form],
components: {
},
created() {
this.changePath("favorites/businesscard")
},
data() {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "收藏名片",
// 是否显示弹出层
open: false,
direction:"rtl",
toString:[
],
toDate:[
"favoriteTime",
],
// 表单校验
rules: {
favoriteTime: [
{required: true,message: "请选择收藏时间" },
],
createTime: [
{required: true,message: "请选择创建时间" },
],
}
};
},
methods: {
/** 编辑 */
edit(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="favorites/businesscard/edit";
this.getData();
this.pageInfo.type="edit"
this.title = "修改收藏名片";
},
/** 新增 */
add(row) {
this.reset()
this.urls.currUrl = "favorites/businesscard/add";
this.getData();
this.pageInfo.type="add"
this.title = "新增收藏名片";
},
/** 查看*/
view(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="favorites/businesscard/view";
this.getData();
this.pageInfo.type="view"
this.title = "收藏名片详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
// 表单重置
reset() {
this.form = {
userId : null,
staffId : null,
remark : "",
favoriteTime : null,
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
</script>
<template>
<div class="page">
<LayoutTable :data="tableData" notAdd notDel :config="tableConfig">
</LayoutTable>
<drawer-show ref="drawerform" @ok="getData" />
</div>
</template>
<script>
/** 表单弹出框模式需引入 */
import drawerShow from "./drawershow";
import table from "@/assets/mixins/table";
export default {
name: "FavoritesBusinesscardList",
components: {
drawerShow
},
mixins: [table],
created() {
},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.drawerform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.drawerform.view(row);
},
},
data() {
return {
config: {
search: [
],
columns: [
{type: "selection", width: 60},
{type: "index",label: "序号",width: 50},
{label: "用户", prop: "userId", formatter: this.formatter},
{label: "员工", prop: "staffId", formatter: this.formatter},
{label: "创建用户", prop: "createUserId", formatter: this.formatter},
{
label: "操作",
width: 240,
formatter: row => {
return (
<table-buttons noAdd row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
);
}
}
]
}
};
}
};
</script>
<template>
<layout-view>
<el-descriptions :title="title" :column="column" :size="size" :colon="false" border>
<template slot="title">
<i class="el-icon-tickets"></i>
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="用户ID," label-class-name="labelClass" content-class-name="contentClass">
{{form.userId}}
</el-descriptions-item>
<el-descriptions-item label="员工ID, 关联到员工表中的ID,表示这是哪个名片的收藏" label-class-name="labelClass" content-class-name="contentClass">
{{form.staffId}}
</el-descriptions-item>
<el-descriptions-item label="备注" label-class-name="labelClass" content-class-name="contentClass">
{{form.remark}}
</el-descriptions-item>
<el-descriptions-item label="收藏时间" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatterDate(form.favoriteTime)}}
</el-descriptions-item>
</el-descriptions>
</layout-view>
</template>
<script>
import view from "@/assets/mixins/view";
export default {
mixins: [view],
components: {
},
methods: {
},
data() {
return {
size:"small",
column:2,
toString:[
],
toArrays: [
],
toDate: [
]
}
}
}
</script>
<style lang="less">
.labelClass{
width: 200px;
}
.el-descriptions__body{
margin-left: 5px;
margin-right: 5px;
color: #606266;
background-color: #FFF;
}
.contentClass{
width: 600px;
}
</style>
\ No newline at end of file
<template>
<!-- 弹出框表单 -->
<el-drawer
:title="title"
:visible.sync="open"
:direction="direction"
:destroy-on-close="true"
size="50%">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<Field label="用户ID," prop="userId" v-model="form.userId" placeholder="请输入用户ID,"/>
<Field label="新闻ID, 关联到新闻表中的ID,表示这是哪个新闻的收藏" prop="newsId" v-model="form.newsId" placeholder="请输入新闻ID, 关联到新闻表中的ID,表示这是哪个新闻的收藏"/>
<Field label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注"/>
<Field label="收藏时间" prop="favoriteTime" v-model="form.favoriteTime" type="date" />
</el-row>
<form-buttons @submit='submitForm' v-if="pageInfo.type!='view'" noCancelBtn />
</el-form>
</el-drawer>
</template>
<script>
import form from "@/assets/mixins/formdialog";
export default {
name: "FavoritesNewsDetail",
mixins: [form],
components: {
},
created() {
this.changePath("favorites/news")
},
data() {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "收藏新闻",
// 是否显示弹出层
open: false,
direction:"rtl",
toString:[
],
toDate:[
"favoriteTime",
],
// 表单校验
rules: {
favoriteTime: [
{required: true,message: "请选择收藏时间" },
],
createTime: [
{required: true,message: "请选择创建时间" },
],
}
};
},
methods: {
/** 编辑 */
edit(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="favorites/news/edit";
this.getData();
this.pageInfo.type="edit"
this.title = "修改收藏新闻";
},
/** 新增 */
add(row) {
this.reset()
this.urls.currUrl = "favorites/news/add";
this.getData();
this.pageInfo.type="add"
this.title = "新增收藏新闻";
},
/** 查看*/
view(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="favorites/news/view";
this.getData();
this.pageInfo.type="view"
this.title = "收藏新闻详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
// 表单重置
reset() {
this.form = {
userId : null,
newsId : null,
remark : "",
favoriteTime : null,
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
</script>
<template>
<div class="page">
<LayoutTable :data="tableData" notAdd notDel :config="tableConfig">
</LayoutTable>
<drawer-show ref="drawerform" @ok="getData" />
</div>
</template>
<script>
/** 表单弹出框模式需引入 */
import drawerShow from "./drawershow";
import table from "@/assets/mixins/table";
export default {
name: "FavoritesNewsList",
components: {
drawerShow
},
mixins: [table],
created() {
},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.drawerform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.drawerform.view(row);
},
},
data() {
return {
config: {
search: [
],
columns: [
{type: "selection", width: 60},
{type: "index",label: "序号",width: 50},
{label: "用户", prop: "userId", formatter: this.formatter},
{label: "新闻", prop: "newsId", formatter: this.formatter},
{label: "创建用户", prop: "createUserId", formatter: this.formatter},
{
label: "操作",
width: 240,
formatter: row => {
return (
<table-buttons noAdd row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
);
}
}
]
}
};
}
};
</script>
<template>
<layout-view>
<el-descriptions :title="title" :column="column" :size="size" :colon="false" border>
<template slot="title">
<i class="el-icon-tickets"></i>
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="用户ID," label-class-name="labelClass" content-class-name="contentClass">
{{form.userId}}
</el-descriptions-item>
<el-descriptions-item label="新闻ID, 关联到新闻表中的ID,表示这是哪个新闻的收藏" label-class-name="labelClass" content-class-name="contentClass">
{{form.newsId}}
</el-descriptions-item>
<el-descriptions-item label="备注" label-class-name="labelClass" content-class-name="contentClass">
{{form.remark}}
</el-descriptions-item>
<el-descriptions-item label="收藏时间" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatterDate(form.favoriteTime)}}
</el-descriptions-item>
</el-descriptions>
</layout-view>
</template>
<script>
import view from "@/assets/mixins/view";
export default {
mixins: [view],
components: {
},
methods: {
},
data() {
return {
size:"small",
column:2,
toString:[
],
toArrays: [
],
toDate: [
]
}
}
}
</script>
<style lang="less">
.labelClass{
width: 200px;
}
.el-descriptions__body{
margin-left: 5px;
margin-right: 5px;
color: #606266;
background-color: #FFF;
}
.contentClass{
width: 600px;
}
</style>
\ No newline at end of file
<template>
<!-- 弹出框表单 -->
<el-drawer
:title="title"
:visible.sync="open"
:direction="direction"
:destroy-on-close="true"
size="50%">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<Field label="用户ID," prop="userId" v-model="form.userId" placeholder="请输入用户ID,"/>
<Field label="页面ID, 关联到用户表中的ID,表示哪个用户收藏了这个页面" prop="pageId" v-model="form.pageId" placeholder="请输入页面ID, 关联到用户表中的ID,表示哪个用户收藏了这个页面"/>
<Field label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注"/>
<Field label="收藏时间" prop="favoriteTime" v-model="form.favoriteTime" type="date" />
</el-row>
<form-buttons @submit='submitForm' v-if="pageInfo.type!='view'" noCancelBtn />
</el-form>
</el-drawer>
</template>
<script>
import form from "@/assets/mixins/formdialog";
export default {
name: "FavoritesPagesDetail",
mixins: [form],
components: {
},
created() {
this.changePath("favorites/pages")
},
data() {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "收藏页面",
// 是否显示弹出层
open: false,
direction:"rtl",
toString:[
],
toDate:[
"favoriteTime",
],
// 表单校验
rules: {
favoriteTime: [
{required: true,message: "请选择收藏时间" },
],
createTime: [
{required: true,message: "请选择创建时间" },
],
}
};
},
methods: {
/** 编辑 */
edit(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="favorites/pages/edit";
this.getData();
this.pageInfo.type="edit"
this.title = "修改收藏页面";
},
/** 新增 */
add(row) {
this.reset()
this.urls.currUrl = "favorites/pages/add";
this.getData();
this.pageInfo.type="add"
this.title = "新增收藏页面";
},
/** 查看*/
view(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="favorites/pages/view";
this.getData();
this.pageInfo.type="view"
this.title = "收藏页面详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
// 表单重置
reset() {
this.form = {
userId : null,
pageId : null,
remark : "",
favoriteTime : null,
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
</script>
<template>
<div class="page">
<LayoutTable :data="tableData" notAdd notDel :config="tableConfig">
</LayoutTable>
<drawer-show ref="drawerform" @ok="getData" />
</div>
</template>
<script>
/** 表单弹出框模式需引入 */
import drawerShow from "./drawershow";
import table from "@/assets/mixins/table";
export default {
name: "FavoritesPagesList",
components: {
drawerShow
},
mixins: [table],
created() {
},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.drawerform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.drawerform.view(row);
},
},
data() {
return {
config: {
search: [
],
columns: [
{type: "selection", width: 60},
{type: "index",label: "序号",width: 50},
{label: "用户", prop: "userId", formatter: this.formatter},
{label: "页面", prop: "pageId", formatter: this.formatter},
{label: "创建用户", prop: "createUserId", formatter: this.formatter},
{
label: "操作",
width: 240,
formatter: row => {
return (
<table-buttons noAdd row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
);
}
}
]
}
};
}
};
</script>
<template>
<layout-view>
<el-descriptions :title="title" :column="column" :size="size" :colon="false" border>
<template slot="title">
<i class="el-icon-tickets"></i>
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="用户ID," label-class-name="labelClass" content-class-name="contentClass">
{{form.userId}}
</el-descriptions-item>
<el-descriptions-item label="页面ID, 关联到用户表中的ID,表示哪个用户收藏了这个页面" label-class-name="labelClass" content-class-name="contentClass">
{{form.pageId}}
</el-descriptions-item>
<el-descriptions-item label="备注" label-class-name="labelClass" content-class-name="contentClass">
{{form.remark}}
</el-descriptions-item>
<el-descriptions-item label="收藏时间" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatterDate(form.favoriteTime)}}
</el-descriptions-item>
</el-descriptions>
</layout-view>
</template>
<script>
import view from "@/assets/mixins/view";
export default {
mixins: [view],
components: {
},
methods: {
},
data() {
return {
size:"small",
column:2,
toString:[
],
toArrays: [
],
toDate: [
]
}
}
}
</script>
<style lang="less">
.labelClass{
width: 200px;
}
.el-descriptions__body{
margin-left: 5px;
margin-right: 5px;
color: #606266;
background-color: #FFF;
}
.contentClass{
width: 600px;
}
</style>
\ No newline at end of file
<template>
<!-- 弹出框表单 -->
<el-drawer
:title="title"
:visible.sync="open"
:direction="direction"
:destroy-on-close="true"
size="50%">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<Field label="用户ID," prop="userId" v-model="form.userId" placeholder="请输入用户ID,"/>
<Field label="产品ID, 关联到产品表中的ID,表示这是哪个产品的收藏" prop="productId" v-model="form.productId" placeholder="请输入产品ID, 关联到产品表中的ID,表示这是哪个产品的收藏"/>
<Field label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注"/>
<Field label="收藏时间" prop="favoriteTime" v-model="form.favoriteTime" type="date" />
</el-row>
<form-buttons @submit='submitForm' v-if="pageInfo.type!='view'" noCancelBtn />
</el-form>
</el-drawer>
</template>
<script>
import form from "@/assets/mixins/formdialog";
export default {
name: "FavoritesProductDetail",
mixins: [form],
components: {
},
created() {
this.changePath("favorites/product")
},
data() {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "收藏产品",
// 是否显示弹出层
open: false,
direction:"rtl",
toString:[
],
toDate:[
"favoriteTime",
],
// 表单校验
rules: {
favoriteTime: [
{required: true,message: "请选择收藏时间" },
],
createTime: [
{required: true,message: "请选择创建时间" },
],
}
};
},
methods: {
/** 编辑 */
edit(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="favorites/product/edit";
this.getData();
this.pageInfo.type="edit"
this.title = "修改收藏产品";
},
/** 新增 */
add(row) {
this.reset()
this.urls.currUrl = "favorites/product/add";
this.getData();
this.pageInfo.type="add"
this.title = "新增收藏产品";
},
/** 查看*/
view(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="favorites/product/view";
this.getData();
this.pageInfo.type="view"
this.title = "收藏产品详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
// 表单重置
reset() {
this.form = {
userId : null,
productId : null,
remark : "",
favoriteTime : null,
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
</script>
<template>
<div class="page">
<LayoutTable :data="tableData" notAdd notDel :config="tableConfig">
</LayoutTable>
<drawer-show ref="drawerform" @ok="getData" />
</div>
</template>
<script>
/** 表单弹出框模式需引入 */
import drawerShow from "./drawershow";
import table from "@/assets/mixins/table";
export default {
name: "FavoritesProductList",
components: {
drawerShow
},
mixins: [table],
created() {
},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.drawerform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.drawerform.view(row);
},
},
data() {
return {
config: {
search: [
],
columns: [
{type: "selection", width: 60},
{type: "index",label: "序号",width: 50},
{label: "用户", prop: "userId", formatter: this.formatter},
{label: "产品", prop: "productId", formatter: this.formatter},
{label: "创建用户", prop: "createUserId", formatter: this.formatter},
{
label: "操作",
width: 240,
formatter: row => {
return (
<table-buttons noAdd row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
);
}
}
]
}
};
}
};
</script>
<template>
<layout-view>
<el-descriptions :title="title" :column="column" :size="size" :colon="false" border>
<template slot="title">
<i class="el-icon-tickets"></i>
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="用户ID," label-class-name="labelClass" content-class-name="contentClass">
{{form.userId}}
</el-descriptions-item>
<el-descriptions-item label="产品ID, 关联到产品表中的ID,表示这是哪个产品的收藏" label-class-name="labelClass" content-class-name="contentClass">
{{form.productId}}
</el-descriptions-item>
<el-descriptions-item label="备注" label-class-name="labelClass" content-class-name="contentClass">
{{form.remark}}
</el-descriptions-item>
<el-descriptions-item label="收藏时间" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatterDate(form.favoriteTime)}}
</el-descriptions-item>
</el-descriptions>
</layout-view>
</template>
<script>
import view from "@/assets/mixins/view";
export default {
mixins: [view],
components: {
},
methods: {
},
data() {
return {
size:"small",
column:2,
toString:[
],
toArrays: [
],
toDate: [
]
}
}
}
</script>
<style lang="less">
.labelClass{
width: 200px;
}
.el-descriptions__body{
margin-left: 5px;
margin-right: 5px;
color: #606266;
background-color: #FFF;
}
.contentClass{
width: 600px;
}
</style>
\ No newline at end of file
......@@ -44,23 +44,23 @@
{type: "selection", width: 60},
{type: "index",label: "序号",width: 50},
{label: "标题", prop: "title"},
{label: "内容", prop: "content"},
{label: "是否公开 ", prop: "isShow",formatter: this.formatter},
{label: "真实姓名", prop: "feedbackName"},
{label: "联系电话", prop: "contactInfo"},
{label: "反馈人姓名", prop: "feedbackName"},
{label: "单位名称", prop: "companyName"},
{label: "联系方式", prop: "contactInfo"},
{label: "身份证号", prop: "idCard"},
{label: "邮箱地址", prop: "email"},
{label: "提交时间", prop: "createTime", formatter: this.formatterDate},
{label: "地址", prop: "Address"},
{label: "是否回复 ", prop: "reply",formatter: this.formatter},
{label: "回复", prop: "replyContent"},
{label: "回复", prop: "replyPerson"},
{label: "反馈类型 ", prop: "feedbackType",formatter: this.formatter},
......@@ -91,4 +91,4 @@
};
}
};
</script>
\ No newline at end of file
</script>
<template>
<!-- 弹出框表单 -->
<el-drawer
:title="title"
:visible.sync="open"
:direction="direction"
:destroy-on-close="true"
size="50%">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<Field label="页面名称" prop="pageName" v-model="form.pageName" placeholder="请输入页面名称"/>
<Field label="页面类型" prop="pageType" v-model="form.pageType" type="select" :enumData="dict.pageType" placeholder="请选择页面类型"/>
<Field label="页面短链接" prop="pageUrl" v-model="form.pageUrl" placeholder="请输入页面短链接"/>
<Field label="可以是一个包含其他页面信息的JSON对象或单独的字段,根据页面的具体需求来设计" prop="otherDetail" v-model="form.otherDetail" type="textarea" placeholder="请输入可以是一个包含其他页面信息的JSON对象或单独的字段,根据页面的具体需求来设计"/>
<Field label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注"/>
<Field label="收藏时间" prop="favoriteTime" v-model="form.favoriteTime" type="date" />
</el-row>
<form-buttons @submit='submitForm' v-if="pageInfo.type!='view'" noCancelBtn />
</el-form>
</el-drawer>
</template>
<script>
import form from "@/assets/mixins/formdialog";
export default {
name: "PageDetail",
mixins: [form],
components: {
},
created() {
this.changePath("page")
},
data() {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "页面信息",
// 是否显示弹出层
open: false,
direction:"rtl",
toString:[
"pageType",
],
toDate:[
"favoriteTime",
],
// 表单校验
rules: {
pageName: [
{required: true,message: "请输入页面名称", trigger: "blur" },
{max: 64,message: "最多只能录入64个字符",trigger: "blur",},
],
pageUrl: [
{required: true,message: "请输入页面短链接", trigger: "blur" },
{max: 64,message: "最多只能录入64个字符",trigger: "blur",},
],
favoriteTime: [
{required: true,message: "请选择收藏时间" },
],
createTime: [
{required: true,message: "请选择创建时间" },
],
}
};
},
methods: {
/** 编辑 */
edit(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="page/edit";
this.getData();
this.pageInfo.type="edit"
this.title = "修改页面信息";
},
/** 新增 */
add(row) {
this.reset()
this.urls.currUrl = "page/add";
this.getData();
this.pageInfo.type="add"
this.title = "新增页面信息";
},
/** 查看*/
view(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="page/view";
this.getData();
this.pageInfo.type="view"
this.title = "页面信息详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
// 表单重置
reset() {
this.form = {
pageName : "",
pageType : null,
pageUrl : "",
otherDetail : "",
remark : "",
favoriteTime : null,
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
</script>
<template>
<div class="page">
<LayoutTable :data="tableData" :config="tableConfig">
</LayoutTable>
<drawer-show ref="drawerform" @ok="getData" />
</div>
</template>
<script>
/** 表单弹出框模式需引入 */
import drawerShow from "./drawershow";
import table from "@/assets/mixins/table";
export default {
name: "PageList",
components: {
drawerShow
},
mixins: [table],
created() {
},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.drawerform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.drawerform.view(row);
},
},
data() {
return {
config: {
search: [
],
columns: [
{type: "selection", width: 60},
{type: "index",label: "序号",width: 50},
{label: "页面名称", prop: "pageName"},
{label: "页面短链接", prop: "pageUrl"},
{label: "创建用户", prop: "createUserId", formatter: this.formatter},
{
label: "操作",
width: 240,
formatter: row => {
return (
<table-buttons noAdd row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
);
}
}
]
}
};
}
};
</script>
\ No newline at end of file
<template>
<layout-view>
<el-descriptions :title="title" :column="column" :size="size" :colon="false" border>
<template slot="title">
<i class="el-icon-tickets"></i>
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="页面名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.pageName}}
</el-descriptions-item>
<el-descriptions-item label="页面类型" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatters("pageType", form.pageType) }}
</el-descriptions-item>
<el-descriptions-item label="页面短链接" label-class-name="labelClass" content-class-name="contentClass">
{{form.pageUrl}}
</el-descriptions-item>
<el-descriptions-item label="可以是一个包含其他页面信息的JSON对象或单独的字段,根据页面的具体需求来设计" label-class-name="labelClass" content-class-name="contentClass">
{{form.otherDetail}}
</el-descriptions-item>
<el-descriptions-item label="备注" label-class-name="labelClass" content-class-name="contentClass">
{{form.remark}}
</el-descriptions-item>
<el-descriptions-item label="收藏时间" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatterDate(form.favoriteTime)}}
</el-descriptions-item>
</el-descriptions>
</layout-view>
</template>
<script>
import view from "@/assets/mixins/view";
export default {
mixins: [view],
components: {
},
methods: {
},
data() {
return {
size:"small",
column:2,
toString:[
"pageType",
],
toArrays: [
],
toDate: [
]
}
}
}
</script>
<style lang="less">
.labelClass{
width: 200px;
}
.el-descriptions__body{
margin-left: 5px;
margin-right: 5px;
color: #606266;
background-color: #FFF;
}
.contentClass{
width: 600px;
}
</style>
\ No newline at end of file
......@@ -28,6 +28,11 @@
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.rabbitmq.host>192.168.0.251</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>root_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>xhx@2022</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.log.level>info</profiles.log.level>
<profiles.publish.path>/home/publish</profiles.publish.path>
......@@ -40,7 +45,7 @@
<id>test</id>
<properties>
<profiles.active>test</profiles.active>
<profiles.platform.type>cloud</profiles.platform.type>
<profiles.platform.type>standalone</profiles.platform.type>
<profiles.server.port>21086</profiles.server.port>
<profiles.server.path>/enterprise</profiles.server.path>
<profiles.publish.path>/home/publish</profiles.publish.path>
......
......@@ -87,10 +87,10 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
String userKey = getTokenKey(uuid);
// Rest<String> rest = userFeign.getToken(userKey);
// String userStr = rest.getData();
cacheService.select(portalDb);
// cacheService.select(portalDb);
String userStr = cacheService.get(userKey);
cacheService.select(db);
// cacheService.select(db);
if (StringUtils.isNotEmpty(userStr)) {
UserEntity userEntity = JSONObject.parseObject(userStr, UserEntity.class);
userEntity.setToken(token);
......
......@@ -154,28 +154,6 @@ public class StandaloneLoginController extends BaseCRUDJsonBodyMappingController
return ret.toJSONString();
}
private void generateBlackCookie(HttpServletRequest request, HttpServletResponse response, String loginName, Set<String> urls) {
try {
String cacheKey = RedisKey.KEY_MENU_CACHE + loginName;
String securityKey = GlobalSysInfo.getPropertyValue(SysConstains.PROP_COOKIE_SECURITY_KEY);
//应为Cookie会超长,所以改为仅存储key将值放入redis
//CookieService.setCookieForAuth(request, response, securityKey, null);
StringBuilder sb = new StringBuilder();
if (urls != null && urls.size() > 0) {
for (String url : urls) {
int index = url.hashCode() & (Integer.MAX_VALUE - 1);
sb.append(index).append(",");
}
}
String menuUrl = sb.toString();
menuUrl = AESUtil.encrypt(menuUrl, securityKey);
cacheService.set(cacheKey, menuUrl, 604800);
HttpUtil.setCookieValue(request, response, SysConstains.COOKIE_MENU, cacheKey, -1);
} catch (Throwable e) {
}
}
private String generateMenuUrlCode(Set<String> urls) {
......
......@@ -99,8 +99,23 @@ public class UserEntity extends UserVo implements IUser {
*/
private Long deptId;
/**
* 员工分享码
*/
private String shareCode;
public UserEntity(){}
public String getShareCode() {
return shareCode;
}
public void setShareCode(String shareCode) {
this.shareCode = shareCode;
}
/**
* 获取 登录名
* @return String
......
......@@ -188,6 +188,14 @@ public class UserQuery extends UserEntity {
/** 微信openId排除列表 */
private List <String> openIdNotList;
/** 员工分享码 */
private List<String> shareCodeList;
/** 员工分享码排除列表 */
private List <String> shareCodeNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<UserQuery> orConditionList;
......@@ -1837,6 +1845,24 @@ public class UserQuery extends UserEntity {
return this;
}
/**
* 设置 员工分享码
* @param shareCode
*/
public UserQuery shareCode(String shareCode){
setShareCode(shareCode);
return this;
}
/**
* 设置 员工分享码
* @param shareCodeList
*/
public UserQuery shareCodeList(List<String> shareCodeList){
this.shareCodeList = shareCodeList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
......
package com.mortals.xhx.busiz;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public abstract class BaseReq implements Serializable {
/**
* 当前页
*/
private Integer page;
/**
* 每页条数
*/
private Integer size;
private String phone;
}
package com.mortals.xhx.busiz.applets;
import lombok.Data;
/**
* @author karlhoo
*/
@Data
public class ApiResp<T> {
/**
* 结果编码
*/
private int code;
/**
* 结果描述
*/
private String msg;
/**
* 响应数据
*/
private T data;
}
package com.mortals.xhx.busiz.applets.req;
import com.mortals.xhx.busiz.BaseReq;
import lombok.Data;
/**
* 新闻请求
*
* @author: zxfei
* @date: 2023/10/7 16:53
*/
@Data
public class NewsReq extends BaseReq {
private Long id;
/**
* 分类id
*/
private Long newsCategoryId;
}
package com.mortals.xhx.busiz.applets.rsp;
import lombok.Data;
import java.util.Date;
@Data
public class NewsListInfo {
/**
* id
*/
private Long id;
/**
* 标题
*/
private String title;
/**
* 标题logo
*/
private String titleLogoPath;
/**
* 发布时间
*/
private Date publishTime;
}
package com.mortals.xhx.busiz.applets.web;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.web.BaseJsonBodyController;
import com.mortals.xhx.busiz.BaseReq;
import org.springframework.util.ObjectUtils;
import java.util.Map;
import static com.mortals.framework.ap.SysConstains.*;
public abstract class AbstractBaseController<T extends BaseReq> extends BaseJsonBodyController {
protected PageInfo buildPageInfo(T query) {
PageInfo pageInfo = new PageInfo();
if (!ObjectUtils.isEmpty(query) && !ObjectUtils.isEmpty(query.getPage())) {
pageInfo.setCurrPage(query.getPage());
}
if (!ObjectUtils.isEmpty(query) && !ObjectUtils.isEmpty(query.getSize())) {
pageInfo.setPrePageResult(query.getSize());
}
return pageInfo;
}
protected void parsePageInfo(Map<String, Object> model, PageInfo pageInfo) {
model.put(TOTAL, pageInfo.getTotalResult());
model.put(PER_PAGE, pageInfo.getPrePageResult());
model.put(CURRENT_PAGE, pageInfo.getCurrPage());
model.put(LAST_PAGE, pageInfo.getTotalPage());
model.put(PAGEINFO_KEY, pageInfo);
}
}
package com.mortals.xhx.busiz.applets.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.base.system.user.model.UserQuery;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.busiz.applets.req.NewsReq;
import com.mortals.xhx.busiz.applets.rsp.NewsListInfo;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.category.model.CategoryQuery;
import com.mortals.xhx.module.category.service.CategoryService;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.news.model.NewsCategoryQuery;
import com.mortals.xhx.module.news.model.NewsEntity;
import com.mortals.xhx.module.news.model.NewsQuery;
import com.mortals.xhx.module.news.service.NewsCategoryService;
import com.mortals.xhx.module.news.service.NewsService;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static com.mortals.framework.ap.SysConstains.PAGEINFO_KEY;
import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED;
import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED_CONTENT;
/**
* 小程序 新闻列表
*
* @author: zxfei
* @date: 2023/10/7 16:57
*/
@RestController
@Slf4j
@RequestMapping("/api/v1/news")
public class NewsApiController extends AbstractBaseController<NewsReq> {
@Autowired
private ParamService paramService;
@Autowired
private NewsService newsService;
@Autowired
private NewsCategoryService newsCategoryService;
@Autowired
private DeptService deptService;
@Autowired
private UserService userService;
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "top", paramService.getParamBySecondOrganize("News", "top"));
this.addDict(model, "viewNums", paramService.getParamBySecondOrganize("News", "viewNums"));
this.addDict(model, "categoryId", newsCategoryService.find(new NewsCategoryQuery()).stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getName(), (o, n) -> n)));
this.addDict(model, "deptId", deptService.find(new DeptQuery()).stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getDeptName(), (o, n) -> n)));
this.addDict(model, "createUserId", userService.find(new UserQuery()).stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getRealName(), (o, n) -> n)));
}
/**
* 新闻频道分类
*/
@PostMapping(value = "categoryList")
public Rest<Object> categoryList(){
String busiDesc = "新闻频道";
Rest<Object> rest = Rest.ok();
try {
rest.setData(newsCategoryService.find(new NewsCategoryQuery()));
}catch (Exception e) {
log.error(busiDesc, e);
rest = Rest.fail(super.convertException(e));
}
return rest;
}
/**
* 新闻列表
*/
@PostMapping(value = "newsList")
public Rest<Object> newsList(@RequestBody NewsReq newsReq) {
String busiDesc = "新闻列表";
log.info("【{}】【请求体】--> {}", busiDesc, JSONObject.toJSONString(newsReq));
Rest<Object> rest = Rest.ok();
Map<String, Object> model = new HashMap<>();
Context context = this.getContext();
if (ObjectUtils.isEmpty(context) || ObjectUtils.isEmpty(context.getUser())) {
throw new AppException(ERROR_TOKEN_EXPIRED, ERROR_TOKEN_EXPIRED_CONTENT);
}
try {
PageInfo pageInfo = buildPageInfo(newsReq);
NewsQuery query = new NewsQuery();
if(!ObjectUtils.isEmpty(newsReq.getNewsCategoryId())){
query.setCategoryId(newsReq.getNewsCategoryId());
}
query.setOrderColList(Arrays.asList(new OrderCol("createTime", OrderCol.DESCENDING)));
Result<NewsEntity> result = newsService.find(query, pageInfo, context);
List<NewsListInfo> collect = result.getList().stream().map(item -> {
NewsListInfo newsListInfo = new NewsListInfo();
BeanUtils.copyProperties(item, newsListInfo, BeanUtil.getNullPropertyNames(item));
return newsListInfo;
}).collect(Collectors.toList());
model.put(KEY_RESULT_DATA, collect);
model.put(PAGEINFO_KEY, result.getPageInfo());
super.parsePageInfo(model, result.getPageInfo());
rest.setData(model);
this.init(model, context);
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error(busiDesc, e);
rest = Rest.fail(super.convertException(e));
}
return rest;
}
/**
* 新闻详细
*/
@PostMapping(value = "newsInfo")
public Rest<NewsEntity> appealInfo(@RequestBody NewsReq newsReq) {
String busiDesc = "新闻详细";
log.info("【{}】【请求体】--> {}", busiDesc, JSONObject.toJSONString(newsReq));
Rest<NewsEntity> rest = Rest.ok(busiDesc + " 【成功】");
Context context = this.getContext();
Map<String, Object> model = new HashMap<>();
try {
if (ObjectUtils.isEmpty(newsReq.getId())) {
throw new AppException("详细查询id不能为空!");
}
NewsEntity newsEntity = newsService.get(newsReq.getId(), context);
rest.setData(newsEntity);
this.init(model, context);
rest.setDict(model.get("dict"));
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error(busiDesc, e);
rest = Rest.fail(super.convertException(e));
}
return rest;
}
}
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 页面类型(1.首页,2.产品详情,3.文章详情)枚举类
*
* @author zxfei
*/
public enum PageTypeEnum {
首页(1, "首页"),
产品详情(2, "产品详情"),
文章详情(3, "文章详情");
private Integer value;
private String desc;
PageTypeEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static PageTypeEnum getByValue(Integer value) {
for (PageTypeEnum pageTypeEnum : PageTypeEnum.values()) {
if (pageTypeEnum.getValue() == value) {
return pageTypeEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (PageTypeEnum item : PageTypeEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
package com.mortals.xhx.module.favorites.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.favorites.model.FavoritesBusinesscardEntity;
import java.util.List;
/**
* 收藏名片Dao
* 收藏名片 DAO接口
*
* @author zxfei
* @date 2023-10-07
*/
public interface FavoritesBusinesscardDao extends ICRUDDao<FavoritesBusinesscardEntity,Long>{
}
package com.mortals.xhx.module.favorites.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.favorites.model.FavoritesNewsEntity;
import java.util.List;
/**
* 收藏新闻Dao
* 收藏新闻 DAO接口
*
* @author zxfei
* @date 2023-10-07
*/
public interface FavoritesNewsDao extends ICRUDDao<FavoritesNewsEntity,Long>{
}
package com.mortals.xhx.module.favorites.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.favorites.model.FavoritesPagesEntity;
import java.util.List;
/**
* 收藏页面Dao
* 收藏页面 DAO接口
*
* @author zxfei
* @date 2023-10-07
*/
public interface FavoritesPagesDao extends ICRUDDao<FavoritesPagesEntity,Long>{
}
package com.mortals.xhx.module.favorites.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.favorites.model.FavoritesProductEntity;
import java.util.List;
/**
* 收藏产品Dao
* 收藏产品 DAO接口
*
* @author zxfei
* @date 2023-10-07
*/
public interface FavoritesProductDao extends ICRUDDao<FavoritesProductEntity,Long>{
}
package com.mortals.xhx.module.favorites.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.favorites.dao.FavoritesBusinesscardDao;
import com.mortals.xhx.module.favorites.model.FavoritesBusinesscardEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 收藏名片DaoImpl DAO接口
*
* @author zxfei
* @date 2023-10-07
*/
@Repository("favoritesBusinesscardDao")
public class FavoritesBusinesscardDaoImpl extends BaseCRUDDaoMybatis<FavoritesBusinesscardEntity,Long> implements FavoritesBusinesscardDao {
}
package com.mortals.xhx.module.favorites.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.favorites.dao.FavoritesNewsDao;
import com.mortals.xhx.module.favorites.model.FavoritesNewsEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 收藏新闻DaoImpl DAO接口
*
* @author zxfei
* @date 2023-10-07
*/
@Repository("favoritesNewsDao")
public class FavoritesNewsDaoImpl extends BaseCRUDDaoMybatis<FavoritesNewsEntity,Long> implements FavoritesNewsDao {
}
package com.mortals.xhx.module.favorites.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.favorites.dao.FavoritesPagesDao;
import com.mortals.xhx.module.favorites.model.FavoritesPagesEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 收藏页面DaoImpl DAO接口
*
* @author zxfei
* @date 2023-10-07
*/
@Repository("favoritesPagesDao")
public class FavoritesPagesDaoImpl extends BaseCRUDDaoMybatis<FavoritesPagesEntity,Long> implements FavoritesPagesDao {
}
package com.mortals.xhx.module.favorites.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.favorites.dao.FavoritesProductDao;
import com.mortals.xhx.module.favorites.model.FavoritesProductEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 收藏产品DaoImpl DAO接口
*
* @author zxfei
* @date 2023-10-07
*/
@Repository("favoritesProductDao")
public class FavoritesProductDaoImpl extends BaseCRUDDaoMybatis<FavoritesProductEntity,Long> implements FavoritesProductDao {
}
package com.mortals.xhx.module.favorites.model;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.favorites.model.vo.FavoritesBusinesscardVo;
import lombok.Data;
/**
* 收藏名片实体对象
*
* @author zxfei
* @date 2023-10-07
*/
@Data
public class FavoritesBusinesscardEntity extends FavoritesBusinesscardVo {
private static final long serialVersionUID = 1L;
/**
* 用户ID,
*/
private Long userId;
/**
* 员工ID, 关联到员工表中的ID,表示这是哪个名片的收藏
*/
private Long staffId;
/**
* 备注
*/
private String remark;
/**
* 收藏时间
*/
private Date favoriteTime;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof FavoritesBusinesscardEntity) {
FavoritesBusinesscardEntity tmp = (FavoritesBusinesscardEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.userId = null;
this.staffId = null;
this.remark = "";
this.favoriteTime = new Date();
}
}
\ No newline at end of file
package com.mortals.xhx.module.favorites.model;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.favorites.model.vo.FavoritesNewsVo;
import lombok.Data;
/**
* 收藏新闻实体对象
*
* @author zxfei
* @date 2023-10-07
*/
@Data
public class FavoritesNewsEntity extends FavoritesNewsVo {
private static final long serialVersionUID = 1L;
/**
* 用户ID,
*/
private Long userId;
/**
* 新闻ID, 关联到新闻表中的ID,表示这是哪个新闻的收藏
*/
private Long newsId;
/**
* 备注
*/
private String remark;
/**
* 收藏时间
*/
private Date favoriteTime;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof FavoritesNewsEntity) {
FavoritesNewsEntity tmp = (FavoritesNewsEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.userId = null;
this.newsId = null;
this.remark = "";
this.favoriteTime = new Date();
}
}
\ No newline at end of file
package com.mortals.xhx.module.favorites.model;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.favorites.model.vo.FavoritesPagesVo;
import lombok.Data;
/**
* 收藏页面实体对象
*
* @author zxfei
* @date 2023-10-07
*/
@Data
public class FavoritesPagesEntity extends FavoritesPagesVo {
private static final long serialVersionUID = 1L;
/**
* 用户ID,
*/
private Long userId;
/**
* 页面ID, 关联到用户表中的ID,表示哪个用户收藏了这个页面
*/
private Long pageId;
/**
* 备注
*/
private String remark;
/**
* 收藏时间
*/
private Date favoriteTime;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof FavoritesPagesEntity) {
FavoritesPagesEntity tmp = (FavoritesPagesEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.userId = null;
this.pageId = null;
this.remark = "";
this.favoriteTime = new Date();
}
}
\ No newline at end of file
package com.mortals.xhx.module.favorites.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.favorites.model.FavoritesBusinesscardEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 收藏名片视图对象
*
* @author zxfei
* @date 2023-10-07
*/
@Data
public class FavoritesBusinesscardVo extends BaseEntityLong {
/** 序号,主键,自增长列表 */
private List <Long> idList;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment