Commit d6a1144e authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents 9903e75f fd04a60e
......@@ -5,6 +5,7 @@
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"serve2": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
"build": "vue-cli-service build --mode production",
"beta": "vue-cli-service build --mode beta",
"test": "vue-cli-service build --mode test",
......
......@@ -395,12 +395,13 @@ export default {
let { uid } = info.file;
if (code === 1) {
let obj = {
uid: uid,
uid,
name: fileName,
status: "done",
materialName: this.form.materialName,
fileName: fileName,
fileUrl: this.apiUrl + url,
url,
fileUrl: url,
filetype: num,
source: 1,
};
......
......@@ -12,8 +12,8 @@
:columns="columns"
:data-source="tableData"
>
<template slot="action" slot-scope="text">
<a @click="handleClick(text)">下载</a>
<template slot="action" slot-scope="text, record">
<a :href="record.fileUrl" :download="record.fileName">下载</a>
</template>
</a-table>
</a-modal>
......@@ -21,7 +21,7 @@
</template>
<script>
import { download } from "@/services/matter";
// import { download } from "@/services/matter";
// import axios from "axios";
const columns = [
{
......@@ -70,63 +70,60 @@ export default {
},
},
methods: {
downloadByBlob(url, name) {
let image = new Image();
image.setAttribute("crossOrigin", "anonymous");
image.src = url;
image.onload = () => {
let canvas = document.createElement("canvas");
canvas.width = image.width;
canvas.height = image.height;
let ctx = canvas.getContext("2d");
ctx.drawImage(image, 0, 0, image.width, image.height);
canvas.toBlob((blob) => {
let url = URL.createObjectURL(blob);
this.download(url, name);
// 用完释放URL对象
URL.revokeObjectURL(url);
});
};
},
download(href, name) {
let eleLink = document.createElement("a");
eleLink.style = "display: none";
eleLink.download = name;
eleLink.href = href;
document.body.appendChild(eleLink);
eleLink.click();
eleLink.remove();
},
async downloadFile(row, type) {
let res = await download(
{ datumId: row.datumId },
{ responseType: "blob" }
);
let data = res.data;
const blob = new Blob([data], {
type: type,
});
const link = document.createElement("a");
link.href = URL.createObjectURL(blob);
link.setAttribute("download", row.fileName); // 设置下载文件名称
document.body.appendChild(link);
link.click();
link.remove();
},
handleClick(row) {
let index = row.fileUrl.lastIndexOf(".");
let str = row.fileUrl.slice(index + 1);
if (str === "png" || str === "jpg" || str === "jpeg") {
this.downloadByBlob(row.fileUrl, row.fileName);
} else {
this.download(row.fileUrl, row.fileName);
}
},
// downloadByBlob(url, name) {
// let image = new Image();
// image.setAttribute("crossOrigin", "anonymous");
// image.src = url;
// image.onload = () => {
// let canvas = document.createElement("canvas");
// canvas.width = image.width;
// canvas.height = image.height;
// let ctx = canvas.getContext("2d");
// ctx.drawImage(image, 0, 0, image.width, image.height);
// canvas.toBlob((blob) => {
// let url = URL.createObjectURL(blob);
// this.download(url, name);
// // 用完释放URL对象
// URL.revokeObjectURL(url);
// });
// };
// },
// download(href, name) {
// let eleLink = document.createElement("a");
// eleLink.style = "display: none";
// eleLink.download = name;
// eleLink.href = href;
// document.body.appendChild(eleLink);
// eleLink.click();
// eleLink.remove();
// },
// async downloadFile(row, type) {
// let res = await download(
// { datumId: row.datumId },
// { responseType: "blob" }
// );
// let data = res.data;
// const blob = new Blob([data], {
// type: type,
// });
// const link = document.createElement("a");
// link.href = URL.createObjectURL(blob);
// link.setAttribute("download", row.fileName); // 设置下载文件名称
// document.body.appendChild(link);
// link.click();
// link.remove();
// },
// handleClick(row) {
// let index = row.fileUrl.lastIndexOf(".");
// let str = row.fileUrl.slice(index + 1);
// if (str === "png" || str === "jpg" || str === "jpeg") {
// this.downloadByBlob(row.fileUrl, row.fileName);
// } else {
// this.download(row.fileUrl, row.fileName);
// }
// },
},
};
</script>
<style lang="less" scoped>
</style>
\ No newline at end of file
<style lang="less" scoped></style>
......@@ -8,7 +8,7 @@
width="50"
height="50"
v-if="appInfo.appIconPath"
:src="api + appInfo.appIconPath"
:src="appInfo.appIconPath"
/>
<div class="name">{{ appInfo.appName }}</div>
<div class="version">当前版本:v{{ appInfo.version }}</div>
......
......@@ -49,8 +49,8 @@
<img
class="cover"
v-if="text.cover"
:src="api2 + text.cover"
@click="handlePreview(api2 + text.cover)"
:src="text.cover"
@click="handlePreview(text.cover)"
/>
<span v-else>--</span>
</template>
......@@ -132,8 +132,6 @@ export default {
},
data() {
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
columns,
siteId: local.getLocal("siteId"),
tableData: [], // 表格数据
......
......@@ -83,7 +83,7 @@
v-if="text.video"
width="50"
:src="filterRes(text.video)"
@click="handlePreview('video', api2 + text.video)"
@click="handlePreview('video', text.video)"
/>
<span v-else>--</span>
</template>
......@@ -320,7 +320,7 @@ export default {
// 过滤影音
filterRes(data) {
let resource = data.split(",").map((v) => {
return this.api2 + v;
return v;
});
return resource[0];
......@@ -328,7 +328,7 @@ export default {
// 预览
handlePreview(type, data) {
let resource = data.split(",").map((v) => {
return this.api2 + v;
return v;
});
if (type == "img") {
this.$viewerApi({
......
......@@ -56,8 +56,8 @@
class="pointer"
height="20"
width="20"
:src="api2 + text.appIconPath"
@click="handlePreview(api2 + text.appIconPath)"
:src="text.appIconPath"
@click="handlePreview(text.appIconPath)"
/>
<span v-else>--</span>
</template>
......@@ -203,7 +203,6 @@ export default {
data() {
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
columns,
siteId: local.getLocal("siteId"),
tableData: [], // 表格数据
......
......@@ -56,8 +56,8 @@
class="pointer"
height="20"
width="20"
:src="api2 + text.appIconPath"
@click="handlePreview(api2 + text.appIconPath)"
:src="text.appIconPath"
@click="handlePreview(text.appIconPath)"
/>
<span v-else>--</span>
</template>
......@@ -203,7 +203,6 @@ export default {
data() {
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
columns,
siteId: local.getLocal("siteId"),
tableData: [], // 表格数据
......
......@@ -182,7 +182,6 @@ export default {
return {
accept: "image/jpeg,image/png,image/svg+xml",
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
iconFileList: [],
labelCol: {
span: 3,
......@@ -307,17 +306,25 @@ export default {
return isJpgOrPng && isLt5M;
},
// 上传图标
handleChangeIcon({ fileList }) {
handleChangeIcon({ file, fileList }) {
if (
file.status &&
file.status != "removed" &&
file.response &&
file.response.code == -1
) {
this.$message.error(file.response.msg);
fileList = fileList.filter((file) => file.response.code != -1);
}
this.iconFileList = [...fileList].slice(-1);
this.iconFileList = this.iconFileList.map((v) => {
if (v.response) {
v.url2 = v.response.url;
v.url = this.api2 + v.response.url;
v.url = v.response.url;
}
return v;
});
if (this.iconFileList[0]) {
this.form.appIconPath = this.iconFileList[0].url2;
this.form.appIconPath = this.iconFileList[0].url;
} else {
this.form.appIconPath = "";
}
......@@ -330,6 +337,17 @@ export default {
},
// 上传应用
handleChangeFile(info) {
if (
info.file.status &&
info.file.status != "removed" &&
info.file.response &&
info.file.response.code == -1
) {
this.$message.error(info.file.response.msg);
info.fileList = info.fileList.filter(
(file) => file.response.code != -1
);
}
let fileList = [...info.fileList];
fileList = fileList.slice(-1);
fileList = fileList.map((file) => {
......@@ -370,8 +388,7 @@ export default {
uid: "-2",
name: this.form.appIconPath,
status: "done",
url: this.api2 + this.form.appIconPath,
url2: this.form.appIconPath,
url: this.form.appIconPath,
},
];
});
......
......@@ -141,6 +141,7 @@
:action="api + '/base/file/commonupload'"
:multiple="true"
:file-list="v.fileList"
:beforeUpload="handleBeforeUpload"
@change="
(info) => {
handleChange(info, v);
......@@ -420,8 +421,43 @@ export default {
});
this.form = { ...data };
},
// 文件上传
// 更改文件名称
renameFile(originalFile, newName) {
return new File([originalFile], newName, {
type: originalFile.type,
lastModified: originalFile.lastModified,
});
},
handleBeforeUpload(file) {
let index = file.name.lastIndexOf(".");
let fileName = file.name.slice(0, index);
let suffix = file.name.slice(index);
let uid = file.uid;
if (fileName.length >= 40) {
let newName = fileName.slice(0, 40) + "..." + suffix;
let newFile = this.renameFile(file, newName);
newFile.uid = uid;
return new Promise((resolve) => {
resolve(newFile);
});
}
},
// 文件上传状态变化
handleChange(info, row) {
if (
info.file.status &&
info.file.status != "removed" &&
info.file.response &&
info.file.response.code == -1
) {
this.$message.error(info.file.response.msg);
info.fileList = info.fileList.filter(
(file) => file.response.code != -1
);
}
let fileList = [...info.fileList];
// fileList = fileList.slice(-1);
fileList = fileList.map((file) => {
......
......@@ -69,7 +69,6 @@ export default {
return {
accept: "image/jpeg,image/png",
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
fileList: [],
form: {
siteId: local.getLocal("siteId"), // 站点id
......@@ -117,8 +116,7 @@ export default {
uid: "-2",
name: this.form.cover,
status: "done",
url: this.api2 + this.form.cover,
url2: this.form.cover,
url: this.form.cover,
},
];
}
......@@ -158,17 +156,25 @@ export default {
return isJpgOrPng && isLt10M;
},
// 上传封面
handleChangeCover({ fileList }) {
handleChangeCover({ file, fileList }) {
if (
file.status &&
file.status != "removed" &&
file.response &&
file.response.code == -1
) {
this.$message.error(file.response.msg);
fileList = fileList.filter((file) => file.response.code != -1);
}
this.fileList = [...fileList].slice(-1);
this.fileList = this.fileList.map((v) => {
if (v.response) {
v.url2 = v.response.url;
v.url = this.api2 + v.response.url;
v.url = v.response.url;
}
return v;
});
if (this.fileList[0]) {
this.form.cover = this.fileList[0].url2;
this.form.cover = this.fileList[0].url;
} else {
this.form.cover = "";
}
......
......@@ -56,16 +56,13 @@
<!-- 模块图标 -->
<template slot="modelIcon" slot-scope="text">
<div v-if="text.modelIcon">
<!-- <div class="svg-box" v-if="isSvg(text.modelIcon)">
<img width="30" height="30" :src="api2 + text.modelIcon" />
</div> -->
<div class="svg-box">
<img
class="pointer"
width="30"
height="30"
:src="api2 + text.modelIcon"
@click="handlePreview({ url: api2 + text.modelIcon })"
:src="text.modelIcon"
@click="handlePreview({ url: text.modelIcon })"
/>
</div>
</div>
......@@ -301,7 +298,6 @@ export default {
return {
pageSizeOptions,
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
accept: "image/jpeg,image/png,image/svg+xml", // 上传类型
columns,
loading: true,
......@@ -404,8 +400,7 @@ export default {
uid: -1,
status: "done",
name: this.formData.modelIcon,
url: this.api2 + this.formData.modelIcon,
url2: this.formData.modelIcon,
url: this.formData.modelIcon,
},
];
}
......@@ -471,13 +466,12 @@ export default {
this.fileList = [...fileList].slice(-1);
this.fileList = this.fileList.map((v) => {
if (v.response) {
v.url2 = v.response.url;
v.url = this.api2 + v.response.url;
v.url = v.response.url;
}
return v;
});
if (this.fileList[0]) {
this.formData.modelIcon = this.fileList[0].url2;
this.formData.modelIcon = this.fileList[0].url;
} else {
this.formData.modelIcon = "";
}
......
......@@ -347,7 +347,6 @@ export default {
// };
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
accept: "image/jpeg,image/png", // 上传类型
loading: false,
options: regionData, // 地区级联数据
......@@ -634,8 +633,7 @@ export default {
uid: -1,
status: "done",
name: this.formInfo.logoPath,
url: this.api2 + this.formInfo.logoPath,
url2: this.formInfo.logoPath,
url: this.formInfo.logoPath,
},
];
}
......@@ -680,17 +678,25 @@ export default {
return isJpgOrPng && isLt10M;
},
// 上传图片
handleChange({ fileList }) {
handleChange({ file, fileList }) {
if (
file.status &&
file.status != "removed" &&
file.response &&
file.response.code == -1
) {
this.$message.error(file.response.msg);
fileList = fileList.filter((file) => file.response.code != -1);
}
this.fileList = [...fileList].slice(-1);
this.fileList = this.fileList.map((v) => {
if (v.response) {
v.url2 = v.response.url;
v.url = this.api2 + v.response.url;
v.url = v.response.url;
}
return v;
});
if (this.fileList[0]) {
this.formInfo.logoPath = this.fileList[0].url2;
this.formInfo.logoPath = this.fileList[0].url;
} else {
this.formInfo.logoPath = "";
}
......
......@@ -5,7 +5,9 @@
<h2 class="show-titlw">{{ curSkin.name }}</h2>
<p>
更新时间:<span style="margin-right: 20px">{{
curSkin.updateTime | dateFormat
curSkin.updateTime
? dateFormat(curSkin.updateTime)
: dateFormat(curSkin.createTime)
}}</span>
支持分辨率:<span
>{{ filterItems(curSkin.imageResolution, imageResolution) }}
......@@ -167,6 +169,9 @@ export default {
},
});
},
dateFormat(val) {
return this.$moment(val).format("YYYY-MM-DD HH:mm:ss");
},
},
};
</script>
......
......@@ -399,7 +399,7 @@ export default {
file.type === "image/png" ||
file.type === "image/gif";
if (!isJpgOrPng) {
this.$message.error("请上传jpeg或者png图片!");
this.$message.error("请上传jpeg,png或者gif图片!");
}
const isLt5M = file.size / 1024 / 1024 < 5;
if (!isLt5M) {
......
<template>
<div class="system flex flexc">
<a-tabs :activeKey="activeKey" @change="changeRouter">
<a-tab-pane key="/system/user">
<span slot="tab">
<a-icon type="user" />
用户管理
</span>
</a-tab-pane>
<a-tab-pane key="/system/role">
<span slot="tab">
<a-icon type="idcard" />
角色管理
</span>
</a-tab-pane>
<a-tab-pane key="/system/resource">
<span slot="tab">
<a-icon type="cloud-sync" />
资源管理
</span>
</a-tab-pane>
<a-tab-pane key="/system/dimension">
<span slot="tab">
<a-icon type="deployment-unit" />
维度管理
</span>
</a-tab-pane>
<a-tab-pane key="/system/parameter">
<span slot="tab">
<a-icon type="container" />
......
<template>
<div class="dimension-container">
<div class="control flex aic jcb mb15 pdr6">
<div>
<a-button type="primary" style="margin-right: 10px" @click="handleAdd"
>新增</a-button
>
<a-button type="danger" @click="handleDelAll">批量删除</a-button>
</div>
<div class="search-box">
<a-input-search
placeholder="请输入维度名搜索"
enter-button="搜索"
v-model="searchValue"
allowClear
@search="onSearch"
/>
</div>
</div>
<!-- 表格 -->
<div class="table-content">
<a-table
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
:loading="loading"
bordered
:scroll="{ y: 590 }"
:columns="columns"
:pagination="{
showTotal: (total) => `共 ${total} 条`,
current: current,
total: total,
pageSize: size,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
onChange: handleChange,
onShowSizeChange: showSizeChange,
}"
:data-source="tableData"
:rowKey="(record) => record.id"
>
<!-- 序号 -->
<span slot="num" slot-scope="text, record, index">{{
(current - 1) * size + index + 1
}}</span>
<!-- 操作 -->
<template slot="action" slot-scope="text">
<a-space size="middle">
<span
href="javascript:;"
class="primary pointer"
@click="handleEdit(text)"
>编辑</span
>
<span
href="javascript:;"
class="delete pointer"
@click="handleDel(text.id)"
>删除</span
>
</a-space>
</template>
</a-table>
</div>
<!-- 新增 -->
<AddDimension
ref="AddDimension"
:addVisible.sync="addVisible"
:title="title"
:dict="dict"
@addSuccess="getDimensionList"
></AddDimension>
</div>
</template>
<script>
import { getDimensionList, delDimension } from "@/services/system";
import { pageSizeOptions } from "@/config/pageConfig.js";
import AddDimension from "./modal/AddDimension";
export default {
components: { AddDimension },
data() {
const columns = [
{
title: "序号",
dataIndex: "num",
width: "65px",
scopedSlots: {
customRender: "num",
},
},
{
title: "名称",
dataIndex: "dimensionName",
},
{
title: "编码",
dataIndex: "dimensionCode",
},
{
title: "类型",
dataIndex: "dimensionType",
customRender: (text) => {
return this.dict.dimensionType[text];
},
},
{
title: "维度值",
dataIndex: "dimensionValue",
},
{
title: "创建时间",
dataIndex: "createTime",
customRender: (text) => {
return this.$moment(text).format("YYYY-MM-DD HH:mm:ss");
},
},
{
title: "操作",
width: "120px",
scopedSlots: { customRender: "action" },
},
];
return {
columns,
loading: false,
current: 1,
size: 10,
total: 0,
pageSizeOptions,
searchValue: "", // 搜索
tableData: [],
selectedRowKeys: [],
dict: {}, // 字典
addVisible: false,
title: "新增",
};
},
created() {
this.getDimensionList();
},
methods: {
// 获取列表
async getDimensionList() {
this.loading = true;
let res = await getDimensionList({
page: this.current,
size: this.size,
dimensionName: this.searchValue,
});
this.loading = false;
if (res.data.code == 1) {
let { data, total, dict } = res.data.data;
this.tableData = data;
this.total = total;
this.dict = dict;
}
},
// 新增
handleAdd() {
this.title = "新增";
this.$refs.AddDimension.onAdd();
this.addVisible = true;
},
// 搜索
onSearch() {
this.current = 1;
},
// 分页
handleChange(num) {
this.current = num;
},
// 改变每页显示数量
showSizeChange(current, size) {
this.current = current;
this.size = size;
},
// 选择
onSelectChange(keys) {
this.selectedRowKeys = keys;
},
// 批量删除
handleDelAll() {
if (!this.selectedRowKeys.length) {
this.$message.warn("请先勾选数据");
return;
}
let ids = this.selectedRowKeys.join(",");
this.handleDel(ids);
},
// 编辑
handleEdit(row) {
this.title = "编辑";
this.$refs.AddDimension.onEdit(row);
this.addVisible = true;
},
// 删除
handleDel(id) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "exclamation-circle",
maskClosable: true,
async onOk() {
let res = await delDimension({ id });
if (res.data.code == 1) {
_this.$message.success(res.data.msg);
_this.getDimensionList();
}
console.log(id);
},
onCancel() {
console.log("Cancel");
},
});
},
},
};
</script>
<style lang="less" scoped>
.dimension-container {
width: 100%;
height: 100%;
}
</style>
<template>
<div>
<a-modal
:title="title"
:visible="Visible"
@cancel="handleCancel"
:maskClosable="false"
>
<a-button slot="footer" @click="handleReset">重置</a-button>
<a-button
slot="footer"
type="primary"
:loading="loading"
@click="handleOk"
>确定</a-button
>
<a-form-model
:model="form"
ref="form"
:rules="rules"
:label-col="{ span: 5 }"
:wrapper-col="{ span: 19 }"
>
<a-form-model-item label="名称" prop="dimensionName">
<a-input
v-model="form.dimensionName"
placeholder="请输入维度名称"
></a-input>
</a-form-model-item>
<a-form-model-item label="编号" prop="dimensionCode">
<a-input
v-model="form.dimensionCode"
placeholder="请输入维度编号"
></a-input>
</a-form-model-item>
<a-form-model-item label="类型" prop="dimensionType">
<a-select v-model="form.dimensionType" placeholder="请选择维度类型">
<a-select-option
v-for="(v, key) in dict.dimensionType"
:key="key"
:value="Number(key)"
>{{ v }}</a-select-option
>
</a-select>
</a-form-model-item>
<a-form-model-item label="维度值" prop="dimensionValue">
<a-input
v-model="form.dimensionValue"
placeholder="请输入维度值"
></a-input>
</a-form-model-item>
</a-form-model>
</a-modal>
</div>
</template>
<script>
import { saveDimension } from "@/services/system";
export default {
components: {},
props: {
addVisible: {
required: true,
type: Boolean,
default: false,
},
title: {
required: true,
type: String,
default: "",
},
dict: {
required: true,
type: Object,
default: () => {},
},
},
data() {
return {
loading: false,
form: {
dimensionName: "", // 维度名称
dimensionCode: "", // 维度编码
dimensionValue: "", // 维度值
dimensionType: undefined, // 维度类型
},
rules: {
dimensionName: [
{ required: true, message: "请输入维度名称", trigger: "blur" },
],
dimensionCode: [
{ required: true, message: "请输入维度编码", trigger: "blur" },
],
dimensionValue: [
{ required: true, message: "请输入维度值", trigger: "blur" },
],
dimensionType: [
{ required: true, message: "请选择维度类型", trigger: "change" },
],
},
};
},
computed: {
Visible: {
get() {
return this.addVisible;
},
set(val) {
this.$emit("update:addVisible", val);
},
},
},
created() {},
methods: {
// 新增
onAdd() {
Object.assign(this.form, this.$options.data().form);
this.form.id && this.$delete(this.form, "id");
},
// 编辑
onEdit(row) {
this.$nextTick(() => {
this.form = { ...row };
});
},
// 保存
handleOk() {
this.$refs.form.validate(async (valid) => {
if (valid) {
this.loading = true;
let res = await saveDimension(this.form);
let { code, msg } = res.data;
this.loading = false;
if (code == 1) {
this.$message.success(msg);
this.$emit("addSuccess");
this.handleCancel();
}
}
});
},
// 重置
handleReset() {
this.$refs.form.resetFields();
},
// 关闭
handleCancel() {
this.$refs.form.resetFields();
this.Visible = false;
},
},
};
</script>
<style lang="less" scoped></style>
......@@ -8,13 +8,20 @@
<a-button type="danger" @click="handleDelAll">批量删除</a-button>
</div>
<div class="search-box">
<a-input-search
<a-space>
<a-input
placeholder="请输入参数名搜索"
enter-button="搜索"
v-model="searchValue"
v-model="searchForm.name"
allowClear
@search="onSearch"
/>
<a-input
placeholder="请输入二级组织搜索"
v-model="searchForm.secondOrganize"
allowClear
/>
<a-button type="primary" @click="onSearch">搜索</a-button>
<a-button @click="resetSearch">重置</a-button>
</a-space>
</div>
</div>
<!-- 表格 -->
......@@ -176,6 +183,10 @@ export default {
total: 0,
pageSizeOptions,
searchValue: "", // 搜索
searchForm: {
name: "",
secondOrganize: "",
},
tableData: [],
selectedRowKeys: [],
dict: {}, // 字典
......@@ -193,7 +204,8 @@ export default {
let res = await getSystemParameterList({
page: this.current,
size: this.size,
name: `%${this.searchValue}%`,
name: `%${this.searchForm.name}%`,
secondOrganize: `%${this.searchForm.secondOrganize}%`,
});
this.loading = false;
if (res.data.code == 1) {
......@@ -217,6 +229,12 @@ export default {
this.current = 1;
this.getSystemParameterList();
},
// 重置搜索
resetSearch() {
this.current = 1;
Object.assign(this.searchForm, this.$options.data().searchForm);
this.getSystemParameterList();
},
// 分页
handleChange(num) {
this.current = num;
......
......@@ -183,9 +183,11 @@ export default {
// 文件上传
handleUpload({ file }) {
if (file.status === "done") {
let { code, url } = file.response;
let { code, url, msg } = file.response;
if (code == 1) {
this.form.paramValue = url;
} else {
this.$message.error(msg);
}
}
},
......
<template>
<div class="resource-container">
<div class="control flex aic jcb mb15 pdr6">
<a-space>
<a-button type="primary" @click="handleAdd">新增</a-button>
<a-button
v-permission="[1]"
type="primary"
class="addclass"
@click="refSresource"
>刷新资源</a-button
>
<a-button type="danger" @click="handleDelAll">批量删除</a-button>
</a-space>
<div class="search-box">
<a-input-search
placeholder="请输入资源名搜索"
enter-button="搜索"
v-model="searchValue"
allowClear
@search="onSearch"
/>
</div>
</div>
<!-- 表格 -->
<div class="table-content">
<a-table
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
:loading="loading"
bordered
:scroll="{ y: 590 }"
:columns="columns"
:pagination="{
showTotal: (total) => `共 ${total} 条`,
current: current,
total: total,
pageSize: size,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
onChange: handleChange,
onShowSizeChange: showSizeChange,
}"
:data-source="tableData"
:rowKey="(record) => record.id"
>
<!-- 序号 -->
<span slot="num" slot-scope="text, record, index">{{
(current - 1) * size + index + 1
}}</span>
<!-- 操作 -->
<template slot="action" slot-scope="text">
<a-space size="middle">
<span
href="javascript:;"
class="primary pointer"
@click="handleEdit(text)"
>编辑</span
>
<span
href="javascript:;"
class="delete pointer"
@click="handleDel(text.id)"
>删除</span
>
</a-space>
</template>
</a-table>
</div>
<!-- 新增、编辑 -->
<AddResurce
ref="AddResurce"
:title="title"
:visible.sync="addVisible"
:dict="dict"
@add="getResourceList"
></AddResurce>
</div>
</template>
<script>
import {
getResourceList,
refreshResource,
delResource,
} from "@/services/system";
import { pageSizeOptions } from "@/config/pageConfig.js";
import AddResurce from "./modal/AddResurce.vue";
export default {
components: { AddResurce },
data() {
const columns = [
{
title: "序号",
dataIndex: "num",
width: "65px",
scopedSlots: {
customRender: "num",
},
},
{
title: "名称",
width: 400,
dataIndex: "name",
},
{
title: "资源",
dataIndex: "url",
customRender: (text) => {
if (text) {
return text.split(",").map((v) => {
return (
<a-tag style="margin-bottom:4px" color="blue">
{v}
</a-tag>
);
});
}
},
},
{
title: "认证类型",
width: 200,
dataIndex: "authType",
customRender: (text) => {
return this.dict.authType[text];
},
},
{
title: "操作",
width: "120px",
scopedSlots: { customRender: "action" },
},
];
return {
columns,
loading: false,
current: 1,
size: 10,
total: 0,
pageSizeOptions,
searchValue: "", // 搜索
tableData: [],
selectedRowKeys: [],
dict: {}, // 字典
addVisible: false,
title: "新增",
};
},
created() {
this.getResourceList();
},
methods: {
// 获取资源列表
async getResourceList() {
this.loading = true;
let res = await getResourceList({
page: this.current,
size: this.size,
name: `%${this.searchValue}%`,
});
this.loading = false;
if (res.data.code == 1) {
let { data, total, dict } = res.data.data;
this.tableData = data;
this.total = total;
this.dict = dict;
}
},
// 新增
handleAdd() {
this.title = "新增";
this.$refs.AddResurce.onAdd();
this.addVisible = true;
},
// 搜索
onSearch() {
this.current = 1;
this.getResourceList();
},
// 分页
handleChange(num) {
this.current = num;
this.getResourceList();
},
// 改变每页显示数量
showSizeChange(current, size) {
this.current = current;
this.size = size;
this.getResourceList();
},
// 选择
onSelectChange(keys) {
this.selectedRowKeys = keys;
},
// 批量删除
handleDelAll() {
if (!this.selectedRowKeys.length) {
this.$message.warn("请先勾选数据");
return;
}
let ids = this.selectedRowKeys.join(",");
this.handleDel(ids);
},
// 编辑
handleEdit(row) {
this.title = "编辑";
this.$refs.AddResurce.onEdit(row);
this.addVisible = true;
},
// 删除
handleDel(id) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "exclamation-circle",
maskClosable: true,
async onOk() {
let res = await delResource({ id });
if (res.data.code == 1) {
let { msg } = res.data;
_this.$message.success(msg);
_this.getResourceList();
}
},
onCancel() {
console.log("Cancel");
},
});
},
// 刷新资源
async refSresource() {
let _this = this;
this.$confirm({
title: "系统提示",
content: "确定要刷新资源吗?",
okText: "",
cancelText: "",
centered: true,
async onOk() {
let res = await refreshResource();
if (res.data.code == 1) {
_this.$message.success(res.data.msg);
_this.getResourceList();
}
},
});
},
},
};
</script>
<style lang="less" scoped>
.resource-container {
width: 100%;
height: 100%;
}
</style>
<template>
<div class="add-resurce">
<a-modal
:title="title"
:centered="true"
:visible="Visible"
@cancel="handleCancel"
width="30%"
:maskClosable="false"
>
<a-form-model
:label-col="{
span: 5,
}"
:wrapper-col="{
span: 19,
}"
ref="form"
:model="form"
:rules="rules"
>
<a-form-model-item label="资源名称" prop="name">
<a-input
placeholder="请输入资源名称"
allowClear
v-model="form.name"
/>
</a-form-model-item>
<a-form-model-item label="权限类型" prop="authType">
<a-select v-model="form.authType" placeholder="请选择权限类型">
<a-select-option
v-for="(v, key) in dict.authType"
:key="key"
:value="Number(key)"
>{{ v }}</a-select-option
>
</a-select>
</a-form-model-item>
<a-form-model-item class="url-params-box" label="链接地址">
<a-form-model-item
class="url-params"
v-for="(v, i) in form.urls"
:key="i"
:prop="`urls.${i}.value`"
:rules="[
{ required: true, validator: validatorUrl, trigger: 'blur' },
]"
>
<a-input
class="mr10"
v-model="v.value"
placeholder="请输入链接地址"
/>
<a-space>
<a-button type="primary" @click="changeParams(i, 'add')"
><a-icon type="plus"
/></a-button>
<a-button
type="danger"
v-if="i > 0"
@click="changeParams(i, 'remove')"
><a-icon type="minus"
/></a-button>
</a-space>
</a-form-model-item>
</a-form-model-item>
</a-form-model>
<template slot="footer">
<a-button @click="resetForm">重置</a-button>
<a-button
type="primary"
class="addclass"
:loading="loading"
@click="subForm"
>确定</a-button
>
</template>
</a-modal>
</div>
</template>
<script>
import { saveResource } from "@/services/system";
export default {
props: {
title: {
required: true,
type: String,
default: "新增资源",
},
visible: {
required: true,
type: Boolean,
default: false,
},
dict: {
required: true,
type: Object,
default: () => {},
},
},
data() {
return {
loading: false,
form: {
name: "",
authType: undefined,
url: "",
urls: [
{
value: "",
},
],
},
rules: {
name: [{ required: true, message: "请输入资源名称", trigger: "blur" }],
authType: [
{ required: true, message: "请输选择权限类型", trigger: "change" },
],
},
};
},
computed: {
Visible: {
get() {
return this.visible;
},
set(val) {
this.$emit("update:visible", val);
},
},
},
methods: {
onAdd() {
Object.assign(this.form, this.$options.data().form);
this.form.id && this.$delete(this.form, "id");
},
onEdit(row) {
setTimeout(() => {
this.form = { ...row };
let arr = [];
if (this.form.url) {
arr = this.form.url.split(",").map((v) => {
return {
value: v,
};
});
}
this.$set(this.form, "urls", arr);
}, 10);
},
subForm() {
this.$refs.form.validate(async (valid) => {
if (valid) {
this.loading = true;
let res = await saveResource({
...this.form,
url: this.form.urls.map((v) => v.value).join(","),
});
let { code, msg } = res.data;
this.loading = false;
if (code == 1) {
this.$message.success(msg);
this.$emit("add");
this.handleCancel();
}
}
});
},
// 判断是否存在链接
isRepeat(val) {
return this.form.urls.filter((v) => v.value == val).length > 1;
},
// 校验链接地址
validatorUrl(rule, value, callback) {
if (!value) {
callback(new Error("请输入链接"));
} else if (this.isRepeat(value)) {
callback(new Error("重复的链接地址"));
} else {
callback();
}
},
changeParams(index, type) {
if (type == "add") {
let obj = {
value: "",
};
if (this.form.urls.some((v) => !v.value)) {
this.$message.warning("请先完成前面地址的填写");
return;
}
this.form.urls.splice(index + 1, 0, obj);
} else {
this.form.urls.splice(index, 1);
}
// this.$forceUpdate();
},
resetForm() {
// 重置还原表单信息内容
this.$refs.form.resetFields();
this.$set(this.form, "urls", [{ value: "" }]);
},
handleCancel() {
this.resetForm();
this.Visible = false;
},
},
};
</script>
<style lang="less" scoped>
/deep/.ant-modal-body {
max-height: 600px;
overflow-y: auto;
}
/deep/.url-params-box {
display: block !important;
.ant-form-item-children {
display: block;
}
}
/deep/.url-params {
.ant-form-item-children {
display: flex;
align-items: center;
}
}
</style>
<template>
<div class="role-container">
<div class="control flex aic jcb mb15 pdr6">
<div>
<a-button type="primary" style="margin-right: 10px" @click="handleAdd"
>新增</a-button
>
<a-button type="danger" @click="handleDelAll">批量删除</a-button>
</div>
<div class="search-box">
<a-input-search
placeholder="请输入角色名搜索"
enter-button="搜索"
v-model="searchValue"
allowClear
@search="onSearch"
/>
</div>
</div>
<!-- 表格 -->
<div class="table-content">
<a-table
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
:loading="loading"
bordered
:scroll="{ y: 590 }"
:columns="columns"
:pagination="{
showTotal: (total) => `共 ${total} 条`,
current: current,
total: total,
pageSize: size,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
onChange: handleChange,
onShowSizeChange: showSizeChange,
}"
:data-source="tableData"
:rowKey="(record) => record.id"
>
<!-- 序号 -->
<span slot="num" slot-scope="text, record, index">{{
(current - 1) * size + index + 1
}}</span>
<!-- 操作 -->
<template slot="action" slot-scope="text">
<a-space size="middle">
<span class="primary pointer" @click="apportion(text)"
>分配资源</span
>
<span class="primary pointer" @click="handleResDim(text)"
>资源规则</span
>
<span class="primary pointer" @click="handleEdit(text)">编辑</span>
<span class="delete pointer" @click="handleDel(text.id)">删除</span>
</a-space>
</template>
</a-table>
</div>
<!-- 新增 -->
<AddRole
ref="AddRole"
:title="title"
:addVisible.sync="addVisible"
@addSuccess="getRoleList"
></AddRole>
<!-- 分配资源 -->
<ApportionRes ref="ApportionRes" :visible.sync="resVisible"></ApportionRes>
<!-- 资源规则 -->
<ResDimList ref="ResDimList" :visible.sync="resDimListVisible"></ResDimList>
</div>
</template>
<script>
import { getRoleList, delRole } from "@/services/system";
import { pageSizeOptions } from "@/config/pageConfig.js";
import AddRole from "./modal/AddRole.vue";
import ApportionRes from "./modal/ApportionRes.vue";
import ResDimList from "./modal/ResDimList.vue";
export default {
components: { AddRole, ApportionRes, ResDimList },
data() {
const columns = [
{
title: "序号",
dataIndex: "num",
width: "65px",
scopedSlots: {
customRender: "num",
},
},
{
title: "角色名称",
dataIndex: "name",
},
{
title: "备注",
dataIndex: "remark",
},
{
title: "操作",
width: "20% ",
scopedSlots: { customRender: "action" },
},
];
return {
columns,
loading: false,
current: 1,
size: 10,
total: 0,
pageSizeOptions,
searchValue: "", // 搜索
tableData: [],
selectedRowKeys: [],
dict: {}, // 字典
addVisible: false,
resVisible: false,
resDimListVisible: false,
title: "新增角色",
};
},
created() {
this.getRoleList();
},
methods: {
// 获取角色列表
async getRoleList() {
this.loading = true;
let res = await getRoleList({
current: this.current,
size: this.size,
name: this.searchValue,
});
this.loading = false;
if (res.data.code == 1) {
let { data, total } = res.data.data;
this.tableData = data;
this.total = total;
}
},
// 新增
handleAdd() {
this.title = "新增角色";
this.$refs.AddRole.onAdd();
this.addVisible = true;
},
// 搜索
onSearch() {
this.current = 1;
this.getRoleList();
},
// 分页
handleChange(num) {
this.current = num;
this.getRoleList();
},
// 改变每页显示数量
showSizeChange(current, size) {
this.current = current;
this.size = size;
this.getRoleList();
},
// 选择
onSelectChange(keys) {
this.selectedRowKeys = keys;
},
// 批量删除
handleDelAll() {
if (!this.selectedRowKeys.length) {
this.$message.warn("请先勾选数据");
return;
}
let ids = this.selectedRowKeys.join(",");
this.handleDel(ids);
},
// 编辑
handleEdit(row) {
this.title = "编辑角色";
this.$refs.AddRole.onEdit(row);
this.addVisible = true;
},
// 删除
handleDel(id) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "exclamation-circle",
maskClosable: true,
async onOk() {
let res = await delRole({ id });
if (res.data.code == 1) {
_this.$message.success(res.data.msg);
_this.getRoleList();
}
},
onCancel() {
console.log("Cancel");
},
});
},
// 分配资源
apportion(row) {
this.$refs.ApportionRes.onAdd(row.id);
this.resVisible = true;
},
// 资源维度
handleResDim(row) {
this.$refs.ResDimList.getRoleInfo(row);
this.resDimListVisible = true;
},
},
};
</script>
<style lang="less" scoped>
.role-container {
width: 100%;
height: 100%;
}
</style>
<template>
<div>
<a-modal
:title="title"
:visible="Visible"
@cancel="handleCancel"
:maskClosable="false"
:zIndex="1001"
>
<a-form-model
:model="form"
ref="form"
:rules="rules"
:label-col="{ span: 5 }"
:wrapper-col="{ span: 19 }"
>
<a-form-model-item label="所属资源" prop="resourceId">
<a-cascader
:options="resourceList"
v-model="resource"
placeholder="请选择资源"
@change="changeRes"
/>
</a-form-model-item>
<a-form-model-item label="所属维度" prop="ruleCode">
<a-select
allowClear
v-model="form.ruleCode"
@change="changeDim"
placeholder="请选择所属维度"
>
<a-select-option
v-for="v in dimensionList"
:key="v.id"
:value="v.dimensionCode"
:dataset-row="v"
>
{{ v.dimensionName }}
</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="规则条件" prop="ruleCondition">
<a-select
allowClear
v-model="form.ruleCondition"
placeholder="请选择规则条件"
>
<a-select-option
v-for="(v, key) in dict.ruleCondition"
:key="key"
:value="key"
>
{{ v }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-form-model>
<a-button slot="footer" @click="handleReset">重置</a-button>
<a-button
slot="footer"
type="primary"
:loading="loading"
@click="handleOk"
>确定</a-button
>
</a-modal>
</div>
</template>
<script>
import {
getDimensionList,
getResourceList,
saveDimRes,
} from "@/services/system";
export default {
components: {},
props: {
addVisible: {
required: true,
type: Boolean,
default: false,
},
title: {
required: true,
type: String,
default: "",
},
dict: {
required: true,
type: Object,
default: () => {},
},
},
data() {
return {
loading: false,
resource: [],
dimensionList: [], // 维度列表
resourceList: [], // 资源列表
form: {
roleId: "", // 角色id
resourceId: "", // 资源id
ruleCode: undefined, // 维度编码
ruleName: "", // 维度名称
ruleCondition: undefined, // 规则条件
ruleValue: "", // 维度值
ruleType: "", // 维度类型
roleName: "", // 角色名称
resourceName: "", // 资源名称
},
rules: {
resourceId: [
{ required: true, message: "请选择资源", trigger: "change" },
],
ruleCode: [
{ required: true, message: "请选择维度", trigger: "change" },
],
ruleCondition: [
{ required: true, message: "请选择规则条件", trigger: "change" },
],
},
};
},
computed: {
Visible: {
get() {
return this.addVisible;
},
set(val) {
this.$emit("update:addVisible", val);
},
},
},
created() {
this.getDimensionList();
this.getResourceList();
},
methods: {
// 获取维度列表
async getDimensionList() {
let res = await getDimensionList({
page: 1,
size: -1,
});
if (res.data.code == 1) {
let { data } = res.data.data;
this.dimensionList = data;
}
},
// 获取资源列表
async getResourceList() {
let res = await getResourceList({
page: 1,
size: -1,
});
if (res.data.code == 1) {
let { data } = res.data.data;
this.resourceList = this.groupByAuth(data);
}
},
// 资源分组
groupByAuth(list) {
let group = {};
let groupList = [];
list.forEach((item) => {
let name = item.name.split("-")[0];
if (!group[name]) {
group[name] = {
indeterminate: false,
checkAll: false,
list: [],
};
}
group[name].list.push(item);
});
groupList = Object.keys(group).map((key) => {
return {
label: key,
value: key,
children: group[key].list.map((v) => {
return {
label: v.name,
value: v.id,
};
}),
};
});
return groupList;
},
// 选择资源
changeRes(val, selectedOptions) {
if (selectedOptions.length) {
this.form.resourceId = selectedOptions[1].value;
this.form.resourceName = selectedOptions[1].label;
} else {
this.form.resourceId = "";
this.form.resourceName = "";
}
},
// 选择维度
changeDim(val, e) {
if (val && e) {
let { dimensionName, dimensionType, dimensionValue } = e.data.attrs[
"dataset-row"
];
this.form.ruleName = dimensionName;
this.form.ruleType = dimensionType;
this.form.ruleValue = dimensionValue;
} else {
this.form.ruleName = "";
this.form.ruleType = "";
this.form.ruleValue = "";
}
},
// 新增
onAdd(roleInfo) {
Object.assign(this.form, this.$options.data().form);
this.form.id && this.$delete(this.form, "id");
this.form.roleId = roleInfo.id;
this.form.roleName = roleInfo.name;
},
// 编辑
onEdit(row) {
this.$nextTick(() => {
this.form = { ...row };
let resName = this.form.resourceName.split("-")[0];
this.resource = [resName, this.form.resourceId];
});
},
// 保存
handleOk() {
this.$refs.form.validate(async (valid) => {
if (valid) {
this.loading = true;
let res = await saveDimRes(this.form);
let { code, msg } = res.data;
this.loading = false;
if (code == 1) {
this.$message.success(msg);
this.$emit("addSuccess");
this.handleCancel();
}
}
});
},
// 重置
handleReset() {
this.$refs.form.resetFields();
this.form.ruleName = "";
this.form.ruleType = "";
this.form.ruleValue = "";
this.form.resourceId = "";
this.form.resourceName = "";
this.resource = [];
},
// 关闭
handleCancel() {
this.handleReset();
this.Visible = false;
},
},
};
</script>
<style lang="less" scoped></style>
<template>
<div>
<a-modal
:title="title"
:visible="Visible"
@cancel="handleCancel"
:maskClosable="false"
>
<a-button slot="footer" @click="handleReset">重置</a-button>
<a-button
slot="footer"
type="primary"
:loading="loading"
@click="handleOk"
>确定</a-button
>
<a-form-model
:model="form"
ref="form"
:rules="rules"
:label-col="{ span: 5 }"
:wrapper-col="{ span: 19 }"
>
<a-form-model-item label="名称" prop="name">
<a-input v-model="form.name" placeholder="请输入角色名称"></a-input>
</a-form-model-item>
<a-form-model-item label="备注" prop="remark">
<a-textarea
v-model="form.remark"
placeholder="请输入备注"
></a-textarea>
</a-form-model-item>
</a-form-model>
</a-modal>
</div>
</template>
<script>
import { saveRole } from "@/services/system";
export default {
components: {},
props: {
addVisible: {
required: true,
type: Boolean,
default: false,
},
title: {
required: true,
type: String,
default: "",
},
},
data() {
return {
loading: false,
form: {
name: "",
remark: "",
roleType: 2,
},
rules: {
name: [{ required: true, message: "请输入角色名称", trigger: "blur" }],
},
};
},
computed: {
Visible: {
get() {
return this.addVisible;
},
set(val) {
this.$emit("update:addVisible", val);
},
},
},
created() {},
methods: {
// 新增
onAdd() {
Object.assign(this.form, this.$options.data().form);
this.form.id && this.$delete(this.form, "id");
},
// 编辑
onEdit(row) {
this.$nextTick(() => {
this.form = { ...row };
});
},
// 保存
handleOk() {
this.$refs.form.validate(async (valid) => {
if (valid) {
this.loading = true;
let res = await saveRole(this.form);
let { code, msg } = res.data;
this.loading = false;
if (code == 1) {
this.$message.success(msg);
this.$emit("addSuccess");
this.handleCancel();
}
}
});
},
// 重置
handleReset() {
this.$refs.form.resetFields();
},
// 关闭
handleCancel() {
this.$refs.form.resetFields();
this.Visible = false;
},
},
};
</script>
<style lang="less" scoped></style>
<template>
<div class="apportion-res">
<a-modal
title="分配资源"
:centered="true"
:visible="Visible"
@cancel="handleCancel"
width="40%"
:maskClosable="false"
>
<div class="mb10" v-for="(v, key) in resourceList" :key="key">
<div class="mb10" :style="{ borderBottom: '1px solid #E9E9E9' }">
<span class="title">{{ key }}</span>
<a-checkbox
:indeterminate="v.indeterminate"
:checked="v.checkAll"
@change="onCheckAllChange($event, v)"
>
全选
</a-checkbox>
</div>
<a-checkbox-group
style="width:100%"
:value="form.resourceIdList"
@change="onChange($event, v)"
>
<a-row>
<a-col :span="12" v-for="item in v.list" :key="item.id">
<a-checkbox :value="item.id">
{{ item.name }}
</a-checkbox>
</a-col>
</a-row>
</a-checkbox-group>
</div>
<template slot="footer">
<a-button @click="resetForm">重置</a-button>
<a-button type="primary" class="addclass" @click="subForm"
>确定</a-button
>
</template>
</a-modal>
</div>
</template>
<script>
import {
getRoleResourceList,
getResourceList,
saveRoleResource,
} from "@/services/system";
export default {
props: {
visible: {
required: true,
type: Boolean,
default: false,
},
},
data() {
return {
form: {
resourceIdList: [],
roleId: "",
},
rules: {},
resourceList: {}, // 资源列表
userResourceList: [], // 用户资源列表
};
},
computed: {
Visible: {
get() {
return this.visible;
},
set(val) {
this.$emit("update:visible", val);
},
},
},
methods: {
// 获取资源列表
async getResourceList() {
let res = await getResourceList({
page: 1,
size: -1,
});
if (res.data.code == 1) {
let { data } = res.data.data;
this.resourceList = this.groupByAuth(data);
}
},
// 获取角色资源权限列表
async getRoleResourceList(roleId) {
let res = await getRoleResourceList({
size: -1,
page: 1,
roleId,
});
if (res.data.code == 1) {
let { data } = res.data.data;
let arr = data.filter((v) => v.resourceId);
this.form.resourceIdList = arr.map((v) => v.resourceId);
}
},
// 权限分组
groupByAuth(list) {
let group = {};
list.forEach((item) => {
let name = item.name.split("-")[0];
if (!group[name]) {
group[name] = {
indeterminate: false,
checkAll: false,
list: [],
};
}
group[name].list.push(item);
});
return group;
},
// 控制全选
onCheckAllChange(e, row) {
let rowIds = row.list.map((v) => v.id);
let checked = e.target.checked;
row.indeterminate = false;
row.checkAll = checked;
if (checked) {
this.form.resourceIdList = [
...new Set([...this.form.resourceIdList, ...rowIds]),
];
} else {
this.form.resourceIdList = this.form.resourceIdList.filter((v) => {
return !rowIds.includes(v);
});
}
},
// 控制单选
onChange(checkedList, row) {
let rowIds = row.list.map((v) => v.id);
this.form.resourceIdList = this.form.resourceIdList.filter((v) => {
return !rowIds.includes(v);
});
this.form.resourceIdList = [
...new Set([...this.form.resourceIdList, ...checkedList]),
];
row.indeterminate =
!!checkedList.length && checkedList.length < rowIds.length;
row.checkAll = checkedList.length === rowIds.length;
},
onAdd(roleId) {
Object.assign(this.form, this.$options.data().form);
this.form.roleId = roleId;
this.getResourceList();
this.getRoleResourceList(roleId);
},
async subForm() {
let res = await saveRoleResource(this.form);
if (res.data.code == 1) {
this.$message.success("添加成功");
this.handleCancel();
}
},
resetForm() {
this.form.resourceIdList = [];
Object.keys(this.resourceList).forEach((key) => {
this.resourceList[key].checkAll = false;
this.resourceList[key].indeterminate = false;
});
// 重置还原表单信息内容
// this.$refs.form.resetFields();
},
handleCancel() {
this.resetForm();
this.Visible = false;
},
},
};
</script>
<style lang="less" scoped>
/deep/.ant-modal-body {
max-height: 700px;
overflow-y: auto;
}
.title {
margin-right: 1em;
font-size: 18px;
font-weight: bold;
}
</style>
<template>
<div>
<a-drawer
title="资源规则"
:visible="Visible"
@close="onClose"
:maskClosable="false"
:destroyOnClose="true"
width="50%"
>
<div class="mb10">
角色名称:<span class="primary">{{ roleInfo.name }}</span>
</div>
<div class="search-box flex aic jcb mb20">
<div>
<a-space>
<a-button type="primary" @click="handleAdd"> 新增 </a-button>
<a-button type="danger" @click="handleDelAll"> 批量删除 </a-button>
</a-space>
</div>
<a-input-search
style="width: 300px"
placeholder="请输入维度名称搜索"
enter-button="搜索"
v-model="searchVal"
allowClear
@search="onSearch"
/>
</div>
<!-- 表格 -->
<div class="table-content">
<a-table
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
size="small"
:loading="loading"
bordered
:scroll="{ y: 460 }"
:columns="columns"
:pagination="{
showTotal: (total) => `共 ${total} 条`,
current: current,
total: total,
pageSize: size,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
onChange: handleChange,
onShowSizeChange: showSizeChange,
}"
:data-source="tableData"
:rowKey="(record) => record.id"
>
<!-- 序号 -->
<span slot="num" slot-scope="text, record, index">{{
(current - 1) * size + index + 1
}}</span>
<!-- 操作 -->
<template slot="action" slot-scope="text">
<a-space>
<a href="javascript:;" class="edit" @click="handleEdit(text)"
>编辑</a
>
<a href="javascript:;" class="delete" @click="handleDel(text.id)"
>删除</a
>
</a-space>
</template>
</a-table>
</div>
<AddResDim
ref="AddResDim"
:addVisible.sync="addVisible"
:title="title"
:dict="dict"
@addSuccess="getDimResList"
></AddResDim>
</a-drawer>
</div>
</template>
<script>
import { pageSizeOptions } from "@/config/pageConfig.js";
import { getDimResList, delDimRes } from "@/services/system";
import AddResDim from "./AddResDim.vue";
export default {
props: {
visible: {
type: Boolean,
require: true,
default: false,
},
},
components: { AddResDim },
data() {
const columns = [
{
title: "序号",
dataIndex: "num",
width: "65px",
scopedSlots: {
customRender: "num",
},
},
{
title: "维度名称",
dataIndex: "ruleName",
},
{
title: "维度编码",
dataIndex: "ruleCode",
},
{
title: "维度类型",
dataIndex: "ruleType",
},
{
title: "维度值",
dataIndex: "ruleValue",
},
{
title: "所属资源",
dataIndex: "resourceName",
},
{
title: "规则条件",
dataIndex: "ruleCondition",
customRender: (text) => {
return this.dict.ruleCondition[text];
},
},
{
title: "创建时间",
dataIndex: "createTime",
customRender: (text) => {
return this.$moment(text).format("YYYY-MM-DD HH:mm:ss");
},
},
{
title: "操作",
width: "100px",
scopedSlots: { customRender: "action" },
},
];
return {
columns,
roleInfo: {}, // 模块信息
loading: false,
total: 0,
size: 10,
current: 1,
pageSizeOptions,
selectedRowKeys: [],
tableData: [],
addVisible: false,
title: "新增",
searchVal: "",
dict: {}, // 字典
};
},
computed: {
Visible: {
get() {
return this.visible;
},
set(val) {
this.$emit("update:visible", val);
},
},
},
methods: {
// 获取模块信息
getRoleInfo(roleInfo) {
this.roleInfo = roleInfo;
this.getDimResList();
},
// 获取列表
async getDimResList() {
this.loading = true;
let res = await getDimResList({
current: this.current,
size: this.size,
roleId: this.roleInfo.id,
ruleName: `%${this.searchVal}%`,
});
this.loading = false;
if (res.data.code == 1) {
let { data, total, dict } = res.data.data;
this.total = total;
this.tableData = data;
this.dict = dict;
}
},
handleAdd() {
this.title = "新增";
this.addVisible = true;
this.$refs.AddResDim.onAdd(this.roleInfo);
},
handleDelAll() {
if (!this.selectedRowKeys.length) {
this.$message.warning("请先勾选数据");
return;
}
let ids = this.selectedRowKeys.join(",");
this.handleDel(ids);
},
// 关闭抽屉
onClose() {
this.searchVal = "";
this.selectedRowKeys = [];
this.Visible = false;
},
// 搜索
onSearch() {
this.current = 1;
this.getDimResList();
},
// 编辑
handleEdit(row) {
this.title = "编辑";
this.addVisible = true;
this.$refs.AddResDim.onEdit(row);
},
// 翻页
handleChange(cur) {
this.current = cur;
this.getDimResList();
},
// 改变每页显示数量
showSizeChange(current, size) {
this.current = current;
this.size = size;
this.getDimResList();
},
// 删除
handleDel(id) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "exclamation-circle",
maskClosable: true,
async onOk() {
let res = await delDimRes({ id });
if (res.data.code == 1) {
_this.$message.success(res.data.msg);
_this.getDimResList();
}
},
});
},
// 选中
onSelectChange(keys) {
this.selectedRowKeys = keys;
},
},
};
</script>
<style lang="less" scoped></style>
<template>
<div class="user-container">
<div class="control flex aic jcb mb15 pdr6">
<div>
<!-- <a-button type="primary" style="margin-right: 10px" @click="handleAdd"
>新增</a-button
>
<a-button type="danger" @click="handleDelAll">批量删除</a-button> -->
</div>
<div class="search-box">
<a-space>
<a-input
placeholder="请输入登录名搜索"
v-model="searchForm.loginName"
allowClear
/>
<a-input
placeholder="请输入用户姓名搜索"
v-model="searchForm.realName"
allowClear
/>
<a-button type="primary" @click="onSearch">搜索</a-button>
<a-button @click="resetSearch">重置</a-button>
</a-space>
</div>
</div>
<!-- 表格 -->
<div class="table-content">
<a-table
:loading="loading"
bordered
:scroll="{ y: 590 }"
:columns="columns"
:pagination="{
showTotal: (total) => `共 ${total} 条`,
current: current,
total: total,
pageSize: size,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
onChange: handleChange,
onShowSizeChange: showSizeChange,
}"
:data-source="tableData"
:rowKey="(record) => record.id"
>
<!-- 序号 -->
<span slot="num" slot-scope="text, record, index">{{
(current - 1) * size + index + 1
}}</span>
<!-- 操作 -->
<template slot="action" slot-scope="text">
<a-space size="middle">
<span class="primary pointer" @click="changeRole(text)"
>分配角色</span
>
</a-space>
</template>
</a-table>
</div>
<!-- 分配角色 -->
<AddUserRole
ref="AddUserRole"
:addVisible.sync="addVisible"
@addSuccess="getUserList"
></AddUserRole>
</div>
</template>
<script>
import { getUserList } from "@/services/system";
import { pageSizeOptions } from "@/config/pageConfig.js";
import AddUserRole from "./modal/AddUserRole.vue";
import { mapState } from "vuex";
export default {
components: { AddUserRole },
data() {
const columns = [
{
title: "序号",
dataIndex: "num",
width: "65px",
scopedSlots: {
customRender: "num",
},
},
{
title: "登录名",
dataIndex: "loginName",
},
{
title: "用户姓名",
dataIndex: "realName",
},
{
title: "所属角色",
dataIndex: "roleIds",
customRender: (text) => {
if (text && this.dict.roleIds) {
return <a-tag>{this.dict.roleIds[text]}</a-tag>;
}
},
},
{
title: "状态",
dataIndex: "status",
customRender: (text) => {
return <a-tag>{this.dict.status[text]}</a-tag>;
},
},
{
title: "操作",
width: "120px",
scopedSlots: { customRender: "action" },
},
];
return {
columns,
loading: false,
current: 1,
size: 10,
total: 0,
pageSizeOptions,
searchForm: {
loginName: "",
realName: "",
},
tableData: [],
selectedRowKeys: [],
dict: {}, // 字典
addVisible: false,
title: "新增",
loginNames: ["admin", "administrator1", "Administrator"],
};
},
computed: {
...mapState("site", ["userInfo"]),
},
created() {
this.getUserList();
},
methods: {
// 获取用户列表
async getUserList() {
this.loading = true;
let res = await getUserList({
page: this.current,
size: this.size,
...this.searchForm,
});
this.loading = false;
if (res.data.code == 1) {
let { data, total, dict } = res.data.data;
let { name } = this.userInfo;
if (this.loginNames.includes(name)) {
this.tableData = data;
this.total = total;
} else {
this.tableData = data.filter((v) => {
return !this.loginNames.includes(v.loginName);
});
this.total = total - this.loginNames.length;
}
this.dict = dict;
}
},
// 新增
handleAdd() {
this.title = "新增";
this.$refs.AddParameter.onAdd();
this.addVisible = true;
},
// 搜索
onSearch() {
this.current = 1;
this.getUserList();
},
resetSearch() {
this.current = 1;
Object.assign(this.searchForm, this.$options.data().searchForm);
this.getUserList();
},
// 分页
handleChange(num) {
this.current = num;
this.getUserList();
},
// 改变每页显示数量
showSizeChange(current, size) {
this.current = current;
this.size = size;
this.getUserList();
},
// 分配角色
changeRole(row) {
this.$refs.AddUserRole.onEdit(row);
this.addVisible = true;
},
},
};
</script>
<style lang="less" scoped>
.user-container {
width: 100%;
height: 100%;
}
</style>
<template>
<div>
<a-modal
title="分配角色"
:visible="Visible"
@cancel="handleCancel"
:maskClosable="false"
>
<a-button slot="footer" @click="handleReset">重置</a-button>
<a-button
slot="footer"
type="primary"
:loading="loading"
@click="handleOk"
>确定</a-button
>
<a-form-model
:model="form"
ref="form"
:rules="rules"
:label-col="{ span: 5 }"
:wrapper-col="{ span: 19 }"
>
<a-form-model-item label="选择角色" prop="roleIds">
<a-select
mode="multiple"
v-model="form.roleIds"
placeholder="请选择角色"
>
<a-select-option v-for="v in roleList" :key="v.id" :value="v.id">{{
v.name
}}</a-select-option>
</a-select>
</a-form-model-item>
</a-form-model>
</a-modal>
</div>
</template>
<script>
import { getRoleList, saveUser } from "@/services/system";
export default {
components: {},
props: {
addVisible: {
required: true,
type: Boolean,
default: false,
},
},
data() {
return {
loading: false,
form: {
roleIds: [],
},
roleList: [],
rules: {
roleIds: [{ required: true, message: "请选择角色", trigger: "change" }],
},
};
},
computed: {
Visible: {
get() {
return this.addVisible;
},
set(val) {
this.$emit("update:addVisible", val);
},
},
},
created() {
this.getRoleList();
},
methods: {
// 获取角色列表
async getRoleList() {
let res = await getRoleList({
page: 1,
size: -1,
});
if (res.data.code == 1) {
let { data } = res.data.data;
this.roleList = data;
}
},
// 新增
onAdd() {
Object.assign(this.form, this.$options.data().form);
this.form.id && this.$delete(this.form, "id");
},
// 编辑
onEdit(row) {
this.$nextTick(() => {
this.form = { ...row };
if (this.form.roleIds) {
this.form.roleIds = this.form.roleIds.split(",");
} else {
this.form.roleIds = [];
}
});
},
// 保存
handleOk() {
this.$refs.form.validate(async (valid) => {
if (valid) {
this.loading = true;
let { id, roleIds, lastLoginAddress, mobile } = this.form;
let res = await saveUser({
id,
lastLoginAddress,
mobile,
roleIds: roleIds.join(","),
});
this.loading = false;
let { code, msg } = res.data;
if (code == 1) {
this.$message.success(msg);
this.$emit("addSuccess");
this.handleCancel();
}
}
});
},
// 重置
handleReset() {
this.$refs.form.resetFields();
},
// 关闭
handleCancel() {
this.$refs.form.resetFields();
this.Visible = false;
},
},
};
</script>
<style lang="less" scoped></style>
......@@ -385,7 +385,6 @@ export default {
};
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
accept: "image/jpeg,image/png", // 上传类型
fileList: [],
loading: false,
......@@ -541,8 +540,7 @@ export default {
uid: -1,
status: "done",
name: this.form.photoPath,
url: this.api2 + this.form.photoPath,
url2: this.form.photoPath,
url: this.form.photoPath,
},
];
}
......@@ -564,17 +562,25 @@ export default {
this.$refs.formData.resetFields();
},
// 照片上传
handleChange({ fileList }) {
handleChange({ file, fileList }) {
if (
file.status &&
file.status != "removed" &&
file.response &&
file.response.code == -1
) {
this.$message.error(file.response.msg);
fileList = fileList.filter((file) => file.response.code != -1);
}
this.fileList = [...fileList].slice(-1);
this.fileList = this.fileList.map((v) => {
if (v.response) {
v.url2 = v.response.url;
v.url = this.api2 + v.response.url;
v.url = v.response.url;
}
return v;
});
if (this.fileList[0]) {
this.form.photoPath = this.fileList[0].url2;
this.form.photoPath = this.fileList[0].url;
} else {
this.form.photoPath = "";
}
......
......@@ -582,8 +582,7 @@ export default {
uid: -1,
status: "done",
name: this.form.photoPath,
url: this.api2 + this.form.photoPath,
url2: this.form.photoPath,
url: this.form.photoPath,
},
];
}
......@@ -599,17 +598,25 @@ export default {
},
// 照片上传
handleChange({ fileList }) {
handleChange({ file, fileList }) {
if (
file.status &&
file.status != "removed" &&
file.response &&
file.response.code == -1
) {
this.$message.error(file.response.msg);
fileList = fileList.filter((file) => file.response.code != -1);
}
this.fileList = [...fileList].slice(-1);
this.fileList = this.fileList.map((v) => {
if (v.response) {
v.url2 = v.response.url;
v.url = this.api2 + v.response.url;
v.url = v.response.url;
}
return v;
});
if (this.fileList[0]) {
this.form.photoPath = this.fileList[0].url2;
this.form.photoPath = this.fileList[0].url;
} else {
this.form.photoPath = "";
}
......
......@@ -228,8 +228,8 @@
<template slot="pic" slot-scope="text">
<img
v-if="text.photoPath"
:src="api2 + text.photoPath"
@click="handlePreview(api2 + text.photoPath)"
:src="text.photoPath"
@click="handlePreview(text.photoPath)"
class="pht"
/>
......@@ -408,7 +408,6 @@ export default {
visibleEditPwd: false,
editVisible: false,
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
siteId: local.getLocal("siteId"),
deptData: [], // 部门数据
windowData: [], // 窗口数据
......
......@@ -306,8 +306,34 @@ const options = {
meta: {
icon: "global",
},
redirect: "system/parameter",
redirect: "system/user",
children: [
{
path: "user",
name: "用户管理",
component: () => import("@/pages/basicset/system/user/User"),
meta: { invisible: true },
},
{
path: "role",
name: "角色管理",
component: () => import("@/pages/basicset/system/role/Role"),
meta: { invisible: true },
},
{
path: "resource",
name: "资源管理",
component: () =>
import("@/pages/basicset/system/resourceManage/Resource"),
meta: { invisible: true },
},
{
path: "dimension",
name: "维度管理",
component: () =>
import("@/pages/basicset/system/dimension/Dimension"),
meta: { invisible: true },
},
{
path: "parameter",
name: "系统参数",
......
......@@ -349,6 +349,44 @@ module.exports = {
save: `${BASE_URL}/base/task/save`,
delete: `${BASE_URL}/base/task/delete`,
},
// 维度
dimension: {
list: `${BASE_URL}/base/dimension/list`,
info: `${BASE_URL}/base/dimension/info`,
save: `${BASE_URL}/base/dimension/save`,
delete: `${BASE_URL}/base/dimension/delete`,
},
// 角色资源维度
dimensionResource: {
list: `${BASE_URL}/base/dimension/resource/rule/list`,
info: `${BASE_URL}/base/dimension/resource/rule/info`,
save: `${BASE_URL}/base/dimension/resource/rule/save`,
delete: `${BASE_URL}/base/dimension/resource/rule/delete`,
},
// 用户
user: {
list: `${BASE_URL}/base/user/list`,
info: `${BASE_URL}/base/user/info`,
save: `${BASE_URL}/base/user/save`,
delete: `${BASE_URL}/base/user/delete`,
},
// 角色
role: {
list: `${BASE_URL}/base/role/list`,
info: `${BASE_URL}/base/role/info`,
save: `${BASE_URL}/base/role/save`,
delete: `${BASE_URL}/base/role/delete`,
authList: `${BASE_URL}/base/role/auth/list`,
distributionSource: `${BASE_URL}/base/role/auth/distributionSource`,
},
// 资源
resource: {
list: `${BASE_URL}/base/resource/list`,
info: `${BASE_URL}/base/resource/info`,
save: `${BASE_URL}/base/resource/save`,
delete: `${BASE_URL}/base/resource/delete`,
refreshUrl: `${BASE_URL}/base/resource/refreshUrl`,
},
},
// 站点大厅
hall: {
......
import userService from './user'
import userService from "./user";
export {
userService
import { upload } from "@/services/basicsetApi";
import { request, METHOD } from "@/utils/request";
// 上传文件
export async function uploadFile(data) {
return request(upload.file, METHOD.POST, data);
}
export { userService };
......@@ -46,3 +46,112 @@ export async function saveSystemTask(data) {
export async function delSystemTask(data) {
return request(system.task.delete, METHOD.GET, data);
}
/*
* 用户管理
*/
// 获取用户列表
export async function getUserList(data) {
return request(system.user.list, METHOD.POST, data);
}
// 获取用户信息
export async function getUserInfo(data) {
return request(system.user.info, METHOD.GET, data);
}
// 保存用户信息
export async function saveUser(data) {
return request(system.user.save, METHOD.POST, data);
}
// 删除用户信息
export async function delUser(data) {
return request(system.user.delete, METHOD.GET, data);
}
/*
* 角色管理
*/
// 获取角色列表
export async function getRoleList(data) {
return request(system.role.list, METHOD.POST, data);
}
// 获取角色信息
export async function getRoleInfo(data) {
return request(system.role.info, METHOD.GET, data);
}
// 保存角色信息
export async function saveRole(data) {
return request(system.role.save, METHOD.POST, data);
}
// 删除角色信息
export async function delRole(data) {
return request(system.role.delete, METHOD.GET, data);
}
// 获取角色资源列表
export async function getRoleResourceList(data) {
return request(system.role.authList, METHOD.POST, data);
}
// 保存角色资源信息
export async function saveRoleResource(data) {
return request(system.role.distributionSource, METHOD.POST, data);
}
/*
* 资源管理
*/
// 获取资源列表
export async function getResourceList(data) {
return request(system.resource.list, METHOD.POST, data);
}
// 获取资源信息
export async function getResourceInfo(data) {
return request(system.resource.info, METHOD.GET, data);
}
// 保存资源信息
export async function saveResource(data) {
return request(system.resource.save, METHOD.POST, data);
}
// 删除资源信息
export async function delResource(data) {
return request(system.resource.delete, METHOD.GET, data);
}
// 刷新资源
export async function refreshResource(data) {
return request(system.resource.refreshUrl, METHOD.POST, data);
}
/*
* 维度管理
*/
// 获取维度列表
export async function getDimensionList(data) {
return request(system.dimension.list, METHOD.POST, data);
}
// 获取维度信息
export async function getDimensionInfo(data) {
return request(system.dimension.info, METHOD.GET, data);
}
// 保存维度信息
export async function saveDimension(data) {
return request(system.dimension.save, METHOD.POST, data);
}
// 删除维度信息
export async function delDimension(data) {
return request(system.dimension.delete, METHOD.GET, data);
}
// 获取角色资源维度列表
export async function getDimResList(data) {
return request(system.dimensionResource.list, METHOD.POST, data);
}
// 获取角色资源维度信息
export async function getDimResInfo(data) {
return request(system.dimensionResource.info, METHOD.GET, data);
}
// 保存角色资源维度信息
export async function saveDimRes(data) {
return request(system.dimensionResource.save, METHOD.POST, data);
}
// 删除角色资源维度信息
export async function delDimRes(data) {
return request(system.dimensionResource.delete, METHOD.GET, data);
}
......@@ -49,6 +49,11 @@ module.exports = {
},
// cookieDomainRewrite: 'localhost',
},
"/file": {
//此处要与 /services/api.js 中的 API_PROXY_PREFIX 值保持一致
target: process.env.VUE_APP_API_BASE_URL,
changeOrigin: true,
},
},
},
pluginOptions: {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -348,5 +348,6 @@ PRIMARY KEY (`id`)
ALTER TABLE mortals_sys_dept ADD COLUMN `inNum` int(9) DEFAULT '0' COMMENT '入驻事项数量' AFTER updateTime;
INSERT INTO mortals_xhx_task VALUES (null, '同步全部站点事项材料附件', 'SyncMatterDaumFileTask', 0, 'SyncMatterDaumFileTask', '', '', 1, 3600, '16:05', '', '192.168.1.107', '2024-05-18 16:05:00', 0, '2024-03-01 10:59:53', 1, '系统管理员');
-- ----------------------------
-- 数据授权权限表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_dimension`;
CREATE TABLE `mortals_xhx_dimension` (
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`dimension_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '维度编码',
`dimension_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '维度名称',
`dimension_value` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '维度值',
`dimension_type` tinyint(2) DEFAULT '1' COMMENT '维度类型(1.固定值,2.系统上下问变量)',
`createTime` datetime COMMENT '创建时间',
`createUserId` bigint(20) COMMENT '创建用户',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC COMMENT='授权维度';
-- ----------------------------
-- 角色资源授权规则表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_dimension_resource_rule`;
CREATE TABLE `mortals_xhx_dimension_resource_rule` (
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`role_id` bigint(20) DEFAULT NULL COMMENT '角色ID',
`role_name` varchar(64) DEFAULT NULL COMMENT '角色名称',
`resource_id` bigint(20) DEFAULT NULL COMMENT '资源ID',
`resource_name` varchar(64) DEFAULT NULL COMMENT '资源名称',
`rule_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '规则编码',
`rule_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '规则名称',
`rule_condition` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT 'IN' COMMENT '规则条件(IN.属于,<.小于,>.大于,=.等于,!=.不等于,>=.大于等于,<=.小于等于,like %.左模糊,like %.右模糊)',
`rule_value` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '规则值,固定值或者系统变量',
`rule_type` tinyint(2) DEFAULT '1' COMMENT '规则值类型(1.固定值,2.系统上下问变量)',
`create_time` datetime COMMENT '创建时间',
`create_user_id` bigint(20) COMMENT '创建用户',
`update_user_id` bigint(20) COMMENT '更新用户',
`update_time` datetime COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC COMMENT='角色资源维度规则表';
This source diff could not be displayed because it is too large. You can view the blob instead.
package com.mortals.xhx.annotation;
import java.lang.annotation.*;
/**
*
* @author: zxfei
* @date: 2024/5/15 16:09
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
@Documented
public @interface DataPermission {
/**
* 数据权限类型
* 1 上下级授权 2 数据范围授权
*/
String permissionType() default "2";
/**
* 配置菜单的组件路径,用于数据权限
*/
String componentRoute() default "";
}
package com.mortals.xhx.base.framework.aspect;
import com.mortals.framework.service.IAuthTokenService;
import com.mortals.framework.service.IUser;
import com.mortals.xhx.annotation.DataPermission;
import com.mortals.xhx.common.utils.RuleQueryGenerator;
import com.mortals.xhx.module.dimension.model.DimensionResourceRuleEntity;
import com.mortals.xhx.module.dimension.service.DimensionResourceRuleService;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.util.List;
@Aspect
@Slf4j
//@Component
public class DataPermissionAspect {
@Autowired
private DimensionResourceRuleService dimensionResourceRuleService;
@Autowired
private IAuthTokenService authTokenService;
public static final String DATA_PERMISSION_SEARCH_SQL = "DATA_PERMISSION_SEARCH_SQL";
@Pointcut("@annotation(com.mortals.xhx.annotation.DataPermission)")
public void pointCut() {
}
@Around("pointCut()")
public Object around(ProceedingJoinPoint point) throws Throwable {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
String componentRoute = request.getServletPath();
IUser loginUser = authTokenService.getLoginUser(request);
MethodSignature signature = (MethodSignature) point.getSignature();
Method method = signature.getMethod();
DataPermission permissionData = method.getAnnotation(DataPermission.class);
if (!ObjectUtils.isEmpty(permissionData)&&!ObjectUtils.isEmpty(componentRoute)) {
//获取授权方式
String permissionType = permissionData.permissionType();
//获取组件路由 通过controller 获取
// String componentRoute = permissionData.componentRoute();
// 查找当前用户此资源路径下的所有规则
List<DimensionResourceRuleEntity> componentRules = dimensionResourceRuleService.getRoleComponentRule(loginUser.getId(), componentRoute);
if (!ObjectUtils.isEmpty(componentRules)) {
//在request添加属性
//todo 构建数据权限sql 并设置到request中。
String permissionSql = RuleQueryGenerator.getPermissionSql(componentRules, loginUser);
log.info("permissionSql:{}", permissionSql);
request.setAttribute(DATA_PERMISSION_SEARCH_SQL, permissionSql);
}
}
return point.proceed();
}
}
......@@ -20,6 +20,7 @@ import io.jsonwebtoken.SignatureAlgorithm;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Primary;
import org.springframework.core.annotation.Order;
import org.springframework.data.redis.core.RedisTemplate;
......@@ -44,6 +45,7 @@ import java.util.Set;
public class AuthTokenServiceImpl implements IAuthTokenService {
@Autowired
@Lazy
private UserService userService;
// 令牌自定义标识
......
......@@ -32,6 +32,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -61,7 +62,6 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
@Autowired
private IUserFeign userFeign;
private static Log logger = LogFactory.getLog(LoginController.class);
@RequestMapping("login")
public String login(@RequestBody LoginForm loginForm) throws Exception {
......
......@@ -25,6 +25,7 @@ import com.mortals.xhx.base.system.role.service.RoleAuthService;
import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.common.utils.ControllerScanUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
......@@ -49,6 +50,7 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao, Re
private ICacheService cacheService;
@Autowired
@Lazy
private RoleAuthService roleAuthService;
@Override
......
......@@ -7,7 +7,6 @@ import com.mortals.framework.common.code.UserType;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.role.model.RoleQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......
......@@ -58,6 +58,10 @@ public class UploadServiceImpl implements UploadService {
throw new AppException("文件上传大小超过限制!");
}
if (null != fileName && fileName.length() > 50) {
throw new AppException("文件名称过长,无法上传!");
}
String rootPath = this.filePath.endsWith("/") ? this.filePath : this.filePath + "/";
String filePath = rootPath + (StringUtils.isEmpty(prePath) ? "" : prePath + "/");
......@@ -170,4 +174,14 @@ public class UploadServiceImpl implements UploadService {
}
}
public static void main(String[] args) {
String fileName="好.txt";
System.out.println(fileName.length());
}
}
\ No newline at end of file
......@@ -77,6 +77,7 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
@Autowired
private RoleUserService roleUserService;
@Autowired
@Lazy
private SiteService siteService;
@Lazy
......@@ -122,6 +123,29 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
this.doHandlerUser(entity);
}
@Override
protected void saveAfter(UserEntity entity, Context context) throws AppException {
//新增角色
updateUserRole(entity);
super.saveAfter(entity, context);
}
@Override
protected void updateAfter(UserEntity entity, Context context) throws AppException {
updateUserRole(entity);
super.updateAfter(entity, context);
}
private void updateUserRole(UserEntity entity) {
if (!ObjectUtils.isEmpty(entity.getId()) && entity.getId().longValue() != SysConstains.ADMIN_ID && !ObjectUtils.isEmpty(entity.getRoleIds())) {
RoleUserQuery roleUserQuery = new RoleUserQuery();
roleUserQuery.setUserId(entity.getId());
List<Long> idList = Arrays.asList(entity.getRoleIds().split(",")).stream().map(Long::parseLong).collect(Collectors.toList());
roleUserQuery.setRoleIdList(idList);
roleUserService.doDistributionRole(roleUserQuery);
}
}
@Override
protected UserEntity findBefore(UserEntity params, Context context) throws AppException {
// if (StringUtils.isNotEmpty(params.getDeptIds())) {
......
......@@ -17,6 +17,7 @@ import com.mortals.xhx.common.code.UserStatus;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
......@@ -58,13 +59,13 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
}
}
@Override
/* @Override
protected void saveBefore(UserEntity entity, Map<String, Object> model, Context context) throws AppException {
if (service.existUser(entity.getLoginName(), entity.getId())) {
if (!ObjectUtils.isEmpty(entity.getLoginName())&&service.existUser(entity.getLoginName(), entity.getId())) {
throw new AppException("登录名已存在!");
}
super.saveBefore(entity, model, context);
}
}*/
@RequestMapping(value = "change/password", method = RequestMethod.POST)
......
......@@ -9,6 +9,10 @@ import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.ParamDto;
import com.mortals.framework.model.Result;
import com.mortals.xhx.common.code.SourceEnum;
import com.mortals.xhx.module.app.model.AppDatasetEntity;
import com.mortals.xhx.module.app.model.AppDatasetQuery;
import com.mortals.xhx.module.app.service.AppDatasetService;
import com.mortals.xhx.module.app.service.AppInfoFieldService;
import com.mortals.xhx.module.business.model.BusinessMatterEntity;
import com.mortals.xhx.module.business.model.BusinessMatterQuery;
import com.mortals.xhx.module.business.service.BusinessMatterService;
......@@ -41,10 +45,7 @@ import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StopWatch;
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 org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Arrays;
......@@ -74,13 +75,13 @@ public class DemoWebApiController {
@Autowired
private MatterService matterService;
@Autowired
private SiteThemeService siteThemeService;
@Autowired
private SiteThemeMatterService siteThemeMatterService;
@Autowired
private BusinessMatterService businessMatterService;
@Autowired
private AppDatasetService appDatasetService;
@Autowired
private AppInfoFieldService appInfoFieldService;
@PostMapping(value = "testGov")
......@@ -327,7 +328,7 @@ public class DemoWebApiController {
public Rest<String> limit() {
log.info("limit in");
try {
String tableName="mortals_sys_area";
String tableName = "mortals_sys_area";
//CacheDataUtil.getInstance().getBaseData()
return Rest.ok();
......@@ -338,6 +339,33 @@ public class DemoWebApiController {
}
@GetMapping(value = "genApp")
@UnAuth
public Rest<String> genApp() {
try {
AppDatasetQuery appDatasetQuery = new AppDatasetQuery();
appDatasetQuery.setAppId(304L);
List<AppDatasetEntity> appDatasetEntities = appDatasetService.find(appDatasetQuery);
StringBuilder sb = new StringBuilder();
for (AppDatasetEntity appDatasetEntity : appDatasetEntities) {
sb.append(String.format("INSERT INTO `mortals_sys_app_info_field`(`id`, `datasetId`, `fieldCode`, `fieldName`, `fieldType`, `fieldTypeValue`, `dataType`, `fieldValue`, `defaultValue`, `fieldLen`, `fieldNull`, `isList`, `fieldOrderNo`, `remark`, `createTime`, `createUserId`, `updateTime`, `updateUserId`, `serviceApi`, `serviceApiParams`) VALUES (null, %s, 'name', '政策全称', 'input', '', 'string', '', '', 128, 0, 1, 99, '', '2024-05-29 17:55:38', 1, '2024-05-29 17:55:38', 1, '', '');", appDatasetEntity.getId()));
sb.append("\n");
}
log.info("sql:{}",sb.toString());
//INSERT INTO `mortals_sys_app_info_field`(`id`, `datasetId`, `fieldCode`, `fieldName`, `fieldType`, `fieldTypeValue`, `dataType`, `fieldValue`, `defaultValue`, `fieldLen`, `fieldNull`, `isList`, `fieldOrderNo`, `remark`, `createTime`, `createUserId`, `updateTime`, `updateUserId`, `serviceApi`, `serviceApiParams`) VALUES (null, 755, 'name', '政策全称', 'input', '', 'string', '', '', 128, 0, 1, 99, '', '2024-05-29 17:55:38', 1, '2024-05-29 17:55:38', 1, '', '');
return Rest.ok();
} catch (Exception e) {
log.error("异常:", e.getMessage());
return Rest.fail(e.getMessage());
}
}
public static void main(String[] args) {
System.out.println(1001 / 500);
......
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 维度类型(1.固定值,2.系统上下问变量)枚举类
*
* @author zxfei
*/
public enum DimensionTypeEnum {
固定值(1, "固定值"),
系统上下问变量(2, "系统上下问变量");
private Integer value;
private String desc;
DimensionTypeEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static DimensionTypeEnum getByValue(Integer value) {
for (DimensionTypeEnum dimensionTypeEnum : DimensionTypeEnum.values()) {
if (dimensionTypeEnum.getValue() == value) {
return dimensionTypeEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (DimensionTypeEnum item : DimensionTypeEnum.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.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 规则条件(IN.属于,<.小于,>.大于,=.等于,!=.不等于,>=.大于等于,<=.小于等于,like %.左模糊,like %.右模糊)枚举类
*
* @author zxfei
*/
public enum RuleConditionEnum {
属于("IN", "属于"),
小于("<", "小于"),
大于(">", "大于"),
等于("=", "等于"),
不等于("!=", "不等于"),
大于等于(">=", "大于等于"),
小于等于("<=", "小于等于"),
左模糊("like %", "左模糊"),
右模糊("like %", "右模糊");
private String value;
private String desc;
RuleConditionEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static RuleConditionEnum getByValue(String value) {
for (RuleConditionEnum ruleConditionEnum : RuleConditionEnum.values()) {
if (ruleConditionEnum.getValue() == value) {
return ruleConditionEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(String... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (RuleConditionEnum item : RuleConditionEnum.values()) {
try {
boolean hasE = false;
for (String 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.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 规则值类型(1.固定值,2.系统上下问变量)枚举类
*
* @author zxfei
*/
public enum RuleTypeEnum {
固定值(1, "固定值"),
系统上下问变量(2, "系统上下问变量");
private Integer value;
private String desc;
RuleTypeEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static RuleTypeEnum getByValue(Integer value) {
for (RuleTypeEnum ruleTypeEnum : RuleTypeEnum.values()) {
if (ruleTypeEnum.getValue() == value) {
return ruleTypeEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (RuleTypeEnum item : RuleTypeEnum.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.common.utils;
import com.mortals.framework.service.IUser;
import com.mortals.xhx.module.dimension.model.DimensionResourceRuleEntity;
import org.apache.commons.compress.utils.Lists;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
public class DataPermissionUtils {
public static final String COMPONENT_DATA_RULES = "COMPONENT_DATA_RULES";
public static final String SYS_USER_INFO = "SYS_USER_INFO";
/**
* 往链接请求里面,传入数据查询条件
*
* @param request
* @param componentRules
*/
public static void installDataSearchConditon(HttpServletRequest request, List<DimensionResourceRuleEntity> componentRules) {
// 1.先从request获取MENU_DATA_AUTHOR_RULES,如果存则获取到LIST
List<DimensionResourceRuleEntity> list = loadDataSearchCondition(request);
if (list == null) {
// 2.如果不存在,则new一个list
list = Lists.newArrayList();
}
list.addAll(componentRules);
// 3.往list里面增量存指
request.setAttribute(COMPONENT_DATA_RULES, list);
}
/**
* 往链接请求里面,传入数据查询条件
*
* @param request
* @param searchSql
*/
public static void installSearchSql(HttpServletRequest request,String searchSql) {
// 1.先从request获取MENU_DATA_AUTHOR_RULES,如果存则获取到LIST
// 3.往list里面增量存指
// request.setAttribute(DATA_PERMISSION_SEARCH_SQL, searchSql);
}
/**
* 获取请求对应的数据权限规则
*/
@SuppressWarnings("unchecked")
public static synchronized List<DimensionResourceRuleEntity> loadDataSearchCondition(HttpServletRequest request) {
return (List<DimensionResourceRuleEntity>) request.getAttribute(COMPONENT_DATA_RULES);
}
public static synchronized void installUserInfo(HttpServletRequest request, IUser userinfo) {
request.setAttribute(SYS_USER_INFO, userinfo);
}
}
......@@ -111,7 +111,7 @@ public class MatterDetailHtmlParseUtil {
List<String> allGroup = ReUtil.findAllGroup1("'(.*?)'", onclickStr);
if (!ObjectUtils.isEmpty(allGroup)) {
String encryUrl = "http://www.sczwfw.gov.cn/jiq/interface/item/annex/encryptUrl?id=" + allGroup.get(0);
/* String encryUrl = "http://www.sczwfw.gov.cn/jiq/interface/item/annex/encryptUrl?id=" + allGroup.get(0);
String resp = HttpUtil.get(encryUrl);
JSONObject obj = JSON.parseObject(resp);
......@@ -120,7 +120,8 @@ public class MatterDetailHtmlParseUtil {
if ("0".equals(code)) {
fileEntity.setFileUrl(data);
fileEntity.setLocalFileUrl(data);
}
}*/
fileEntity.setFileUrl(allGroup.get(0));
}
// fileEntity.setFileUrl(node.firstChild().attr("href").trim());
......@@ -150,7 +151,7 @@ public class MatterDetailHtmlParseUtil {
List<String> allGroup = ReUtil.findAllGroup1("'(.*?)'", onclickStr);
if (!ObjectUtils.isEmpty(allGroup)) {
String encryUrl = "http://www.sczwfw.gov.cn/jiq/interface/item/annex/encryptUrl?id=" + allGroup.get(0);
/* String encryUrl = "http://www.sczwfw.gov.cn/jiq/interface/item/annex/encryptUrl?id=" + allGroup.get(0);
String resp = HttpUtil.get(encryUrl);
JSONObject obj = JSON.parseObject(resp);
......@@ -159,7 +160,8 @@ public class MatterDetailHtmlParseUtil {
if ("0".equals(code)) {
fileEntity.setFileUrl(data);
fileEntity.setLocalFileUrl(data);
}
}*/
fileEntity.setFileUrl(allGroup.get(0));
}
// fileEntity.setFileUrl(node.firstChild().attr("href").trim());
datumSampleFileEntities.add(fileEntity);
......
package com.mortals.xhx.common.utils;
import cn.hutool.core.util.ReflectUtil;
import com.google.common.collect.Maps;
import com.mortals.framework.service.IUser;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.common.code.RuleConditionEnum;
import com.mortals.xhx.common.code.RuleTypeEnum;
import com.mortals.xhx.module.dimension.model.DimensionResourceRuleEntity;
import lombok.experimental.UtilityClass;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 权限sql 查询语句实现
*
* @author: zxfei
* @date: 2024/5/15 10:44
*/
@Slf4j
@UtilityClass
public class RuleQueryGenerator {
private static final String SQL_AND = " and ";
private static final String SQL_OR = " or ";
private static final String SQL_JOINT = " (%s) ";
public static String getPermissionSql(List<DimensionResourceRuleEntity> conditionList, IUser loginUser) {
//存在权限
//对当前身份根据规则编码分组-去除不同角色中相同编码且规则值为ALL的规则 并根据角色id分组
Map<Long, List<DimensionResourceRuleEntity>> ruleMap = getRuleMapByRoleId(conditionList);
StringBuilder sb = new StringBuilder();
String roleSql;
if (MapUtils.isNotEmpty(ruleMap)) {
//按角色拼接SQL
for (Map.Entry<Long, List<DimensionResourceRuleEntity>> entry : ruleMap.entrySet()) {
List<DimensionResourceRuleEntity> lists = entry.getValue();
// 同角色之间使用 AND
roleSql = buildRoleSql(lists, loginUser);
//角色之间使用 OR
if (StringUtils.isNotEmpty(roleSql)) {
jointSqlByRoles(sb, roleSql);
}
}
}
return sb.toString();
}
/**
* 获取带有数据权限的SQL
*
* @param identityId 身份ID
*/
public String getPermissionSql(String identityId) {
//------------------------获取当前身份的数据规则------------------------------------
List<DimensionResourceRuleEntity> conditionList = getCurrentIdentyPermission(identityId);
if (ObjectUtils.isEmpty(conditionList)) {
//没有权限
return "1 = 0";
}
//存在权限
//对当前身份根据规则编码分组-去除不同角色中相同编码且规则值为ALL的规则 并根据角色id分组
Map<Long, List<DimensionResourceRuleEntity>> ruleMap = getRuleMapByRoleId(conditionList);
StringBuilder sb = new StringBuilder();
String roleSql;
if (MapUtils.isNotEmpty(ruleMap)) {
//按角色拼接SQL
for (Map.Entry<Long, List<DimensionResourceRuleEntity>> entry : ruleMap.entrySet()) {
List<DimensionResourceRuleEntity> lists = entry.getValue();
// 同角色之间使用 AND
roleSql = buildRoleSql(lists, null);
//角色之间使用 OR
if (StringUtils.isNotEmpty(roleSql)) {
jointSqlByRoles(sb, roleSql);
}
}
}
return sb.toString();
}
private static List<DimensionResourceRuleEntity> getCurrentIdentyPermission(String identityId) {
return null;
/* //----------------------------获取所有数据规则-----------------------------
List<DimensionResourceRuleEntity> roleRuleList = DataPermissionUtils.loadDataSearchCondition();
if(ObjectUtils.isEmpty(roleRuleList)){
return null;
}
//-----------------------------过滤掉不属于当前身份的规则-----------------------------------
return roleRuleList.stream()
// .filter(item -> item.getIdentityId().equals(identityId))
.collect(Collectors.toList());*/
}
/**
* 构建单角色SQL
*/
private static String buildRoleSql(List<DimensionResourceRuleEntity> lists, IUser loginUser) {
StringBuilder roleSql = new StringBuilder();
for (DimensionResourceRuleEntity item : lists) {
//如果出现全选 则 代表全部,不需要限定范围
if ("ALL".equals(item.getRuleValue())) {
continue;
}
//将规则转换成SQL
String filedSql = convertRuleToSql(item, loginUser);
if(!ObjectUtils.isEmpty(filedSql)){
roleSql.append(SQL_AND).append(filedSql);
}
}
return roleSql.toString();
}
/**
* 将单一规则转化成SQL,默认全部使用 In
* ruleCode : area_test
* ruleValue : 区域1,区域2,区域3
*
* @param rule 规则值
*/
private static String convertRuleToSql(DimensionResourceRuleEntity rule, IUser loginUser) {
//判断规则类型
String ruleValueConvert = "";
if (RuleConditionEnum.属于.getValue().equalsIgnoreCase(rule.getRuleCondition())) {
String whereCondition = " in ";
if(RuleTypeEnum.系统上下问变量.getValue()==rule.getRuleType()){
ruleValueConvert = getInConditionValue(rule.getRuleValue(),loginUser);
if(ObjectUtils.isEmpty(ruleValueConvert)) return null;
return rule.getRuleCode() + whereCondition + ruleValueConvert;
}else{
ruleValueConvert = getInConditionValue(rule.getRuleValue());
if(ObjectUtils.isEmpty(ruleValueConvert)) return null;
return rule.getRuleCode() + whereCondition + ruleValueConvert;
}
} else if (RuleConditionEnum.大于.getValue().equalsIgnoreCase(rule.getRuleCondition())) {
String whereCondition = " > ";
ruleValueConvert = getGreaterConditionValue(rule.getRuleValue());
return rule.getRuleCode() + whereCondition + ruleValueConvert;
} else {
//todo
//不支持的类型
}
return null;
}
/**
* IN字符串转换
* 区域1, 区域2, 区域3 --> ("区域1","区域2","区域3")
* 江西大区 --> ("江西大区")
*/
private static String getInConditionValue(String ruleValue) {
String[] temp = ruleValue.split(",");
StringBuilder res = new StringBuilder();
for (String string : temp) {
res.append(",'").append(string).append("'");
}
return "(" + res.substring(1) + ")";
}
/**
* IN字符串转换
* 区域1, 区域2, 区域3 --> ("区域1","区域2","区域3")
* 江西大区 --> ("江西大区")
*/
private static String getInConditionValue(String ruleValue,IUser loginUser) {
//el表达式 提取变量 再通过反射获取值,最终设置值
Object fieldValue = ReflectUtil.getFieldValue(loginUser, ruleValue);
if(fieldValue!=null){
return "(" + fieldValue + ")";
}
return null;
}
/**
* > 字符串转换
* 区域1, 区域2, 区域3 --> ("区域1","区域2","区域3")
* 江西大区 --> ("江西大区")
*/
private static String getGreaterConditionValue(String ruleValue) {
return ruleValue;
}
/**
* 拼接单角色的SQL
*
* @param sqlBuilder 总的SQL
* @param roleSql 单角色SQL
*/
private static void jointSqlByRoles(StringBuilder sqlBuilder, String roleSql) {
roleSql = roleSql.replaceFirst(SQL_AND, "");
if (StringUtils.isEmpty(sqlBuilder.toString())) {
sqlBuilder.append(String.format(SQL_JOINT, roleSql));
} else {
sqlBuilder.append(SQL_OR).append(String.format(SQL_JOINT, roleSql));
}
}
/**
* 1. 对当前身份根据规则编码分组-去除不同角色中相同编码且规则值为ALL的规则
* 2. 对角色进行分组
*
* @param conditionList 数据规则
* @return 分组后的规则list
*/
public static Map<Long, List<DimensionResourceRuleEntity>> getRuleMapByRoleId(List<DimensionResourceRuleEntity> conditionList) {
//--------过滤掉不属于当前身份的规则,并对条件编码进行分组-----------------------------------
Map<String, List<DimensionResourceRuleEntity>> conditionMap = conditionList.stream().collect(Collectors.groupingBy(DimensionResourceRuleEntity::getRuleCode));
//--------相同编码分组中存在ALL的排除掉-----------------------------------------------
List<DimensionResourceRuleEntity> newRoleRuleList = new ArrayList<>();
if (MapUtils.isNotEmpty(conditionMap)) {
for (Map.Entry<String, List<DimensionResourceRuleEntity>> entry : conditionMap.entrySet()) {
boolean flag = true;
List<DimensionResourceRuleEntity> lists = entry.getValue();
for (DimensionResourceRuleEntity item : lists) {
if ("ALL".equals(item.getRuleValue())) {
flag = false;
break;
}
}
if (flag) {
newRoleRuleList.addAll(lists);
}
}
}
if (CollectionUtils.isNotEmpty(newRoleRuleList)) {
return newRoleRuleList.stream().collect(Collectors.groupingBy(DimensionResourceRuleEntity::getRoleId));
}
return Maps.newHashMap();
}
}
package com.mortals.xhx.daemon.applicationservice;
import com.mortals.framework.common.Rest;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.util.ThreadPool;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.user.UserPdu;
import com.mortals.xhx.common.utils.SendTaskThreadPool;
import com.mortals.xhx.feign.user.IUserFeign;
import com.mortals.framework.springcloud.service.IApplicationService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.mortals.framework.springcloud.service.IApplicationService;
import org.springframework.util.ObjectUtils;
import java.util.List;
@Component
//@Component
public class DemoStartService implements IApplicationService {
private static Log logger = LogFactory.getLog(DemoStartService.class);
@Autowired
private ICacheService cacheService;
@Autowired
private IUserFeign userFeign;
@Autowired
private UserService userService;
@Override
public void start() {
// ThreadPool.getInstance().init(10);
logger.info("开始服务..[配置已加载完成,但部分框架还未初始化,比如:Kafka]");
/* Rest<String> rest = userFeign.synchSiteAuth();
if (rest.getCode().equals(YesNoEnum.YES.getValue())) {
UserPdu userPdu = new UserPdu();
userPdu.setPage(1);
userPdu.setSize(-1);
Rest<RespData<List<UserPdu>>> list = userFeign.list(userPdu);
if(!ObjectUtils.isEmpty(list.getData().getData())){
//初始化更新门户用户站点树
cacheService.del(Constant.USER_SITE_TREE);
userService.updateUserList(list.getData().getData());
}
}*/
}
@Override
......
package com.mortals.xhx.daemon.applicationservice;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.IUser;
import com.mortals.framework.springcloud.config.web.BaseWebMvcConfigurer;
import com.mortals.framework.springcloud.service.IApplicationStartedService;
import com.mortals.framework.util.ThreadPool;
import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.model.UserQuery;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.common.pdu.user.UserPdu;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.common.utils.SyncTreeSiteThread;
import com.mortals.xhx.feign.user.IUserFeign;
import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.site.model.SiteTreeSelect;
import com.mortals.xhx.module.site.service.SiteService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
import com.mortals.framework.springcloud.service.IApplicationStartedService;
import org.springframework.util.ObjectUtils;
import java.util.List;
import static com.mortals.xhx.common.key.Constant.USER_SITE_TREE;
@Component
@Slf4j
public class DemoStartedService implements IApplicationStartedService {
private static Log logger = LogFactory.getLog(DemoStartedService.class);
@Autowired
private IUserFeign userFeign;
@Autowired
private UserService userService;
@Autowired
private ICacheService cacheService;
@Autowired
......@@ -47,54 +25,16 @@ public class DemoStartedService implements IApplicationStartedService {
@Override
public void start() {
ThreadPool.getInstance().init(6);
logger.info("开始服务..[初始化用户站点树]");
ThreadPool.getInstance().init(10);
log.info("开始服务..[初始化用户站点树]");
//删除redis 中的 站点树
cacheService.del(USER_SITE_TREE);
siteService.updateAllSiteTree(null);
//测试获取站点
/*
int i=0;
while (true) {
SiteEntity siteCache = siteService.getCache("1");
if (ObjectUtils.isEmpty(siteCache)) {
log.error("siteCache is null");
}else {
log.info("count==>"+i);
}
try {
Thread.sleep(50);
i++;
} catch (InterruptedException e) {
}
}*/
/* UserEntity userEntity = new UserEntity();
userEntity.initAttrValue();
userEntity.setId(0L);
Context contextTemp = new Context();
contextTemp.setUser(userEntity);
SyncTreeSiteThread syncTreeSiteThread = new SyncTreeSiteThread(contextTemp);
ThreadPool.getInstance().execute(syncTreeSiteThread);
userEntity = new UserEntity();
userEntity.initAttrValue();
userEntity.setId(1L);
contextTemp = new Context();
contextTemp.setUser(userEntity);
syncTreeSiteThread = new SyncTreeSiteThread(contextTemp);
ThreadPool.getInstance().execute(syncTreeSiteThread);*/
}
@Override
public void stop() {
logger.info("停止服务..");
log.info("停止服务..");
}
@Override
......
......@@ -50,6 +50,11 @@ public class SyncMatterTaskImpl implements ITaskExcuteService {
stopWatch.stop();
log.info("同步站点部门完成,耗时:{}s", stopWatch.getLastTaskTimeMillis() / 1000);
log.info("开始同步事项==》{}", siteEntity.getSiteName());
stopWatch.start("同步删除本地多余的政务事项");
log.info("同步删除本地多余的政务事项");
matterExtService.syncDelMatterBySiteId(siteEntity, null);
stopWatch.stop();
log.info("同步删除本地多余的政务事项完成,耗时:{}s", stopWatch.getLastTaskTimeMillis() / 1000);
stopWatch.start("开始同步事项方法");
matterExtService.syncMatterBySiteId(siteEntity, null);
......
......@@ -30,11 +30,6 @@ import java.util.stream.Collectors;
@Service("areaService")
public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaEntity, Long> implements AreaService {
@Autowired
private SiteService siteService;
@Autowired
private BaseAreaService baseAreaService;
@Override
public void putCache(String key, AreaEntity data) {
......
package com.mortals.xhx.module.dept.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.module.dept.model.DeptEntity;
......@@ -20,9 +21,12 @@ public interface DeptDao extends ICRUDDao<DeptEntity,Long>{
String GET_DEPT_LIST_BY_BUSINESS = "getDeptListByBusiness";
String GET_BUSINESS_BY_DEPT = "getBusinessByDept";
String GET_DEPTLIST_BY_EXISTBUSINESS = "getDeptListByExistBusiness";
List<DeptVo> getDeptListByBusiness(DeptQuery deptQuery);
List<DeptVo> getBusinessByDept(DeptQuery deptQuery);
List<DeptEntity> getDeptListByExistBusiness(DeptQuery deptQuery);
}
package com.mortals.xhx.module.dept.dao.ibatis;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.ParamDto;
import com.mortals.framework.model.Result;
import com.mortals.xhx.module.dept.model.DeptQuery;
......@@ -9,17 +10,21 @@ import com.mortals.xhx.module.matter.model.MatterEntity;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.dept.dao.DeptDao;
import com.mortals.xhx.module.dept.model.DeptEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 部门DaoImpl DAO接口
*
* @author zxfei
* @date 2022-01-12
*/
* 部门DaoImpl DAO接口
*
* @author zxfei
* @date 2022-01-12
*/
@Repository("deptDao")
public class DeptDaoImpl extends BaseCRUDDaoMybatis<DeptEntity,Long> implements DeptDao {
public class DeptDaoImpl extends BaseCRUDDaoMybatis<DeptEntity, Long> implements DeptDao {
/**
* @param deptQuery
* @return
......@@ -41,4 +46,13 @@ public class DeptDaoImpl extends BaseCRUDDaoMybatis<DeptEntity,Long> implements
List list = this.getSqlSession().selectList(this.getSqlId(GET_BUSINESS_BY_DEPT), paramDto);
return list;
}
/**
* @return
*/
@Override
public List<DeptEntity> getDeptListByExistBusiness(DeptQuery deptQuery) {
ParamDto paramDto = this.getQueryParam(deptQuery);
return this.getSqlSession().selectList(this.getSqlId(GET_DEPTLIST_BY_EXISTBUSINESS),paramDto);
}
}
......@@ -49,6 +49,6 @@ public interface DeptService extends ICRUDCacheService<DeptEntity, Long> {
Rest<Map<String,List<DeptVo>>> getDeptListByBusiness(DeptQuery deptQuery, Context context);
List<DeptEntity> getDeptListByExistBusiness(DeptQuery deptQuery, Context context);
}
\ No newline at end of file
......@@ -213,6 +213,14 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
return Rest.ok(collect);
}
/**
* @return
*/
@Override
public List<DeptEntity> getDeptListByExistBusiness(DeptQuery deptQuery, Context context) {
return this.dao.getDeptListByExistBusiness(deptQuery);
}
/**
* @param entity
......
......@@ -23,10 +23,7 @@ import com.mortals.xhx.module.site.service.SiteService;
import org.checkerframework.checker.units.qual.A;
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 org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -145,6 +142,36 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic
}
/**
* 根据部门查询业务
*/
@GetMapping(value = "getDeptListByExistBusiness")
@UnAuth
public String getDeptListByExistBusiness(@RequestParam("siteId") Long siteId) {
JSONObject jsonObject = new JSONObject();
String busiDesc = "根据业务查询存在的部门列表" + this.getModuleDesc();
try {
if (ObjectUtils.isEmpty(siteId)) {
throw new AppException("站点id不能为空!");
}
DeptQuery query = new DeptQuery();
query.setSiteId(siteId);
List<DeptEntity> deptList = this.service.getDeptListByExistBusiness(query, getContext());
if (!ObjectUtils.isEmpty(getContext()) && !ObjectUtils.isEmpty(getContext().getUser())) {
recordSysLog(request, busiDesc + " 【成功】");
}
jsonObject.put(KEY_RESULT_DATA, deptList);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, busiDesc + "成功!");
} catch (Exception e) {
log.error("获取异常", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
jsonObject.put(KEY_RESULT_MSG, super.convertException(e));
}
return jsonObject.toJSONString();
}
/**
* 根据部门查询业务
*/
......
package com.mortals.xhx.module.dimension.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.dimension.model.DimensionEntity;
/**
* 授权维度Dao
* 授权维度 DAO接口
*
* @author zxfei
* @date 2024-05-16
*/
public interface DimensionDao extends ICRUDDao<DimensionEntity,Long>{
}
package com.mortals.xhx.module.dimension.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.dimension.model.DimensionResourceRuleEntity;
import java.util.List;
/**
* 角色资源维度规则Dao
* 角色资源维度规则 DAO接口
*
* @author zxfei
* @date 2024-05-16
*/
public interface DimensionResourceRuleDao extends ICRUDDao<DimensionResourceRuleEntity,Long>{
List<DimensionResourceRuleEntity> getRoleComponentRule(Long userId,String route);
}
package com.mortals.xhx.module.dimension.dao.ibatis;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import com.mortals.xhx.module.dimension.dao.DimensionDao;
import com.mortals.xhx.module.dimension.model.DimensionEntity;
import org.springframework.stereotype.Repository;
/**
* 授权维度DaoImpl DAO接口
*
* @author zxfei
* @date 2024-05-16
*/
@Repository("dimensionDao")
public class DimensionDaoImpl extends BaseCRUDDaoMybatis<DimensionEntity,Long> implements DimensionDao {
}
package com.mortals.xhx.module.dimension.dao.ibatis;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import com.mortals.xhx.module.dimension.dao.DimensionResourceRuleDao;
import com.mortals.xhx.module.dimension.model.DimensionResourceRuleEntity;
import org.springframework.stereotype.Repository;
import java.util.HashMap;
import java.util.List;
/**
* 角色资源维度规则DaoImpl DAO接口
*
* @author zxfei
* @date 2024-05-16
*/
@Repository("dimensionResourceRuleDao")
public class DimensionResourceRuleDaoImpl extends BaseCRUDDaoMybatis<DimensionResourceRuleEntity,Long> implements DimensionResourceRuleDao {
/**
* @param userId
* @param route
* @return
*/
@Override
public List<DimensionResourceRuleEntity> getRoleComponentRule(Long userId, String route) {
return getSqlSession().selectList(getSqlId("getRoleComponentRule"), new HashMap<String, Object>() {
{
put("userId", userId);
put("route", route);
}
});
}
}
package com.mortals.xhx.module.dimension.model;
import com.mortals.xhx.module.dimension.model.vo.DimensionVo;
import lombok.Data;
/**
* 授权维度实体对象
*
* @author zxfei
* @date 2024-05-16
*/
@Data
public class DimensionEntity extends DimensionVo {
private static final long serialVersionUID = 1L;
/**
* 维度编码
*/
private String dimensionCode;
/**
* 维度名称
*/
private String dimensionName;
/**
* 维度值
*/
private String dimensionValue;
/**
* 维度类型(1.固定值,2.系统上下问变量)
*/
private Integer dimensionType;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof DimensionEntity) {
DimensionEntity tmp = (DimensionEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.dimensionCode = "";
this.dimensionName = "";
this.dimensionValue = "";
this.dimensionType = 1;
}
}
\ No newline at end of file
package com.mortals.xhx.module.dimension.model;
import java.util.List;
/**
* 授权维度查询对象
*
* @author zxfei
* @date 2024-05-16
*/
public class DimensionQuery extends DimensionEntity {
/** 开始 序号,主键,自增长 */
private Long idStart;
/** 结束 序号,主键,自增长 */
private Long idEnd;
/** 增加 序号,主键,自增长 */
private Long idIncrement;
/** 序号,主键,自增长列表 */
private List <Long> idList;
/** 序号,主键,自增长排除列表 */
private List <Long> idNotList;
/** 维度编码 */
private List<String> dimensionCodeList;
/** 维度编码排除列表 */
private List <String> dimensionCodeNotList;
/** 维度名称 */
private List<String> dimensionNameList;
/** 维度名称排除列表 */
private List <String> dimensionNameNotList;
/** 维度值 */
private List<String> dimensionValueList;
/** 维度值排除列表 */
private List <String> dimensionValueNotList;
/** 开始 维度类型(1.固定值,2.系统上下问变量) */
private Integer dimensionTypeStart;
/** 结束 维度类型(1.固定值,2.系统上下问变量) */
private Integer dimensionTypeEnd;
/** 增加 维度类型(1.固定值,2.系统上下问变量) */
private Integer dimensionTypeIncrement;
/** 维度类型(1.固定值,2.系统上下问变量)列表 */
private List <Integer> dimensionTypeList;
/** 维度类型(1.固定值,2.系统上下问变量)排除列表 */
private List <Integer> dimensionTypeNotList;
/** 开始 创建时间 */
private String createTimeStart;
/** 结束 创建时间 */
private String createTimeEnd;
/** 开始 创建用户 */
private Long createUserIdStart;
/** 结束 创建用户 */
private Long createUserIdEnd;
/** 增加 创建用户 */
private Long createUserIdIncrement;
/** 创建用户列表 */
private List <Long> createUserIdList;
/** 创建用户排除列表 */
private List <Long> createUserIdNotList;
/** 开始 更新用户 */
private Long updateUserIdStart;
/** 结束 更新用户 */
private Long updateUserIdEnd;
/** 增加 更新用户 */
private Long updateUserIdIncrement;
/** 更新用户列表 */
private List <Long> updateUserIdList;
/** 更新用户排除列表 */
private List <Long> updateUserIdNotList;
/** 开始 更新时间 */
private String updateTimeStart;
/** 结束 更新时间 */
private String updateTimeEnd;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<DimensionQuery> orConditionList;
/** AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4) */
private List<DimensionQuery> andConditionList;
public DimensionQuery(){}
/**
* 获取 开始 序号,主键,自增长
* @return idStart
*/
public Long getIdStart(){
return this.idStart;
}
/**
* 设置 开始 序号,主键,自增长
* @param idStart
*/
public void setIdStart(Long idStart){
this.idStart = idStart;
}
/**
* 获取 结束 序号,主键,自增长
* @return $idEnd
*/
public Long getIdEnd(){
return this.idEnd;
}
/**
* 设置 结束 序号,主键,自增长
* @param idEnd
*/
public void setIdEnd(Long idEnd){
this.idEnd = idEnd;
}
/**
* 获取 增加 序号,主键,自增长
* @return idIncrement
*/
public Long getIdIncrement(){
return this.idIncrement;
}
/**
* 设置 增加 序号,主键,自增长
* @param idIncrement
*/
public void setIdIncrement(Long idIncrement){
this.idIncrement = idIncrement;
}
/**
* 获取 序号,主键,自增长
* @return idList
*/
public List<Long> getIdList(){
return this.idList;
}
/**
* 设置 序号,主键,自增长
* @param idList
*/
public void setIdList(List<Long> idList){
this.idList = idList;
}
/**
* 获取 序号,主键,自增长
* @return idNotList
*/
public List<Long> getIdNotList(){
return this.idNotList;
}
/**
* 设置 序号,主键,自增长
* @param idNotList
*/
public void setIdNotList(List<Long> idNotList){
this.idNotList = idNotList;
}
/**
* 获取 维度编码
* @return dimensionCodeList
*/
public List<String> getDimensionCodeList(){
return this.dimensionCodeList;
}
/**
* 设置 维度编码
* @param dimensionCodeList
*/
public void setDimensionCodeList(List<String> dimensionCodeList){
this.dimensionCodeList = dimensionCodeList;
}
/**
* 获取 维度编码
* @return dimensionCodeNotList
*/
public List<String> getDimensionCodeNotList(){
return this.dimensionCodeNotList;
}
/**
* 设置 维度编码
* @param dimensionCodeNotList
*/
public void setDimensionCodeNotList(List<String> dimensionCodeNotList){
this.dimensionCodeNotList = dimensionCodeNotList;
}
/**
* 获取 维度名称
* @return dimensionNameList
*/
public List<String> getDimensionNameList(){
return this.dimensionNameList;
}
/**
* 设置 维度名称
* @param dimensionNameList
*/
public void setDimensionNameList(List<String> dimensionNameList){
this.dimensionNameList = dimensionNameList;
}
/**
* 获取 维度名称
* @return dimensionNameNotList
*/
public List<String> getDimensionNameNotList(){
return this.dimensionNameNotList;
}
/**
* 设置 维度名称
* @param dimensionNameNotList
*/
public void setDimensionNameNotList(List<String> dimensionNameNotList){
this.dimensionNameNotList = dimensionNameNotList;
}
/**
* 获取 维度值
* @return dimensionValueList
*/
public List<String> getDimensionValueList(){
return this.dimensionValueList;
}
/**
* 设置 维度值
* @param dimensionValueList
*/
public void setDimensionValueList(List<String> dimensionValueList){
this.dimensionValueList = dimensionValueList;
}
/**
* 获取 维度值
* @return dimensionValueNotList
*/
public List<String> getDimensionValueNotList(){
return this.dimensionValueNotList;
}
/**
* 设置 维度值
* @param dimensionValueNotList
*/
public void setDimensionValueNotList(List<String> dimensionValueNotList){
this.dimensionValueNotList = dimensionValueNotList;
}
/**
* 获取 开始 维度类型(1.固定值,2.系统上下问变量)
* @return dimensionTypeStart
*/
public Integer getDimensionTypeStart(){
return this.dimensionTypeStart;
}
/**
* 设置 开始 维度类型(1.固定值,2.系统上下问变量)
* @param dimensionTypeStart
*/
public void setDimensionTypeStart(Integer dimensionTypeStart){
this.dimensionTypeStart = dimensionTypeStart;
}
/**
* 获取 结束 维度类型(1.固定值,2.系统上下问变量)
* @return $dimensionTypeEnd
*/
public Integer getDimensionTypeEnd(){
return this.dimensionTypeEnd;
}
/**
* 设置 结束 维度类型(1.固定值,2.系统上下问变量)
* @param dimensionTypeEnd
*/
public void setDimensionTypeEnd(Integer dimensionTypeEnd){
this.dimensionTypeEnd = dimensionTypeEnd;
}
/**
* 获取 增加 维度类型(1.固定值,2.系统上下问变量)
* @return dimensionTypeIncrement
*/
public Integer getDimensionTypeIncrement(){
return this.dimensionTypeIncrement;
}
/**
* 设置 增加 维度类型(1.固定值,2.系统上下问变量)
* @param dimensionTypeIncrement
*/
public void setDimensionTypeIncrement(Integer dimensionTypeIncrement){
this.dimensionTypeIncrement = dimensionTypeIncrement;
}
/**
* 获取 维度类型(1.固定值,2.系统上下问变量)
* @return dimensionTypeList
*/
public List<Integer> getDimensionTypeList(){
return this.dimensionTypeList;
}
/**
* 设置 维度类型(1.固定值,2.系统上下问变量)
* @param dimensionTypeList
*/
public void setDimensionTypeList(List<Integer> dimensionTypeList){
this.dimensionTypeList = dimensionTypeList;
}
/**
* 获取 维度类型(1.固定值,2.系统上下问变量)
* @return dimensionTypeNotList
*/
public List<Integer> getDimensionTypeNotList(){
return this.dimensionTypeNotList;
}
/**
* 设置 维度类型(1.固定值,2.系统上下问变量)
* @param dimensionTypeNotList
*/
public void setDimensionTypeNotList(List<Integer> dimensionTypeNotList){
this.dimensionTypeNotList = dimensionTypeNotList;
}
/**
* 获取 开始 创建时间
* @return createTimeStart
*/
public String getCreateTimeStart(){
return this.createTimeStart;
}
/**
* 设置 开始 创建时间
* @param createTimeStart
*/
public void setCreateTimeStart(String createTimeStart){
this.createTimeStart = createTimeStart;
}
/**
* 获取 结束 创建时间
* @return createTimeEnd
*/
public String getCreateTimeEnd(){
return this.createTimeEnd;
}
/**
* 设置 结束 创建时间
* @param createTimeEnd
*/
public void setCreateTimeEnd(String createTimeEnd){
this.createTimeEnd = createTimeEnd;
}
/**
* 获取 开始 创建用户
* @return createUserIdStart
*/
public Long getCreateUserIdStart(){
return this.createUserIdStart;
}
/**
* 设置 开始 创建用户
* @param createUserIdStart
*/
public void setCreateUserIdStart(Long createUserIdStart){
this.createUserIdStart = createUserIdStart;
}
/**
* 获取 结束 创建用户
* @return $createUserIdEnd
*/
public Long getCreateUserIdEnd(){
return this.createUserIdEnd;
}
/**
* 设置 结束 创建用户
* @param createUserIdEnd
*/
public void setCreateUserIdEnd(Long createUserIdEnd){
this.createUserIdEnd = createUserIdEnd;
}
/**
* 获取 增加 创建用户
* @return createUserIdIncrement
*/
public Long getCreateUserIdIncrement(){
return this.createUserIdIncrement;
}
/**
* 设置 增加 创建用户
* @param createUserIdIncrement
*/
public void setCreateUserIdIncrement(Long createUserIdIncrement){
this.createUserIdIncrement = createUserIdIncrement;
}
/**
* 获取 创建用户
* @return createUserIdList
*/
public List<Long> getCreateUserIdList(){
return this.createUserIdList;
}
/**
* 设置 创建用户
* @param createUserIdList
*/
public void setCreateUserIdList(List<Long> createUserIdList){
this.createUserIdList = createUserIdList;
}
/**
* 获取 创建用户
* @return createUserIdNotList
*/
public List<Long> getCreateUserIdNotList(){
return this.createUserIdNotList;
}
/**
* 设置 创建用户
* @param createUserIdNotList
*/
public void setCreateUserIdNotList(List<Long> createUserIdNotList){
this.createUserIdNotList = createUserIdNotList;
}
/**
* 获取 开始 更新用户
* @return updateUserIdStart
*/
public Long getUpdateUserIdStart(){
return this.updateUserIdStart;
}
/**
* 设置 开始 更新用户
* @param updateUserIdStart
*/
public void setUpdateUserIdStart(Long updateUserIdStart){
this.updateUserIdStart = updateUserIdStart;
}
/**
* 获取 结束 更新用户
* @return $updateUserIdEnd
*/
public Long getUpdateUserIdEnd(){
return this.updateUserIdEnd;
}
/**
* 设置 结束 更新用户
* @param updateUserIdEnd
*/
public void setUpdateUserIdEnd(Long updateUserIdEnd){
this.updateUserIdEnd = updateUserIdEnd;
}
/**
* 获取 增加 更新用户
* @return updateUserIdIncrement
*/
public Long getUpdateUserIdIncrement(){
return this.updateUserIdIncrement;
}
/**
* 设置 增加 更新用户
* @param updateUserIdIncrement
*/
public void setUpdateUserIdIncrement(Long updateUserIdIncrement){
this.updateUserIdIncrement = updateUserIdIncrement;
}
/**
* 获取 更新用户
* @return updateUserIdList
*/
public List<Long> getUpdateUserIdList(){
return this.updateUserIdList;
}
/**
* 设置 更新用户
* @param updateUserIdList
*/
public void setUpdateUserIdList(List<Long> updateUserIdList){
this.updateUserIdList = updateUserIdList;
}
/**
* 获取 更新用户
* @return updateUserIdNotList
*/
public List<Long> getUpdateUserIdNotList(){
return this.updateUserIdNotList;
}
/**
* 设置 更新用户
* @param updateUserIdNotList
*/
public void setUpdateUserIdNotList(List<Long> updateUserIdNotList){
this.updateUserIdNotList = updateUserIdNotList;
}
/**
* 获取 开始 更新时间
* @return updateTimeStart
*/
public String getUpdateTimeStart(){
return this.updateTimeStart;
}
/**
* 设置 开始 更新时间
* @param updateTimeStart
*/
public void setUpdateTimeStart(String updateTimeStart){
this.updateTimeStart = updateTimeStart;
}
/**
* 获取 结束 更新时间
* @return updateTimeEnd
*/
public String getUpdateTimeEnd(){
return this.updateTimeEnd;
}
/**
* 设置 结束 更新时间
* @param updateTimeEnd
*/
public void setUpdateTimeEnd(String updateTimeEnd){
this.updateTimeEnd = updateTimeEnd;
}
/**
* 设置 序号,主键,自增长
* @param id
*/
public DimensionQuery id(Long id){
setId(id);
return this;
}
/**
* 设置 开始 序号,主键,自增长
* @param idStart
*/
public DimensionQuery idStart(Long idStart){
this.idStart = idStart;
return this;
}
/**
* 设置 结束 序号,主键,自增长
* @param idEnd
*/
public DimensionQuery idEnd(Long idEnd){
this.idEnd = idEnd;
return this;
}
/**
* 设置 增加 序号,主键,自增长
* @param idIncrement
*/
public DimensionQuery idIncrement(Long idIncrement){
this.idIncrement = idIncrement;
return this;
}
/**
* 设置 序号,主键,自增长
* @param idList
*/
public DimensionQuery idList(List<Long> idList){
this.idList = idList;
return this;
}
/**
* 设置 序号,主键,自增长
* @param idNotList
*/
public DimensionQuery idNotList(List<Long> idNotList){
this.idNotList = idNotList;
return this;
}
/**
* 设置 维度编码
* @param dimensionCode
*/
public DimensionQuery dimensionCode(String dimensionCode){
setDimensionCode(dimensionCode);
return this;
}
/**
* 设置 维度编码
* @param dimensionCodeList
*/
public DimensionQuery dimensionCodeList(List<String> dimensionCodeList){
this.dimensionCodeList = dimensionCodeList;
return this;
}
/**
* 设置 维度名称
* @param dimensionName
*/
public DimensionQuery dimensionName(String dimensionName){
setDimensionName(dimensionName);
return this;
}
/**
* 设置 维度名称
* @param dimensionNameList
*/
public DimensionQuery dimensionNameList(List<String> dimensionNameList){
this.dimensionNameList = dimensionNameList;
return this;
}
/**
* 设置 维度值
* @param dimensionValue
*/
public DimensionQuery dimensionValue(String dimensionValue){
setDimensionValue(dimensionValue);
return this;
}
/**
* 设置 维度值
* @param dimensionValueList
*/
public DimensionQuery dimensionValueList(List<String> dimensionValueList){
this.dimensionValueList = dimensionValueList;
return this;
}
/**
* 设置 维度类型(1.固定值,2.系统上下问变量)
* @param dimensionType
*/
public DimensionQuery dimensionType(Integer dimensionType){
setDimensionType(dimensionType);
return this;
}
/**
* 设置 开始 维度类型(1.固定值,2.系统上下问变量)
* @param dimensionTypeStart
*/
public DimensionQuery dimensionTypeStart(Integer dimensionTypeStart){
this.dimensionTypeStart = dimensionTypeStart;
return this;
}
/**
* 设置 结束 维度类型(1.固定值,2.系统上下问变量)
* @param dimensionTypeEnd
*/
public DimensionQuery dimensionTypeEnd(Integer dimensionTypeEnd){
this.dimensionTypeEnd = dimensionTypeEnd;
return this;
}
/**
* 设置 增加 维度类型(1.固定值,2.系统上下问变量)
* @param dimensionTypeIncrement
*/
public DimensionQuery dimensionTypeIncrement(Integer dimensionTypeIncrement){
this.dimensionTypeIncrement = dimensionTypeIncrement;
return this;
}
/**
* 设置 维度类型(1.固定值,2.系统上下问变量)
* @param dimensionTypeList
*/
public DimensionQuery dimensionTypeList(List<Integer> dimensionTypeList){
this.dimensionTypeList = dimensionTypeList;
return this;
}
/**
* 设置 维度类型(1.固定值,2.系统上下问变量)
* @param dimensionTypeNotList
*/
public DimensionQuery dimensionTypeNotList(List<Integer> dimensionTypeNotList){
this.dimensionTypeNotList = dimensionTypeNotList;
return this;
}
/**
* 设置 创建用户
* @param createUserId
*/
public DimensionQuery createUserId(Long createUserId){
setCreateUserId(createUserId);
return this;
}
/**
* 设置 开始 创建用户
* @param createUserIdStart
*/
public DimensionQuery createUserIdStart(Long createUserIdStart){
this.createUserIdStart = createUserIdStart;
return this;
}
/**
* 设置 结束 创建用户
* @param createUserIdEnd
*/
public DimensionQuery createUserIdEnd(Long createUserIdEnd){
this.createUserIdEnd = createUserIdEnd;
return this;
}
/**
* 设置 增加 创建用户
* @param createUserIdIncrement
*/
public DimensionQuery createUserIdIncrement(Long createUserIdIncrement){
this.createUserIdIncrement = createUserIdIncrement;
return this;
}
/**
* 设置 创建用户
* @param createUserIdList
*/
public DimensionQuery createUserIdList(List<Long> createUserIdList){
this.createUserIdList = createUserIdList;
return this;
}
/**
* 设置 创建用户
* @param createUserIdNotList
*/
public DimensionQuery createUserIdNotList(List<Long> createUserIdNotList){
this.createUserIdNotList = createUserIdNotList;
return this;
}
/**
* 设置 更新用户
* @param updateUserId
*/
public DimensionQuery updateUserId(Long updateUserId){
setUpdateUserId(updateUserId);
return this;
}
/**
* 设置 开始 更新用户
* @param updateUserIdStart
*/
public DimensionQuery updateUserIdStart(Long updateUserIdStart){
this.updateUserIdStart = updateUserIdStart;
return this;
}
/**
* 设置 结束 更新用户
* @param updateUserIdEnd
*/
public DimensionQuery updateUserIdEnd(Long updateUserIdEnd){
this.updateUserIdEnd = updateUserIdEnd;
return this;
}
/**
* 设置 增加 更新用户
* @param updateUserIdIncrement
*/
public DimensionQuery updateUserIdIncrement(Long updateUserIdIncrement){
this.updateUserIdIncrement = updateUserIdIncrement;
return this;
}
/**
* 设置 更新用户
* @param updateUserIdList
*/
public DimensionQuery updateUserIdList(List<Long> updateUserIdList){
this.updateUserIdList = updateUserIdList;
return this;
}
/**
* 设置 更新用户
* @param updateUserIdNotList
*/
public DimensionQuery updateUserIdNotList(List<Long> updateUserIdNotList){
this.updateUserIdNotList = updateUserIdNotList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
*/
public List<DimensionQuery> getOrConditionList(){
return this.orConditionList;
}
/**
* 设置 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @param orConditionList
*/
public void setOrConditionList(List<DimensionQuery> orConditionList){
this.orConditionList = orConditionList;
}
/**
* 获取 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
* @return andConditionList
*/
public List<DimensionQuery> getAndConditionList(){
return this.andConditionList;
}
/**
* 设置 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
* @param andConditionList
*/
public void setAndConditionList(List<DimensionQuery> andConditionList){
this.andConditionList = andConditionList;
}
}
\ No newline at end of file
package com.mortals.xhx.module.dimension.model;
import com.mortals.xhx.module.dimension.model.vo.DimensionResourceRuleVo;
import lombok.Data;
/**
* 角色资源维度规则实体对象
*
* @author zxfei
* @date 2024-05-22
*/
@Data
public class DimensionResourceRuleEntity extends DimensionResourceRuleVo {
private static final long serialVersionUID = 1L;
/**
* 角色ID
*/
private Long roleId;
/**
* 资源ID
*/
private Long resourceId;
/**
* 规则编码
*/
private String ruleCode;
/**
* 规则名称
*/
private String ruleName;
/**
* 规则条件(IN.属于,<.小于,>.大于,=.等于,!=.不等于,>=.大于等于,<=.小于等于,like %.左模糊,like %.右模糊)
*/
private String ruleCondition;
/**
* 规则值,固定值或者系统变量
*/
private String ruleValue;
/**
* 规则值类型(1.固定值,2.系统上下问变量)
*/
private Integer ruleType;
/**
* 角色名称
*/
private String roleName;
/**
* 资源名称
*/
private String resourceName;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof DimensionResourceRuleEntity) {
DimensionResourceRuleEntity tmp = (DimensionResourceRuleEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.roleId = null;
this.resourceId = null;
this.ruleCode = "";
this.ruleName = "";
this.ruleCondition = "IN";
this.ruleValue = "";
this.ruleType = 1;
this.roleName = "";
this.resourceName = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.dimension.model;
import java.util.List;
/**
* 角色资源维度规则查询对象
*
* @author zxfei
* @date 2024-05-22
*/
public class DimensionResourceRuleQuery extends DimensionResourceRuleEntity {
/** 开始 序号,主键,自增长 */
private Long idStart;
/** 结束 序号,主键,自增长 */
private Long idEnd;
/** 增加 序号,主键,自增长 */
private Long idIncrement;
/** 序号,主键,自增长列表 */
private List <Long> idList;
/** 序号,主键,自增长排除列表 */
private List <Long> idNotList;
/** 开始 角色ID */
private Long roleIdStart;
/** 结束 角色ID */
private Long roleIdEnd;
/** 增加 角色ID */
private Long roleIdIncrement;
/** 角色ID列表 */
private List <Long> roleIdList;
/** 角色ID排除列表 */
private List <Long> roleIdNotList;
/** 开始 资源ID */
private Long resourceIdStart;
/** 结束 资源ID */
private Long resourceIdEnd;
/** 增加 资源ID */
private Long resourceIdIncrement;
/** 资源ID列表 */
private List <Long> resourceIdList;
/** 资源ID排除列表 */
private List <Long> resourceIdNotList;
/** 规则编码 */
private List<String> ruleCodeList;
/** 规则编码排除列表 */
private List <String> ruleCodeNotList;
/** 规则名称 */
private List<String> ruleNameList;
/** 规则名称排除列表 */
private List <String> ruleNameNotList;
/** 规则条件(IN.属于,<.小于,>.大于,=.等于,!=.不等于,>=.大于等于,<=.小于等于,like %.左模糊,like %.右模糊) */
private List<String> ruleConditionList;
/** 规则条件(IN.属于,<.小于,>.大于,=.等于,!=.不等于,>=.大于等于,<=.小于等于,like %.左模糊,like %.右模糊)排除列表 */
private List <String> ruleConditionNotList;
/** 规则值,固定值或者系统变量 */
private List<String> ruleValueList;
/** 规则值,固定值或者系统变量排除列表 */
private List <String> ruleValueNotList;
/** 开始 规则值类型(1.固定值,2.系统上下问变量) */
private Integer ruleTypeStart;
/** 结束 规则值类型(1.固定值,2.系统上下问变量) */
private Integer ruleTypeEnd;
/** 增加 规则值类型(1.固定值,2.系统上下问变量) */
private Integer ruleTypeIncrement;
/** 规则值类型(1.固定值,2.系统上下问变量)列表 */
private List <Integer> ruleTypeList;
/** 规则值类型(1.固定值,2.系统上下问变量)排除列表 */
private List <Integer> ruleTypeNotList;
/** 开始 创建时间 */
private String createTimeStart;
/** 结束 创建时间 */
private String createTimeEnd;
/** 开始 创建用户 */
private Long createUserIdStart;
/** 结束 创建用户 */
private Long createUserIdEnd;
/** 增加 创建用户 */
private Long createUserIdIncrement;
/** 创建用户列表 */
private List <Long> createUserIdList;
/** 创建用户排除列表 */
private List <Long> createUserIdNotList;
/** 开始 更新用户 */
private Long updateUserIdStart;
/** 结束 更新用户 */
private Long updateUserIdEnd;
/** 增加 更新用户 */
private Long updateUserIdIncrement;
/** 更新用户列表 */
private List <Long> updateUserIdList;
/** 更新用户排除列表 */
private List <Long> updateUserIdNotList;
/** 开始 更新时间 */
private String updateTimeStart;
/** 结束 更新时间 */
private String updateTimeEnd;
/** 角色名称 */
private List<String> roleNameList;
/** 角色名称排除列表 */
private List <String> roleNameNotList;
/** 资源名称 */
private List<String> resourceNameList;
/** 资源名称排除列表 */
private List <String> resourceNameNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<DimensionResourceRuleQuery> orConditionList;
/** AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4) */
private List<DimensionResourceRuleQuery> andConditionList;
public DimensionResourceRuleQuery(){}
/**
* 获取 开始 序号,主键,自增长
* @return idStart
*/
public Long getIdStart(){
return this.idStart;
}
/**
* 设置 开始 序号,主键,自增长
* @param idStart
*/
public void setIdStart(Long idStart){
this.idStart = idStart;
}
/**
* 获取 结束 序号,主键,自增长
* @return $idEnd
*/
public Long getIdEnd(){
return this.idEnd;
}
/**
* 设置 结束 序号,主键,自增长
* @param idEnd
*/
public void setIdEnd(Long idEnd){
this.idEnd = idEnd;
}
/**
* 获取 增加 序号,主键,自增长
* @return idIncrement
*/
public Long getIdIncrement(){
return this.idIncrement;
}
/**
* 设置 增加 序号,主键,自增长
* @param idIncrement
*/
public void setIdIncrement(Long idIncrement){
this.idIncrement = idIncrement;
}
/**
* 获取 序号,主键,自增长
* @return idList
*/
public List<Long> getIdList(){
return this.idList;
}
/**
* 设置 序号,主键,自增长
* @param idList
*/
public void setIdList(List<Long> idList){
this.idList = idList;
}
/**
* 获取 序号,主键,自增长
* @return idNotList
*/
public List<Long> getIdNotList(){
return this.idNotList;
}
/**
* 设置 序号,主键,自增长
* @param idNotList
*/
public void setIdNotList(List<Long> idNotList){
this.idNotList = idNotList;
}
/**
* 获取 开始 角色ID
* @return roleIdStart
*/
public Long getRoleIdStart(){
return this.roleIdStart;
}
/**
* 设置 开始 角色ID
* @param roleIdStart
*/
public void setRoleIdStart(Long roleIdStart){
this.roleIdStart = roleIdStart;
}
/**
* 获取 结束 角色ID
* @return $roleIdEnd
*/
public Long getRoleIdEnd(){
return this.roleIdEnd;
}
/**
* 设置 结束 角色ID
* @param roleIdEnd
*/
public void setRoleIdEnd(Long roleIdEnd){
this.roleIdEnd = roleIdEnd;
}
/**
* 获取 增加 角色ID
* @return roleIdIncrement
*/
public Long getRoleIdIncrement(){
return this.roleIdIncrement;
}
/**
* 设置 增加 角色ID
* @param roleIdIncrement
*/
public void setRoleIdIncrement(Long roleIdIncrement){
this.roleIdIncrement = roleIdIncrement;
}
/**
* 获取 角色ID
* @return roleIdList
*/
public List<Long> getRoleIdList(){
return this.roleIdList;
}
/**
* 设置 角色ID
* @param roleIdList
*/
public void setRoleIdList(List<Long> roleIdList){
this.roleIdList = roleIdList;
}
/**
* 获取 角色ID
* @return roleIdNotList
*/
public List<Long> getRoleIdNotList(){
return this.roleIdNotList;
}
/**
* 设置 角色ID
* @param roleIdNotList
*/
public void setRoleIdNotList(List<Long> roleIdNotList){
this.roleIdNotList = roleIdNotList;
}
/**
* 获取 开始 资源ID
* @return resourceIdStart
*/
public Long getResourceIdStart(){
return this.resourceIdStart;
}
/**
* 设置 开始 资源ID
* @param resourceIdStart
*/
public void setResourceIdStart(Long resourceIdStart){
this.resourceIdStart = resourceIdStart;
}
/**
* 获取 结束 资源ID
* @return $resourceIdEnd
*/
public Long getResourceIdEnd(){
return this.resourceIdEnd;
}
/**
* 设置 结束 资源ID
* @param resourceIdEnd
*/
public void setResourceIdEnd(Long resourceIdEnd){
this.resourceIdEnd = resourceIdEnd;
}
/**
* 获取 增加 资源ID
* @return resourceIdIncrement
*/
public Long getResourceIdIncrement(){
return this.resourceIdIncrement;
}
/**
* 设置 增加 资源ID
* @param resourceIdIncrement
*/
public void setResourceIdIncrement(Long resourceIdIncrement){
this.resourceIdIncrement = resourceIdIncrement;
}
/**
* 获取 资源ID
* @return resourceIdList
*/
public List<Long> getResourceIdList(){
return this.resourceIdList;
}
/**
* 设置 资源ID
* @param resourceIdList
*/
public void setResourceIdList(List<Long> resourceIdList){
this.resourceIdList = resourceIdList;
}
/**
* 获取 资源ID
* @return resourceIdNotList
*/
public List<Long> getResourceIdNotList(){
return this.resourceIdNotList;
}
/**
* 设置 资源ID
* @param resourceIdNotList
*/
public void setResourceIdNotList(List<Long> resourceIdNotList){
this.resourceIdNotList = resourceIdNotList;
}
/**
* 获取 规则编码
* @return ruleCodeList
*/
public List<String> getRuleCodeList(){
return this.ruleCodeList;
}
/**
* 设置 规则编码
* @param ruleCodeList
*/
public void setRuleCodeList(List<String> ruleCodeList){
this.ruleCodeList = ruleCodeList;
}
/**
* 获取 规则编码
* @return ruleCodeNotList
*/
public List<String> getRuleCodeNotList(){
return this.ruleCodeNotList;
}
/**
* 设置 规则编码
* @param ruleCodeNotList
*/
public void setRuleCodeNotList(List<String> ruleCodeNotList){
this.ruleCodeNotList = ruleCodeNotList;
}
/**
* 获取 规则名称
* @return ruleNameList
*/
public List<String> getRuleNameList(){
return this.ruleNameList;
}
/**
* 设置 规则名称
* @param ruleNameList
*/
public void setRuleNameList(List<String> ruleNameList){
this.ruleNameList = ruleNameList;
}
/**
* 获取 规则名称
* @return ruleNameNotList
*/
public List<String> getRuleNameNotList(){
return this.ruleNameNotList;
}
/**
* 设置 规则名称
* @param ruleNameNotList
*/
public void setRuleNameNotList(List<String> ruleNameNotList){
this.ruleNameNotList = ruleNameNotList;
}
/**
* 获取 规则条件(IN.属于,<.小于,>.大于,=.等于,!=.不等于,>=.大于等于,<=.小于等于,like %.左模糊,like %.右模糊)
* @return ruleConditionList
*/
public List<String> getRuleConditionList(){
return this.ruleConditionList;
}
/**
* 设置 规则条件(IN.属于,<.小于,>.大于,=.等于,!=.不等于,>=.大于等于,<=.小于等于,like %.左模糊,like %.右模糊)
* @param ruleConditionList
*/
public void setRuleConditionList(List<String> ruleConditionList){
this.ruleConditionList = ruleConditionList;
}
/**
* 获取 规则条件(IN.属于,<.小于,>.大于,=.等于,!=.不等于,>=.大于等于,<=.小于等于,like %.左模糊,like %.右模糊)
* @return ruleConditionNotList
*/
public List<String> getRuleConditionNotList(){
return this.ruleConditionNotList;
}
/**
* 设置 规则条件(IN.属于,<.小于,>.大于,=.等于,!=.不等于,>=.大于等于,<=.小于等于,like %.左模糊,like %.右模糊)
* @param ruleConditionNotList
*/
public void setRuleConditionNotList(List<String> ruleConditionNotList){
this.ruleConditionNotList = ruleConditionNotList;
}
/**
* 获取 规则值,固定值或者系统变量
* @return ruleValueList
*/
public List<String> getRuleValueList(){
return this.ruleValueList;
}
/**
* 设置 规则值,固定值或者系统变量
* @param ruleValueList
*/
public void setRuleValueList(List<String> ruleValueList){
this.ruleValueList = ruleValueList;
}
/**
* 获取 规则值,固定值或者系统变量
* @return ruleValueNotList
*/
public List<String> getRuleValueNotList(){
return this.ruleValueNotList;
}
/**
* 设置 规则值,固定值或者系统变量
* @param ruleValueNotList
*/
public void setRuleValueNotList(List<String> ruleValueNotList){
this.ruleValueNotList = ruleValueNotList;
}
/**
* 获取 开始 规则值类型(1.固定值,2.系统上下问变量)
* @return ruleTypeStart
*/
public Integer getRuleTypeStart(){
return this.ruleTypeStart;
}
/**
* 设置 开始 规则值类型(1.固定值,2.系统上下问变量)
* @param ruleTypeStart
*/
public void setRuleTypeStart(Integer ruleTypeStart){
this.ruleTypeStart = ruleTypeStart;
}
/**
* 获取 结束 规则值类型(1.固定值,2.系统上下问变量)
* @return $ruleTypeEnd
*/
public Integer getRuleTypeEnd(){
return this.ruleTypeEnd;
}
/**
* 设置 结束 规则值类型(1.固定值,2.系统上下问变量)
* @param ruleTypeEnd
*/
public void setRuleTypeEnd(Integer ruleTypeEnd){
this.ruleTypeEnd = ruleTypeEnd;
}
/**
* 获取 增加 规则值类型(1.固定值,2.系统上下问变量)
* @return ruleTypeIncrement
*/
public Integer getRuleTypeIncrement(){
return this.ruleTypeIncrement;
}
/**
* 设置 增加 规则值类型(1.固定值,2.系统上下问变量)
* @param ruleTypeIncrement
*/
public void setRuleTypeIncrement(Integer ruleTypeIncrement){
this.ruleTypeIncrement = ruleTypeIncrement;
}
/**
* 获取 规则值类型(1.固定值,2.系统上下问变量)
* @return ruleTypeList
*/
public List<Integer> getRuleTypeList(){
return this.ruleTypeList;
}
/**
* 设置 规则值类型(1.固定值,2.系统上下问变量)
* @param ruleTypeList
*/
public void setRuleTypeList(List<Integer> ruleTypeList){
this.ruleTypeList = ruleTypeList;
}
/**
* 获取 规则值类型(1.固定值,2.系统上下问变量)
* @return ruleTypeNotList
*/
public List<Integer> getRuleTypeNotList(){
return this.ruleTypeNotList;
}
/**
* 设置 规则值类型(1.固定值,2.系统上下问变量)
* @param ruleTypeNotList
*/
public void setRuleTypeNotList(List<Integer> ruleTypeNotList){
this.ruleTypeNotList = ruleTypeNotList;
}
/**
* 获取 开始 创建时间
* @return createTimeStart
*/
public String getCreateTimeStart(){
return this.createTimeStart;
}
/**
* 设置 开始 创建时间
* @param createTimeStart
*/
public void setCreateTimeStart(String createTimeStart){
this.createTimeStart = createTimeStart;
}
/**
* 获取 结束 创建时间
* @return createTimeEnd
*/
public String getCreateTimeEnd(){
return this.createTimeEnd;
}
/**
* 设置 结束 创建时间
* @param createTimeEnd
*/
public void setCreateTimeEnd(String createTimeEnd){
this.createTimeEnd = createTimeEnd;
}
/**
* 获取 开始 创建用户
* @return createUserIdStart
*/
public Long getCreateUserIdStart(){
return this.createUserIdStart;
}
/**
* 设置 开始 创建用户
* @param createUserIdStart
*/
public void setCreateUserIdStart(Long createUserIdStart){
this.createUserIdStart = createUserIdStart;
}
/**
* 获取 结束 创建用户
* @return $createUserIdEnd
*/
public Long getCreateUserIdEnd(){
return this.createUserIdEnd;
}
/**
* 设置 结束 创建用户
* @param createUserIdEnd
*/
public void setCreateUserIdEnd(Long createUserIdEnd){
this.createUserIdEnd = createUserIdEnd;
}
/**
* 获取 增加 创建用户
* @return createUserIdIncrement
*/
public Long getCreateUserIdIncrement(){
return this.createUserIdIncrement;
}
/**
* 设置 增加 创建用户
* @param createUserIdIncrement
*/
public void setCreateUserIdIncrement(Long createUserIdIncrement){
this.createUserIdIncrement = createUserIdIncrement;
}
/**
* 获取 创建用户
* @return createUserIdList
*/
public List<Long> getCreateUserIdList(){
return this.createUserIdList;
}
/**
* 设置 创建用户
* @param createUserIdList
*/
public void setCreateUserIdList(List<Long> createUserIdList){
this.createUserIdList = createUserIdList;
}
/**
* 获取 创建用户
* @return createUserIdNotList
*/
public List<Long> getCreateUserIdNotList(){
return this.createUserIdNotList;
}
/**
* 设置 创建用户
* @param createUserIdNotList
*/
public void setCreateUserIdNotList(List<Long> createUserIdNotList){
this.createUserIdNotList = createUserIdNotList;
}
/**
* 获取 开始 更新用户
* @return updateUserIdStart
*/
public Long getUpdateUserIdStart(){
return this.updateUserIdStart;
}
/**
* 设置 开始 更新用户
* @param updateUserIdStart
*/
public void setUpdateUserIdStart(Long updateUserIdStart){
this.updateUserIdStart = updateUserIdStart;
}
/**
* 获取 结束 更新用户
* @return $updateUserIdEnd
*/
public Long getUpdateUserIdEnd(){
return this.updateUserIdEnd;
}
/**
* 设置 结束 更新用户
* @param updateUserIdEnd
*/
public void setUpdateUserIdEnd(Long updateUserIdEnd){
this.updateUserIdEnd = updateUserIdEnd;
}
/**
* 获取 增加 更新用户
* @return updateUserIdIncrement
*/
public Long getUpdateUserIdIncrement(){
return this.updateUserIdIncrement;
}
/**
* 设置 增加 更新用户
* @param updateUserIdIncrement
*/
public void setUpdateUserIdIncrement(Long updateUserIdIncrement){
this.updateUserIdIncrement = updateUserIdIncrement;
}
/**
* 获取 更新用户
* @return updateUserIdList
*/
public List<Long> getUpdateUserIdList(){
return this.updateUserIdList;
}
/**
* 设置 更新用户
* @param updateUserIdList
*/
public void setUpdateUserIdList(List<Long> updateUserIdList){
this.updateUserIdList = updateUserIdList;
}
/**
* 获取 更新用户
* @return updateUserIdNotList
*/
public List<Long> getUpdateUserIdNotList(){
return this.updateUserIdNotList;
}
/**
* 设置 更新用户
* @param updateUserIdNotList
*/
public void setUpdateUserIdNotList(List<Long> updateUserIdNotList){
this.updateUserIdNotList = updateUserIdNotList;
}
/**
* 获取 开始 更新时间
* @return updateTimeStart
*/
public String getUpdateTimeStart(){
return this.updateTimeStart;
}
/**
* 设置 开始 更新时间
* @param updateTimeStart
*/
public void setUpdateTimeStart(String updateTimeStart){
this.updateTimeStart = updateTimeStart;
}
/**
* 获取 结束 更新时间
* @return updateTimeEnd
*/
public String getUpdateTimeEnd(){
return this.updateTimeEnd;
}
/**
* 设置 结束 更新时间
* @param updateTimeEnd
*/
public void setUpdateTimeEnd(String updateTimeEnd){
this.updateTimeEnd = updateTimeEnd;
}
/**
* 获取 角色名称
* @return roleNameList
*/
public List<String> getRoleNameList(){
return this.roleNameList;
}
/**
* 设置 角色名称
* @param roleNameList
*/
public void setRoleNameList(List<String> roleNameList){
this.roleNameList = roleNameList;
}
/**
* 获取 角色名称
* @return roleNameNotList
*/
public List<String> getRoleNameNotList(){
return this.roleNameNotList;
}
/**
* 设置 角色名称
* @param roleNameNotList
*/
public void setRoleNameNotList(List<String> roleNameNotList){
this.roleNameNotList = roleNameNotList;
}
/**
* 获取 资源名称
* @return resourceNameList
*/
public List<String> getResourceNameList(){
return this.resourceNameList;
}
/**
* 设置 资源名称
* @param resourceNameList
*/
public void setResourceNameList(List<String> resourceNameList){
this.resourceNameList = resourceNameList;
}
/**
* 获取 资源名称
* @return resourceNameNotList
*/
public List<String> getResourceNameNotList(){
return this.resourceNameNotList;
}
/**
* 设置 资源名称
* @param resourceNameNotList
*/
public void setResourceNameNotList(List<String> resourceNameNotList){
this.resourceNameNotList = resourceNameNotList;
}
/**
* 设置 序号,主键,自增长
* @param id
*/
public DimensionResourceRuleQuery id(Long id){
setId(id);
return this;
}
/**
* 设置 开始 序号,主键,自增长
* @param idStart
*/
public DimensionResourceRuleQuery idStart(Long idStart){
this.idStart = idStart;
return this;
}
/**
* 设置 结束 序号,主键,自增长
* @param idEnd
*/
public DimensionResourceRuleQuery idEnd(Long idEnd){
this.idEnd = idEnd;
return this;
}
/**
* 设置 增加 序号,主键,自增长
* @param idIncrement
*/
public DimensionResourceRuleQuery idIncrement(Long idIncrement){
this.idIncrement = idIncrement;
return this;
}
/**
* 设置 序号,主键,自增长
* @param idList
*/
public DimensionResourceRuleQuery idList(List<Long> idList){
this.idList = idList;
return this;
}
/**
* 设置 序号,主键,自增长
* @param idNotList
*/
public DimensionResourceRuleQuery idNotList(List<Long> idNotList){
this.idNotList = idNotList;
return this;
}
/**
* 设置 角色ID
* @param roleId
*/
public DimensionResourceRuleQuery roleId(Long roleId){
setRoleId(roleId);
return this;
}
/**
* 设置 开始 角色ID
* @param roleIdStart
*/
public DimensionResourceRuleQuery roleIdStart(Long roleIdStart){
this.roleIdStart = roleIdStart;
return this;
}
/**
* 设置 结束 角色ID
* @param roleIdEnd
*/
public DimensionResourceRuleQuery roleIdEnd(Long roleIdEnd){
this.roleIdEnd = roleIdEnd;
return this;
}
/**
* 设置 增加 角色ID
* @param roleIdIncrement
*/
public DimensionResourceRuleQuery roleIdIncrement(Long roleIdIncrement){
this.roleIdIncrement = roleIdIncrement;
return this;
}
/**
* 设置 角色ID
* @param roleIdList
*/
public DimensionResourceRuleQuery roleIdList(List<Long> roleIdList){
this.roleIdList = roleIdList;
return this;
}
/**
* 设置 角色ID
* @param roleIdNotList
*/
public DimensionResourceRuleQuery roleIdNotList(List<Long> roleIdNotList){
this.roleIdNotList = roleIdNotList;
return this;
}
/**
* 设置 资源ID
* @param resourceId
*/
public DimensionResourceRuleQuery resourceId(Long resourceId){
setResourceId(resourceId);
return this;
}
/**
* 设置 开始 资源ID
* @param resourceIdStart
*/
public DimensionResourceRuleQuery resourceIdStart(Long resourceIdStart){
this.resourceIdStart = resourceIdStart;
return this;
}
/**
* 设置 结束 资源ID
* @param resourceIdEnd
*/
public DimensionResourceRuleQuery resourceIdEnd(Long resourceIdEnd){
this.resourceIdEnd = resourceIdEnd;
return this;
}
/**
* 设置 增加 资源ID
* @param resourceIdIncrement
*/
public DimensionResourceRuleQuery resourceIdIncrement(Long resourceIdIncrement){
this.resourceIdIncrement = resourceIdIncrement;
return this;
}
/**
* 设置 资源ID
* @param resourceIdList
*/
public DimensionResourceRuleQuery resourceIdList(List<Long> resourceIdList){
this.resourceIdList = resourceIdList;
return this;
}
/**
* 设置 资源ID
* @param resourceIdNotList
*/
public DimensionResourceRuleQuery resourceIdNotList(List<Long> resourceIdNotList){
this.resourceIdNotList = resourceIdNotList;
return this;
}
/**
* 设置 规则编码
* @param ruleCode
*/
public DimensionResourceRuleQuery ruleCode(String ruleCode){
setRuleCode(ruleCode);
return this;
}
/**
* 设置 规则编码
* @param ruleCodeList
*/
public DimensionResourceRuleQuery ruleCodeList(List<String> ruleCodeList){
this.ruleCodeList = ruleCodeList;
return this;
}
/**
* 设置 规则名称
* @param ruleName
*/
public DimensionResourceRuleQuery ruleName(String ruleName){
setRuleName(ruleName);
return this;
}
/**
* 设置 规则名称
* @param ruleNameList
*/
public DimensionResourceRuleQuery ruleNameList(List<String> ruleNameList){
this.ruleNameList = ruleNameList;
return this;
}
/**
* 设置 规则条件(IN.属于,<.小于,>.大于,=.等于,!=.不等于,>=.大于等于,<=.小于等于,like %.左模糊,like %.右模糊)
* @param ruleCondition
*/
public DimensionResourceRuleQuery ruleCondition(String ruleCondition){
setRuleCondition(ruleCondition);
return this;
}
/**
* 设置 规则条件(IN.属于,<.小于,>.大于,=.等于,!=.不等于,>=.大于等于,<=.小于等于,like %.左模糊,like %.右模糊)
* @param ruleConditionList
*/
public DimensionResourceRuleQuery ruleConditionList(List<String> ruleConditionList){
this.ruleConditionList = ruleConditionList;
return this;
}
/**
* 设置 规则值,固定值或者系统变量
* @param ruleValue
*/
public DimensionResourceRuleQuery ruleValue(String ruleValue){
setRuleValue(ruleValue);
return this;
}
/**
* 设置 规则值,固定值或者系统变量
* @param ruleValueList
*/
public DimensionResourceRuleQuery ruleValueList(List<String> ruleValueList){
this.ruleValueList = ruleValueList;
return this;
}
/**
* 设置 规则值类型(1.固定值,2.系统上下问变量)
* @param ruleType
*/
public DimensionResourceRuleQuery ruleType(Integer ruleType){
setRuleType(ruleType);
return this;
}
/**
* 设置 开始 规则值类型(1.固定值,2.系统上下问变量)
* @param ruleTypeStart
*/
public DimensionResourceRuleQuery ruleTypeStart(Integer ruleTypeStart){
this.ruleTypeStart = ruleTypeStart;
return this;
}
/**
* 设置 结束 规则值类型(1.固定值,2.系统上下问变量)
* @param ruleTypeEnd
*/
public DimensionResourceRuleQuery ruleTypeEnd(Integer ruleTypeEnd){
this.ruleTypeEnd = ruleTypeEnd;
return this;
}
/**
* 设置 增加 规则值类型(1.固定值,2.系统上下问变量)
* @param ruleTypeIncrement
*/
public DimensionResourceRuleQuery ruleTypeIncrement(Integer ruleTypeIncrement){
this.ruleTypeIncrement = ruleTypeIncrement;
return this;
}
/**
* 设置 规则值类型(1.固定值,2.系统上下问变量)
* @param ruleTypeList
*/
public DimensionResourceRuleQuery ruleTypeList(List<Integer> ruleTypeList){
this.ruleTypeList = ruleTypeList;
return this;
}
/**
* 设置 规则值类型(1.固定值,2.系统上下问变量)
* @param ruleTypeNotList
*/
public DimensionResourceRuleQuery ruleTypeNotList(List<Integer> ruleTypeNotList){
this.ruleTypeNotList = ruleTypeNotList;
return this;
}
/**
* 设置 创建用户
* @param createUserId
*/
public DimensionResourceRuleQuery createUserId(Long createUserId){
setCreateUserId(createUserId);
return this;
}
/**
* 设置 开始 创建用户
* @param createUserIdStart
*/
public DimensionResourceRuleQuery createUserIdStart(Long createUserIdStart){
this.createUserIdStart = createUserIdStart;
return this;
}
/**
* 设置 结束 创建用户
* @param createUserIdEnd
*/
public DimensionResourceRuleQuery createUserIdEnd(Long createUserIdEnd){
this.createUserIdEnd = createUserIdEnd;
return this;
}
/**
* 设置 增加 创建用户
* @param createUserIdIncrement
*/
public DimensionResourceRuleQuery createUserIdIncrement(Long createUserIdIncrement){
this.createUserIdIncrement = createUserIdIncrement;
return this;
}
/**
* 设置 创建用户
* @param createUserIdList
*/
public DimensionResourceRuleQuery createUserIdList(List<Long> createUserIdList){
this.createUserIdList = createUserIdList;
return this;
}
/**
* 设置 创建用户
* @param createUserIdNotList
*/
public DimensionResourceRuleQuery createUserIdNotList(List<Long> createUserIdNotList){
this.createUserIdNotList = createUserIdNotList;
return this;
}
/**
* 设置 更新用户
* @param updateUserId
*/
public DimensionResourceRuleQuery updateUserId(Long updateUserId){
setUpdateUserId(updateUserId);
return this;
}
/**
* 设置 开始 更新用户
* @param updateUserIdStart
*/
public DimensionResourceRuleQuery updateUserIdStart(Long updateUserIdStart){
this.updateUserIdStart = updateUserIdStart;
return this;
}
/**
* 设置 结束 更新用户
* @param updateUserIdEnd
*/
public DimensionResourceRuleQuery updateUserIdEnd(Long updateUserIdEnd){
this.updateUserIdEnd = updateUserIdEnd;
return this;
}
/**
* 设置 增加 更新用户
* @param updateUserIdIncrement
*/
public DimensionResourceRuleQuery updateUserIdIncrement(Long updateUserIdIncrement){
this.updateUserIdIncrement = updateUserIdIncrement;
return this;
}
/**
* 设置 更新用户
* @param updateUserIdList
*/
public DimensionResourceRuleQuery updateUserIdList(List<Long> updateUserIdList){
this.updateUserIdList = updateUserIdList;
return this;
}
/**
* 设置 更新用户
* @param updateUserIdNotList
*/
public DimensionResourceRuleQuery updateUserIdNotList(List<Long> updateUserIdNotList){
this.updateUserIdNotList = updateUserIdNotList;
return this;
}
/**
* 设置 角色名称
* @param roleName
*/
public DimensionResourceRuleQuery roleName(String roleName){
setRoleName(roleName);
return this;
}
/**
* 设置 角色名称
* @param roleNameList
*/
public DimensionResourceRuleQuery roleNameList(List<String> roleNameList){
this.roleNameList = roleNameList;
return this;
}
/**
* 设置 资源名称
* @param resourceName
*/
public DimensionResourceRuleQuery resourceName(String resourceName){
setResourceName(resourceName);
return this;
}
/**
* 设置 资源名称
* @param resourceNameList
*/
public DimensionResourceRuleQuery resourceNameList(List<String> resourceNameList){
this.resourceNameList = resourceNameList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
*/
public List<DimensionResourceRuleQuery> getOrConditionList(){
return this.orConditionList;
}
/**
* 设置 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @param orConditionList
*/
public void setOrConditionList(List<DimensionResourceRuleQuery> orConditionList){
this.orConditionList = orConditionList;
}
/**
* 获取 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
* @return andConditionList
*/
public List<DimensionResourceRuleQuery> getAndConditionList(){
return this.andConditionList;
}
/**
* 设置 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
* @param andConditionList
*/
public void setAndConditionList(List<DimensionResourceRuleQuery> andConditionList){
this.andConditionList = andConditionList;
}
}
\ No newline at end of file
package com.mortals.xhx.module.dimension.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import lombok.Data;
import java.util.List;
/**
* 角色资源维度规则视图对象
*
* @author zxfei
* @date 2024-05-16
*/
@Data
public class DimensionResourceRuleVo extends BaseEntityLong {
/** 序号,主键,自增长列表 */
private List <Long> idList;
}
\ No newline at end of file
package com.mortals.xhx.module.dimension.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import lombok.Data;
import java.util.List;
/**
* 授权维度视图对象
*
* @author zxfei
* @date 2024-05-16
*/
@Data
public class DimensionVo extends BaseEntityLong {
/** 序号,主键,自增长列表 */
private List <Long> idList;
}
\ No newline at end of file
package com.mortals.xhx.module.dimension.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.dimension.dao.DimensionResourceRuleDao;
import com.mortals.xhx.module.dimension.model.DimensionResourceRuleEntity;
import java.util.List;
/**
* DimensionResourceRuleService
*
* 角色资源维度规则 service接口
*
* @author zxfei
* @date 2024-05-16
*/
public interface DimensionResourceRuleService extends ICRUDService<DimensionResourceRuleEntity,Long>{
DimensionResourceRuleDao getDao();
/**
* 根据当前controller路由获取用户角色资源维度规则
* @param userId
* @param route 当前controller路由
* @return
*/
List<DimensionResourceRuleEntity> getRoleComponentRule(Long userId,String route);
}
\ No newline at end of file
package com.mortals.xhx.module.dimension.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.dimension.dao.DimensionDao;
import com.mortals.xhx.module.dimension.model.DimensionEntity;
/**
* DimensionService
*
* 授权维度 service接口
*
* @author zxfei
* @date 2024-05-16
*/
public interface DimensionService extends ICRUDService<DimensionEntity,Long>{
DimensionDao getDao();
}
\ No newline at end of file
package com.mortals.xhx.module.dimension.service.impl;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.module.dimension.dao.DimensionResourceRuleDao;
import com.mortals.xhx.module.dimension.model.DimensionResourceRuleEntity;
import com.mortals.xhx.module.dimension.service.DimensionResourceRuleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* DimensionResourceRuleService
* 角色资源维度规则 service实现
*
* @author zxfei
* @date 2024-05-16
*/
@Service("dimensionResourceRuleService")
@Slf4j
public class DimensionResourceRuleServiceImpl extends AbstractCRUDServiceImpl<DimensionResourceRuleDao, DimensionResourceRuleEntity, Long> implements DimensionResourceRuleService {
/**
* @param userId
* @param route 当前controller路由
* @return
*/
@Override
public List<DimensionResourceRuleEntity> getRoleComponentRule(Long userId, String route) {
return this.getDao().getRoleComponentRule(userId, route);
}
}
\ No newline at end of file
package com.mortals.xhx.module.dimension.service.impl;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.module.dimension.dao.DimensionDao;
import com.mortals.xhx.module.dimension.model.DimensionEntity;
import com.mortals.xhx.module.dimension.service.DimensionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* DimensionService
* 授权维度 service实现
*
* @author zxfei
* @date 2024-05-16
*/
@Service("dimensionService")
@Slf4j
public class DimensionServiceImpl extends AbstractCRUDServiceImpl<DimensionDao, DimensionEntity, Long> implements DimensionService {
}
\ No newline at end of file
package com.mortals.xhx.module.dimension.web;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.DimensionTypeEnum;
import com.mortals.xhx.module.dimension.model.DimensionEntity;
import com.mortals.xhx.module.dimension.service.DimensionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
*
* 授权维度
*
* @author zxfei
* @date 2024-05-16
*/
@RestController
@RequestMapping("dimension")
public class DimensionController extends BaseCRUDJsonBodyMappingController<DimensionService,DimensionEntity,Long> {
@Autowired
private ParamService paramService;
public DimensionController(){
super.setModuleDesc( "授权维度");
}
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "dimensionType", DimensionTypeEnum.getEnumMap());
super.init(model, context);
}
}
\ No newline at end of file
package com.mortals.xhx.module.dimension.web;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.RuleConditionEnum;
import com.mortals.xhx.common.code.RuleTypeEnum;
import com.mortals.xhx.module.dimension.model.DimensionResourceRuleEntity;
import com.mortals.xhx.module.dimension.service.DimensionResourceRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
*
* 角色资源维度规则
*
* @author zxfei
* @date 2024-05-16
*/
@RestController
@RequestMapping("dimension/resource/rule")
public class DimensionResourceRuleController extends BaseCRUDJsonBodyMappingController<DimensionResourceRuleService,DimensionResourceRuleEntity,Long> {
@Autowired
private ParamService paramService;
public DimensionResourceRuleController(){
super.setModuleDesc( "角色资源维度规则");
}
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "ruleCondition", RuleConditionEnum.getEnumMap());
this.addDict(model, "ruleType", RuleTypeEnum.getEnumMap());
super.init(model, context);
}
}
\ No newline at end of file
......@@ -2,7 +2,6 @@ package com.mortals.xhx.module.holiday.web;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.holiday.model.HolidayEntity;
import com.mortals.xhx.module.holiday.service.HolidayService;
......
......@@ -21,4 +21,7 @@ public class MatterVo extends BaseEntityLong {
*/
private List <String> eventTypeShowNotList;
}
\ No newline at end of file
......@@ -23,4 +23,12 @@ public interface MatterExtService extends ICRUDService<MatterExtEntity,Long>{
void deleteByMatterId(Long matterId, Context context);
/**
* 同步删除 已经没有的站点事项
* @param siteEntity
* @param context
* @return
*/
Rest<String> syncDelMatterBySiteId(SiteEntity siteEntity, Context context);
}
\ No newline at end of file
......@@ -27,6 +27,7 @@ public interface MatterService extends ICRUDService<MatterEntity, Long> {
MatterDao getDao();
/**
* 添加业务到站点
*
......@@ -66,6 +67,7 @@ public interface MatterService extends ICRUDService<MatterEntity, Long> {
/**
* 查找差集子项
*
* @param matterQuery
* @param pageInfo
* @param context
......@@ -75,4 +77,14 @@ public interface MatterService extends ICRUDService<MatterEntity, Long> {
Result<MatterEntity> findSubList(MatterEntity matterQuery, PageInfo pageInfo, Context context) throws AppException;
Result<MatterInfo> findMicroList(MatterQuery matterQuery, PageInfo pageInfo, Context context) throws AppException;
/**
* 生成事项文本
* @param context
* @return
*/
Rest<Void> genMatterTxt(MatterQuery matterQuery,Context context);
Rest<Void> genMatterMarkdown(MatterQuery matterQuery,Context context);
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.common.Rest;
import com.mortals.framework.util.ThreadPool;
import com.mortals.xhx.common.code.DxTypeEnum;
import com.mortals.xhx.common.code.SourceEnum;
import com.mortals.xhx.common.code.YesNoEnum;
......@@ -18,10 +19,7 @@ import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.module.matter.model.MatterQuery;
import com.mortals.xhx.module.matter.service.MatterService;
import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.site.model.SiteMatterEntity;
import com.mortals.xhx.module.site.model.SiteMatterQuery;
import com.mortals.xhx.module.site.model.SiteQuery;
import com.mortals.xhx.module.site.model.*;
import com.mortals.xhx.module.site.service.SiteMatterService;
import com.mortals.xhx.module.site.service.SiteService;
import com.mortals.xhx.module.site.service.SiteThemeMatterService;
......@@ -58,13 +56,11 @@ public class MatterExtServiceImpl extends AbstractCRUDServiceImpl<MatterExtDao,
@Autowired
private MatterService matterService;
@Autowired
private SiteService siteService;
@Autowired
private SiteMatterService siteMatterService;
@Autowired
private SiteThemeMatterService siteThemeMatterService;
@Autowired
private SiteThemeService siteThemeService;
@Autowired
private SiteMatterService siteMatterService;
/**
......@@ -76,30 +72,7 @@ public class MatterExtServiceImpl extends AbstractCRUDServiceImpl<MatterExtDao,
*/
@Override
public Rest<String> syncMatterBySiteId(SiteEntity siteEntity, Context context) {
AreaEntity areaEntity = areaService.getCache(siteEntity.getAreaCode());
List<DeptEntity> deptEntities = deptService.find(new DeptQuery().siteId(siteEntity.getId()).source(SourceEnum.政务网.getValue()));
List<MatterEntity> govMatterList = deptEntities.parallelStream().flatMap(deptEntity -> {
HashMap<String, String> params = new HashMap<>();
params.put("areaCode", areaEntity.getAreaCode());
params.put("dxType", "6");
params.put("deptCode", deptEntity.getDeptNumber());
params.put("searchtext", "");
params.put("taskType", "");
List<MatterEntity> deptMatterList = this.getMatters(params, context);
return deptMatterList.stream();
}).collect(Collectors.toList());
/* for (DeptEntity deptEntity : deptEntities) {
HashMap<String, String> params = new HashMap<>();
params.put("areaCode", areaEntity.getAreaCode());
params.put("dxType", "6");
params.put("deptCode", deptEntity.getDeptNumber());
params.put("searchtext", "");
params.put("taskType", "");
List<MatterEntity> deptMatterList = this.getMatters(params, context);
if (!ObjectUtils.isEmpty(deptMatterList)) {
govMatterList.addAll(deptMatterList);
}
}*/
List<MatterEntity> govMatterList = getMatterEntities(siteEntity, context);
//当前本地区事项全部事项
log.info("计算差集");
MatterQuery matterQuery = new MatterQuery();
......@@ -128,17 +101,37 @@ public class MatterExtServiceImpl extends AbstractCRUDServiceImpl<MatterExtDao,
}
log.info("开始更新事项详细!");
for (MatterEntity matterEntity : matterList) {
Runnable runnable = new Runnable() {
@Override
public void run() {
Rest<String> rest = matterService.buildMatterDetail(matterEntity, null);
if (rest.getCode() == YesNoEnum.YES.getValue()) {
// log.info("更新详细事项==>{},id===>{},localVersion===>{}", matterEntity.getMatterName(),matterEntity.getId(),matterEntity.getMatterEdition());
//matterEntity.setUrl(null);
matterEntity.setUpdateTime(new Date());
matterService.update(matterEntity, null);
}
}
};
ThreadPool.getInstance().execute(runnable);
}
return Rest.ok();
}
private List<MatterEntity> getMatterEntities(SiteEntity siteEntity, Context context) {
AreaEntity areaEntity = areaService.getCache(siteEntity.getAreaCode());
List<DeptEntity> deptEntities = deptService.find(new DeptQuery().siteId(siteEntity.getId()).source(SourceEnum.政务网.getValue()));
List<MatterEntity> govMatterList = deptEntities.parallelStream().flatMap(deptEntity -> {
HashMap<String, String> params = new HashMap<>();
params.put("areaCode", areaEntity.getAreaCode());
params.put("dxType", "6");
params.put("deptCode", deptEntity.getDeptNumber());
params.put("searchtext", "");
params.put("taskType", "");
List<MatterEntity> deptMatterList = this.getMatters(params, context);
return deptMatterList.stream();
}).collect(Collectors.toList());
return govMatterList;
}
/**
* 同步站点主题事项
*
......@@ -191,7 +184,6 @@ public class MatterExtServiceImpl extends AbstractCRUDServiceImpl<MatterExtDao,
return firstList.parallelStream().filter(item -> !secondSet.contains(item.getMatterNo())).collect(Collectors.toList());
}
private List<MatterEntity> getMatters(HashMap<String, String> params, Context context) {
String url = GlobalSysInfo.getParamValue(Constant.GOV_MATTER_PAGELIST_URL, "http://www.sczwfw.gov.cn/jiq/interface/item/tags");
Rest<Map<String, Integer>> restStat = MatterHtmlParseUtil.statSiteMatterCount(params, url);
......@@ -234,5 +226,52 @@ public class MatterExtServiceImpl extends AbstractCRUDServiceImpl<MatterExtDao,
this.dao.delete(condition);
}
/**
* @param siteEntity
* @param context
* @return
*/
@Override
public Rest<String> syncDelMatterBySiteId(SiteEntity siteEntity, Context context) {
//
List<MatterEntity> govMatterList = getMatterEntities(siteEntity, context);
log.info("计算差集");
MatterQuery matterQuery = new MatterQuery();
matterQuery.setAreaCode(siteEntity.getAreaCode());
matterQuery.setSource(SourceEnum.政务网.getValue());
//本地事项
List<MatterEntity> matterList = matterService.getDao().getMatterListByAreaCode(matterQuery);
log.info("本地事项总数:{}", matterList.size());
//政务网存在set
Set<String> matterExistSet = govMatterList.parallelStream().map(i -> i.getMatterNo()).collect(Collectors.toSet());
List<MatterEntity> delList = this.subListSet(matterList, matterExistSet);
log.info("抓取事项总数:{} ,需要删除事项数量:{}", govMatterList.size(), delList.size());
//删除matter 和siteMatter
if (!ObjectUtils.isEmpty(delList)) {
Long[] delMatterIds = delList.parallelStream().map(i -> i.getId()).toArray(Long[]::new);
matterService.remove(delMatterIds, context);
SiteMatterQuery siteMatterQuery = new SiteMatterQuery();
siteMatterQuery.setMatterIdList(Arrays.asList(delMatterIds));
List<SiteMatterEntity> delSiteMatterList = siteMatterService.find(siteMatterQuery);
if (!ObjectUtils.isEmpty(delSiteMatterList)) {
log.info("删除站点事项数量:{}", delSiteMatterList.size());
siteMatterService.removeList(delSiteMatterList, context);
}
SiteThemeMatterQuery siteThemeMatterQuery = new SiteThemeMatterQuery();
siteThemeMatterQuery.setMatterIdList(Arrays.asList(delMatterIds));
List<SiteThemeMatterEntity> delSiteThemeMatterList = siteThemeMatterService.find(siteThemeMatterQuery);
if (!ObjectUtils.isEmpty(delSiteThemeMatterList)) {
log.info("删除站点主题事项数量:{}", delSiteThemeMatterList.size());
siteThemeMatterService.removeList(delSiteThemeMatterList, context);
}
}
return Rest.ok("同步删除成功!");
}
}
\ No newline at end of file
package com.mortals.xhx.module.matter.service.impl;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.PageUtil;
import cn.hutool.core.util.ReflectUtil;
import cn.hutool.setting.Setting;
......@@ -315,6 +316,11 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
return matterInfoResult;
}
/**
* @param context
* @return
*/
@Override
public void syncMatter(String areaCode, Context context) {
......@@ -1099,7 +1105,7 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
//更新事项更新标志
matterEntity.setHaveGetMatterInfo("true");
matterEntity.setMatterEdition(matterEditionRemote+"");
matterEntity.setMatterEdition(matterEditionRemote + "");
return Rest.ok("更新详细成功!");
......@@ -1393,4 +1399,309 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
}
@Override
public Rest<Void> genMatterTxt(MatterQuery matterQuery, Context context) {
List<String> strList = new ArrayList<>();
List<MatterEntity> mattersList = this.find(matterQuery);
for (MatterEntity matterEntity : mattersList) {
if (ObjectUtils.isEmpty(matterEntity.getUrl())) {
continue;
}
StringBuilder sb = new StringBuilder();
int reCount = 0;
while (reCount < MAX_RETRY_COUNT) {
try {
Document dom = Jsoup.connect(matterEntity.getUrl())
.ignoreContentType(true)
.ignoreHttpErrors(true)
.timeout(60 * 1000).get();
// sb.append(matterEntity.getMatterName()).append("\n");
//基本属性
sb.append(matterEntity.getMatterName()).append("-基本信息,");
Map<String, String> baseInfoMap = MatterDetailHtmlParseUtil.getbaseInfoMapByHtml(dom);
StringBuilder sb1 = new StringBuilder();
for (Map.Entry<String, String> entry : baseInfoMap.entrySet()) {
if(sb1.length()>360){
sb.append(sb1);
sb.append("\n");
sb1 = new StringBuilder();
sb.append(matterEntity.getMatterName()).append("-基本信息,");
}
sb1.append(entry.getKey()).append(" ").append(entry.getValue());
}
sb.append(sb1);
sb.append("\n");
//更新材料属性
sb.append(matterEntity.getMatterName()).append("-申请材料,");
List<Map<String, Object>> sqclList = MatterDetailHtmlParseUtil.getsqclInfoMapByHtml(dom);
for (Map<String, Object> sqclMap : sqclList) {
Map<String, String> baseinfoMap = (HashMap<String, String>) sqclMap.get("baseinfo");
for (Map.Entry<String, String> entry : baseinfoMap.entrySet()) {
if(!"材料名称".equals(entry.getKey())){
continue;
}
sb.append(entry.getKey()).append(" ").append(entry.getValue());
}
/* List<MatterDatumFileEntity> datumFileEntities = (List<MatterDatumFileEntity>) sqclMap.get("blankList");
for (MatterDatumFileEntity datumFileEntity : datumFileEntities) {
sb.append("材料名称").append(" ").append(datumFileEntity.getFileName());
sb.append("材料地址").append(" ").append(datumFileEntity.getFileUrl());
}*/
}
//更新受理条件
sb.append("\n");
sb.append(matterEntity.getMatterName()).append("-受理条件,");
Map<String, String> sltjMap = MatterDetailHtmlParseUtil.getSltjMapByHtml(dom);
String sltjStr = sltjMap.getOrDefault("sltj", " ");
sb.append(sltjStr);
//更新办理流程
sb.append("\n");
sb.append(matterEntity.getMatterName()).append("-办理流程,");
List<Map<String, Object>> bllcMapList = MatterDetailHtmlParseUtil.getbllcMapByHtml(dom);
for (Map<String, Object> bllcMap : bllcMapList) {
for (Map.Entry<String, Object> entry : bllcMap.entrySet()) {
sb.append(entry.getKey()).append(" ").append(entry.getValue());
}
}
//更新收费标准
sb.append("\n");
sb.append(matterEntity.getMatterName()).append("-收费标准,");
Map<String, String> sfbzMap = MatterDetailHtmlParseUtil.getSfbzMapByHtml(dom);
String sfbzStr = sfbzMap.getOrDefault("sfbz", " ");
sb.append(sfbzStr);
sb.append("\n");
//设定依据
/* sb.append(matterEntity.getMatterName()).append("-设定依据,");
List<Map<String, Object>> sdyjMapList = MatterDetailHtmlParseUtil.getSdyjMapByHtml(dom);
StringBuilder sb2 = new StringBuilder();
for (Map<String, Object> bllcMap : sdyjMapList) {
for (Map.Entry<String, Object> entry : bllcMap.entrySet()) {
if(sb2.length()>360){
sb.append(sb2);
sb.append("\n");
sb2 = new StringBuilder();
sb.append(matterEntity.getMatterName()).append("-设定依据,");
}
sb2.append(entry.getKey()).append(" ").append(entry.getValue());
}
}
sb.append(sb2);*/
//中介服务
sb.append("\n");
sb.append(matterEntity.getMatterName()).append("-中介服务,");
Map<String, String> zjfwMap = MatterDetailHtmlParseUtil.getZjfwMapByHtml(dom);
for (Map.Entry<String, String> entry : zjfwMap.entrySet()) {
sb.append(entry.getKey()).append(" ").append(entry.getValue());
}
//常见问题
sb.append("\n");
sb.append(matterEntity.getMatterName()).append("-常见问题,");
StringBuilder sb3 = new StringBuilder();
List<Map<String, Object>> cjwtMapList = MatterDetailHtmlParseUtil.getCjwtMapByHtml(dom);
for (Map<String, Object> bllcMap : cjwtMapList) {
for (Map.Entry<String, Object> entry : bllcMap.entrySet()) {
if(sb3.length()>360){
sb.append(sb3);
sb.append("\n");
sb3 = new StringBuilder();
sb.append(matterEntity.getMatterName()).append("-常见问题,");
}
sb3.append(entry.getKey()).append(" ").append(entry.getValue());
}
}
sb.append(sb3);
strList.add(sb.toString());
log.info("事项名称:{}",matterEntity.getMatterName());
break;
} catch (Exception e) {
log.error("异常", e);
reCount++;
try {
Thread.sleep(2000);
} catch (InterruptedException ie) {
}
}
}
}
//todo 实时爬取后组合
String path = "E:\\temp.csv";
FileUtil.writeUtf8Lines(strList,path);
return Rest.ok();
}
@Override
public Rest<Void> genMatterMarkdown(MatterQuery matterQuery, Context context) {
List<String> strList = new ArrayList<>();
List<MatterEntity> mattersList = this.find(matterQuery);
for (MatterEntity matterEntity : mattersList) {
if (ObjectUtils.isEmpty(matterEntity.getUrl())) {
continue;
}
StringBuilder sb = new StringBuilder();
int reCount = 0;
while (reCount < MAX_RETRY_COUNT) {
try {
Document dom = Jsoup.connect(matterEntity.getUrl())
.ignoreContentType(true)
.ignoreHttpErrors(true)
.timeout(60 * 1000).get();
//基本属性
sb.append("# "+matterEntity.getMatterName()+"\n");
sb.append("\n");
sb.append("## 基本信息\n");
Map<String, String> baseInfoMap = MatterDetailHtmlParseUtil.getbaseInfoMapByHtml(dom);
for (Map.Entry<String, String> entry : baseInfoMap.entrySet()) {
sb.append(entry.getKey()).append(" ").append(entry.getValue());
sb.append("\n");
}
sb.append("\n");
//更新材料属性
sb.append("## 申请材料\n");
List<Map<String, Object>> sqclList = MatterDetailHtmlParseUtil.getsqclInfoMapByHtml(dom);
for (Map<String, Object> sqclMap : sqclList) {
Map<String, String> baseinfoMap = (HashMap<String, String>) sqclMap.get("baseinfo");
for (Map.Entry<String, String> entry : baseinfoMap.entrySet()) {
if("要求提供材料的依据".equals(entry.getKey())) continue;
sb.append(entry.getKey()).append(" ").append(entry.getValue());
sb.append("\n");
}
}
//更新受理条件
sb.append("\n");
sb.append("## 受理条件\n");
Map<String, String> sltjMap = MatterDetailHtmlParseUtil.getSltjMapByHtml(dom);
String sltjStr = sltjMap.getOrDefault("sltj", " ");
sb.append(sltjStr);
//更新办理流程
sb.append("\n");
sb.append("## 办理流程\n");
List<Map<String, Object>> bllcMapList = MatterDetailHtmlParseUtil.getbllcMapByHtml(dom);
for (Map<String, Object> bllcMap : bllcMapList) {
for (Map.Entry<String, Object> entry : bllcMap.entrySet()) {
if("sort".equals(entry.getKey())){
sb.append("流程").append(":").append(entry.getValue());
}else{
sb.append(entry.getKey()).append(" ").append(entry.getValue());
}
sb.append("\n");
}
}
//更新收费标准
sb.append("\n");
sb.append("## 收费标准\n");
Map<String, String> sfbzMap = MatterDetailHtmlParseUtil.getSfbzMapByHtml(dom);
String sfbzStr = sfbzMap.getOrDefault("sfbz", " ");
sb.append(sfbzStr);
//设定依据
/* sb.append(matterEntity.getMatterName()).append("-设定依据,");
List<Map<String, Object>> sdyjMapList = MatterDetailHtmlParseUtil.getSdyjMapByHtml(dom);
StringBuilder sb2 = new StringBuilder();
for (Map<String, Object> bllcMap : sdyjMapList) {
for (Map.Entry<String, Object> entry : bllcMap.entrySet()) {
if(sb2.length()>360){
sb.append(sb2);
sb.append("\n");
sb2 = new StringBuilder();
sb.append(matterEntity.getMatterName()).append("-设定依据,");
}
sb2.append(entry.getKey()).append(" ").append(entry.getValue());
}
}
sb.append(sb2);*/
//中介服务
sb.append("\n");
sb.append("## 中介服务\n");
Map<String, String> zjfwMap = MatterDetailHtmlParseUtil.getZjfwMapByHtml(dom);
if(zjfwMap.size()>0){
for (Map.Entry<String, String> entry : zjfwMap.entrySet()) {
sb.append(entry.getKey()).append(" ").append(entry.getValue());
}
}else{
sb.append("无\n");
}
//常见问题
sb.append("\n");
sb.append("## 常见问题\n");
List<Map<String, Object>> cjwtMapList = MatterDetailHtmlParseUtil.getCjwtMapByHtml(dom);
for (Map<String, Object> bllcMap : cjwtMapList) {
for (Map.Entry<String, Object> entry : bllcMap.entrySet()) {
sb.append(entry.getKey()).append(" ").append(entry.getValue());
sb.append("\n");
}
}
strList.add(sb.toString());
log.info("事项名称:{}",matterEntity.getMatterName());
break;
} catch (Exception e) {
log.error("异常", e);
reCount++;
try {
Thread.sleep(2000);
} catch (InterruptedException ie) {
}
}
}
}
String path = "E:\\gov.md";
FileUtil.writeUtf8Lines(strList,path);
return Rest.ok();
}
public static void main(String[] args) {
/*
ArrayList<MatterEntity> matterEntities = new ArrayList<>();
MatterEntity matterEntity = new MatterEntity();
matterEntity.initAttrValue();
matterEntities.add(matterEntity);
String path = "E:\\1.txt";
FileUtil.writeUtf8Lines(matterEntities, path);
*/
StringBuilder sb = new StringBuilder();
sb.append("问:小区经业主大会续聘(或选聘)物业服务企业的,物业服务合同备案对召开会议时间是否有要求? 答:有。根据《四川省业主大会和业主委员会指导规则》相关要求,业主委员会应当自提议确定之日起,将业主大会会议拟表决事项在物业管理区域内显著位置公示并告知相关的居民(村民)委员会,公示期不少于15日。\n" +
"住宅专项维修资金交存-基本信息,是否支持全省就近办理 否是否支持物流快递 否业务办理项编码 11510821008501563R451201700100301认证等级需求 实名认证名称 操作承诺办结时限 1个工作日基本编码 512017001003计划生效日期 无法定办结时限 1个工作日实施主体编码 11510821008501563R网办地址 点击访问服务对象 自然人咨询方式 咨询电话:0825-5428572;事项状态 在用办理时间 星期一至星期五 上午:08:30-12:00 下午:14:00-17:30 备注:法定节假日除外;实施主体性质 受委托组织是否进驻政务大厅 是村居社区名称 无权力来源 上级下放村居社区代码 无法定时限办结说明 自受理之日起,在法定期限内办结行使层级 县级到办事现场次数 0住宅专项维修资金交存-基本信息,网办类型 全程网办实施主体 蓬溪县住房和城乡建设局是否网办 是监督投诉方式 投诉电话:0825-12345;事项类型 公共服务行使方式 依申请行使承诺时限办结说明 自受理之日起,在承诺期限内办结是否支持全省就近取件 否是否支持预约办理 否事项版本 19联办机构 无办件类型 即办件通办范围 无是否支持上门收取申请材料 否是否支持自助终端办理 否数量限制 无办理形式 窗口办理、网上办理乡镇街道名称 无是否支持网上支付 否委托部门 蓬溪县住房保障和房屋管理局乡镇街道代码 无是否收费 否网上办理深度 互联网咨询、互联网收件、互联网预审、互联网受理、互联网办理、互联网办理结果信息反馈实施编码 11510821008501563R4512017001003特别程序 必须到现场原因 无住宅专项维修资金交存-基本信息,办理地点 四川省-遂宁市-蓬溪县-蜀北中路街道-108号,详细地址:蓬溪县住房保障和房屋管理局三楼办公室;计划取消日期 无\n" +
"住宅专项维修资金交存-申请材料,材料名称 公有住房买卖合同材料名称 身份证明材料材料名称 商品房买卖合同\n" +
"住宅专项维修资金交存-受理条件,四川省行政区域内商品住宅、售后公有住房住宅专项维修资金(以下称维修资金)的交存、使用、管理和监督,拟申请住宅专项维修资金交存。\n" +
"住宅专项维修资金交存-办理流程,转外时限 0个工作日sort 1办理流程 受理办理流程说明 1.申请:申请人到政务服务中心综合 窗口提交申请材料;2.受理:窗口工作人员收到申请材料当场或者规定工作日内作出受理或不予受理决定。材料不齐全或不符合法定形式的,办理机关应在规定工作日内一次性告知申请人需要补正的全部内容,对不属于受理范围的,出具不予受理通知书;3.审查:办理人员对申请人提交的材料进行审查,提出初步审查意见;4.决定:办理机关负责人依据审查意见签署审批结果。对予批准办理的,由办理机关向申请人核发办理结果,不予批准的,由办理机关书面通知申请人并说明理由,并告知申请人对结果有异议的,可依法申请行政复议或者提起行政诉讼;5.制证:制证部门完成制证;6.颁发和送达:申请人凭个人身份证明(有效的身份证、临时居住证、户口簿等)和受理通知书到申办窗口领取办理结果。办理时长 0个工作日转外时限 0个工作日sort 2办理流程 办结办理时长 0个工作日\n" +
"住宅专项维修资金交存-收费标准,该事项无收费标准!\n" +
"住宅专项维修资金交存-设定依据,法规类型 部门规章条例 第六条条款内容 下列物业的业主应当按照本办法的规定交存住宅专项维修资金: (一)住宅,但一个业主所有且与其他物业不具有共用部位、共用设施设备的除外; (二)住宅小区内的非住宅或者住宅小区外与单幢住宅结构相连的非住宅。 前款所列物业属于出售公有住房的,售房单位应当按照本办法的规定交存住宅专项维修资金。法律法规名称 住宅专项维修资金管理办法sort 1法规类型 地方法规条例 第六十九条条款内容 住宅物业和住宅区内的非住宅物业出售时,物业出售人和买受人应当按照国家和省的规定交存专项维修资金。法律法规名称 四川省物业管理条例sort 2");
System.out.println(sb.length());
}
}
\ No newline at end of file
......@@ -4,7 +4,6 @@ import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.matter.model.MatterAcceptEntity;
import com.mortals.xhx.module.matter.service.MatterAcceptService;
......
......@@ -4,7 +4,6 @@ import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.matter.model.MatterChargesEntity;
import com.mortals.xhx.module.matter.service.MatterChargesService;
......
......@@ -9,12 +9,13 @@ import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.util.ThreadPool;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.framework.config.InterceptorConfig;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.JointInfoShowEnum;
import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.module.matter.model.MatterQuery;
import com.mortals.xhx.module.matter.service.MatterService;
import com.mortals.xhx.module.site.model.SiteThemeQuery;
import com.mortals.xhx.module.site.service.SiteThemeService;
......@@ -50,6 +51,8 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
private InterceptorConfig interceptorConfig;
@Autowired
private SiteThemeService siteThemeService;
@Autowired
private MatterService matterService;
public MatterController() {
super.setModuleDesc("基础事项");
......@@ -189,4 +192,64 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
return ret;
}
@PostMapping(value = "genMatterTxt")
@UnAuth
public Rest<Object> genMatterTxt(@RequestBody MatterQuery query) {
Rest<Object> ret = new Rest<>();
Map<String, Object> model = new HashMap<>();
Context context = this.getContext();
String busiDesc = "生成文本" + this.getModuleDesc();
int code = VALUE_RESULT_SUCCESS;
try {
/* Runnable runnable = new Runnable() {
*//**
*
*//*
@Override
public void run() {
matterService.genMatterTxt(query, getContext());
}
};
ThreadPool.getInstance().execute(runnable);*/
this.service.genMatterTxt(query, getContext());
model.put(MESSAGE_INFO, busiDesc + "成功");
} catch (Exception e) {
code = VALUE_RESULT_FAILURE;
this.doException(request, busiDesc, model, e);
}
ret.setCode(code);
ret.setData(model);
ret.setMsg(model.get(MESSAGE_INFO) == null ? "" : model.remove(MESSAGE_INFO).toString());
return ret;
}
@PostMapping(value = "genMatterMarkdown")
@UnAuth
public Rest<Object> genMatterMarkdown(@RequestBody MatterQuery query) {
Rest<Object> ret = new Rest<>();
Map<String, Object> model = new HashMap<>();
Context context = this.getContext();
String busiDesc = "生成文本" + this.getModuleDesc();
int code = VALUE_RESULT_SUCCESS;
try {
this.service.genMatterMarkdown(query, getContext());
model.put(MESSAGE_INFO, busiDesc + "成功");
} catch (Exception e) {
code = VALUE_RESULT_FAILURE;
this.doException(request, busiDesc, model, e);
}
ret.setCode(code);
ret.setData(model);
ret.setMsg(model.get(MESSAGE_INFO) == null ? "" : model.remove(MESSAGE_INFO).toString());
return ret;
}
}
\ No newline at end of file
package com.mortals.xhx.module.matter.web;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
......@@ -7,7 +10,6 @@ import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.matter.model.MatterDatumEntity;
import com.mortals.xhx.module.matter.model.MatterDatumFileEntity;
......@@ -17,10 +19,7 @@ import com.mortals.xhx.module.matter.service.MatterDatumFileService;
import com.mortals.xhx.module.matter.service.MatterDatumService;
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 org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
......@@ -99,13 +98,14 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
List<MatterDatumEntity> matterDatumEntities = (List<MatterDatumEntity>) model.get(KEY_RESULT_DATA);
//去重复
List<MatterDatumEntity> collect = matterDatumEntities.stream().distinct().collect(Collectors.toList());
model.put(KEY_RESULT_DATA,collect);
model.put(KEY_RESULT_DATA, collect);
return super.doListAfter(query, model, context);
}
/**
* 查询的材料 名称去重 并且
*
* @param query
* @return
*/
......@@ -135,4 +135,33 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
return ret;
}
/**
* 解密下载地址
*
* @param encryptId 文件加密id
* @return
*/
@GetMapping(value = "decodeDownloadUrl")
@UnAuth
public Rest<String> decodeDownloadUrl(@RequestParam(name = "encryptId") String encryptId) {
Map<String, Object> model = new HashMap<>();
String busiDesc = "查询材料" + this.getModuleDesc();
try {
String encryUrl = "http://www.sczwfw.gov.cn/jiq/interface/item/annex/encryptUrl?id=" + encryptId;
String resp = HttpUtil.get(encryUrl);
JSONObject obj = JSON.parseObject(resp);
String code = obj.getString("code");
String data = obj.getString("data");
if ("0".equals(code)) {
return Rest.ok("获取附件链接成功!",data);
} else {
return Rest.fail("获取链接失败");
}
} catch (Exception e) {
this.doException(request, busiDesc, model, e);
return Rest.fail(e.getMessage());
}
}
}
\ No newline at end of file
......@@ -4,7 +4,6 @@ import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.matter.model.MatterDatumFileEntity;
import com.mortals.xhx.module.matter.service.MatterDatumFileService;
......
package com.mortals.xhx.module.matter.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.matter.model.MatterQuery;
import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.site.model.SiteQuery;
import com.mortals.xhx.module.site.service.SiteService;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -31,10 +39,13 @@ import static com.mortals.framework.ap.SysConstains.*;
*/
@RestController
@RequestMapping("matter/ext")
@Slf4j
public class MatterExtController extends BaseCRUDJsonBodyMappingController<MatterExtService,MatterExtEntity,Long> {
@Autowired
private ParamService paramService;
@Autowired
private SiteService siteService;
public MatterExtController(){
super.setModuleDesc( "事项扩展");
......@@ -47,4 +58,32 @@ public class MatterExtController extends BaseCRUDJsonBodyMappingController<Matte
}
@GetMapping(value = "delMattersBySiteId")
@UnAuth
public Rest<Object> delMattersBySiteId() {
Rest<Object> ret = new Rest<>();
Map<String, Object> model = new HashMap<>();
String busiDesc = "删除" + this.getModuleDesc();
int code = VALUE_RESULT_SUCCESS;
try {
List<SiteEntity> siteEntities = siteService.find(new SiteEntity());
for (SiteEntity siteEntity : siteEntities) {
log.info("开始同步删除站点事项==》{}", siteEntity.getSiteName());
this.service.syncDelMatterBySiteId(siteEntity, getContext());
}
model.put(MESSAGE_INFO, busiDesc + "成功");
} catch (Exception e) {
code = VALUE_RESULT_FAILURE;
this.doException(request, busiDesc, model, e);
}
ret.setCode(code);
ret.setData(model);
ret.setMsg(model.get(MESSAGE_INFO) == null ? "" : model.remove(MESSAGE_INFO).toString());
return ret;
}
}
\ No newline at end of file
......@@ -4,7 +4,6 @@ import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.matter.model.MatterFlowlimitEntity;
import com.mortals.xhx.module.matter.service.MatterFlowlimitService;
......
......@@ -4,7 +4,6 @@ import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.matter.model.MatterIntermediaryEntity;
import com.mortals.xhx.module.matter.service.MatterIntermediaryService;
......
......@@ -4,7 +4,6 @@ import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.matter.model.MatterQuestionEntity;
import com.mortals.xhx.module.matter.service.MatterQuestionService;
......
......@@ -4,7 +4,6 @@ import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.matter.model.MatterSetbaseEntity;
import com.mortals.xhx.module.matter.service.MatterSetbaseService;
......
......@@ -21,6 +21,7 @@ import com.mortals.xhx.module.site.service.SiteBusinessService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
......@@ -39,9 +40,11 @@ import java.util.stream.Collectors;
public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBusinessDao, SiteBusinessEntity, Long> implements SiteBusinessService {
@Autowired
@Lazy
private BusinessService businessService;
@Autowired
@Lazy
private BusinessMatterService businessMatterService;
/**
......
......@@ -165,4 +165,7 @@ public class SiteMatterServiceImpl extends AbstractCRUDServiceImpl<SiteMatterDao
return Rest.ok();
}
}
\ No newline at end of file
......@@ -62,6 +62,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
......@@ -86,14 +87,17 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
* 根据用户id 暂存对应站点树 默认0为全站点树
*/
private Map<Long, List<SiteTreeSelect>> siteTreeMap = new HashMap<>();
@Autowired
@Lazy
private AreaService areaService;
@Autowired
@Lazy
private ModelService modelService;
@Autowired
@Lazy
private IUserFeign userFeign;
@Autowired
@Lazy
private UserService userService;
@Autowired
private DeptService deptService;
......
......@@ -5,19 +5,27 @@ 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.util.ThreadPool;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.SourceEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.matter.model.MatterQuery;
import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.site.model.SiteMatterEntity;
import com.mortals.xhx.module.site.model.SiteMatterQuery;
import com.mortals.xhx.module.site.model.SiteQuery;
import com.mortals.xhx.module.site.service.SiteMatterService;
import com.mortals.xhx.module.site.service.SiteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.util.*;
/**
* 站点事项
......@@ -31,6 +39,12 @@ public class SiteMatterController extends BaseCRUDJsonBodyMappingController<Site
@Autowired
private ParamService paramService;
@Autowired
private DeptService deptService;
@Autowired
private SiteService siteService;
@Autowired
private SiteMatterService siteMatterService;
public SiteMatterController() {
super.setModuleDesc("站点事项");
......@@ -50,4 +64,51 @@ public class SiteMatterController extends BaseCRUDJsonBodyMappingController<Site
query.setEventTypeShowNotList(Arrays.asList("行政处罚"));
}
}
/**
* @param list
* @param model
* @param context
* @return
* @throws AppException
*/
@Override
protected int batchSaveAfter(List<SiteMatterEntity> list, Map<String, Object> model, Context context) throws AppException {
//统计部门入驻数量
Runnable runnable = new Runnable() {
/**
*
*/
@Override
public void run() {
List<SiteEntity> siteEntities = siteService.find(new SiteQuery());
for (SiteEntity siteEntity : siteEntities) {
DeptQuery query = new DeptQuery();
query.setSiteId(siteEntity.getId());
List<DeptEntity> deptEntities = deptService.find(query);
for (DeptEntity deptEntity : deptEntities) {
DeptEntity deptQuery = new DeptEntity();
deptQuery.setUpdateTime(new Date());
//统计入驻事项
SiteMatterQuery siteMatterQuery = new SiteMatterQuery();
siteMatterQuery.setDeptCode(deptEntity.getDeptNumber());
siteMatterQuery.setSource(SourceEnum.政务网.getValue());
siteMatterQuery.setHallCheckIn(YesNoEnum.YES.getValue());
int incount = siteMatterService.count(siteMatterQuery, null);
deptQuery.setInNum(incount);
DeptEntity condition = new DeptEntity();
condition.setId(deptEntity.getId());
deptService.getDao().update(deptQuery, condition);
}
}
}
};
ThreadPool.getInstance().execute(runnable);
return super.batchSaveAfter(list, model, context);
}
}
\ No newline at end of file
package com.mortals.xhx.module.site.web;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.site.model.SiteModelEntity;
import com.mortals.xhx.module.site.service.SiteModelService;
......
package com.mortals.xhx.module.skin.service.impl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.skin.model.SkinFieldQuery;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.module.skin.dao.SkinFieldDao;
import com.mortals.xhx.module.skin.model.SkinFieldEntity;
import com.mortals.xhx.module.skin.service.SkinFieldService;
import org.springframework.util.ObjectUtils;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
/**
* SkinFieldService
* 皮肤属性字段配置 service实现
*
* @author zxfei
* @date 2022-05-24
*/
* SkinFieldService
* 皮肤属性字段配置 service实现
*
* @author zxfei
* @date 2022-05-24
*/
@Service("skinFieldService")
public class SkinFieldServiceImpl extends AbstractCRUDServiceImpl<SkinFieldDao, SkinFieldEntity, Long> implements SkinFieldService {
/**
* @param entity
* @param context
* @throws AppException
*/
@Override
protected void updateAfter(SkinFieldEntity entity, Context context) throws AppException {
super.updateAfter(entity, context);
if (0L == entity.getSkinId()) {
//更新模板属性 所有引用了当前模板的属性
SkinFieldQuery skinFieldQuery = new SkinFieldQuery();
skinFieldQuery.setTemplateId(entity.getTemplateId());
skinFieldQuery.setFieldCode(entity.getFieldCode());
List<SkinFieldEntity> updateList = this.find(skinFieldQuery, context).stream()
.filter(f -> f.getSkinId() != 0L)
.map(item -> {
item.setFieldName(entity.getFieldName());
item.setFieldType(entity.getFieldType());
item.setFieldOrderNo(entity.getFieldOrderNo());
item.setEnabled(entity.getEnabled());
return item;
})
.collect(Collectors.toList());
if (!ObjectUtils.isEmpty(updateList)) {
this.update(updateList, context);
}
}
}
/**
* @param entity
* @param context
* @throws AppException
*/
@Override
protected void saveAfter(SkinFieldEntity entity, Context context) throws AppException {
super.saveAfter(entity, context);
if (0L == entity.getSkinId()) {
//新增模板属性
SkinFieldQuery skinFieldQuery = new SkinFieldQuery();
skinFieldQuery.setTemplateId(entity.getTemplateId());
//skinFieldQuery.setFieldCode(entity.getFieldCode());
//重复提交
Map<Long, Set<String>> collect = this.find(skinFieldQuery, context).stream().collect(Collectors.groupingBy(x -> x.getSkinId(), Collectors.mapping(y -> y.getFieldCode(), Collectors.toSet())));
for (Map.Entry<Long, Set<String>> entry : collect.entrySet()) {
Long key = entry.getKey();
Set<String> value = entry.getValue();
if (key == 0L) continue;
if (value.contains(entity.getFieldCode())) continue;
//新增属性
SkinFieldEntity target = new SkinFieldEntity();
BeanUtils.copyProperties(entity, target, BeanUtil.getNullPropertyNames(entity));
target.setId(null);
target.setSkinId(key);
this.save(target, context);
}
}
}
}
\ No newline at end of file
......@@ -56,8 +56,7 @@ public class SkinTemplateServiceImpl extends AbstractCRUDServiceImpl<SkinTemplat
}
private void saveSkinFields(SkinTemplateEntity entity, Context context) {
//查找模板id,与皮肤肯定
//查找模板id,与皮肤绑定
Long[] ids = skinFieldService.find(new SkinFieldQuery().skinId(0L).templateId(entity.getId())).stream().map(item -> item.getId()).toArray(Long[]::new);
if (!ObjectUtils.isEmpty(ids)) {
skinFieldService.remove(ids, context);
......
......@@ -4,7 +4,6 @@ import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.sms.model.SmsSetEntity;
import com.mortals.xhx.module.sms.service.SmsSetService;
......
......@@ -2,7 +2,6 @@ package com.mortals.xhx.module.sms.web;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.sms.model.SmsTemplateEntity;
import com.mortals.xhx.module.sms.service.SmsTemplateService;
......
......@@ -7,6 +7,7 @@ import com.mortals.xhx.module.window.model.WindowEntity;
import com.mortals.xhx.module.window.model.WindowQuery;
import com.mortals.xhx.module.window.service.WindowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
......@@ -31,6 +32,7 @@ import java.util.stream.Collectors;
public class WindowHallServiceImpl extends AbstractCRUDCacheServiceImpl<WindowHallDao, WindowHallEntity, Long> implements WindowHallService {
@Autowired
@Lazy
private WindowService windowService;
/**
......@@ -48,16 +50,5 @@ public class WindowHallServiceImpl extends AbstractCRUDCacheServiceImpl<WindowHa
WindowEntity windowEntity = collectWin.get(item.getWindowId());
item.setFromnum(windowEntity == null ? "" : windowEntity.getFromnum());
});
/* List<Long> collect = list.stream().map(i -> i.getWindowId()).distinct().collect(Collectors.toList());
if (!ObjectUtils.isEmpty(collect)) {
WindowQuery windowQuery = new WindowQuery();
windowQuery.setIdList(collect);
Map<Long, WindowEntity> collectWin = windowService.find(windowQuery).stream().collect(Collectors.toMap(x -> x.getId(), y -> y, (o, n) -> n));
list.forEach(item -> {
WindowEntity windowEntity = collectWin.get(item.getWindowId());
item.setFromnum(windowEntity == null ? "" : windowEntity.getFromnum());
});
}*/
}
}
\ No newline at end of file
......@@ -30,6 +30,7 @@ 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.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.module.window.dao.WindowDao;
......@@ -55,14 +56,13 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
@Autowired
private WorkmanService workmanService;
@Autowired
private WindowBusinessService windowBusinessService;
@Autowired
private WindowMatterService windowMatterService;
@Autowired
@Lazy
private WindowHallService windowHallService;
@Autowired
private BusinessService businessService;
......
package com.mortals.xhx.module.window.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.window.model.WindowBusinessEntity;
import com.mortals.xhx.module.window.service.WindowBusinessService;
import org.springframework.beans.factory.annotation.Autowired;
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.HashMap;
import java.util.Map;
/**
* 窗口业务
*
......
......@@ -7,18 +7,16 @@ import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.site.service.SiteService;
import com.mortals.xhx.module.window.model.WindowEntity;
import com.mortals.xhx.module.window.service.WindowBusinessService;
import com.mortals.xhx.module.window.service.WindowService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -28,14 +26,11 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.*;
import static com.mortals.framework.ap.SysConstains.MESSAGE_INFO;
import static com.mortals.framework.ap.SysConstains.PAGEINFO_KEY;
import static com.mortals.xhx.common.key.RedisKey.KEY_SEARCH_HALL_BUSINESS_CACHE;
/**
* 站点部门窗口
......@@ -54,6 +49,8 @@ public class WindowController extends BaseCRUDJsonBodyMappingController<WindowSe
private SiteService siteService;
@Autowired
private DeptService deptService;
@Autowired
private ICacheService cacheService;
public WindowController() {
......@@ -88,6 +85,11 @@ public class WindowController extends BaseCRUDJsonBodyMappingController<WindowSe
Long windowId = DataUtil.converObj2Long(map.get("windowId"));
try {
this.service.addBusinessToWindow(businessIds, windowId, getContext());
//更新完窗口业务,删除缓存列表
Set<String> scanSet = cacheService.scan(KEY_SEARCH_HALL_BUSINESS_CACHE);
for (String delKey : scanSet) {
cacheService.del(delKey);
}
jsonObject.put(KEY_RESULT_DATA, model);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, "添加业务到窗口成功!");
......@@ -186,15 +188,15 @@ public class WindowController extends BaseCRUDJsonBodyMappingController<WindowSe
if (!ObjectUtils.isEmpty(deptEntity)) {
windowEntity.setDeptId(deptEntity.getId());
windowEntity.setDeptName(deptEntity.getName());
}else {
} else {
//判断是否填入了部门名称
if(!ObjectUtils.isEmpty(windowEntity.getDeptName())){
if (!ObjectUtils.isEmpty(windowEntity.getDeptName())) {
//根据部门名称与站点 更新窗口
DeptQuery deptQuery = new DeptQuery();
deptQuery.setName(windowEntity.getDeptName());
deptQuery.setSiteId(DataUtil.converStr2Long(siteId,0L));
deptQuery.setSiteId(DataUtil.converStr2Long(siteId, 0L));
deptEntity = deptService.selectOne(deptQuery);
if(!ObjectUtils.isEmpty(deptEntity)){
if (!ObjectUtils.isEmpty(deptEntity)) {
windowEntity.setDeptId(deptEntity.getId());
windowEntity.setDeptName(deptEntity.getName());
}
......@@ -205,7 +207,7 @@ public class WindowController extends BaseCRUDJsonBodyMappingController<WindowSe
Iterator<WindowEntity> iterator = list.iterator();
while (iterator.hasNext()) {
WindowEntity next = iterator.next();
if(ObjectUtils.isEmpty(next.getSiteId())||ObjectUtils.isEmpty(next.getDeptId())){
if (ObjectUtils.isEmpty(next.getSiteId()) || ObjectUtils.isEmpty(next.getDeptId())) {
iterator.remove();
}
}
......
......@@ -2,18 +2,13 @@ package com.mortals.xhx.module.window.web;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.ap.GlobalSysInfo;
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.util.HttpUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.feign.rsp.ApiResp;
import com.mortals.xhx.module.window.model.WindowMatterEntity;
import com.mortals.xhx.module.window.service.WindowMatterService;
import lombok.extern.slf4j.Slf4j;
......
......@@ -60,4 +60,23 @@
</select>
<!-- 获取所有存在业务的部门列表 -->
<select id="getDeptListByExistBusiness" parameterType="paramDto" resultMap="DeptEntity-Map">
SELECT DISTINCT
<include refid="_columns"/>
FROM
mortals_sys_dept a,
mortals_sys_window t1,
mortals_sys_window_business t2
WHERE
a.id = t1.deptId
AND t1.id = t2.windowId and
<trim prefixOverrides="and" prefix="">
<if test="condition.siteId!=null">
a.siteId = #{condition.siteId}
</if>
</trim>
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.dimension.dao.ibatis.DimensionDaoImpl">
<!-- 字段和属性映射 -->
<resultMap type="DimensionEntity" id="DimensionEntity-Map">
<id property="id" column="id" />
<result property="dimensionCode" column="dimension_code" />
<result property="dimensionName" column="dimension_name" />
<result property="dimensionValue" column="dimension_value" />
<result property="dimensionType" column="dimension_type" />
<result property="createTime" column="createTime" />
<result property="createUserId" column="createUserId" />
<result property="updateUserId" column="updateUserId" />
<result property="updateTime" column="updateTime" />
</resultMap>
<!-- 表所有列 -->
<sql id="_columns">
<trim suffixOverrides="," suffix="">
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('id') or colPickMode == 1 and data.containsKey('id')))">
a.id,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('dimensionCode') or colPickMode == 1 and data.containsKey('dimensionCode')))">
a.dimension_code,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('dimensionName') or colPickMode == 1 and data.containsKey('dimensionName')))">
a.dimension_name,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('dimensionValue') or colPickMode == 1 and data.containsKey('dimensionValue')))">
a.dimension_value,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('dimensionType') or colPickMode == 1 and data.containsKey('dimensionType')))">
a.dimension_type,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))">
a.createTime,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createUserId') or colPickMode == 1 and data.containsKey('createUserId')))">
a.createUserId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateUserId') or colPickMode == 1 and data.containsKey('updateUserId')))">
a.updateUserId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
a.updateTime,
</if>
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="DimensionEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_dimension
(dimension_code,dimension_name,dimension_value,dimension_type,createTime,createUserId,updateUserId,updateTime)
VALUES
(#{dimensionCode},#{dimensionName},#{dimensionValue},#{dimensionType},#{createTime},#{createUserId},#{updateUserId},#{updateTime})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_dimension
(dimension_code,dimension_name,dimension_value,dimension_type,createTime,createUserId,updateUserId,updateTime)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.dimensionCode},#{item.dimensionName},#{item.dimensionValue},#{item.dimensionType},#{item.createTime},#{item.createUserId},#{item.updateUserId},#{item.updateTime})
</foreach>
</insert>
<!-- 根据ParamDto更新 -->
<update id="update" parameterType="paramDto">
update mortals_xhx_dimension as a
set
<trim suffixOverrides="," suffix="">
<if test="(colPickMode==0 and data.containsKey('dimensionCode')) or (colPickMode==1 and !data.containsKey('dimensionCode'))">
a.dimension_code=#{data.dimensionCode},
</if>
<if test="(colPickMode==0 and data.containsKey('dimensionName')) or (colPickMode==1 and !data.containsKey('dimensionName'))">
a.dimension_name=#{data.dimensionName},
</if>
<if test="(colPickMode==0 and data.containsKey('dimensionValue')) or (colPickMode==1 and !data.containsKey('dimensionValue'))">
a.dimension_value=#{data.dimensionValue},
</if>
<if test="(colPickMode==0 and data.containsKey('dimensionType')) or (colPickMode==1 and !data.containsKey('dimensionType'))">
a.dimension_type=#{data.dimensionType},
</if>
<if test="(colPickMode==0 and data.containsKey('dimensionTypeIncrement')) or (colPickMode==1 and !data.containsKey('dimensionTypeIncrement'))">
a.dimension_type=ifnull(a.dimension_type,0) + #{data.dimensionTypeIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))">
a.createTime=#{data.createTime},
</if>
<if test="(colPickMode==0 and data.containsKey('createUserId')) or (colPickMode==1 and !data.containsKey('createUserId'))">
a.createUserId=#{data.createUserId},
</if>
<if test="(colPickMode==0 and data.containsKey('createUserIdIncrement')) or (colPickMode==1 and !data.containsKey('createUserIdIncrement'))">
a.createUserId=ifnull(a.createUserId,0) + #{data.createUserIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('updateUserId')) or (colPickMode==1 and !data.containsKey('updateUserId'))">
a.updateUserId=#{data.updateUserId},
</if>
<if test="(colPickMode==0 and data.containsKey('updateUserIdIncrement')) or (colPickMode==1 and !data.containsKey('updateUserIdIncrement'))">
a.updateUserId=ifnull(a.updateUserId,0) + #{data.updateUserIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
a.updateTime=#{data.updateTime},
</if>
</trim>
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</update>
<!-- 批量更新 -->
<update id="updateBatch" parameterType="paramDto">
update mortals_xhx_dimension as a
<trim prefix="set" suffixOverrides=",">
<trim prefix="dimension_code=(case" suffix="ELSE dimension_code end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('dimensionCode')) or (colPickMode==1 and !item.containsKey('dimensionCode'))">
when a.id=#{item.id} then #{item.dimensionCode}
</if>
</foreach>
</trim>
<trim prefix="dimension_name=(case" suffix="ELSE dimension_name end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('dimensionName')) or (colPickMode==1 and !item.containsKey('dimensionName'))">
when a.id=#{item.id} then #{item.dimensionName}
</if>
</foreach>
</trim>
<trim prefix="dimension_value=(case" suffix="ELSE dimension_value end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('dimensionValue')) or (colPickMode==1 and !item.containsKey('dimensionValue'))">
when a.id=#{item.id} then #{item.dimensionValue}
</if>
</foreach>
</trim>
<trim prefix="dimension_type=(case" suffix="ELSE dimension_type end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('dimensionType')) or (colPickMode==1 and !item.containsKey('dimensionType'))">
when a.id=#{item.id} then #{item.dimensionType}
</when>
<when test="(colPickMode==0 and item.containsKey('dimensionTypeIncrement')) or (colPickMode==1 and !item.containsKey('dimensionTypeIncrement'))">
when a.id=#{item.id} then ifnull(a.dimension_type,0) + #{item.dimensionTypeIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="createTime=(case" suffix="ELSE createTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('createTime')) or (colPickMode==1 and !item.containsKey('createTime'))">
when a.id=#{item.id} then #{item.createTime}
</if>
</foreach>
</trim>
<trim prefix="createUserId=(case" suffix="ELSE createUserId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('createUserId')) or (colPickMode==1 and !item.containsKey('createUserId'))">
when a.id=#{item.id} then #{item.createUserId}
</when>
<when test="(colPickMode==0 and item.containsKey('createUserIdIncrement')) or (colPickMode==1 and !item.containsKey('createUserIdIncrement'))">
when a.id=#{item.id} then ifnull(a.createUserId,0) + #{item.createUserIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="updateUserId=(case" suffix="ELSE updateUserId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('updateUserId')) or (colPickMode==1 and !item.containsKey('updateUserId'))">
when a.id=#{item.id} then #{item.updateUserId}
</when>
<when test="(colPickMode==0 and item.containsKey('updateUserIdIncrement')) or (colPickMode==1 and !item.containsKey('updateUserIdIncrement'))">
when a.id=#{item.id} then ifnull(a.updateUserId,0) + #{item.updateUserIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="updateTime=(case" suffix="ELSE updateTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('updateTime')) or (colPickMode==1 and !item.containsKey('updateTime'))">
when a.id=#{item.id} then #{item.updateTime}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
#{item.id}
</foreach>
</update>
<!-- 根据主健查询 -->
<select id="getByKey" parameterType="paramDto" resultMap="DimensionEntity-Map">
select <include refid="_columns"/>
from mortals_xhx_dimension as a
where a.id=#{condition.id}
</select>
<!-- 根据主健删除 -->
<delete id="deleteByKey" parameterType="paramDto">
delete a.* from mortals_xhx_dimension as a where a.id=#{condition.id}
</delete>
<!-- 根据主健删除一批,针对单一主健有效 -->
<delete id="deleteByKeys">
delete from mortals_xhx_dimension where id in
<foreach collection="array" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 根据主健列表删除一批,针对单一主健有效 -->
<delete id="deleteByKeyList">
delete from mortals_xhx_dimension where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 根据对象列表删除一批,针对单一主健有效 -->
<delete id="deleteByEntityList">
delete from mortals_xhx_dimension where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item.id}
</foreach>
</delete>
<!-- 根据paramDto删除一批 -->
<delete id="deleteByMap" parameterType="paramDto">
delete a.* from mortals_xhx_dimension as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</delete>
<!-- 获取列表 -->
<select id="getList" parameterType="paramDto" resultMap="DimensionEntity-Map">
select <include refid="_columns"/>
from mortals_xhx_dimension as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
<include refid="_orderCols_"/>
</select>
<!-- 获取 -->
<select id="getListCount" parameterType="paramDto" resultType="int">
select count(1)
from mortals_xhx_dimension as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</select>
<!-- 条件映射 -->
<sql id="_condition_">
<if test="condition != null and !condition.isEmpty()">
<!-- 条件映射-普通条件 -->
<include refid="_condition_param_">
<property name="_conditionParam_" value="condition"/>
<property name="_conditionType_" value="and"/>
</include>
<!-- 条件映射-集合之间使用AND,集合中元素使用OR-(list[0].1 or list[0].2) and (list[1].3 or list[1].4) -->
<if test="condition.containsKey('andConditionList') and !condition.andConditionList.isEmpty()">
and
<foreach collection="condition.andConditionList" open="(" close=")" index="index" item="andCondition" separator=" and ">
<trim prefixOverrides="or" prefix="(" suffix=")">
<include refid="_condition_param_">
<property name="_conditionParam_" value="andCondition"/>
<property name="_conditionType_" value="or"/>
</include>
</trim>
</foreach>
</if>
<!-- 条件映射-集合之间使用OR,集合中元素使用AND-(list[0].1 and list[0].2) or (list[1].3 and list[1].4) -->
<if test="condition.containsKey('orConditionList') and !condition.orConditionList.isEmpty()">
and
<foreach collection="condition.orConditionList" open="(" close=")" index="index" item="orCondition" separator=" or ">
<trim prefixOverrides="and" prefix="(" suffix=")">
<include refid="_condition_param_">
<property name="_conditionParam_" value="orCondition"/>
<property name="_conditionType_" value="and"/>
</include>
</trim>
</foreach>
</if>
</if>
</sql>
<!-- 条件映射-代参数 -->
<sql id="_condition_param_">
<bind name="conditionParamRef" value="${_conditionParam_}"/>
<if test="conditionParamRef.containsKey('id')">
<if test="conditionParamRef.id != null">
${_conditionType_} a.id=#{${_conditionParam_}.id}
</if>
</if>
<if test="conditionParamRef.containsKey('id')">
<if test="conditionParamRef.id != null ">
${_conditionType_} a.id = #{${_conditionParam_}.id}
</if>
<if test="conditionParamRef.id == null">
${_conditionType_} a.id is null
</if>
</if>
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
${_conditionType_} a.id in
<foreach collection="conditionParamRef.idList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idNotList') and conditionParamRef.idNotList.size() > 0">
${_conditionType_} a.id not in
<foreach collection="conditionParamRef.idNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idStart') and conditionParamRef.idStart != null">
${_conditionType_} a.id <![CDATA[ >= ]]> #{${_conditionParam_}.idStart}
</if>
<if test="conditionParamRef.containsKey('idEnd') and conditionParamRef.idEnd != null">
${_conditionType_} a.id <![CDATA[ <= ]]> #{${_conditionParam_}.idEnd}
</if>
<if test="conditionParamRef.containsKey('dimensionCode')">
<if test="conditionParamRef.dimensionCode != null and conditionParamRef.dimensionCode != ''">
${_conditionType_} a.dimension_code like #{${_conditionParam_}.dimensionCode}
</if>
<if test="conditionParamRef.dimensionCode == null">
${_conditionType_} a.dimension_code is null
</if>
</if>
<if test="conditionParamRef.containsKey('dimensionCodeList') and conditionParamRef.dimensionCodeList.size() > 0">
${_conditionType_} a.dimension_code in
<foreach collection="conditionParamRef.dimensionCodeList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('dimensionCodeNotList') and conditionParamRef.dimensionCodeNotList.size() > 0">
${_conditionType_} a.dimension_code not in
<foreach collection="conditionParamRef.dimensionCodeNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('dimensionName')">
<if test="conditionParamRef.dimensionName != null and conditionParamRef.dimensionName != ''">
${_conditionType_} a.dimension_name like #{${_conditionParam_}.dimensionName}
</if>
<if test="conditionParamRef.dimensionName == null">
${_conditionType_} a.dimension_name is null
</if>
</if>
<if test="conditionParamRef.containsKey('dimensionNameList') and conditionParamRef.dimensionNameList.size() > 0">
${_conditionType_} a.dimension_name in
<foreach collection="conditionParamRef.dimensionNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('dimensionNameNotList') and conditionParamRef.dimensionNameNotList.size() > 0">
${_conditionType_} a.dimension_name not in
<foreach collection="conditionParamRef.dimensionNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('dimensionValue')">
<if test="conditionParamRef.dimensionValue != null and conditionParamRef.dimensionValue != ''">
${_conditionType_} a.dimension_value like #{${_conditionParam_}.dimensionValue}
</if>
<if test="conditionParamRef.dimensionValue == null">
${_conditionType_} a.dimension_value is null
</if>
</if>
<if test="conditionParamRef.containsKey('dimensionValueList') and conditionParamRef.dimensionValueList.size() > 0">
${_conditionType_} a.dimension_value in
<foreach collection="conditionParamRef.dimensionValueList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('dimensionValueNotList') and conditionParamRef.dimensionValueNotList.size() > 0">
${_conditionType_} a.dimension_value not in
<foreach collection="conditionParamRef.dimensionValueNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('dimensionType')">
<if test="conditionParamRef.dimensionType != null ">
${_conditionType_} a.dimension_type = #{${_conditionParam_}.dimensionType}
</if>
<if test="conditionParamRef.dimensionType == null">
${_conditionType_} a.dimension_type is null
</if>
</if>
<if test="conditionParamRef.containsKey('dimensionTypeList') and conditionParamRef.dimensionTypeList.size() > 0">
${_conditionType_} a.dimension_type in
<foreach collection="conditionParamRef.dimensionTypeList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('dimensionTypeNotList') and conditionParamRef.dimensionTypeNotList.size() > 0">
${_conditionType_} a.dimension_type not in
<foreach collection="conditionParamRef.dimensionTypeNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('dimensionTypeStart') and conditionParamRef.dimensionTypeStart != null">
${_conditionType_} a.dimension_type <![CDATA[ >= ]]> #{${_conditionParam_}.dimensionTypeStart}
</if>
<if test="conditionParamRef.containsKey('dimensionTypeEnd') and conditionParamRef.dimensionTypeEnd != null">
${_conditionType_} a.dimension_type <![CDATA[ <= ]]> #{${_conditionParam_}.dimensionTypeEnd}
</if>
<if test="conditionParamRef.containsKey('createTime')">
<if test="conditionParamRef.createTime != null ">
${_conditionType_} a.createTime = #{${_conditionParam_}.createTime}
</if>
<if test="conditionParamRef.createTime == null">
${_conditionType_} a.createTime is null
</if>
</if>
<if test="conditionParamRef.containsKey('createTimeStart') and conditionParamRef.createTimeStart != null and conditionParamRef.createTimeStart!=''">
${_conditionType_} a.createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('createTimeEnd') and conditionParamRef.createTimeEnd != null and conditionParamRef.createTimeEnd!=''">
${_conditionType_} a.createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('createUserId')">
<if test="conditionParamRef.createUserId != null ">
${_conditionType_} a.createUserId = #{${_conditionParam_}.createUserId}
</if>
<if test="conditionParamRef.createUserId == null">
${_conditionType_} a.createUserId is null
</if>
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
${_conditionType_} a.createUserId in
<foreach collection="conditionParamRef.createUserIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('createUserIdNotList') and conditionParamRef.createUserIdNotList.size() > 0">
${_conditionType_} a.createUserId not in
<foreach collection="conditionParamRef.createUserIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('createUserIdStart') and conditionParamRef.createUserIdStart != null">
${_conditionType_} a.createUserId <![CDATA[ >= ]]> #{${_conditionParam_}.createUserIdStart}
</if>
<if test="conditionParamRef.containsKey('createUserIdEnd') and conditionParamRef.createUserIdEnd != null">
${_conditionType_} a.createUserId <![CDATA[ <= ]]> #{${_conditionParam_}.createUserIdEnd}
</if>
<if test="conditionParamRef.containsKey('updateUserId')">
<if test="conditionParamRef.updateUserId != null ">
${_conditionType_} a.updateUserId = #{${_conditionParam_}.updateUserId}
</if>
<if test="conditionParamRef.updateUserId == null">
${_conditionType_} a.updateUserId is null
</if>
</if>
<if test="conditionParamRef.containsKey('updateUserIdList') and conditionParamRef.updateUserIdList.size() > 0">
${_conditionType_} a.updateUserId in
<foreach collection="conditionParamRef.updateUserIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('updateUserIdNotList') and conditionParamRef.updateUserIdNotList.size() > 0">
${_conditionType_} a.updateUserId not in
<foreach collection="conditionParamRef.updateUserIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('updateUserIdStart') and conditionParamRef.updateUserIdStart != null">
${_conditionType_} a.updateUserId <![CDATA[ >= ]]> #{${_conditionParam_}.updateUserIdStart}
</if>
<if test="conditionParamRef.containsKey('updateUserIdEnd') and conditionParamRef.updateUserIdEnd != null">
${_conditionType_} a.updateUserId <![CDATA[ <= ]]> #{${_conditionParam_}.updateUserIdEnd}
</if>
<if test="conditionParamRef.containsKey('updateTime')">
<if test="conditionParamRef.updateTime != null ">
${_conditionType_} a.updateTime = #{${_conditionParam_}.updateTime}
</if>
<if test="conditionParamRef.updateTime == null">
${_conditionType_} a.updateTime is null
</if>
</if>
<if test="conditionParamRef.containsKey('updateTimeStart') and conditionParamRef.updateTimeStart != null and conditionParamRef.updateTimeStart!=''">
${_conditionType_} a.updateTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''">
${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
</sql>
<sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()">
order by
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
field(a.id,
<foreach collection="conditionParamRef.idList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('dimensionTypeList') and conditionParamRef.dimensionTypeList.size() > 0">
field(a.dimensionType,
<foreach collection="conditionParamRef.dimensionTypeList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
field(a.createUserId,
<foreach collection="conditionParamRef.createUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('updateUserIdList') and conditionParamRef.updateUserIdList.size() > 0">
field(a.updateUserId,
<foreach collection="conditionParamRef.updateUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<trim suffixOverrides="," suffix="">
<foreach collection="orderColList" open="" close="" index="index" item="item" separator=",">
a.${item.colName} ${item.sortKind}
</foreach>
</trim>
</if>
<if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()">
order by
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
field(a.id,
<foreach collection="conditionParamRef.idList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('dimensionTypeList') and conditionParamRef.dimensionTypeList.size() > 0">
field(a.dimensionType,
<foreach collection="conditionParamRef.dimensionTypeList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
field(a.createUserId,
<foreach collection="conditionParamRef.createUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('updateUserIdList') and conditionParamRef.updateUserIdList.size() > 0">
field(a.updateUserId,
<foreach collection="conditionParamRef.updateUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<trim suffixOverrides="," suffix="">
<if test="orderCol.containsKey('id')">
a.id
<if test='orderCol.id != null and "DESC".equalsIgnoreCase(orderCol.id)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('dimensionCode')">
a.dimension_code
<if test='orderCol.dimensionCode != null and "DESC".equalsIgnoreCase(orderCol.dimensionCode)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('dimensionName')">
a.dimension_name
<if test='orderCol.dimensionName != null and "DESC".equalsIgnoreCase(orderCol.dimensionName)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('dimensionValue')">
a.dimension_value
<if test='orderCol.dimensionValue != null and "DESC".equalsIgnoreCase(orderCol.dimensionValue)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('dimensionType')">
a.dimension_type
<if test='orderCol.dimensionType != null and "DESC".equalsIgnoreCase(orderCol.dimensionType)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('createTime')">
a.createTime
<if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('createUserId')">
a.createUserId
<if test='orderCol.createUserId != null and "DESC".equalsIgnoreCase(orderCol.createUserId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('updateUserId')">
a.updateUserId
<if test='orderCol.updateUserId != null and "DESC".equalsIgnoreCase(orderCol.updateUserId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('updateTime')">
a.updateTime
<if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
,
</if>
</trim>
</if>
</sql>
<sql id="_group_by_">
<if test="groupList != null and !groupList.isEmpty()">
GROUP BY
<trim suffixOverrides="," suffix="">
<foreach collection="groupList" open="" close="" index="index" item="item" separator=",">
${item}
</foreach>
</trim>
</if>
</sql>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.dimension.dao.ibatis.DimensionResourceRuleDaoImpl">
<!-- 字段和属性映射 -->
<resultMap type="DimensionResourceRuleEntity" id="DimensionResourceRuleEntity-Map">
<id property="id" column="id" />
<result property="roleId" column="role_id" />
<result property="resourceId" column="resource_id" />
<result property="ruleCode" column="rule_code" />
<result property="ruleName" column="rule_name" />
<result property="ruleCondition" column="rule_condition" />
<result property="ruleValue" column="rule_value" />
<result property="ruleType" column="rule_type" />
<result property="createTime" column="create_time" />
<result property="createUserId" column="create_user_id" />
<result property="updateUserId" column="update_user_id" />
<result property="updateTime" column="update_time" />
<result property="roleName" column="role_name" />
<result property="resourceName" column="resource_name" />
</resultMap>
<!-- 表所有列 -->
<sql id="_columns">
<trim suffixOverrides="," suffix="">
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('id') or colPickMode == 1 and data.containsKey('id')))">
a.id,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('roleId') or colPickMode == 1 and data.containsKey('roleId')))">
a.role_id,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('resourceId') or colPickMode == 1 and data.containsKey('resourceId')))">
a.resource_id,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('ruleCode') or colPickMode == 1 and data.containsKey('ruleCode')))">
a.rule_code,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('ruleName') or colPickMode == 1 and data.containsKey('ruleName')))">
a.rule_name,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('ruleCondition') or colPickMode == 1 and data.containsKey('ruleCondition')))">
a.rule_condition,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('ruleValue') or colPickMode == 1 and data.containsKey('ruleValue')))">
a.rule_value,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('ruleType') or colPickMode == 1 and data.containsKey('ruleType')))">
a.rule_type,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))">
a.create_time,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createUserId') or colPickMode == 1 and data.containsKey('createUserId')))">
a.create_user_id,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateUserId') or colPickMode == 1 and data.containsKey('updateUserId')))">
a.update_user_id,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
a.update_time,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('roleName') or colPickMode == 1 and data.containsKey('roleName')))">
a.role_name,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('resourceName') or colPickMode == 1 and data.containsKey('resourceName')))">
a.resource_name,
</if>
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="DimensionResourceRuleEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_dimension_resource_rule
(role_id,resource_id,rule_code,rule_name,rule_condition,rule_value,rule_type,create_time,create_user_id,update_user_id,update_time,role_name,resource_name)
VALUES
(#{roleId},#{resourceId},#{ruleCode},#{ruleName},#{ruleCondition},#{ruleValue},#{ruleType},#{createTime},#{createUserId},#{updateUserId},#{updateTime},#{roleName},#{resourceName})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_dimension_resource_rule
(role_id,resource_id,rule_code,rule_name,rule_condition,rule_value,rule_type,create_time,create_user_id,update_user_id,update_time,role_name,resource_name)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.roleId},#{item.resourceId},#{item.ruleCode},#{item.ruleName},#{item.ruleCondition},#{item.ruleValue},#{item.ruleType},#{item.createTime},#{item.createUserId},#{item.updateUserId},#{item.updateTime},#{item.roleName},#{item.resourceName})
</foreach>
</insert>
<!-- 根据ParamDto更新 -->
<update id="update" parameterType="paramDto">
update mortals_xhx_dimension_resource_rule as a
set
<trim suffixOverrides="," suffix="">
<if test="(colPickMode==0 and data.containsKey('roleId')) or (colPickMode==1 and !data.containsKey('roleId'))">
a.role_id=#{data.roleId},
</if>
<if test="(colPickMode==0 and data.containsKey('roleIdIncrement')) or (colPickMode==1 and !data.containsKey('roleIdIncrement'))">
a.role_id=ifnull(a.role_id,0) + #{data.roleIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('resourceId')) or (colPickMode==1 and !data.containsKey('resourceId'))">
a.resource_id=#{data.resourceId},
</if>
<if test="(colPickMode==0 and data.containsKey('resourceIdIncrement')) or (colPickMode==1 and !data.containsKey('resourceIdIncrement'))">
a.resource_id=ifnull(a.resource_id,0) + #{data.resourceIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('ruleCode')) or (colPickMode==1 and !data.containsKey('ruleCode'))">
a.rule_code=#{data.ruleCode},
</if>
<if test="(colPickMode==0 and data.containsKey('ruleName')) or (colPickMode==1 and !data.containsKey('ruleName'))">
a.rule_name=#{data.ruleName},
</if>
<if test="(colPickMode==0 and data.containsKey('ruleCondition')) or (colPickMode==1 and !data.containsKey('ruleCondition'))">
a.rule_condition=#{data.ruleCondition},
</if>
<if test="(colPickMode==0 and data.containsKey('ruleValue')) or (colPickMode==1 and !data.containsKey('ruleValue'))">
a.rule_value=#{data.ruleValue},
</if>
<if test="(colPickMode==0 and data.containsKey('ruleType')) or (colPickMode==1 and !data.containsKey('ruleType'))">
a.rule_type=#{data.ruleType},
</if>
<if test="(colPickMode==0 and data.containsKey('ruleTypeIncrement')) or (colPickMode==1 and !data.containsKey('ruleTypeIncrement'))">
a.rule_type=ifnull(a.rule_type,0) + #{data.ruleTypeIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))">
a.create_time=#{data.createTime},
</if>
<if test="(colPickMode==0 and data.containsKey('createUserId')) or (colPickMode==1 and !data.containsKey('createUserId'))">
a.create_user_id=#{data.createUserId},
</if>
<if test="(colPickMode==0 and data.containsKey('createUserIdIncrement')) or (colPickMode==1 and !data.containsKey('createUserIdIncrement'))">
a.create_user_id=ifnull(a.create_user_id,0) + #{data.createUserIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('updateUserId')) or (colPickMode==1 and !data.containsKey('updateUserId'))">
a.update_user_id=#{data.updateUserId},
</if>
<if test="(colPickMode==0 and data.containsKey('updateUserIdIncrement')) or (colPickMode==1 and !data.containsKey('updateUserIdIncrement'))">
a.update_user_id=ifnull(a.update_user_id,0) + #{data.updateUserIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
a.update_time=#{data.updateTime},
</if>
<if test="(colPickMode==0 and data.containsKey('roleName')) or (colPickMode==1 and !data.containsKey('roleName'))">
a.role_name=#{data.roleName},
</if>
<if test="(colPickMode==0 and data.containsKey('resourceName')) or (colPickMode==1 and !data.containsKey('resourceName'))">
a.resource_name=#{data.resourceName},
</if>
</trim>
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</update>
<!-- 批量更新 -->
<update id="updateBatch" parameterType="paramDto">
update mortals_xhx_dimension_resource_rule as a
<trim prefix="set" suffixOverrides=",">
<trim prefix="role_id=(case" suffix="ELSE role_id end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('roleId')) or (colPickMode==1 and !item.containsKey('roleId'))">
when a.id=#{item.id} then #{item.roleId}
</when>
<when test="(colPickMode==0 and item.containsKey('roleIdIncrement')) or (colPickMode==1 and !item.containsKey('roleIdIncrement'))">
when a.id=#{item.id} then ifnull(a.role_id,0) + #{item.roleIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="resource_id=(case" suffix="ELSE resource_id end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('resourceId')) or (colPickMode==1 and !item.containsKey('resourceId'))">
when a.id=#{item.id} then #{item.resourceId}
</when>
<when test="(colPickMode==0 and item.containsKey('resourceIdIncrement')) or (colPickMode==1 and !item.containsKey('resourceIdIncrement'))">
when a.id=#{item.id} then ifnull(a.resource_id,0) + #{item.resourceIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="rule_code=(case" suffix="ELSE rule_code end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('ruleCode')) or (colPickMode==1 and !item.containsKey('ruleCode'))">
when a.id=#{item.id} then #{item.ruleCode}
</if>
</foreach>
</trim>
<trim prefix="rule_name=(case" suffix="ELSE rule_name end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('ruleName')) or (colPickMode==1 and !item.containsKey('ruleName'))">
when a.id=#{item.id} then #{item.ruleName}
</if>
</foreach>
</trim>
<trim prefix="rule_condition=(case" suffix="ELSE rule_condition end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('ruleCondition')) or (colPickMode==1 and !item.containsKey('ruleCondition'))">
when a.id=#{item.id} then #{item.ruleCondition}
</if>
</foreach>
</trim>
<trim prefix="rule_value=(case" suffix="ELSE rule_value end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('ruleValue')) or (colPickMode==1 and !item.containsKey('ruleValue'))">
when a.id=#{item.id} then #{item.ruleValue}
</if>
</foreach>
</trim>
<trim prefix="rule_type=(case" suffix="ELSE rule_type end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('ruleType')) or (colPickMode==1 and !item.containsKey('ruleType'))">
when a.id=#{item.id} then #{item.ruleType}
</when>
<when test="(colPickMode==0 and item.containsKey('ruleTypeIncrement')) or (colPickMode==1 and !item.containsKey('ruleTypeIncrement'))">
when a.id=#{item.id} then ifnull(a.rule_type,0) + #{item.ruleTypeIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="create_time=(case" suffix="ELSE create_time end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('createTime')) or (colPickMode==1 and !item.containsKey('createTime'))">
when a.id=#{item.id} then #{item.createTime}
</if>
</foreach>
</trim>
<trim prefix="create_user_id=(case" suffix="ELSE create_user_id end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('createUserId')) or (colPickMode==1 and !item.containsKey('createUserId'))">
when a.id=#{item.id} then #{item.createUserId}
</when>
<when test="(colPickMode==0 and item.containsKey('createUserIdIncrement')) or (colPickMode==1 and !item.containsKey('createUserIdIncrement'))">
when a.id=#{item.id} then ifnull(a.create_user_id,0) + #{item.createUserIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="update_user_id=(case" suffix="ELSE update_user_id end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('updateUserId')) or (colPickMode==1 and !item.containsKey('updateUserId'))">
when a.id=#{item.id} then #{item.updateUserId}
</when>
<when test="(colPickMode==0 and item.containsKey('updateUserIdIncrement')) or (colPickMode==1 and !item.containsKey('updateUserIdIncrement'))">
when a.id=#{item.id} then ifnull(a.update_user_id,0) + #{item.updateUserIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="update_time=(case" suffix="ELSE update_time end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('updateTime')) or (colPickMode==1 and !item.containsKey('updateTime'))">
when a.id=#{item.id} then #{item.updateTime}
</if>
</foreach>
</trim>
<trim prefix="role_name=(case" suffix="ELSE role_name end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('roleName')) or (colPickMode==1 and !item.containsKey('roleName'))">
when a.id=#{item.id} then #{item.roleName}
</if>
</foreach>
</trim>
<trim prefix="resource_name=(case" suffix="ELSE resource_name end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('resourceName')) or (colPickMode==1 and !item.containsKey('resourceName'))">
when a.id=#{item.id} then #{item.resourceName}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
#{item.id}
</foreach>
</update>
<!-- 根据主健查询 -->
<select id="getByKey" parameterType="paramDto" resultMap="DimensionResourceRuleEntity-Map">
select <include refid="_columns"/>
from mortals_xhx_dimension_resource_rule as a
where a.id=#{condition.id}
</select>
<!-- 根据主健删除 -->
<delete id="deleteByKey" parameterType="paramDto">
delete a.* from mortals_xhx_dimension_resource_rule as a where a.id=#{condition.id}
</delete>
<!-- 根据主健删除一批,针对单一主健有效 -->
<delete id="deleteByKeys">
delete from mortals_xhx_dimension_resource_rule where id in
<foreach collection="array" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 根据主健列表删除一批,针对单一主健有效 -->
<delete id="deleteByKeyList">
delete from mortals_xhx_dimension_resource_rule where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 根据对象列表删除一批,针对单一主健有效 -->
<delete id="deleteByEntityList">
delete from mortals_xhx_dimension_resource_rule where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item.id}
</foreach>
</delete>
<!-- 根据paramDto删除一批 -->
<delete id="deleteByMap" parameterType="paramDto">
delete a.* from mortals_xhx_dimension_resource_rule as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</delete>
<!-- 获取列表 -->
<select id="getList" parameterType="paramDto" resultMap="DimensionResourceRuleEntity-Map">
select <include refid="_columns"/>
from mortals_xhx_dimension_resource_rule as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
<include refid="_orderCols_"/>
</select>
<!-- 获取 -->
<select id="getListCount" parameterType="paramDto" resultType="int">
select count(1)
from mortals_xhx_dimension_resource_rule as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</select>
<!-- 条件映射 -->
<sql id="_condition_">
<if test="condition != null and !condition.isEmpty()">
<!-- 条件映射-普通条件 -->
<include refid="_condition_param_">
<property name="_conditionParam_" value="condition"/>
<property name="_conditionType_" value="and"/>
</include>
<!-- 条件映射-集合之间使用AND,集合中元素使用OR-(list[0].1 or list[0].2) and (list[1].3 or list[1].4) -->
<if test="condition.containsKey('andConditionList') and !condition.andConditionList.isEmpty()">
and
<foreach collection="condition.andConditionList" open="(" close=")" index="index" item="andCondition" separator=" and ">
<trim prefixOverrides="or" prefix="(" suffix=")">
<include refid="_condition_param_">
<property name="_conditionParam_" value="andCondition"/>
<property name="_conditionType_" value="or"/>
</include>
</trim>
</foreach>
</if>
<!-- 条件映射-集合之间使用OR,集合中元素使用AND-(list[0].1 and list[0].2) or (list[1].3 and list[1].4) -->
<if test="condition.containsKey('orConditionList') and !condition.orConditionList.isEmpty()">
and
<foreach collection="condition.orConditionList" open="(" close=")" index="index" item="orCondition" separator=" or ">
<trim prefixOverrides="and" prefix="(" suffix=")">
<include refid="_condition_param_">
<property name="_conditionParam_" value="orCondition"/>
<property name="_conditionType_" value="and"/>
</include>
</trim>
</foreach>
</if>
</if>
</sql>
<!-- 条件映射-代参数 -->
<sql id="_condition_param_">
<bind name="conditionParamRef" value="${_conditionParam_}"/>
<if test="conditionParamRef.containsKey('id')">
<if test="conditionParamRef.id != null">
${_conditionType_} a.id=#{${_conditionParam_}.id}
</if>
</if>
<if test="conditionParamRef.containsKey('id')">
<if test="conditionParamRef.id != null ">
${_conditionType_} a.id = #{${_conditionParam_}.id}
</if>
<if test="conditionParamRef.id == null">
${_conditionType_} a.id is null
</if>
</if>
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
${_conditionType_} a.id in
<foreach collection="conditionParamRef.idList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idNotList') and conditionParamRef.idNotList.size() > 0">
${_conditionType_} a.id not in
<foreach collection="conditionParamRef.idNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idStart') and conditionParamRef.idStart != null">
${_conditionType_} a.id <![CDATA[ >= ]]> #{${_conditionParam_}.idStart}
</if>
<if test="conditionParamRef.containsKey('idEnd') and conditionParamRef.idEnd != null">
${_conditionType_} a.id <![CDATA[ <= ]]> #{${_conditionParam_}.idEnd}
</if>
<if test="conditionParamRef.containsKey('roleId')">
<if test="conditionParamRef.roleId != null ">
${_conditionType_} a.role_id = #{${_conditionParam_}.roleId}
</if>
<if test="conditionParamRef.roleId == null">
${_conditionType_} a.role_id is null
</if>
</if>
<if test="conditionParamRef.containsKey('roleIdList') and conditionParamRef.roleIdList.size() > 0">
${_conditionType_} a.role_id in
<foreach collection="conditionParamRef.roleIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('roleIdNotList') and conditionParamRef.roleIdNotList.size() > 0">
${_conditionType_} a.role_id not in
<foreach collection="conditionParamRef.roleIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('roleIdStart') and conditionParamRef.roleIdStart != null">
${_conditionType_} a.role_id <![CDATA[ >= ]]> #{${_conditionParam_}.roleIdStart}
</if>
<if test="conditionParamRef.containsKey('roleIdEnd') and conditionParamRef.roleIdEnd != null">
${_conditionType_} a.role_id <![CDATA[ <= ]]> #{${_conditionParam_}.roleIdEnd}
</if>
<if test="conditionParamRef.containsKey('resourceId')">
<if test="conditionParamRef.resourceId != null ">
${_conditionType_} a.resource_id = #{${_conditionParam_}.resourceId}
</if>
<if test="conditionParamRef.resourceId == null">
${_conditionType_} a.resource_id is null
</if>
</if>
<if test="conditionParamRef.containsKey('resourceIdList') and conditionParamRef.resourceIdList.size() > 0">
${_conditionType_} a.resource_id in
<foreach collection="conditionParamRef.resourceIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('resourceIdNotList') and conditionParamRef.resourceIdNotList.size() > 0">
${_conditionType_} a.resource_id not in
<foreach collection="conditionParamRef.resourceIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('resourceIdStart') and conditionParamRef.resourceIdStart != null">
${_conditionType_} a.resource_id <![CDATA[ >= ]]> #{${_conditionParam_}.resourceIdStart}
</if>
<if test="conditionParamRef.containsKey('resourceIdEnd') and conditionParamRef.resourceIdEnd != null">
${_conditionType_} a.resource_id <![CDATA[ <= ]]> #{${_conditionParam_}.resourceIdEnd}
</if>
<if test="conditionParamRef.containsKey('ruleCode')">
<if test="conditionParamRef.ruleCode != null and conditionParamRef.ruleCode != ''">
${_conditionType_} a.rule_code like #{${_conditionParam_}.ruleCode}
</if>
<if test="conditionParamRef.ruleCode == null">
${_conditionType_} a.rule_code is null
</if>
</if>
<if test="conditionParamRef.containsKey('ruleCodeList') and conditionParamRef.ruleCodeList.size() > 0">
${_conditionType_} a.rule_code in
<foreach collection="conditionParamRef.ruleCodeList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('ruleCodeNotList') and conditionParamRef.ruleCodeNotList.size() > 0">
${_conditionType_} a.rule_code not in
<foreach collection="conditionParamRef.ruleCodeNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('ruleName')">
<if test="conditionParamRef.ruleName != null and conditionParamRef.ruleName != ''">
${_conditionType_} a.rule_name like #{${_conditionParam_}.ruleName}
</if>
<if test="conditionParamRef.ruleName == null">
${_conditionType_} a.rule_name is null
</if>
</if>
<if test="conditionParamRef.containsKey('ruleNameList') and conditionParamRef.ruleNameList.size() > 0">
${_conditionType_} a.rule_name in
<foreach collection="conditionParamRef.ruleNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('ruleNameNotList') and conditionParamRef.ruleNameNotList.size() > 0">
${_conditionType_} a.rule_name not in
<foreach collection="conditionParamRef.ruleNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('ruleCondition')">
<if test="conditionParamRef.ruleCondition != null and conditionParamRef.ruleCondition != ''">
${_conditionType_} a.rule_condition like #{${_conditionParam_}.ruleCondition}
</if>
<if test="conditionParamRef.ruleCondition == null">
${_conditionType_} a.rule_condition is null
</if>
</if>
<if test="conditionParamRef.containsKey('ruleConditionList') and conditionParamRef.ruleConditionList.size() > 0">
${_conditionType_} a.rule_condition in
<foreach collection="conditionParamRef.ruleConditionList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('ruleConditionNotList') and conditionParamRef.ruleConditionNotList.size() > 0">
${_conditionType_} a.rule_condition not in
<foreach collection="conditionParamRef.ruleConditionNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('ruleValue')">
<if test="conditionParamRef.ruleValue != null and conditionParamRef.ruleValue != ''">
${_conditionType_} a.rule_value like #{${_conditionParam_}.ruleValue}
</if>
<if test="conditionParamRef.ruleValue == null">
${_conditionType_} a.rule_value is null
</if>
</if>
<if test="conditionParamRef.containsKey('ruleValueList') and conditionParamRef.ruleValueList.size() > 0">
${_conditionType_} a.rule_value in
<foreach collection="conditionParamRef.ruleValueList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('ruleValueNotList') and conditionParamRef.ruleValueNotList.size() > 0">
${_conditionType_} a.rule_value not in
<foreach collection="conditionParamRef.ruleValueNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('ruleType')">
<if test="conditionParamRef.ruleType != null ">
${_conditionType_} a.rule_type = #{${_conditionParam_}.ruleType}
</if>
<if test="conditionParamRef.ruleType == null">
${_conditionType_} a.rule_type is null
</if>
</if>
<if test="conditionParamRef.containsKey('ruleTypeList') and conditionParamRef.ruleTypeList.size() > 0">
${_conditionType_} a.rule_type in
<foreach collection="conditionParamRef.ruleTypeList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('ruleTypeNotList') and conditionParamRef.ruleTypeNotList.size() > 0">
${_conditionType_} a.rule_type not in
<foreach collection="conditionParamRef.ruleTypeNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('ruleTypeStart') and conditionParamRef.ruleTypeStart != null">
${_conditionType_} a.rule_type <![CDATA[ >= ]]> #{${_conditionParam_}.ruleTypeStart}
</if>
<if test="conditionParamRef.containsKey('ruleTypeEnd') and conditionParamRef.ruleTypeEnd != null">
${_conditionType_} a.rule_type <![CDATA[ <= ]]> #{${_conditionParam_}.ruleTypeEnd}
</if>
<if test="conditionParamRef.containsKey('createTime')">
<if test="conditionParamRef.createTime != null ">
${_conditionType_} a.create_time = #{${_conditionParam_}.createTime}
</if>
<if test="conditionParamRef.createTime == null">
${_conditionType_} a.create_time is null
</if>
</if>
<if test="conditionParamRef.containsKey('createTimeStart') and conditionParamRef.createTimeStart != null and conditionParamRef.createTimeStart!=''">
${_conditionType_} a.create_time <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('createTimeEnd') and conditionParamRef.createTimeEnd != null and conditionParamRef.createTimeEnd!=''">
${_conditionType_} a.create_time <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('createUserId')">
<if test="conditionParamRef.createUserId != null ">
${_conditionType_} a.create_user_id = #{${_conditionParam_}.createUserId}
</if>
<if test="conditionParamRef.createUserId == null">
${_conditionType_} a.create_user_id is null
</if>
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
${_conditionType_} a.create_user_id in
<foreach collection="conditionParamRef.createUserIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('createUserIdNotList') and conditionParamRef.createUserIdNotList.size() > 0">
${_conditionType_} a.create_user_id not in
<foreach collection="conditionParamRef.createUserIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('createUserIdStart') and conditionParamRef.createUserIdStart != null">
${_conditionType_} a.create_user_id <![CDATA[ >= ]]> #{${_conditionParam_}.createUserIdStart}
</if>
<if test="conditionParamRef.containsKey('createUserIdEnd') and conditionParamRef.createUserIdEnd != null">
${_conditionType_} a.create_user_id <![CDATA[ <= ]]> #{${_conditionParam_}.createUserIdEnd}
</if>
<if test="conditionParamRef.containsKey('updateUserId')">
<if test="conditionParamRef.updateUserId != null ">
${_conditionType_} a.update_user_id = #{${_conditionParam_}.updateUserId}
</if>
<if test="conditionParamRef.updateUserId == null">
${_conditionType_} a.update_user_id is null
</if>
</if>
<if test="conditionParamRef.containsKey('updateUserIdList') and conditionParamRef.updateUserIdList.size() > 0">
${_conditionType_} a.update_user_id in
<foreach collection="conditionParamRef.updateUserIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('updateUserIdNotList') and conditionParamRef.updateUserIdNotList.size() > 0">
${_conditionType_} a.update_user_id not in
<foreach collection="conditionParamRef.updateUserIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('updateUserIdStart') and conditionParamRef.updateUserIdStart != null">
${_conditionType_} a.update_user_id <![CDATA[ >= ]]> #{${_conditionParam_}.updateUserIdStart}
</if>
<if test="conditionParamRef.containsKey('updateUserIdEnd') and conditionParamRef.updateUserIdEnd != null">
${_conditionType_} a.update_user_id <![CDATA[ <= ]]> #{${_conditionParam_}.updateUserIdEnd}
</if>
<if test="conditionParamRef.containsKey('updateTime')">
<if test="conditionParamRef.updateTime != null ">
${_conditionType_} a.update_time = #{${_conditionParam_}.updateTime}
</if>
<if test="conditionParamRef.updateTime == null">
${_conditionType_} a.update_time is null
</if>
</if>
<if test="conditionParamRef.containsKey('updateTimeStart') and conditionParamRef.updateTimeStart != null and conditionParamRef.updateTimeStart!=''">
${_conditionType_} a.update_time <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''">
${_conditionType_} a.update_time <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('roleName')">
<if test="conditionParamRef.roleName != null and conditionParamRef.roleName != ''">
${_conditionType_} a.role_name like #{${_conditionParam_}.roleName}
</if>
<if test="conditionParamRef.roleName == null">
${_conditionType_} a.role_name is null
</if>
</if>
<if test="conditionParamRef.containsKey('roleNameList') and conditionParamRef.roleNameList.size() > 0">
${_conditionType_} a.role_name in
<foreach collection="conditionParamRef.roleNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('roleNameNotList') and conditionParamRef.roleNameNotList.size() > 0">
${_conditionType_} a.role_name not in
<foreach collection="conditionParamRef.roleNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('resourceName')">
<if test="conditionParamRef.resourceName != null and conditionParamRef.resourceName != ''">
${_conditionType_} a.resource_name like #{${_conditionParam_}.resourceName}
</if>
<if test="conditionParamRef.resourceName == null">
${_conditionType_} a.resource_name is null
</if>
</if>
<if test="conditionParamRef.containsKey('resourceNameList') and conditionParamRef.resourceNameList.size() > 0">
${_conditionType_} a.resource_name in
<foreach collection="conditionParamRef.resourceNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('resourceNameNotList') and conditionParamRef.resourceNameNotList.size() > 0">
${_conditionType_} a.resource_name not in
<foreach collection="conditionParamRef.resourceNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
</sql>
<sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()">
order by
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
field(a.id,
<foreach collection="conditionParamRef.idList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('roleIdList') and conditionParamRef.roleIdList.size() > 0">
field(a.roleId,
<foreach collection="conditionParamRef.roleIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('resourceIdList') and conditionParamRef.resourceIdList.size() > 0">
field(a.resourceId,
<foreach collection="conditionParamRef.resourceIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('ruleTypeList') and conditionParamRef.ruleTypeList.size() > 0">
field(a.ruleType,
<foreach collection="conditionParamRef.ruleTypeList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
field(a.createUserId,
<foreach collection="conditionParamRef.createUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('updateUserIdList') and conditionParamRef.updateUserIdList.size() > 0">
field(a.updateUserId,
<foreach collection="conditionParamRef.updateUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<trim suffixOverrides="," suffix="">
<foreach collection="orderColList" open="" close="" index="index" item="item" separator=",">
a.${item.colName} ${item.sortKind}
</foreach>
</trim>
</if>
<if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()">
order by
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
field(a.id,
<foreach collection="conditionParamRef.idList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('roleIdList') and conditionParamRef.roleIdList.size() > 0">
field(a.roleId,
<foreach collection="conditionParamRef.roleIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('resourceIdList') and conditionParamRef.resourceIdList.size() > 0">
field(a.resourceId,
<foreach collection="conditionParamRef.resourceIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('ruleTypeList') and conditionParamRef.ruleTypeList.size() > 0">
field(a.ruleType,
<foreach collection="conditionParamRef.ruleTypeList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
field(a.createUserId,
<foreach collection="conditionParamRef.createUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('updateUserIdList') and conditionParamRef.updateUserIdList.size() > 0">
field(a.updateUserId,
<foreach collection="conditionParamRef.updateUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<trim suffixOverrides="," suffix="">
<if test="orderCol.containsKey('id')">
a.id
<if test='orderCol.id != null and "DESC".equalsIgnoreCase(orderCol.id)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('roleId')">
a.role_id
<if test='orderCol.roleId != null and "DESC".equalsIgnoreCase(orderCol.roleId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('resourceId')">
a.resource_id
<if test='orderCol.resourceId != null and "DESC".equalsIgnoreCase(orderCol.resourceId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('ruleCode')">
a.rule_code
<if test='orderCol.ruleCode != null and "DESC".equalsIgnoreCase(orderCol.ruleCode)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('ruleName')">
a.rule_name
<if test='orderCol.ruleName != null and "DESC".equalsIgnoreCase(orderCol.ruleName)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('ruleCondition')">
a.rule_condition
<if test='orderCol.ruleCondition != null and "DESC".equalsIgnoreCase(orderCol.ruleCondition)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('ruleValue')">
a.rule_value
<if test='orderCol.ruleValue != null and "DESC".equalsIgnoreCase(orderCol.ruleValue)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('ruleType')">
a.rule_type
<if test='orderCol.ruleType != null and "DESC".equalsIgnoreCase(orderCol.ruleType)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('createTime')">
a.create_time
<if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('createUserId')">
a.create_user_id
<if test='orderCol.createUserId != null and "DESC".equalsIgnoreCase(orderCol.createUserId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('updateUserId')">
a.update_user_id
<if test='orderCol.updateUserId != null and "DESC".equalsIgnoreCase(orderCol.updateUserId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('updateTime')">
a.update_time
<if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('roleName')">
a.role_name
<if test='orderCol.roleName != null and "DESC".equalsIgnoreCase(orderCol.roleName)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('resourceName')">
a.resource_name
<if test='orderCol.resourceName != null and "DESC".equalsIgnoreCase(orderCol.resourceName)'>DESC</if>
,
</if>
</trim>
</if>
</sql>
<sql id="_group_by_">
<if test="groupList != null and !groupList.isEmpty()">
GROUP BY
<trim suffixOverrides="," suffix="">
<foreach collection="groupList" open="" close="" index="index" item="item" separator=",">
${item}
</foreach>
</trim>
</if>
</sql>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.dimension.dao.ibatis.DimensionResourceRuleDaoImpl">
<!-- 获取列表 -->
<select id="getRoleComponentRule" parameterType="java.util.HashMap" resultMap="DimensionResourceRuleEntity-Map">
SELECT DISTINCT
t1.role_id,
t1.resource_id,
t1.rule_code,
t1.rule_name,
t1.rule_condition,
t1.rule_value,
t1.rule_type,
t2.userId
FROM
mortals_xhx_dimension_resource_rule t1
LEFT JOIN mortals_xhx_role_user t2 ON t1.role_id = t2.roleId
LEFT JOIN mortals_xhx_role_auth t3 ON t1.role_id = t3.roleId
LEFT JOIN mortals_xhx_resource t4 ON t4.id = t3.resourceId
WHERE
FIND_IN_SET( #{route}, t4.url )
AND t2.userId = #{userId}
</select>
</mapper>
\ No newline at end of file
import com.alibaba.fastjson.JSON;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.utils.MatterHtmlParseUtil;
import com.mortals.xhx.module.matter.model.MatterEntity;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Slf4j
public class TestParsePost {
@Test
public void testUrl() {
String url = "http://www.sczwfw.gov.cn/jiq/interface/item/tags";
HashMap<String, String> params = new HashMap<>();
params.put("areaCode", "511500000000");
params.put("dxType", "6");
params.put("deptCode", "11511200MB1147469G");
params.put("searchtext", "");
// params.put("type", "2");//类型 2.部门 1.主题 3.热度
params.put("taskType", "");
// params.put("pageno", "1");
Rest<Map<String, Integer>> rest = MatterHtmlParseUtil.statSiteMatterCount(params, url);
System.out.println(JSON.toJSONString(rest));
List<MatterEntity> allList = new ArrayList<>();
String url1 = "http://www.sczwfw.gov.cn/jiq/interface/item/tags";
HashMap<String, String> params1 = new HashMap<>();
params1.put("areaCode", "511500000000");
params1.put("dxType", "6");
params1.put("deptCode", "11511200MB1147469G");
params1.put("searchtext", "");
// params1.put("type", "2");
params1.put("taskType", "");
for (int i = 1; i <= rest.getData().get("pageNum"); i++) {
params1.put("pageno", String.valueOf(i));
Rest<List<MatterEntity>> restList = MatterHtmlParseUtil.getMatterList(params1, url1);
if (restList.getCode() == YesNoEnum.YES.getValue() && !ObjectUtils.isEmpty(restList.getData())) {
allList.addAll(restList.getData());
}
}
for (int i = 0; i < allList.size(); i++) {
System.out.println(i + " " + allList.get(i).getMatterName()+" "+ allList.get(i).getUrl()) ;
}
}
}
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import java.util.HashMap;
@Slf4j
public class TestPost {
@Test
public void testUrl() {
HashMap<String, String> headers = new HashMap<>();
headers.put("satoken","d186dc7a-8f07-4936-9f36-94aeb7b246bb");
HttpRequest httpRequest = HttpUtil.createGet("http://59.225.206.13:8331/oauth-pro/admin-pro/oauth2/isLogin").headerMap(headers, true);
String resp = httpRequest.execute().body();
//String resp = httpRequest.getUrl();
// String resp = HttpUtil.get("http://59.225.206.13:8331/oauth-pro/admin-pro/oauth2/isLogin");
log.info("resp:{}",resp);
}
}
......@@ -27,15 +27,19 @@ POST {{baseUrl}}/app/dataset/list
Content-Type: application/json
{
"appId": 20,
"appId": 84,
"orConditionList": [
{
"fieldName": "制定机关",
"fieldValue": "%四川省人民政府%"
"fieldName": "部门",
"fieldValue": "市公安局"
},{
"fieldName": "标题",
"fieldValue": "%管理办法%"
"fieldName": "员工姓名",
"fieldValue": "%黄%"
},
{
"fieldValueList": ["员工姓名"]
}
],
"page": 1,
"size": 10
......
......@@ -54,7 +54,7 @@ POST {{baseUrl}}/base/area/genSubAreaByAreaName
Content-Type: application/json
{
"areaCode": "510921000000"
"areaCode": "513232000000"
}
......
###登录
POST {{baseUrl}}/login/login
Content-Type: application/json
{
"loginName":"admin",
"password":"admin",
"securityCode":"8888"
}
> {%
client.global.set("SmsSet_id", JSON.parse(response.body).data.id);
client.global.set("authToken", JSON.parse(response.body).data.token);
%}
###授权维度列表
POST {{baseUrl}}/dimension/list
Content-Type: application/json
{
"page":1,
"size":10
}
###授权维度更新与保存
POST {{baseUrl}}/dimension/save
Authorization: {{authToken}}
Content-Type: application/json
{
"dimensionCode":"SdgQHJ",
"dimensionName":"0SiGlt",
"dimensionValue":"yVbV78",
"dimensionType":1,
}
> {%
client.global.set("Dimension_id", JSON.parse(response.body).data.id);
%}
###授权维度查看
GET {{baseUrl}}/dimension/info?id={{Dimension_id}}
Accept: application/json
###授权维度编辑
GET {{baseUrl}}/dimension/edit?id={{Dimension_id}}
Accept: application/json
###授权维度删除
GET {{baseUrl}}/dimension/delete?id={{Dimension_id}}
Authorization: {{authToken}}
Accept: application/json
###登录
POST {{baseUrl}}/login/login
Content-Type: application/json
{
"loginName":"admin",
"password":"admin",
"securityCode":"8888"
}
> {%
client.global.set("SmsSet_id", JSON.parse(response.body).data.id);
client.global.set("authToken", JSON.parse(response.body).data.token);
%}
###角色资源维度规则列表
POST {{baseUrl}}/dimension/resource/rule/list
Content-Type: application/json
{
"page":1,
"size":10
}
###角色资源维度规则更新与保存
POST {{baseUrl}}/dimension/resource/rule/save
Authorization: {{authToken}}
Content-Type: application/json
{
"roleId":506,
"resourceId":118,
"ruleCode":"XhCY8s",
"ruleName":"1XHmAY",
"ruleCondition":"IN",
"ruleValue":"HiaFt9",
"ruleType":1,
}
> {%
client.global.set("DimensionResourceRule_id", JSON.parse(response.body).data.id);
%}
###角色资源维度规则查看
GET {{baseUrl}}/dimension/resource/rule/info?id={{DimensionResourceRule_id}}
Accept: application/json
###角色资源维度规则编辑
GET {{baseUrl}}/dimension/resource/rule/edit?id={{DimensionResourceRule_id}}
Accept: application/json
###角色资源维度规则删除
GET {{baseUrl}}/dimension/resource/rule/delete?id={{DimensionResourceRule_id}}
Authorization: {{authToken}}
Accept: application/json
......@@ -25,6 +25,21 @@ Content-Type: application/json
}
###生成文本
POST {{baseUrl}}/matter/genMatterTxt
Content-Type: application/json
{}
###生成文本1
POST {{baseUrl}}/matter/genMatterMarkdown
Content-Type: application/json
{}
###基础事项列表
POST {{baseUrl}}/site/matter/list
Content-Type: application/json
......
###登录
POST {{baseUrl}}/login/login
Content-Type: application/json
{
"loginName":"admin",
"password":"admin",
"securityCode":"8888"
}
> {%
client.global.set("SmsSet_id", JSON.parse(response.body).data.id);
client.global.set("authToken", JSON.parse(response.body).data.token);
%}
###排号汇总列表
POST {{baseUrl}}/ph/queue/list
Content-Type: application/json
{
"page":1,
"size":10
}
###排号汇总更新与保存
POST {{baseUrl}}/ph/queue/save
Authorization: {{authToken}}
Content-Type: application/json
{
"ordernumber":"addtBJ",
"style":"未叫号",
"business":"qdKnAF",
"windowName":"fFkdlu",
"windowFromnum":"dMLXLG",
"flownum":"Um9INN",
"formernum":"Sx3gb6",
"peopleIdcard":"VfS6Xk",
"peopleName":"BZAYKD",
"peopleSex":"a1LaM3",
"peoplePhone":"nH10yu",
"workmanName":"l0DDCz",
"workmanNumber":"U0l5x4",
"taketime":"1712592000000",
"calltime":"1712592000000",
"endtime":"1712592000000",
"waitTime":0,
"handleTime":0,
"deviceName":"oVFvi7",
"callName":"zQ04Ri",
"matterName":"UBwXu5",
"queueid":"42lyL3",
"wySignin":"现场取号",
"sectionName":"0CEkDm",
"hallName":"ASmxoc",
"deviceType":"排号机",
"siteId":0,
"siteCode":"ffN09b",
"siteName":"fIoxJO",
"extNum":"mJdlw4",
}
> {%
client.global.set("PhQueue_id", JSON.parse(response.body).data.id);
%}
###排号汇总查看
GET {{baseUrl}}/ph/queue/info?id={{PhQueue_id}}
Accept: application/json
###排号汇总编辑
GET {{baseUrl}}/ph/queue/edit?id={{PhQueue_id}}
Accept: application/json
###排号汇总删除
GET {{baseUrl}}/ph/queue/delete?id={{PhQueue_id}}
Authorization: {{authToken}}
Accept: application/json
###登录
POST {{baseUrl}}/login/login
Content-Type: application/json
{
"loginName":"admin",
"password":"admin",
"securityCode":"8888"
}
> {%
client.global.set("SmsSet_id", JSON.parse(response.body).data.id);
client.global.set("authToken", JSON.parse(response.body).data.token);
%}
###评价汇总列表
POST {{baseUrl}}/pj/evaluate/list
Content-Type: application/json
{
"page":1,
"size":10
}
###评价汇总更新与保存
POST {{baseUrl}}/pj/evaluate/save
Authorization: {{authToken}}
Content-Type: application/json
{
"peopleIdcard":"snZS5A",
"peopleName":"AmUiOm",
"peopleSex":"mkvrTF",
"peoplePhone":"37a4T3",
"pjOption":"mdVOnL",
"contentTag":"jl8xv2",
"picUrl":"BGNr0D",
"sectionName":"yVM2SE",
"hallName":"vTcXaf",
"pjSource":"jdkCLi",
"opinion":"Ah3ETA",
"windowName":"5oK21X",
"windowFromnum":"pzl4kw",
"flounum":"FIsY0p",
"pjxt":"窗口评价",
"workmanName":"u3u775",
"workmanNumber":"dCOirx",
"devicenum":"AsK2ye",
"evaluatestatus":"等待评价",
"evaluatetype":"截图",
"photobefor":"DQJe0a",
"photoautograph":"k06ZIZ",
"picture":"LLHjrm",
"process":"i95lNE",
"eyevaluate":"未标记",
"pjType":"窗口评价",
"pjTime":"1712592000000",
"siteId":0,
"siteCode":"PO98kN",
"siteName":"CZ26Cv",
"extNum":"x0Zcd3",
}
> {%
client.global.set("PjEvaluate_id", JSON.parse(response.body).data.id);
%}
###评价汇总查看
GET {{baseUrl}}/pj/evaluate/info?id={{PjEvaluate_id}}
Accept: application/json
###评价汇总编辑
GET {{baseUrl}}/pj/evaluate/edit?id={{PjEvaluate_id}}
Accept: application/json
###评价汇总删除
GET {{baseUrl}}/pj/evaluate/delete?id={{PjEvaluate_id}}
Authorization: {{authToken}}
Accept: application/json
......@@ -4,8 +4,8 @@ POST {{baseUrl}}/site/business/interlist
Content-Type: application/json
{
"siteId": 22
"siteId": 1,
"size":100
}
......
......@@ -115,7 +115,7 @@ POST {{baseUrl}}/site/syncGovMatterBySiteId
Content-Type: application/json
{
"id":22
"id":1
}
......
......@@ -36,7 +36,7 @@ client.global.set("SkinBase_id", JSON.parse(response.body).data.id);
%}
###系统基础皮肤查看
GET {{baseUrl}}/skin/base/interview?id=160
GET {{baseUrl}}/skin/base/interview?id=93
Accept: application/json
###系统基础皮肤编辑
......
......@@ -86,7 +86,7 @@
<y-range-picker valueFormat="YYYY-MM-DD" v-model="searchForm.time" />
<a-input
allowClear
placeholder="请输入评价人姓名或窗口编号搜索"
placeholder="请输入评价人姓名或排队编号搜索"
v-model="searchForm.info"
/>
<a-button block class="search-btn" icon="search" @click="handleSearch">
......
......@@ -86,7 +86,7 @@
<y-range-picker valueFormat="YYYY-MM-DD" v-model="searchForm.time" />
<a-input
allowClear
placeholder="请输入评价人姓名或窗口编号搜索"
placeholder="请输入评价人姓名或排队编号搜索"
v-model="searchForm.info"
/>
<a-button block class="search-btn" icon="search" @click="handleSearch">
......
......@@ -86,7 +86,7 @@
<y-range-picker valueFormat="YYYY-MM-DD" v-model="searchForm.time" />
<a-input
allowClear
placeholder="请输入评价人姓名或窗口编号搜索"
placeholder="请输入评价人姓名或排队编号搜索"
v-model="searchForm.info"
/>
<a-button block class="search-btn" icon="search" @click="handleSearch">
......
......@@ -337,7 +337,7 @@ const routes = [
/* webpackChunkName: "matterEvaluation" */ "@/views/dataAdmin/components/evaluationRecordReport/matterEvaluation.vue"
),
meta: {
title: "办理事项评价记录报表",
title: "一号一评记录报表",
activeMenu: "/home/dataManagement",
},
},
......
<template>
<div>
<a-drawer
:title="title"
placement="right"
width="700px"
:visible="Visible"
@close="onClose"
>
<a-drawer :title="title" placement="right" width="700px" :visible="Visible" @close="onClose">
<!-- 评价 -->
<div v-if="type == 1">
<a-steps direction="vertical" :current="1">
......@@ -15,94 +9,63 @@
<div slot="description" class="transact-step">
<a-row :gutter="[0, 10]">
<a-col :span="12">
<span
><span class="lable">评价人:</span
>{{
<span><span class="lable">评价人:</span>{{
detailsInfo.idcard_Name ? detailsInfo.idcard_Name : "--"
}}</span
>
}}</span>
</a-col>
<a-col :span="12">
<span
><span class="lable">手机号:</span
>{{ detailsInfo.phone ? detailsInfo.phone : "--" }}</span
>
<span><span class="lable">手机号:</span>{{ detailsInfo.phone ? detailsInfo.phone : "--" }}</span>
</a-col>
</a-row>
<a-row :gutter="[0, 10]">
<a-col :span="12">
<span
><span class="lable">身份证号:</span
>{{
<span><span class="lable">身份证号:</span>{{
detailsInfo.idcard_IDCardNo
? detailsInfo.idcard_IDCardNo
: "--"
}}</span
>
}}</span>
</a-col>
<a-col :span="12">
<span
><span class="lable">窗口编号:</span
>{{
<span><span class="lable">窗口编号:</span>{{
detailsInfo.window_fronum
? detailsInfo.window_fronum
: "--"
}}</span
>
}}</span>
</a-col>
</a-row>
<a-row :gutter="[0, 10]">
<a-col :span="12">
<span
><span class="lable">评价选项:</span
>{{
<span><span class="lable">评价选项:</span>{{
detailsInfo.option_id ? detailsInfo.option_id : "--"
}}</span
>
}}</span>
</a-col>
<a-col :span="12">
<span
><span class="lable">评价时间:</span
>{{
<span><span class="lable">评价时间:</span>{{
detailsInfo.create_time ? detailsInfo.create_time : "--"
}}</span
>
}}</span>
</a-col>
</a-row>
<a-row :gutter="[0, 10]">
<a-col :span="24">
<span class="lable">评价指标:</span>
<a-tag
color="blue"
class="mb-1"
v-for="(item, index) in detailsInfo.content"
:key="index"
>
<a-tag color="blue" class="mb-1" v-for="(item, index) in detailsInfo.content" :key="index">
{{ item }}
</a-tag>
</a-col>
</a-row>
<a-row :gutter="[0, 10]">
<a-col :span="12">
<span
><span class="lable">评价来源:</span
>{{ detailsInfo.source ? detailsInfo.source : "--" }}</span
>
<span><span class="lable">评价来源:</span>{{ detailsInfo.source ? detailsInfo.source : "--" }}</span>
</a-col>
<a-col :span="12">
<span
><span class="lable">评价设备:</span
>{{
<span><span class="lable">评价设备:</span>{{
detailsInfo.devicenum ? detailsInfo.devicenum : "--"
}}</span
>
}}</span>
</a-col>
</a-row>
<a-row :gutter="[0, 10]">
<a-col :span="12">
<span
><span class="lable">评价状态:</span
>{{
<span><span class="lable">评价状态:</span>{{
!detailsInfo.evaluatestatus
? "--"
: detailsInfo.evaluatestatus == 1
......@@ -116,28 +79,17 @@
: detailsInfo.evaluatestatus == 5
? "用户评价超时"
: "收到图片等待签名"
}}</span
>
}}</span>
</a-col>
<a-col :span="12">
<span>
<span class="lable">评价人照片:</span>
<a-avatar
v-if="!detailsInfo.picture"
shape="square"
:size="40"
icon="user"
/>
<img
v-else
:src="baseurl + '/' + detailsInfo.picture"
@click="
<a-avatar v-if="!detailsInfo.picture" shape="square" :size="40" icon="user" />
<img v-else :src="baseurl + '/' + detailsInfo.picture" @click="
$viewerApi({
images: [baseurl + '/' + detailsInfo.picture],
})
"
class="cursor-pointer w-[50px] max-h-[50px] rounded-[4px]"
/>
" class="cursor-pointer w-[50px] max-h-[50px] rounded-[4px]" />
</span>
</a-col>
</a-row>
......@@ -152,16 +104,11 @@
<div class="elapsed-time">
<p class="elapsed-time-title">
<span>总耗时:</span>
<span
>{{ detailsInfo.alltime ? detailsInfo.alltime : "--" }}
<span>{{ detailsInfo.alltime ? detailsInfo.alltime : "--" }}
<span v-if="detailsInfo.alltime">
<a-icon
v-if="
<a-icon v-if="
compareTime(detailsInfo.alltime, detailsInfo.p_alltime)
"
type="arrow-up"
style="color: #ff4d4f"
/>
" type="arrow-up" style="color: #ff4d4f" />
<a-icon v-else type="arrow-down" style="color: #1bbc9b" />
</span>
</span>
......@@ -180,13 +127,9 @@
detailsInfo.waittime ? detailsInfo.waittime : "--"
}}</span>
<span v-if="detailsInfo.waittime">
<a-icon
v-if="
<a-icon v-if="
compareTime(detailsInfo.waittime, detailsInfo.p_waittime)
"
type="arrow-up"
style="color: #ff4d4f"
/>
" type="arrow-up" style="color: #ff4d4f" />
<a-icon v-else type="arrow-down" style="color: #1bbc9b" />
</span>
</p>
......@@ -202,11 +145,8 @@
<span>办理时间:</span>
<span>{{ detailsInfo.bltime ? detailsInfo.bltime : "--" }}</span>
<span v-if="detailsInfo.bltime">
<a-icon
v-if="compareTime(detailsInfo.bltime, detailsInfo.p_bltime)"
type="arrow-up"
style="color: #ff4d4f"
/>
<a-icon v-if="compareTime(detailsInfo.bltime, detailsInfo.p_bltime)" type="arrow-up"
style="color: #ff4d4f" />
<a-icon v-else type="arrow-down" style="color: #1bbc9b" />
</span>
</p>
......@@ -233,12 +173,10 @@
</a-row>
<a-row :gutter="[0, 8]">
<a-col :span="12">
<span>排队编号:</span
>{{ detailsInfo.flownum ? detailsInfo.flownum : "--" }}
<span>排队编号:</span>{{ detailsInfo.flownum ? detailsInfo.flownum : "--" }}
</a-col>
<a-col :span="12">
<span>取号方式:</span
>{{ detailsInfo.wy_signin === 0 ? "现场取号" : "线上取号" }}
<span>取号方式:</span>{{ detailsInfo.wy_signin === 0 ? "现场取号" : "线上取号" }}
</a-col>
</a-row>
<a-row :gutter="[0, 8]">
......@@ -262,15 +200,12 @@
</div>
</div>
</a-step>
<a-step
title="办理中"
v-if="detailsInfo.style === 1 || detailsInfo.style === 4"
>
<a-step title="办理中" v-if="detailsInfo.style === 1 || detailsInfo.style === 4">
<a-icon type="environment" slot="icon" />
<div slot="description">
<a-row :gutter="[0, 8]">
<a-col :span="12">
<span>办理窗口:</span>{{ detailsInfo.window_name }}
<span>办理窗口:</span>{{ detailsInfo.window_name }}-{{ detailsInfo.window_fromnum }}
</a-col>
<a-col :span="12">
<span>开始办理时间:</span>{{ detailsInfo.calltime }}
......@@ -302,44 +237,30 @@
</a-row>
<a-row :gutter="[0, 8]">
<a-col :span="12">
<span>评价时间:</span
>{{ detailsInfo.pj_time ? detailsInfo.pj_time : "--" }}
<span>评价时间:</span>{{ detailsInfo.pj_time ? detailsInfo.pj_time : "--" }}
</a-col>
</a-row>
<a-row :gutter="[0, 8]">
<a-col :span="24">
<span>评价指标:</span>
<a-tag
color="blue"
class="mb-1"
v-for="(item, index) in detailsInfo.content"
:key="index"
>
<a-tag color="blue" class="mb-1" v-for="(item, index) in detailsInfo.content" :key="index">
{{ item }}
</a-tag>
</a-col>
</a-row>
<a-row :gutter="[0, 10]">
<a-col :span="12">
<span
><span class="lable">评价来源:</span
>{{ detailsInfo.source ? detailsInfo.source : "--" }}</span
>
<span><span class="lable">评价来源:</span>{{ detailsInfo.source ? detailsInfo.source : "--" }}</span>
</a-col>
<a-col :span="12">
<span
><span class="lable">评价设备:</span
>{{
<span><span class="lable">评价设备:</span>{{
detailsInfo.devicenum ? detailsInfo.devicenum : "--"
}}</span
>
}}</span>
</a-col>
</a-row>
<a-row :gutter="[0, 10]">
<a-col :span="12">
<span
><span class="lable">评价状态:</span
>{{
<span><span class="lable">评价状态:</span>{{
!detailsInfo.evaluatestatus
? "--"
: detailsInfo.evaluatestatus == 1
......@@ -353,28 +274,17 @@
: detailsInfo.evaluatestatus == 5
? "用户评价超时"
: "收到图片等待签名"
}}</span
>
}}</span>
</a-col>
<a-col :span="12">
<span>
<span class="lable">评价人照片:</span>
<a-avatar
v-if="!detailsInfo.picture"
shape="square"
:size="40"
icon="user"
/>
<img
v-else
:src="baseurl + '/' + detailsInfo.picture"
@click="
<a-avatar v-if="!detailsInfo.picture" shape="square" :size="40" icon="user" />
<img v-else :src="baseurl + '/' + detailsInfo.picture" @click="
$viewerApi({
images: [baseurl + '/' + detailsInfo.picture],
})
"
class="cursor-pointer w-[50px] max-h-[50px] rounded-[4px]"
/>
" class="cursor-pointer w-[50px] max-h-[50px] rounded-[4px]" />
</span>
</a-col>
</a-row>
......@@ -437,7 +347,7 @@ export default {
return 1;
},
},
created() {},
created() { },
methods: {
onClose() {
this.Visible = false;
......@@ -470,6 +380,7 @@ export default {
:deep(.ant-steps-item-title) {
color: #1890ff !important;
}
.header {
height: 90px;
margin-bottom: 20px;
......@@ -479,15 +390,19 @@ export default {
display: flex;
justify-content: space-around;
align-items: center;
.elapsed-time-title {
font-size: 16px;
}
.time {
color: #1890ff;
}
}
.transact-step {
position: relative;
.transact-tips1,
.transact-tips2,
.transact-tips3 {
......@@ -504,14 +419,17 @@ export default {
right: 0px;
transform: rotate(45deg);
}
.transact-tips1 {
border: 8px solid rgba(0, 168, 112, 0.1);
color: #00a870;
}
.transact-tips2 {
border: 8px solid rgba(8, 87, 232, 0.1);
color: #0857e8;
}
.transact-tips3 {
border: 8px solid rgba(101, 101, 101, 0.1);
color: #656565;
......
......@@ -6,6 +6,7 @@
:data-source="tableData"
:loading="loading"
:scroll="{
x: 1500,
y: 490,
}"
:row-selection="{
......@@ -72,6 +73,8 @@ import { getEvaList, getEvaDetil, getQueEvaData } from "@/api/dataAdmin";
const tHeader = [
"排队编号",
"评价选项",
"办理窗口",
"工作人员",
"评价人",
"身份证号",
"手机号",
......@@ -82,6 +85,8 @@ const tHeader = [
const filterVal = [
"flounum",
"option_id",
"window",
"workman_name",
"idcard_Name",
"idcard_IDCardNo",
"phone",
......@@ -119,6 +124,22 @@ export default {
return text ? text : "--";
},
},
{
title: "办理窗口",
width: 100,
dataIndex: "window",
customRender: (text) => {
return text ? text : "--";
},
},
{
title: "工作人员",
width: 100,
dataIndex: "workman_name",
customRender: (text) => {
return text ? text : "--";
},
},
{
title: "评价人",
width: 100,
......@@ -328,7 +349,7 @@ export default {
this.tHeader,
this.filterVal,
data,
"办理事项评价记录报表" + this.$moment().format("YYYYMMDDHHmmss")
"一号一评记录报表" + this.$moment().format("YYYYMMDDHHmmss")
);
} else {
this.dataSection(this.getDataList, {}, (data) => {
......@@ -347,7 +368,7 @@ export default {
this.tHeader,
this.filterVal,
data,
"办理事项评价记录报表" + this.$moment().format("YYYYMMDDHHmmss")
"一号一评记录报表" + this.$moment().format("YYYYMMDDHHmmss")
);
});
}
......
......@@ -253,7 +253,7 @@ export default {
this.tHeader,
this.filterVal,
data,
"办理事项评价记录报表" + this.$moment().format("YYYYMMDDHHmmss")
"一号一评记录报表" + this.$moment().format("YYYYMMDDHHmmss")
);
} else {
this.dataSection(this.getDataList, {}, (data) => {
......@@ -272,7 +272,7 @@ export default {
this.tHeader,
this.filterVal,
data,
"办理事项评价记录报表" + this.$moment().format("YYYYMMDDHHmmss")
"一号一评记录报表" + this.$moment().format("YYYYMMDDHHmmss")
);
});
}
......
......@@ -253,7 +253,7 @@ export default {
this.tHeader,
this.filterVal,
data,
"办理事项评价记录报表" + this.$moment().format("YYYYMMDDHHmmss")
"一号一评记录报表" + this.$moment().format("YYYYMMDDHHmmss")
);
} else {
this.dataSection(this.getDataList, {}, (data) => {
......@@ -272,7 +272,7 @@ export default {
this.tHeader,
this.filterVal,
data,
"办理事项评价记录报表" + this.$moment().format("YYYYMMDDHHmmss")
"一号一评记录报表" + this.$moment().format("YYYYMMDDHHmmss")
);
});
}
......
......@@ -208,13 +208,14 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
if (sysUser.getLoginLock() == null) {
sysUser.setLoginLock(0);
}
if (sysUser.getLoginLock() == 1 && sysUser.getLockTime() != null) {
//取消账户锁定功能
/* if (sysUser.getLoginLock() == 1 && sysUser.getLockTime() != null) {
String nowStr = DateUtils.getCurrStrDate();
String loginDateStr = DateUtils.getDateTime(sysUser.getLockTime(), "yyyy-MM-dd");
if (nowStr.equals(loginDateStr)) {
throw new AppException("此账号当天密码错误次数已达上限,已被锁定");
}
}
}*/
try {
if (StringUtils.isNotEmpty(sysUser.getSaltKey())) {
......
......@@ -16,7 +16,7 @@ Content-Type: application/json
{
"loginName":"admin",
"password":"admin",
"securityCode":"8888"
"securityCode":"admin"
}
> {%
......
package com.mortals.xhx.base.framework.filter;
import cn.dev33.satoken.reactor.filter.SaReactorFilter;
import cn.dev33.satoken.router.SaRouter;
import cn.dev33.satoken.stp.StpUtil;
import cn.dev33.satoken.util.SaResult;
import com.mortals.framework.common.HttpStatus;
import com.mortals.xhx.base.framework.config.IgnoreWhiteProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* Sa-Token 权限认证拦截器
*
* @author: zxfei
* @date: 2022/6/17 15:18
*/
//@Configuration
public class AuthFilter {
/**
* 注册 Sa-Token 全局过滤器
*/
@Bean
public SaReactorFilter getSaReactorFilter(IgnoreWhiteProperties ignoreWhite) {
return new SaReactorFilter()
// 拦截地址
.addInclude("/**")
//排除地址
.addExclude("/favicon.ico", "/actuator/**")
// 鉴权方法:每次访问进入
.setAuth(obj -> {
// 登录校验 -- 拦截所有路由
SaRouter.match("/**")
.notMatch(ignoreWhite.getWhites())
.check(r -> {
// 检查是否登录 是否有token
// StpUtil.checkLogin();
// 有效率影响 用于临时测试
// if (log.isDebugEnabled()) {
// log.debug("剩余有效时间: {}", StpUtil.getTokenTimeout());
// log.debug("临时有效时间: {}", StpUtil.getTokenActivityTimeout());
// }
});
}).setError(e -> SaResult.error("认证失败,无法访问系统资源").setCode(HttpStatus.UNAUTHORIZED));
}
}
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