52 changed files with 4227 additions and 694 deletions
@ -0,0 +1,53 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询推送消息草稿列表
|
|||
export function listDraft(query) { |
|||
return request({ |
|||
url: '/message/draft/list', |
|||
method: 'post', |
|||
data: query |
|||
}) |
|||
} |
|||
|
|||
// 查询推送消息草稿详细
|
|||
export function getDraft(id) { |
|||
return request({ |
|||
url: '/message/draft/' + id, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增推送消息草稿
|
|||
export function addDraft(data) { |
|||
return request({ |
|||
url: '/message/draft', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改推送消息草稿
|
|||
export function updateDraft(data) { |
|||
return request({ |
|||
url: '/message/draft', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除推送消息草稿
|
|||
export function delDraft(id) { |
|||
return request({ |
|||
url: '/message/draft/' + id, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
|
|||
// 导出推送消息草稿
|
|||
export function exportDraft(query) { |
|||
return request({ |
|||
url: '/message/draft/export', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
@ -0,0 +1,53 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询推送消息编制列表
|
|||
export function listRecords(query) { |
|||
return request({ |
|||
url: '/message/records/list', |
|||
method: 'post', |
|||
data: query |
|||
}) |
|||
} |
|||
|
|||
// 查询推送消息编制详细
|
|||
export function getRecords(id) { |
|||
return request({ |
|||
url: '/message/records/' + id, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增推送消息编制
|
|||
export function addRecords(data) { |
|||
return request({ |
|||
url: '/message/records', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改推送消息编制
|
|||
export function updateRecords(data) { |
|||
return request({ |
|||
url: '/message/records', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除推送消息编制
|
|||
export function delRecords(id) { |
|||
return request({ |
|||
url: '/message/records/' + id, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
|
|||
// 导出推送消息编制
|
|||
export function exportRecords(query) { |
|||
return request({ |
|||
url: '/message/records/export', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
@ -0,0 +1,53 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询推送消息编制列表
|
|||
export function listSend(query) { |
|||
return request({ |
|||
url: '/message/send/list', |
|||
method: 'post', |
|||
data: query |
|||
}) |
|||
} |
|||
|
|||
// 查询推送消息编制详细
|
|||
export function getSend(id) { |
|||
return request({ |
|||
url: '/message/send/' + id, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增推送消息编制
|
|||
export function addSend(data) { |
|||
return request({ |
|||
url: '/message/send', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改推送消息编制
|
|||
export function updateSend(data) { |
|||
return request({ |
|||
url: '/message/send', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除推送消息编制
|
|||
export function delSend(id) { |
|||
return request({ |
|||
url: '/message/send/' + id, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
|
|||
// 导出推送消息编制
|
|||
export function exportSend(query) { |
|||
return request({ |
|||
url: '/message/send/export', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
@ -0,0 +1,53 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询推送消息模板管理列表
|
|||
export function listTemplate(query) { |
|||
return request({ |
|||
url: '/message/template/list', |
|||
method: 'post', |
|||
data: query |
|||
}) |
|||
} |
|||
|
|||
// 查询推送消息模板管理详细
|
|||
export function getTemplate(id) { |
|||
return request({ |
|||
url: '/message/template/' + id, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增推送消息模板管理
|
|||
export function addTemplate(data) { |
|||
return request({ |
|||
url: '/message/template', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改推送消息模板管理
|
|||
export function updateTemplate(data) { |
|||
return request({ |
|||
url: '/message/template', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除推送消息模板管理
|
|||
export function delTemplate(id) { |
|||
return request({ |
|||
url: '/message/template/' + id, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
|
|||
// 导出推送消息模板管理
|
|||
export function exportTemplate(query) { |
|||
return request({ |
|||
url: '/message/template/export', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
@ -0,0 +1,8 @@ |
|||
<template> |
|||
<!-- <div class="app-container"> --> |
|||
<div> |
|||
<router-view /> |
|||
</div> |
|||
</template> |
|||
<script> |
|||
</script> |
@ -0,0 +1,338 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"> |
|||
<el-form-item label="标题" prop="title"> |
|||
<el-input |
|||
v-model="queryParams.data.title" |
|||
placeholder="请输入标题" |
|||
clearable |
|||
size="small" |
|||
@keyup.enter.native="handleQuery" |
|||
> |
|||
<el-button |
|||
type="primary" |
|||
slot="append" |
|||
icon="el-icon-search" |
|||
size="small" |
|||
@click="handleQuery" |
|||
></el-button> |
|||
</el-input> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<el-row :gutter="10" class="mb8"> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="primary" |
|||
icon="el-icon-plus" |
|||
size="mini" |
|||
@click="handleAdd" |
|||
v-hasPermi="['message:draft:add']" |
|||
>新增</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="success" |
|||
icon="el-icon-edit" |
|||
size="mini" |
|||
:disabled="single" |
|||
@click="handleUpdate" |
|||
v-hasPermi="['message:draft:edit']" |
|||
>修改</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="danger" |
|||
icon="el-icon-delete" |
|||
size="mini" |
|||
:disabled="multiple" |
|||
@click="handleDelete" |
|||
v-hasPermi="['message:draft:remove']" |
|||
>删除</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="warning" |
|||
icon="el-icon-download" |
|||
size="mini" |
|||
@click="handleExport" |
|||
v-hasPermi="['message:draft:export']" |
|||
>导出</el-button> |
|||
</el-col> |
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table v-loading="loading" :data="draftList" @selection-change="handleSelectionChange"> |
|||
<el-table-column type="selection" width="55" align="center" fixed/> |
|||
<el-table-column label="序号" type="index" width="50" align="center" fixed/> |
|||
|
|||
<el-table-column label="模板标题" align="center" prop="title" min-width="120"/> |
|||
<el-table-column label="内容" align="center" prop="context" min-width="120"/> |
|||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right"> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-edit" |
|||
@click="handleUpdate(scope.row)" |
|||
v-hasPermi="['message:draft:edit']" |
|||
>修改</el-button> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['message:draft:remove']" |
|||
>删除</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<pagination |
|||
v-show="total>0" |
|||
:total="total" |
|||
:page.sync="queryParams.pageNum" |
|||
:limit.sync="queryParams.pageSize" |
|||
@pagination="getList" |
|||
/> |
|||
|
|||
<!-- 添加或修改推送消息草稿对话框 --> |
|||
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body :close-on-click-modal="false"> |
|||
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
|||
<el-form-item label="模板标题" prop="title"> |
|||
<el-input v-model="form.title" placeholder="请输入模板标题" /> |
|||
</el-form-item> |
|||
<el-form-item label="内容" prop="context"> |
|||
<el-input v-model="form.context" placeholder="请输入内容" /> |
|||
</el-form-item> |
|||
<el-form-item label="人员id集合" prop="personIds"> |
|||
<el-input v-model="form.personIds" placeholder="请输入人员id集合" /> |
|||
</el-form-item> |
|||
<el-form-item label="创建人" prop="createUid"> |
|||
<el-input v-model="form.createUid" placeholder="请输入创建人" /> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="submitForm">确 定</el-button> |
|||
<el-button @click="cancel">取 消</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { listDraft, getDraft, delDraft, addDraft, updateDraft, exportDraft } from "@/api/message/draft"; |
|||
|
|||
export default { |
|||
name: "Draft", |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 推送消息草稿表格数据 |
|||
draftList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids:null, |
|||
data:{ |
|||
title: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
} |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
}, |
|||
methods: { |
|||
/** 查询推送消息草稿列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
listDraft(this.queryParams).then(response => { |
|||
this.draftList = response.records; |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false; |
|||
this.reset(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.form = { |
|||
id: null, |
|||
title: null, |
|||
context: null, |
|||
personIds: null, |
|||
createUid: null, |
|||
createTime: null, |
|||
updateUid: null, |
|||
updateTime: null, |
|||
remark: null |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data:{ |
|||
id: null, |
|||
title: null, |
|||
context: null, |
|||
personIds: null, |
|||
createUid: null, |
|||
createTime: null, |
|||
updateUid: null, |
|||
updateTime: null, |
|||
remark: null |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
/** 搜索按钮操作 */ |
|||
handleQuery() { |
|||
this.queryParams.pageNum = 1; |
|||
this.getList(); |
|||
}, |
|||
/** 重置按钮操作 */ |
|||
resetQuery() { |
|||
this.resetQueryForm(); |
|||
this.handleQuery(); |
|||
}, |
|||
// 多选框选中数据 |
|||
handleSelectionChange(selection) { |
|||
this.ids = selection.map(item => item.id) |
|||
this.single = selection.length!==1 |
|||
this.multiple = !selection.length |
|||
}, |
|||
/** 新增按钮操作 */ |
|||
handleAdd() { |
|||
this.reset(); |
|||
this.open = true; |
|||
this.title = "添加推送消息草稿"; |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset(); |
|||
const id = row.id || this.ids |
|||
getDraft(id).then(response => { |
|||
this.form = response.data; |
|||
this.open = true; |
|||
this.title = "修改推送消息草稿"; |
|||
}); |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate(valid => { |
|||
if (valid) { |
|||
if (this.form.id != null) { |
|||
updateDraft(this.form).then(response => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
addDraft(this.form).then(response => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("新增成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
/** 删除按钮操作 */ |
|||
handleDelete(row) { |
|||
const ids = row.id || this.ids; |
|||
if(ids){ |
|||
this.$confirm("是否删除选中的数据?", "警告", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning" |
|||
}).then(function() { |
|||
return delDraft(ids); |
|||
}).then(() => { |
|||
this.getList(); |
|||
this.msgSuccess("删除成功"); |
|||
}).catch(function() {}); |
|||
}else{ |
|||
this.$message.warning("请选择要删除的数据!!"); |
|||
} |
|||
|
|||
}, |
|||
/** 导出按钮操作 */ |
|||
handleExport() { |
|||
const queryParams = this.queryParams; |
|||
let message = "是否确认导出所有的数据项?"; |
|||
if(this.ids){ |
|||
message = "是否确认导出选中的数据项?"; |
|||
queryParams.ids = this.ids; |
|||
} |
|||
this.$confirm(message, "警告", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning" |
|||
}).then(function() { |
|||
return exportDraft(queryParams); |
|||
}).then(response => { |
|||
this.downloadFile(response, true, response.msg); |
|||
// this.download(response.msg); |
|||
}).catch(function() {}); |
|||
} |
|||
} |
|||
}; |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
@import "@/assets/css/dialog.scss"; |
|||
//::v-deep { |
|||
// .el-dialog { |
|||
// margin-top: 10vh !important; |
|||
// } |
|||
//} |
|||
</style> |
@ -0,0 +1,366 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"> |
|||
<el-form-item label="标题" prop="title"> |
|||
<el-input |
|||
v-model="queryParams.data.title" |
|||
placeholder="请输入标题" |
|||
clearable |
|||
size="small" |
|||
@keyup.enter.native="handleQuery" |
|||
> |
|||
<el-button |
|||
type="primary" |
|||
slot="append" |
|||
icon="el-icon-search" |
|||
size="small" |
|||
@click="handleQuery" |
|||
></el-button> |
|||
</el-input> |
|||
</el-form-item> |
|||
<el-form-item label="发送人" prop="createUid"> |
|||
<el-input |
|||
v-model="queryParams.data.createUid" |
|||
placeholder="请输入发送人" |
|||
clearable |
|||
size="small" |
|||
@keyup.enter.native="handleQuery" |
|||
> |
|||
<el-button |
|||
type="primary" |
|||
slot="append" |
|||
icon="el-icon-search" |
|||
size="small" |
|||
@click="handleQuery" |
|||
></el-button> |
|||
</el-input> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<el-row :gutter="10" class="mb8"> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="primary" |
|||
icon="el-icon-plus" |
|||
size="mini" |
|||
@click="handleAdd" |
|||
v-hasPermi="['message:records:add']" |
|||
>新增</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="success" |
|||
icon="el-icon-edit" |
|||
size="mini" |
|||
:disabled="single" |
|||
@click="handleUpdate" |
|||
v-hasPermi="['message:records:edit']" |
|||
>修改</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="danger" |
|||
icon="el-icon-delete" |
|||
size="mini" |
|||
:disabled="multiple" |
|||
@click="handleDelete" |
|||
v-hasPermi="['message:records:remove']" |
|||
>删除</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="warning" |
|||
icon="el-icon-download" |
|||
size="mini" |
|||
@click="handleExport" |
|||
v-hasPermi="['message:records:export']" |
|||
>导出</el-button> |
|||
</el-col> |
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table v-loading="loading" :data="recordsList" @selection-change="handleSelectionChange"> |
|||
<el-table-column type="selection" width="55" align="center" fixed/> |
|||
<el-table-column label="序号" type="index" width="50" align="center" fixed/> |
|||
|
|||
<el-table-column label="标题" align="center" prop="title" min-width="120"/> |
|||
<el-table-column label="内容" align="center" prop="context" min-width="120"/> |
|||
<el-table-column label="接收人" align="center" prop="personId" min-width="120"/> |
|||
<el-table-column label="状态" align="center" prop="messageStatus" min-width="120"/> |
|||
<el-table-column label="发送人" align="center" prop="createUid" min-width="120"/> |
|||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right"> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-edit" |
|||
@click="handleUpdate(scope.row)" |
|||
v-hasPermi="['message:records:edit']" |
|||
>修改</el-button> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['message:records:remove']" |
|||
>删除</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<pagination |
|||
v-show="total>0" |
|||
:total="total" |
|||
:page.sync="queryParams.pageNum" |
|||
:limit.sync="queryParams.pageSize" |
|||
@pagination="getList" |
|||
/> |
|||
|
|||
<!-- 添加或修改推送消息编制对话框 --> |
|||
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body :close-on-click-modal="false"> |
|||
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
|||
<el-form-item label="标题" prop="title"> |
|||
<el-input v-model="form.title" placeholder="请输入标题" /> |
|||
</el-form-item> |
|||
<el-form-item label="内容" prop="context"> |
|||
<el-input v-model="form.context" placeholder="请输入内容" /> |
|||
</el-form-item> |
|||
<el-form-item label="接收人" prop="personId"> |
|||
<el-input v-model="form.personId" placeholder="请输入接收人" /> |
|||
</el-form-item> |
|||
<el-form-item label="状态"> |
|||
<el-radio-group v-model="form.messageStatus"> |
|||
<el-radio label="1">请选择字典生成</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
<el-form-item label="发送人" prop="createUid"> |
|||
<el-input v-model="form.createUid" placeholder="请输入发送人" /> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="submitForm">确 定</el-button> |
|||
<el-button @click="cancel">取 消</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { listRecords, getRecords, delRecords, addRecords, updateRecords, exportRecords } from "@/api/message/records"; |
|||
|
|||
export default { |
|||
name: "Records", |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 推送消息编制表格数据 |
|||
recordsList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids:null, |
|||
data:{ |
|||
title: null, |
|||
createUid: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
} |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
}, |
|||
methods: { |
|||
/** 查询推送消息编制列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
listRecords(this.queryParams).then(response => { |
|||
this.recordsList = response.records; |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false; |
|||
this.reset(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.form = { |
|||
id: null, |
|||
title: null, |
|||
context: null, |
|||
personId: null, |
|||
messageStatus: 0, |
|||
createUid: null, |
|||
createTime: null, |
|||
updateUid: null, |
|||
updateTime: null, |
|||
remark: null |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data:{ |
|||
id: null, |
|||
title: null, |
|||
context: null, |
|||
personId: null, |
|||
messageStatus: 0, |
|||
createUid: null, |
|||
createTime: null, |
|||
updateUid: null, |
|||
updateTime: null, |
|||
remark: null |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
/** 搜索按钮操作 */ |
|||
handleQuery() { |
|||
this.queryParams.pageNum = 1; |
|||
this.getList(); |
|||
}, |
|||
/** 重置按钮操作 */ |
|||
resetQuery() { |
|||
this.resetQueryForm(); |
|||
this.handleQuery(); |
|||
}, |
|||
// 多选框选中数据 |
|||
handleSelectionChange(selection) { |
|||
this.ids = selection.map(item => item.id) |
|||
this.single = selection.length!==1 |
|||
this.multiple = !selection.length |
|||
}, |
|||
/** 新增按钮操作 */ |
|||
handleAdd() { |
|||
this.reset(); |
|||
this.open = true; |
|||
this.title = "添加推送消息编制"; |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset(); |
|||
const id = row.id || this.ids |
|||
getRecords(id).then(response => { |
|||
this.form = response.data; |
|||
this.open = true; |
|||
this.title = "修改推送消息编制"; |
|||
}); |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate(valid => { |
|||
if (valid) { |
|||
if (this.form.id != null) { |
|||
updateRecords(this.form).then(response => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
addRecords(this.form).then(response => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("新增成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
/** 删除按钮操作 */ |
|||
handleDelete(row) { |
|||
const ids = row.id || this.ids; |
|||
if(ids){ |
|||
this.$confirm("是否删除选中的数据?", "警告", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning" |
|||
}).then(function() { |
|||
return delRecords(ids); |
|||
}).then(() => { |
|||
this.getList(); |
|||
this.msgSuccess("删除成功"); |
|||
}).catch(function() {}); |
|||
}else{ |
|||
this.$message.warning("请选择要删除的数据!!"); |
|||
} |
|||
|
|||
}, |
|||
/** 导出按钮操作 */ |
|||
handleExport() { |
|||
const queryParams = this.queryParams; |
|||
let message = "是否确认导出所有的数据项?"; |
|||
if(this.ids){ |
|||
message = "是否确认导出选中的数据项?"; |
|||
queryParams.ids = this.ids; |
|||
} |
|||
this.$confirm(message, "警告", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning" |
|||
}).then(function() { |
|||
return exportRecords(queryParams); |
|||
}).then(response => { |
|||
this.downloadFile(response, true, response.msg); |
|||
// this.download(response.msg); |
|||
}).catch(function() {}); |
|||
} |
|||
} |
|||
}; |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
@import "@/assets/css/dialog.scss"; |
|||
//::v-deep { |
|||
// .el-dialog { |
|||
// margin-top: 10vh !important; |
|||
// } |
|||
//} |
|||
</style> |
@ -0,0 +1,507 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"> |
|||
<el-form-item label="模板标题" prop="title"> |
|||
<el-input |
|||
v-model="queryParams.data.title" |
|||
placeholder="请输入模板标题" |
|||
clearable |
|||
size="small" |
|||
@keyup.enter.native="handleQuery" |
|||
> |
|||
<el-button |
|||
type="primary" |
|||
slot="append" |
|||
icon="el-icon-search" |
|||
size="small" |
|||
@click="handleQuery" |
|||
></el-button> |
|||
</el-input> |
|||
</el-form-item> |
|||
<el-form-item label="接收人" prop="personIds"> |
|||
<el-input |
|||
v-model="queryParams.data.personIds" |
|||
placeholder="请输入接收人" |
|||
clearable |
|||
size="small" |
|||
@keyup.enter.native="handleQuery" |
|||
> |
|||
<el-button |
|||
type="primary" |
|||
slot="append" |
|||
icon="el-icon-search" |
|||
size="small" |
|||
@click="handleQuery" |
|||
></el-button> |
|||
</el-input> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<el-row :gutter="10" class="mb8"> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="primary" |
|||
icon="el-icon-plus" |
|||
size="mini" |
|||
@click="handleAdd" |
|||
v-hasPermi="['message:send:add']" |
|||
>发送消息</el-button> |
|||
</el-col> |
|||
|
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="danger" |
|||
icon="el-icon-delete" |
|||
size="mini" |
|||
:disabled="multiple" |
|||
@click="handleDelete" |
|||
v-hasPermi="['message:send:remove']" |
|||
>删除</el-button> |
|||
</el-col> |
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table v-loading="loading" :data="sendList" @selection-change="handleSelectionChange"> |
|||
<el-table-column type="selection" width="55" align="center" fixed/> |
|||
<el-table-column label="序号" type="index" width="50" align="center" fixed/> |
|||
|
|||
<el-table-column label="标题" align="center" prop="title" min-width="120"/> |
|||
<el-table-column label="内容" align="center" prop="context" min-width="120"/> |
|||
<el-table-column label="创建人" align="center" prop="createUid" min-width="120"/> |
|||
<el-table-column label="发送人" align="center" prop="personIds" min-width="120"> |
|||
<template slot-scope="scope"> |
|||
<div> |
|||
<!-- 使用 v-for 循环解析后的数组,并在最后一个 ID 之前加逗号 --> |
|||
<span v-for="(id, index) in JSON.parse(scope.row.personIds)" :key="index"> |
|||
{{ id }} |
|||
<span v-if="index !== JSON.parse(scope.row.personIds).length - 1">, </span> |
|||
</span> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right"> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-edit" |
|||
@click="handleUpdate(scope.row)" |
|||
v-hasPermi="['message:send:edit']" |
|||
>修改</el-button> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['message:send:remove']" |
|||
>删除</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<pagination |
|||
v-show="total>0" |
|||
:total="total" |
|||
:page.sync="queryParams.pageNum" |
|||
:limit.sync="queryParams.pageSize" |
|||
@pagination="getList" |
|||
/> |
|||
|
|||
<!-- 添加或修改推送消息编制对话框 --> |
|||
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body :close-on-click-modal="false"> |
|||
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
|||
<el-form-item label="消息模板" prop="title"> |
|||
<el-button @click="openTemplate">模板选择</el-button> |
|||
</el-form-item> |
|||
<el-form-item label="标题" prop="title"> |
|||
<el-input v-model="form.title" placeholder="无" /> |
|||
</el-form-item> |
|||
<el-form-item label="内容" prop="context"> |
|||
<el-input v-model="form.context" placeholder="无" :disabled="true" type="textarea" |
|||
:rows="4"/> |
|||
</el-form-item> |
|||
<el-form-item label="接收人" prop="personIds"> |
|||
<el-tag |
|||
style="margin-right: 5px" |
|||
:key="tag + index" |
|||
v-for="(tag, index) in personIds" |
|||
closable |
|||
:disable-transitions="false" |
|||
@close="handleClose1(tag)" |
|||
> |
|||
{{ tag }} |
|||
</el-tag> |
|||
</el-form-item> |
|||
<el-form-item label="动态内容"> |
|||
<div v-for="(item, index) in dynamicContent" :key="index" class="dynamic-item"> |
|||
<span class="identifier">{{ item.identifier }}</span> |
|||
<el-input v-model="item.value" placeholder="请输入内容" /> |
|||
</div> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="submitForm">确 定</el-button> |
|||
<el-button @click="cancel">取 消</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
|
|||
<el-dialog title="模板选择" :visible.sync="templateOpen" width="800px" append-to-body :close-on-click-modal="false"> |
|||
<el-table v-loading="templateLoading" :data="templateList" > |
|||
<el-table-column label="序号" type="index" width="50" align="center" fixed/> |
|||
<el-table-column label="模板标题" align="center" prop="title" min-width="120"/> |
|||
<el-table-column label="模板内容" align="center" prop="context" min-width="120"/> |
|||
<el-table-column label="发送人" align="center" prop="createUid" min-width="120"/> |
|||
<el-table-column label="接收人" align="center" prop="personIds" min-width="120"> |
|||
<template slot-scope="scope"> |
|||
<div> |
|||
<!-- 使用 v-for 循环解析后的数组,并在最后一个 ID 之前加逗号 --> |
|||
<span v-for="(id, index) in JSON.parse(scope.row.personIds)" :key="index"> |
|||
{{ id }} |
|||
<span v-if="index !== JSON.parse(scope.row.personIds).length - 1">, </span> |
|||
</span> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right"> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-edit" |
|||
@click="handleSelect(scope.row)" |
|||
>选择</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<pagination |
|||
v-show="templateTotal>0" |
|||
:total="templateTotal" |
|||
:page.sync="templateQueryParams.pageNum" |
|||
:limit.sync="templateQueryParams.pageSize" |
|||
@pagination="getTemplateList" |
|||
/> |
|||
</el-dialog> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { listSend, getSend, delSend, addSend, updateSend, exportSend } from "@/api/message/send"; |
|||
import { listTemplate, getTemplate, delTemplate, addTemplate, updateTemplate, exportTemplate } from "@/api/message/template"; |
|||
import Template from "../template/index.vue"; |
|||
import Div from "../../../build/div/index.vue"; |
|||
|
|||
export default { |
|||
name: "Send", |
|||
components: {Div, Template}, |
|||
data() { |
|||
return { |
|||
templateLoading:false, |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
templateOpen:false, |
|||
// 非单个禁用 |
|||
single: true, |
|||
templateList: [], |
|||
templateTotal:0, |
|||
personIds:[], |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
dynamicContent: [], |
|||
// 总条数 |
|||
total: 0, |
|||
templateQueryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids:null, |
|||
data:{ |
|||
title: null, |
|||
createUid: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 推送消息编制表格数据 |
|||
sendList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids:null, |
|||
data:{ |
|||
title: null, |
|||
personIds: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
} |
|||
}; |
|||
}, |
|||
watch: { |
|||
'form.context': { |
|||
handler(newVal) { |
|||
this.parseContext(newVal); // 每当 context 变化时,解析标识符 |
|||
}, |
|||
immediate: true, // 初始化时立即解析 |
|||
}, |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
}, |
|||
methods: { |
|||
handleClose1(tag){ |
|||
this.names.splice(this.names.indexOf(tag), 1); |
|||
this.personIds.splice(this.personIds.indexOf(tag), 1); |
|||
this.form.personIds = this.personIds.length |
|||
? JSON.stringify(this.personIds) |
|||
: null; |
|||
}, |
|||
parseContext(context) { |
|||
const regex = /\${(\w+)}/g; // 匹配 ${identifier} 的正则表达式 |
|||
const identifiers = []; // 存储解析出的标识符 |
|||
let match; |
|||
while ((match = regex.exec(context))) { |
|||
const identifier = match[1]; |
|||
// 检查是否已经存在相同的标识符,避免重复 |
|||
const existing = identifiers.find((item) => item.identifier === identifier); |
|||
if (!existing) { |
|||
identifiers.push({ identifier, value: '' }); // 将标识符添加到列表中 |
|||
} |
|||
} |
|||
this.dynamicContent = identifiers; // 更新动态内容 |
|||
}, |
|||
handleSelect(row){ |
|||
this.personIds=JSON.parse(row.personIds) |
|||
this.form=row |
|||
this.templateOpen=false |
|||
}, |
|||
openTemplate(){ |
|||
this.getTemplateList() |
|||
this.templateOpen=true |
|||
|
|||
}, |
|||
/** 查询推送消息编制列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
listSend(this.queryParams).then(response => { |
|||
this.sendList = response.records; |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
getTemplateList() { |
|||
this.templateLoading = true; |
|||
listTemplate(this.templateQueryParams).then(response => { |
|||
this.templateList = response.records; |
|||
this.templateTotal = response.total; |
|||
this.templateLoading = false; |
|||
}); |
|||
}, |
|||
handleSelectionChange(selection) { |
|||
this.ids = selection.map(item => item.id) |
|||
this.single = selection.length!==1 |
|||
this.multiple = !selection.length |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.personIds=[] |
|||
this.open = false; |
|||
this.reset(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.form = { |
|||
id: null, |
|||
title: null, |
|||
context: null, |
|||
personIds: null, |
|||
createUid: null, |
|||
createTime: null, |
|||
updateUid: null, |
|||
updateTime: null, |
|||
remark: null |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data:{ |
|||
id: null, |
|||
title: null, |
|||
context: null, |
|||
personIds: null, |
|||
createUid: null, |
|||
createTime: null, |
|||
updateUid: null, |
|||
updateTime: null, |
|||
remark: null |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
/** 搜索按钮操作 */ |
|||
handleQuery() { |
|||
this.queryParams.pageNum = 1; |
|||
this.getList(); |
|||
}, |
|||
/** 重置按钮操作 */ |
|||
resetQuery() { |
|||
this.resetQueryForm(); |
|||
this.handleQuery(); |
|||
}, |
|||
// 多选框选中数据 |
|||
|
|||
/** 新增按钮操作 */ |
|||
handleAdd() { |
|||
this.reset(); |
|||
this.open = true; |
|||
this.title = "消息编制"; |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset(); |
|||
const id = row.id || this.ids |
|||
getSend(id).then(response => { |
|||
this.form = response.data; |
|||
this.open = true; |
|||
this.title = "修改推送消息编制"; |
|||
}); |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate(valid => { |
|||
if (valid) { |
|||
this.form.context= this.form.context.replace(/\${(\w+)}/g, (match, p1) => { |
|||
const found = this.dynamicContent.find((item) => item.identifier === p1); |
|||
return found ? found.value : match; // 替换标识符为输入的内容 |
|||
}); |
|||
this.form.id=null |
|||
console.log( this.form.context) |
|||
if (this.form.id != null) { |
|||
updateSend(this.form).then(response => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
addSend(this.form).then(response => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("新增成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
/** 删除按钮操作 */ |
|||
handleDelete(row) { |
|||
const ids = row.id || this.ids; |
|||
if(ids){ |
|||
this.$confirm("是否删除选中的数据?", "警告", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning" |
|||
}).then(function() { |
|||
return delSend(ids); |
|||
}).then(() => { |
|||
this.getList(); |
|||
this.msgSuccess("删除成功"); |
|||
}).catch(function() {}); |
|||
}else{ |
|||
this.$message.warning("请选择要删除的数据!!"); |
|||
} |
|||
|
|||
}, |
|||
/** 导出按钮操作 */ |
|||
handleExport() { |
|||
const queryParams = this.queryParams; |
|||
let message = "是否确认导出所有的数据项?"; |
|||
if(this.ids){ |
|||
message = "是否确认导出选中的数据项?"; |
|||
queryParams.ids = this.ids; |
|||
} |
|||
this.$confirm(message, "警告", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning" |
|||
}).then(function() { |
|||
return exportSend(queryParams); |
|||
}).then(response => { |
|||
this.downloadFile(response, true, response.msg); |
|||
// this.download(response.msg); |
|||
}).catch(function() {}); |
|||
} |
|||
} |
|||
}; |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
@import "@/assets/css/dialog.scss"; |
|||
//::v-deep { |
|||
// .el-dialog { |
|||
// margin-top: 10vh !important; |
|||
// } |
|||
//} |
|||
.dynamic-content-container { |
|||
border: 1px solid #ebeef5; |
|||
border-radius: 4px; |
|||
padding: 10px; |
|||
} |
|||
|
|||
.dynamic-item { |
|||
display: flex; |
|||
align-items: center; |
|||
margin-bottom: 10px; |
|||
} |
|||
|
|||
.identifier { |
|||
margin-right: 10px; |
|||
font-weight: bold; |
|||
text-align: left; |
|||
} |
|||
|
|||
.el-input { |
|||
flex: 1; |
|||
} |
|||
</style> |
@ -0,0 +1,553 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"> |
|||
<el-form-item label="模板标题" prop="title"> |
|||
<el-input |
|||
v-model="queryParams.data.title" |
|||
placeholder="请输入模板标题" |
|||
clearable |
|||
size="small" |
|||
@keyup.enter.native="handleQuery" |
|||
> |
|||
<el-button |
|||
type="primary" |
|||
slot="append" |
|||
icon="el-icon-search" |
|||
size="small" |
|||
@click="handleQuery" |
|||
></el-button> |
|||
</el-input> |
|||
</el-form-item> |
|||
<el-form-item label="创建人" prop="createUid"> |
|||
<el-input |
|||
v-model="queryParams.data.createUid" |
|||
placeholder="请输入创建人" |
|||
clearable |
|||
size="small" |
|||
@keyup.enter.native="handleQuery" |
|||
> |
|||
<el-button |
|||
type="primary" |
|||
slot="append" |
|||
icon="el-icon-search" |
|||
size="small" |
|||
@click="handleQuery" |
|||
></el-button> |
|||
</el-input> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<el-row :gutter="10" class="mb8"> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="primary" |
|||
icon="el-icon-plus" |
|||
size="mini" |
|||
@click="handleAdd" |
|||
v-hasPermi="['message:template:add']" |
|||
>新增</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="success" |
|||
icon="el-icon-edit" |
|||
size="mini" |
|||
:disabled="single" |
|||
@click="handleUpdate" |
|||
v-hasPermi="['message:template:edit']" |
|||
>修改</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="danger" |
|||
icon="el-icon-delete" |
|||
size="mini" |
|||
:disabled="multiple" |
|||
@click="handleDelete" |
|||
v-hasPermi="['message:template:remove']" |
|||
>删除</el-button> |
|||
</el-col> |
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table v-loading="loading" :data="templateList" @selection-change="handleSelectionChange"> |
|||
<el-table-column type="selection" width="55" align="center" fixed/> |
|||
<el-table-column label="序号" type="index" width="50" align="center" fixed/> |
|||
|
|||
<el-table-column label="模板标题" align="center" prop="title" min-width="120"/> |
|||
<el-table-column label="模板内容" align="center" prop="context" min-width="120"/> |
|||
<el-table-column label="创建人" align="center" prop="createUid" min-width="120"/> |
|||
<el-table-column label="发送人" align="center" prop="personIds" min-width="120"> |
|||
<template slot-scope="scope"> |
|||
<div> |
|||
<!-- 使用 v-for 循环解析后的数组,并在最后一个 ID 之前加逗号 --> |
|||
<span v-for="(id, index) in JSON.parse(scope.row.personIds)" :key="index"> |
|||
{{ id }} |
|||
<span v-if="index !== JSON.parse(scope.row.personIds).length - 1">, </span> |
|||
</span> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right"> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-edit" |
|||
@click="handleUpdate(scope.row)" |
|||
v-hasPermi="['message:template:edit']" |
|||
>修改</el-button> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['message:template:remove']" |
|||
>删除</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<pagination |
|||
v-show="total>0" |
|||
:total="total" |
|||
:page.sync="queryParams.pageNum" |
|||
:limit.sync="queryParams.pageSize" |
|||
@pagination="getList" |
|||
/> |
|||
|
|||
<!-- 添加或修改推送消息模板管理对话框 --> |
|||
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body :close-on-click-modal="false"> |
|||
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
|||
<el-form-item label="模板标题" prop="title"> |
|||
<el-input v-model="form.title" placeholder="请输入模板标题" /> |
|||
</el-form-item> |
|||
<el-form-item label="模板内容" prop="context"> |
|||
<el-input v-model="form.context" placeholder="示例:你的代办事件为${incident}" type="textarea" |
|||
:rows="4"/> |
|||
</el-form-item> |
|||
<div class="dgm-form-explain">变量使用$ {变量名}表示,变量名仅支持字母和阿拉伯数字</div> |
|||
<el-form-item label="发送人员" prop="personIds"> |
|||
<el-button @click="openSelect">选择</el-button> |
|||
</el-form-item> |
|||
<el-tag |
|||
style="margin-right: 5px" |
|||
:key="tag + index" |
|||
v-for="(tag, index) in personIds" |
|||
closable |
|||
:disable-transitions="false" |
|||
@close="handleClose1(tag)" |
|||
> |
|||
{{ tag }} |
|||
</el-tag> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="submitForm">确 定</el-button> |
|||
<el-button @click="cancel">取 消</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
<el-dialog title="选择发送人员" :visible.sync="personSelect" width="800px" append-to-body :close-on-click-modal="false"> |
|||
<el-form |
|||
:model="userQueryParams" |
|||
ref="queryForm" |
|||
:inline="true" |
|||
v-show="showSearch" |
|||
label-width="80px" |
|||
> |
|||
<el-form-item label="登录名称" prop="userName"> |
|||
<el-input |
|||
v-model="userQueryParams.cv.value" |
|||
placeholder="请输入登录名称" |
|||
clearable |
|||
size="small" |
|||
style="width: 240px" |
|||
@keyup.enter.native="userHandleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button |
|||
type="cyan" |
|||
icon="el-icon-search" |
|||
size="mini" |
|||
@click="userHandleQuery" |
|||
>搜索</el-button |
|||
> |
|||
<el-button icon="el-icon-refresh" size="mini" @click="userResetQuery" |
|||
>重置</el-button |
|||
> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table |
|||
v-loading="loading" |
|||
:data="userList" |
|||
@selection-change="handlePersonSelectionChange" |
|||
> |
|||
<el-table-column type="selection" width="50" align="center" /> |
|||
<el-table-column label="序号" align="center" type="index" /> |
|||
<el-table-column |
|||
label="登录名" |
|||
align="center" |
|||
prop="userName" |
|||
:show-overflow-tooltip="true" |
|||
/> |
|||
<el-table-column |
|||
label="用户昵称" |
|||
align="center" |
|||
prop="nickName" |
|||
:show-overflow-tooltip="true" |
|||
/> |
|||
|
|||
<el-table-column |
|||
label="创建时间" |
|||
align="center" |
|||
prop="createTime" |
|||
width="180" |
|||
> |
|||
</el-table-column> |
|||
</el-table> |
|||
<pagination |
|||
v-show="userTotal > 0" |
|||
:total="userTotal" |
|||
:page.sync="userQueryParams.pageNum" |
|||
:limit.sync="userQueryParams.pageSize" |
|||
@pagination="getUserList" |
|||
/> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="userSubmitForm">确 定</el-button> |
|||
<el-button @click="cancel">取 消</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { listTemplate, getTemplate, delTemplate, addTemplate, updateTemplate, exportTemplate } from "@/api/message/template"; |
|||
import { |
|||
listUser |
|||
} |
|||
from "@/api/system/user"; |
|||
import Div from "../../../build/div/index.vue"; |
|||
export default { |
|||
name: "Template", |
|||
components: {Div}, |
|||
data() { |
|||
return { |
|||
personSelect:false, |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
names:[], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
userTotal:0, |
|||
personSingle:true, |
|||
personMultiple:true, |
|||
userLoading:false, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
userQueryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data: { |
|||
status: undefined, |
|||
phonenumber: undefined, |
|||
isPcUser: undefined, |
|||
timeView: { |
|||
beginTime: null, |
|||
endTime: null, |
|||
timeField: "create_time", |
|||
}, |
|||
}, |
|||
cv: { |
|||
name: "userName", |
|||
value: null, |
|||
type: "like", |
|||
}, |
|||
userName: undefined, |
|||
|
|||
deptId: undefined, |
|||
ids: null, |
|||
}, |
|||
// 总条数 |
|||
total: 0, |
|||
userList: null, |
|||
personIds:[], |
|||
// 推送消息模板管理表格数据 |
|||
templateList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids:null, |
|||
data:{ |
|||
title: null, |
|||
createUid: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
} |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
}, |
|||
methods: { |
|||
handleClose1(tag){ |
|||
this.names.splice(this.names.indexOf(tag), 1); |
|||
this.personIds.splice(this.personIds.indexOf(tag), 1); |
|||
this.form.personIds = this.personIds.length |
|||
? JSON.stringify(this.personIds) |
|||
: null; |
|||
}, |
|||
getUserList(){ |
|||
this.userLoading = true; |
|||
listUser(this.userQueryParams).then((response) => { |
|||
this.userList = response.records; |
|||
this.userTotal = response.total; |
|||
this.userLoading = false; |
|||
}); |
|||
}, |
|||
openSelect(){ |
|||
this.getUserList() |
|||
this.personSelect=true; |
|||
}, |
|||
/** 查询推送消息模板管理列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
listTemplate(this.queryParams).then(response => { |
|||
this.templateList = response.records; |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.personSelect = false; |
|||
this.userResetQuery(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.form = { |
|||
id: null, |
|||
title: null, |
|||
context: null, |
|||
personIds: null, |
|||
createUid: null, |
|||
createTime: null, |
|||
updateUid: null, |
|||
updateTime: null, |
|||
remark: null |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data:{ |
|||
id: null, |
|||
title: null, |
|||
context: null, |
|||
personIds: null, |
|||
createUid: null, |
|||
createTime: null, |
|||
updateUid: null, |
|||
updateTime: null, |
|||
remark: null |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
/** 搜索按钮操作 */ |
|||
handleQuery() { |
|||
this.queryParams.pageNum = 1; |
|||
this.getList(); |
|||
}, |
|||
userHandleQuery() { |
|||
this.userQueryParams.pageNum = 1; |
|||
this.getUserList(); |
|||
}, |
|||
/** 重置按钮操作 */ |
|||
resetQuery() { |
|||
this.resetQueryForm(); |
|||
this.handleQuery(); |
|||
}, |
|||
userResetQuery() { |
|||
this.userResetQueryForm(); |
|||
this.userHandleQuery(); |
|||
}, |
|||
userResetQueryForm(){ |
|||
this.userQueryParams={ |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data: { |
|||
status: undefined, |
|||
phonenumber: undefined, |
|||
isPcUser: undefined, |
|||
timeView: { |
|||
beginTime: null, |
|||
endTime: null, |
|||
timeField: "create_time", |
|||
}, |
|||
}, |
|||
cv: { |
|||
name: "userName", |
|||
value: null, |
|||
type: "like", |
|||
}, |
|||
userName: undefined, |
|||
|
|||
deptId: undefined, |
|||
ids: null, |
|||
} |
|||
}, |
|||
// 多选框选中数据 |
|||
handleSelectionChange(selection) { |
|||
this.ids = selection.map(item => item.id) |
|||
this.single = selection.length!==1 |
|||
this.multiple = !selection.length |
|||
}, |
|||
handlePersonSelectionChange(selection) { |
|||
this.personIds = selection.map(item => item.id) |
|||
this.names=selection.map(item=>item.nickName) |
|||
this.personSingle = selection.length!==1 |
|||
this.personMultiple = !selection.length |
|||
}, |
|||
/** 新增按钮操作 */ |
|||
handleAdd() { |
|||
this.reset(); |
|||
this.open = true; |
|||
this.title = "添加推送消息模板管理"; |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset(); |
|||
const id = row.id || this.ids |
|||
getTemplate(id).then(response => { |
|||
this.form = response.data; |
|||
this.open = true; |
|||
this.personIds=JSON.parse(response.data.personIds) |
|||
this.title = "修改推送消息模板管理"; |
|||
}); |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate(valid => { |
|||
if (valid) { |
|||
this.form.personIds = this.personIds.length |
|||
? JSON.stringify(this.personIds) |
|||
: null; |
|||
if (this.form.id != null) { |
|||
updateTemplate(this.form).then(response => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
addTemplate(this.form).then(response => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("新增成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
userSubmitForm(){ |
|||
console.log(this.names) |
|||
console.log(this.personIds) |
|||
this.personSelect=false |
|||
}, |
|||
/** 删除按钮操作 */ |
|||
handleDelete(row) { |
|||
const ids = row.id || this.ids; |
|||
if(ids){ |
|||
this.$confirm("是否删除选中的数据?", "警告", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning" |
|||
}).then(function() { |
|||
return delTemplate(ids); |
|||
}).then(() => { |
|||
this.getList(); |
|||
this.msgSuccess("删除成功"); |
|||
}).catch(function() {}); |
|||
}else{ |
|||
this.$message.warning("请选择要删除的数据!!"); |
|||
} |
|||
|
|||
}, |
|||
/** 导出按钮操作 */ |
|||
handleExport() { |
|||
const queryParams = this.queryParams; |
|||
let message = "是否确认导出所有的数据项?"; |
|||
if(this.ids){ |
|||
message = "是否确认导出选中的数据项?"; |
|||
queryParams.ids = this.ids; |
|||
} |
|||
this.$confirm(message, "警告", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning" |
|||
}).then(function() { |
|||
return exportTemplate(queryParams); |
|||
}).then(response => { |
|||
this.downloadFile(response, true, response.msg); |
|||
// this.download(response.msg); |
|||
}).catch(function() {}); |
|||
} |
|||
} |
|||
}; |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
@import "@/assets/css/dialog.scss"; |
|||
//::v-deep { |
|||
// .el-dialog { |
|||
// margin-top: 10vh !important; |
|||
// } |
|||
//} |
|||
.dgm-form-explain{ |
|||
clear: both; |
|||
min-height: 22px; |
|||
margin-top: -10px; |
|||
margin-left: 80px; |
|||
color: rgba(0, 0, 0, .45); |
|||
font-size: 14px; |
|||
line-height: 1.5; |
|||
transition: color .3s cubic-bezier(.215,.61,.355,1); |
|||
margin-bottom: 20px; |
|||
} |
|||
</style> |
@ -1,4 +1,4 @@ |
|||
package com.water; |
|||
package com.kms.config; |
|||
|
|||
import java.security.MessageDigest; |
|||
import java.security.Security; |
@ -0,0 +1,112 @@ |
|||
//package com.water;
|
|||
//
|
|||
//import cn.hutool.core.util.IdUtil;
|
|||
//import cn.hutool.http.HttpRequest;
|
|||
//import cn.hutool.http.HttpResponse;
|
|||
//import com.alibaba.fastjson.JSONObject;
|
|||
//import com.kms.config.singleDomain.SingleOrg;
|
|||
//import lombok.Data;
|
|||
//
|
|||
//import java.util.Date;
|
|||
//import java.util.HashMap;
|
|||
//import java.util.List;
|
|||
//
|
|||
//@Data
|
|||
//public class WaterPortal {
|
|||
//
|
|||
// public static String paasToken;
|
|||
//
|
|||
// public static String paasId;
|
|||
// //网关
|
|||
// public static String url;
|
|||
// //登录
|
|||
// public static String login;
|
|||
//
|
|||
// //单点登录id
|
|||
// public static String loginServiceId;
|
|||
// //单点登录密钥
|
|||
// public static String loginAppsecret;
|
|||
//
|
|||
// static String ul = "http://19.25.35.204:31190/data_center/gateway/api";
|
|||
// static String loginUrl = ul + "/uaa/social/sso";
|
|||
// static String getUserUrl = ul + "/usrc/open-api/user/page";
|
|||
// static String orgUrl = ul + "/usrc/open-api/org/orgPage";
|
|||
// static String roleUrl = ul + "/usrc/open-api/role/page";
|
|||
//
|
|||
//
|
|||
// public static void main(String[] args) throws Exception {
|
|||
// String timestamp = String.valueOf(new Date().getTime());
|
|||
// String nonce = IdUtil.fastSimpleUUID();
|
|||
// String paasToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzeXN0ZW1JZCI6IjE3MzI3MDMxMTE1NDc0ODIxMTQifQ.4oiD3WBwrxT5z8goAvA9O88vsYVxwaE-8vyQmWl7xbg";
|
|||
// String paasId = "1732703111547482114";
|
|||
//
|
|||
// String signature = timestamp + paasToken + nonce + timestamp;
|
|||
// signature = SHACoder.encodeSHA256Hex(signature).toUpperCase();
|
|||
//
|
|||
//// HttpResponse httpGet = HttpRequest.get(loginUrl)
|
|||
//// .header("x-tsp-target",paasId)
|
|||
//// .header("x-tsp-uid-type","id")
|
|||
//// .header("x-tsp-uid","20231207000003")
|
|||
//// .header("x-tsp-paasid",paasId)
|
|||
//// .header("x-tsp-signature",signature)
|
|||
//// .header("x-tsp-timestamp",timestamp)
|
|||
//// .header("x-tsp-serviceid","DGSP_1606192265703567361")
|
|||
//// .header("x-tsp-nonce", nonce)
|
|||
//// .header("x-tsp-appsecret","92c8749c5a424758ba550f3cc79cf882")
|
|||
//// .execute();
|
|||
//
|
|||
// //获取用户
|
|||
//// HashMap<String, Object> hashMap = new HashMap<>();
|
|||
//// hashMap.put("page",1);
|
|||
//// hashMap.put("size",100);
|
|||
//// hashMap.put("systemCode","sgc-jg");
|
|||
//// HttpResponse httpGet = HttpRequest.post(getUserUrl)
|
|||
//// .header("x-tsp-paasid","1732703111547482114")
|
|||
//// .header("x-tsp-signature",signature)
|
|||
//// .header("x-tsp-timestamp",timestamp)
|
|||
//// .header("x-tsp-serviceid","DGSP_1606192265703567361")
|
|||
//// .header("x-tsp-nonce", nonce)
|
|||
//// .header("x-tsp-appsecret","92c8749c5a424758ba550f3cc79cf882")
|
|||
//// .body(JSONObject.toJSONString(hashMap))
|
|||
//// .execute();
|
|||
//
|
|||
//
|
|||
// //获取部门信息
|
|||
//// HashMap<String, Object> hashMap = new HashMap<>();
|
|||
//// hashMap.put("page",1);
|
|||
//// hashMap.put("size",100);
|
|||
//// hashMap.put("systemCode","sgc-jg");
|
|||
//// HttpResponse httpGet = HttpRequest.post(orgUrl)
|
|||
//// .header("x-tsp-paasid","1732703111547482114")
|
|||
//// .header("x-tsp-signature",signature)
|
|||
//// .header("x-tsp-timestamp",timestamp)
|
|||
//// .header("x-tsp-serviceid","DGSP_1606192265703567361")
|
|||
//// .header("x-tsp-nonce", nonce)
|
|||
//// .header("x-tsp-appsecret","92c8749c5a424758ba550f3cc79cf882")
|
|||
//// .body(JSONObject.toJSONString(hashMap))
|
|||
//// .execute();
|
|||
//
|
|||
//
|
|||
// //获取角色
|
|||
// HashMap<String, Object> hashMap = new HashMap<>();
|
|||
// hashMap.put("page",1);
|
|||
// hashMap.put("size",100);
|
|||
// hashMap.put("systemCode","sgc-jg");
|
|||
// HttpResponse httpGet = HttpRequest.post(roleUrl)
|
|||
// .header("x-tsp-paasid","1732703111547482114")
|
|||
// .header("x-tsp-signature",signature)
|
|||
// .header("x-tsp-timestamp",timestamp)
|
|||
// .header("x-tsp-serviceid","DGSP_1731517609955848193")
|
|||
// .header("x-tsp-nonce", nonce)
|
|||
// .header("x-tsp-appsecret","e49e175c07fd4bbe90b3c928772fa58f")
|
|||
// .body(JSONObject.toJSONString(hashMap))
|
|||
// .execute();
|
|||
// String body = httpGet.body();
|
|||
// JSONObject jsonObject = JSONObject.parseObject(body);
|
|||
// String records = jsonObject.getJSONObject("data").getString("records");
|
|||
// List<SingleOrg> singleOrgs = JSONObject.parseArray(records, SingleOrg.class);
|
|||
//// System.out.println(body);
|
|||
//
|
|||
// }
|
|||
//
|
|||
//}
|
@ -0,0 +1,322 @@ |
|||
package com.kms.config; |
|||
|
|||
import cn.hutool.core.util.IdUtil; |
|||
import cn.hutool.http.HttpRequest; |
|||
import cn.hutool.http.HttpResponse; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.jianwei.common.core.domain.AjaxResult; |
|||
import com.jianwei.common.exception.CustomException; |
|||
import com.kms.config.scheduled.WaterScheduled; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.scheduling.annotation.Scheduled; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.Date; |
|||
import java.util.HashMap; |
|||
|
|||
@Component |
|||
public class WaterRequestUtil { |
|||
|
|||
private static final Logger log = LoggerFactory.getLogger(WaterRequestUtil.class); |
|||
|
|||
@Value("${water.tspToken}") |
|||
public String tspToken; |
|||
@Value("${water.tspPaasId}") |
|||
public String tspPaasId; |
|||
|
|||
@Value("${water.tifToken}") |
|||
public String tifToken; |
|||
@Value("${water.tifPaasId}") |
|||
public String tifPaasId; |
|||
|
|||
|
|||
//网关
|
|||
@Value("${water.url}") |
|||
public String url; |
|||
|
|||
//单点登录id
|
|||
@Value("${water.singOnServiceId}") |
|||
public String singOnServiceId; |
|||
//单点登录密钥
|
|||
@Value("${water.singOnAppsecret}") |
|||
public String singOnAppsecret; |
|||
@Value("${water.singOnUrl}") |
|||
public String singOnUrl; |
|||
|
|||
//验证用户登录
|
|||
@Value("${water.userUrl}") |
|||
public String userUrl; |
|||
@Value("${water.authUserServiceId}") |
|||
public String authUserServiceId; |
|||
@Value("${water.authUserAppsecret}") |
|||
public String authUserAppsecret; |
|||
@Value("${water.systemCode}") |
|||
public String systemCode; |
|||
@Value("${water.systemName}") |
|||
public String systemName; |
|||
|
|||
//获取部门信息
|
|||
@Value("${water.orgUrl}") |
|||
public String orgUrl; |
|||
@Value("${water.orgServiceId}") |
|||
public String orgServiceId; |
|||
@Value("${water.orgAppsecret}") |
|||
public String orgAppsecret; |
|||
|
|||
|
|||
//业务角色
|
|||
@Value("${water.roleUrl}") |
|||
public String roleUrl; |
|||
@Value("${water.roleServiceId}") |
|||
public String roleServiceId; |
|||
@Value("${water.roleAppsecret}") |
|||
public String roleAppsecret; |
|||
|
|||
|
|||
|
|||
@Value("${water.systemUrl}") |
|||
public String systemUrl; |
|||
@Value("${water.systemServiceId}") |
|||
public String systemServiceId; |
|||
@Value("${water.systemAppsecret}") |
|||
public String systemAppsecret; |
|||
|
|||
|
|||
@Value("${water.usersUrl}") |
|||
public String usersUrl; |
|||
@Value("${water.usersServiceId}") |
|||
public String usersServiceId; |
|||
@Value("${water.usersAppsecret}") |
|||
public String usersAppsecret; |
|||
|
|||
|
|||
@Value("${water.resourceUrl}") |
|||
public String resourceUrl; |
|||
@Value("${water.resourceServiceId}") |
|||
public String resourceServiceId; |
|||
@Value("${water.resourceAppsecret}") |
|||
public String resourceAppsecret; |
|||
|
|||
/** |
|||
* 设置 |
|||
* @param httpRequest |
|||
* @param serviceId |
|||
* @param appsecret |
|||
*/ |
|||
private void setHead(HttpRequest httpRequest,String serviceId,String appsecret){ |
|||
String timestamp = String.valueOf(new Date().getTime()); |
|||
String tifTimestamp = String.valueOf(new Date().getTime() / 1000); |
|||
String tspTimestamp = String.valueOf(new Date().getTime() / 1000); |
|||
String nonceTif = IdUtil.fastSimpleUUID(); |
|||
String nonceTsp = IdUtil.fastSimpleUUID(); |
|||
String tifSignature = tifTimestamp + tifToken + nonceTif + tifTimestamp; |
|||
String tspSignature = tspTimestamp + tspToken + nonceTsp + tspTimestamp; |
|||
// System.out.println(signature);
|
|||
try { |
|||
tifSignature = SHACoder.encodeSHA256Hex(tifSignature).toUpperCase(); |
|||
tspSignature = SHACoder.encodeSHA256Hex(tspSignature).toUpperCase(); |
|||
|
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
httpRequest |
|||
.header("x-tsp-paasid",tspPaasId) |
|||
.header("x-tsp-signature",tspSignature) |
|||
.header("x-tsp-timestamp",tspTimestamp) |
|||
.header("x-tsp-nonce", nonceTsp) |
|||
.header("x-tif-paasid",tifPaasId) |
|||
.header("x-tif-signature",tifSignature) |
|||
.header("x-tif-timestamp",tifTimestamp) |
|||
.header("x-tif-nonce",nonceTif); |
|||
// .header("x-tsp-serviceid",serviceId)
|
|||
// .header("x-tsp-appsecret",appsecret);
|
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
public HttpRequest createGet(String url,String serviceId,String appsecret){ |
|||
HttpRequest httpRequest = HttpRequest.get(url); |
|||
setHead(httpRequest,serviceId,appsecret); |
|||
return httpRequest; |
|||
} |
|||
|
|||
public HttpRequest createPost(String url,String serviceId,String appsecret){ |
|||
HttpRequest httpRequest = HttpRequest.post(url); |
|||
setHead(httpRequest,serviceId,appsecret); |
|||
return httpRequest; |
|||
} |
|||
|
|||
/** |
|||
* 业务系统 |
|||
* @return |
|||
*/ |
|||
public WaterResult systemPage(){ |
|||
log.info("查询业务系统-----------------"); |
|||
HttpRequest post = createPost(systemUrl, systemServiceId, systemAppsecret); |
|||
HashMap<String, String> query = new HashMap<>(); |
|||
query.put("code",systemCode); |
|||
query.put("name",systemName); |
|||
HttpResponse response = post.body(JSONObject.toJSONString(query)) |
|||
.execute(); |
|||
String body = response.body(); |
|||
System.out.println(body); |
|||
WaterResult waterResult = JSONObject.parseObject(body, WaterResult.class); |
|||
isSuccess(waterResult); |
|||
//{
|
|||
// "msg": "操作成功",
|
|||
// "code": 200,
|
|||
// "data": {
|
|||
// "code": 200,
|
|||
// "message": "成功",
|
|||
// "success": true,
|
|||
// "data": "[{\"contractor\":\"数字广东网络建设有限公司\",\"code\":\"sgc-jg\",\"buildingLinkman\":\"张三\",\"contractorId\":\"1647768587123822593\",\"displayMobileFlag\":\"2\",\"manageUrl\":\"http://19.25.74.73:8001/\",\"type\":\"2\",\"building\":\"广东省水利厅\",\"developerId\":\"1732646766216482817\",\"developerPhone\":\"13333333333\",\"contractorPhone\":\"17324499124\",\"levelText\":\"省级\",\"buildingPhone\":\"13333333333\",\"id\":\"1732648267643097090\",\"manageImg\":\"{}\",\"area\":\"440000\",\"level\":\"1\",\"displayFlag\":\"1\",\"buildingId\":\"202206101718001\",\"createTime\":\"2023-12-07 06:28:33\",\"developerLinkman\":\"张三\",\"name\":\"水工程应用-水利工程建设管理模块\",\"publicUrl\":\"http://10.169.133.130:8001\",\"developer\":\"中通服建设有限公司\",\"contractorLinkman\":\"徐勇\",\"status\":\"1\"}]",
|
|||
// "timestamp": "1710140017747"
|
|||
// }
|
|||
//}
|
|||
return waterResult; |
|||
} |
|||
|
|||
|
|||
// public static void main(String[] args) {
|
|||
// HttpRequest post = createPost("http://19.25.35.204:31190/data_center/gateway/api/usrc/open-api/system/list", "DGSP_1606199297580052481", "b26a1c7b95744369c00f65b7a0790b6");
|
|||
// HashMap<String, String> query = new HashMap<>();
|
|||
// query.put("code","sgc-jg");
|
|||
// query.put("name","水工程应用-水利工程建设管理模块");
|
|||
// HttpResponse response = post.body(JSONObject.toJSONString(query))
|
|||
// .execute();
|
|||
// String body = response.body();
|
|||
// WaterResult waterResult = JSONObject.parseObject(body, WaterResult.class);
|
|||
//
|
|||
// }
|
|||
|
|||
|
|||
/** |
|||
* 单点登录 |
|||
* @return |
|||
*/ |
|||
public WaterResult signOn(String userId){ |
|||
HttpRequest get = createGet(userUrl,singOnServiceId,singOnAppsecret); |
|||
HttpResponse response = get.header("x-tsp-target", tspToken) |
|||
.header("x-tsp-uid-type", "id") |
|||
.header("x-tsp-uid", userId) |
|||
.execute(); |
|||
String body = response.body(); |
|||
System.out.println(body); |
|||
return JSONObject.parseObject(body,WaterResult.class); |
|||
} |
|||
|
|||
/** |
|||
* 验证用户登录 |
|||
* @param authorization |
|||
* @return |
|||
*/ |
|||
public WaterResult authUser(String authorization){ |
|||
log.info("--------请求统一门户用户验证,请求地址为:"+userUrl); |
|||
HashMap<String,Object>map=new HashMap<>(); |
|||
HttpRequest get = createGet(userUrl,authUserServiceId,authUserAppsecret); |
|||
HttpResponse response = get.header("Authorization", authorization) |
|||
.execute(); |
|||
String body = response.body(); |
|||
System.out.println(body); |
|||
WaterResult waterResult = JSONObject.parseObject(body, WaterResult.class); |
|||
isSuccess(waterResult); |
|||
return waterResult; |
|||
} |
|||
|
|||
|
|||
public WaterResult getOrgPage(){ |
|||
log.info("--------请求获取门户组织信息,请求地址为:"+orgUrl); |
|||
HashMap<String, Object> hashMap = new HashMap<>(); |
|||
hashMap.put("page",1); |
|||
hashMap.put("size",999999); |
|||
hashMap.put("systemCode",systemCode); |
|||
HttpRequest get = createPost(orgUrl,orgServiceId,orgAppsecret); |
|||
HttpResponse response = get.body(JSONObject.toJSONString(hashMap)) |
|||
.execute(); |
|||
String body = response.body(); |
|||
System.out.println(tifToken+body); |
|||
WaterResult waterResult = JSONObject.parseObject(body, WaterResult.class); |
|||
isSuccess(waterResult); |
|||
//{
|
|||
// "msg": "操作成功",
|
|||
// "code": 200,
|
|||
// "data": {
|
|||
// "code": 200,
|
|||
// "message": "成功",
|
|||
// "success": true,
|
|||
// "data": "{\"total\":4,\"size\":100,\"records\":[{\"parent\":\"202206101718001\",\"source\":\"tif\",\"type\":\"GA\",\"levelText\":\"省级\",\"id\":\"1646339896680984578\",\"area\":\"440000\",\"level\":\"1\",\"sourceText\":\"统一身份认证\",\"categoryText\":\"单位\",\"name\":\"水文局\",\"treeCode\":\"00030-00016\",\"status\":\"1\",\"code\":\"SJ0013\",\"orgId\":\"1646339896680984578\",\"tifld\":\"1232236\",\"seq\":18,\"areaText\":\"广东省\",\"updateTime\":\"2024-02-28 02:45:24\",\"createTime\":\"2023-04-13 02:29:54\",\"statusText\":\"启用\",\"category\":\"1\",\"crossParent\":\"\"},{\"parent\":\"0\",\"type\":\"FIRM\",\"levelText\":\"省级\",\"id\":\"1732646766216482817\",\"area\":\"440000\",\"level\":\"1\",\"categoryText\":\"单位\",\"name\":\"中通服建设有限公司\",\"treeCode\":\"00028\",\"status\":\"1\",\"code\":\"914400001903268010\",\"orgId\":\"1732646766216482817\",\"seq\":84,\"areaText\":\"广东省\",\"updateTime\":\"2023-12-11 18:05:29\",\"createTime\":\"2023-12-07 06:22:35\",\"statusText\":\"启用\",\"category\":\"1\"},{\"parent\":\"0\",\"natureText\":\"\",\"source\":\"input\",\"type\":\"GA\",\"levelText\":\"省级\",\"id\":\"202206101718001\",\"area\":\"440000\",\"level\":\"1\",\"sourceText\":\"手动创建\",\"categoryText\":\"单位\",\"name\":\"广东省水利厅\",\"treeCode\":\"00030\",\"status\":\"1\",\"code\":\"006941135\",\"abbrName\":\"水利厅\",\"uscc\":\"114400000069411352\",\"orgId\":\"202206101718001\",\"tifld\":\"114400000069411352\",\"seq\":67,\"nature\":\"1\",\"areaText\":\"广东省\",\"updateTime\":\"2024-02-28 02:45:24\",\"createTime\":\"2022-12-14 10:02:37\",\"statusText\":\"启用\",\"category\":\"1\",\"remarks\":\"默认机构,不可删除\"},{\"parent\":\"202206101718001\",\"source\":\"tif\",\"type\":\"GA\",\"deptTags\":\"noEntity\",\"levelText\":\"省级\",\"id\":\"1646339701234806785\",\"area\":\"440000\",\"level\":\"1\",\"sourceText\":\"统一身份认证\",\"categoryText\":\"部门\",\"name\":\"建设处\",\"treeCode\":\"00030-00044\",\"status\":\"1\",\"code\":\"SJ0001-024\",\"orgId\":\"1646339701234806785\",\"seq\":114,\"areaText\":\"广东省\",\"updateTime\":\"2024-01-08 18:47:31\",\"deptTagsText\":\"\",\"createTime\":\"2023-04-13 02:29:07\",\"statusText\":\"启用\",\"category\":\"2\",\"crossParent\":\"\"}],\"page\":1}",
|
|||
// "timestamp": "1710140677104"
|
|||
// }
|
|||
//}
|
|||
return waterResult; |
|||
} |
|||
|
|||
|
|||
public WaterResult getUserResource(String authorization){ |
|||
log.info("--------请求获取门户角色信息,请求地址为:"+resourceUrl); |
|||
HashMap<String, Object> hashMap = new HashMap<>(); |
|||
hashMap.put("systemCode",systemCode); |
|||
HttpRequest get = createPost(resourceUrl+"?systemCode="+systemCode,resourceServiceId,resourceAppsecret); |
|||
// HttpRequest get = createPost(resourceUrl,resourceServiceId,resourceAppsecret);
|
|||
get.header("Authorization",authorization); |
|||
HttpResponse response = get |
|||
.execute(); |
|||
String body = response.body(); |
|||
WaterResult waterResult = JSONObject.parseObject(body, WaterResult.class); |
|||
isSuccess(waterResult); |
|||
//{\"total\":1,\"size\":100,\"records\":[{\"area\":\"440000\",\"systemList\":[{\"area\":\"440000\",\"code\":\"sgc-jg\",\"name\":\"水工程应用-水利工程建设管理模块\",\"id\":\"1732648267643097090\"}],\"code\":\"YW00013\",\"level\":\"1d\",\"dataConfig\":\"none\",\"type\":\"BUSINESS\",\"posts\":[],\"users\":[{\"id\":\"20231225000006\"},{\"id\":\"20240119000002\"}],\"name\":\"水利工程应用-水利工程建设管理模块角色\",\"id\":\"20231213000001\",\"category\":\"BUSINESS\",\"businesses\":[{\"parent\":\"1762458920822599682\",\"businessCode\":\"YWSLGCJSGL0008\",\"parentName\":\"水利工程建设管理\",\"businessName\":\"水利工程建设管理\",\"description\":\"\",\"id\":\"1705128209926942721\",\"delFlag\":0}],\"status\":\"1\"}],\"page\":1}
|
|||
return waterResult; |
|||
} |
|||
|
|||
|
|||
public WaterResult getRolePage(){ |
|||
log.info("--------请求获取门户角色信息,请求地址为:"+roleUrl); |
|||
HashMap<String, Object> hashMap = new HashMap<>(); |
|||
hashMap.put("page",1); |
|||
hashMap.put("size",99999); |
|||
hashMap.put("systemCode",systemCode); |
|||
HttpRequest get = createPost(roleUrl,roleServiceId,roleAppsecret); |
|||
HttpResponse response = get.body(JSONObject.toJSONString(hashMap)) |
|||
.execute(); |
|||
String body = response.body(); |
|||
System.out.println(tifToken+body); |
|||
WaterResult waterResult = JSONObject.parseObject(body, WaterResult.class); |
|||
isSuccess(waterResult); |
|||
//{\"total\":1,\"size\":100,\"records\":[{\"area\":\"440000\",\"systemList\":[{\"area\":\"440000\",\"code\":\"sgc-jg\",\"name\":\"水工程应用-水利工程建设管理模块\",\"id\":\"1732648267643097090\"}],\"code\":\"YW00013\",\"level\":\"1d\",\"dataConfig\":\"none\",\"type\":\"BUSINESS\",\"posts\":[],\"users\":[{\"id\":\"20231225000006\"},{\"id\":\"20240119000002\"}],\"name\":\"水利工程应用-水利工程建设管理模块角色\",\"id\":\"20231213000001\",\"category\":\"BUSINESS\",\"businesses\":[{\"parent\":\"1762458920822599682\",\"businessCode\":\"YWSLGCJSGL0008\",\"parentName\":\"水利工程建设管理\",\"businessName\":\"水利工程建设管理\",\"description\":\"\",\"id\":\"1705128209926942721\",\"delFlag\":0}],\"status\":\"1\"}],\"page\":1}
|
|||
return waterResult; |
|||
} |
|||
|
|||
|
|||
public WaterResult usersPage(){ |
|||
log.info("--------请求获取门户用户信息,请求地址为:"+usersUrl); |
|||
HashMap<String, Object> hashMap = new HashMap<>(); |
|||
hashMap.put("page",1); |
|||
hashMap.put("size",99999); |
|||
hashMap.put("systemCode",systemCode); |
|||
HttpRequest get = createPost(usersUrl,usersServiceId,usersAppsecret); |
|||
HttpResponse response = get.body(JSONObject.toJSONString(hashMap)) |
|||
.execute(); |
|||
String body = response.body(); |
|||
WaterResult waterResult = JSONObject.parseObject(body, WaterResult.class); |
|||
isSuccess(waterResult); |
|||
return waterResult; |
|||
} |
|||
|
|||
|
|||
|
|||
private void isSuccess(WaterResult waterResult){ |
|||
if(waterResult==null){ |
|||
throw new CustomException("请求异常"); |
|||
} |
|||
if(waterResult.getCode()!=200||!waterResult.getSuccess()){ |
|||
throw new CustomException("请求失败,原因:"+waterResult.getMessage()); |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
@ -1,4 +1,4 @@ |
|||
package com.water; |
|||
package com.kms.config; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
@ -1,127 +0,0 @@ |
|||
package com.kms.web.controller.system; |
|||
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.jianwei.common.annotation.Log; |
|||
import com.jianwei.common.constant.YesOrNo; |
|||
import com.jianwei.common.core.controller.BaseController; |
|||
import com.jianwei.common.core.domain.AddParam; |
|||
import com.jianwei.common.core.domain.AjaxResult; |
|||
import com.jianwei.common.core.domain.SearchParam; |
|||
import com.jianwei.common.enums.BusinessType; |
|||
import com.jianwei.common.mybaitsplus.BeanToWrapper; |
|||
import com.jianwei.common.utils.StringUtils; |
|||
import com.jianwei.common.utils.poi.ExcelUtil; |
|||
import com.kms.common.utils.BaseEntityUtils; |
|||
import com.kms.system.domain.CmsTag; |
|||
import com.kms.system.service.CmsTagService; |
|||
import io.swagger.annotations.Api; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 客户标签Controller |
|||
* |
|||
* @author 刘燕军 |
|||
* @date 2022-06-24 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/system/tag") |
|||
@Api("客户标签") |
|||
public class CmsTagController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private CmsTagService cmsTagService; |
|||
|
|||
/** |
|||
* 查询客户标签列表 |
|||
*/ |
|||
|
|||
@PostMapping("/list") |
|||
public IPage list(@RequestBody SearchParam<CmsTag> sp) |
|||
{ |
|||
return cmsTagService.selectPage(sp); |
|||
} |
|||
|
|||
@GetMapping("/listAll") |
|||
public AjaxResult listAll() |
|||
{ |
|||
|
|||
CmsTag param = new CmsTag(); |
|||
param.setOrderBy("sort"); |
|||
List<CmsTag> list = cmsTagService.list(BeanToWrapper.order(param)); |
|||
return AjaxResult.success(list); |
|||
} |
|||
/** |
|||
* 导出客户标签列表 |
|||
*/ |
|||
|
|||
@Log(title = "客户标签", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public AjaxResult export(@RequestBody CmsTag cmsTag) |
|||
{ |
|||
List<CmsTag> list = cmsTagService.listByIds(cmsTag.getIds()); |
|||
ExcelUtil<CmsTag> util = new ExcelUtil<CmsTag>(CmsTag.class); |
|||
return util.exportExcel(list, "tag"); |
|||
} |
|||
|
|||
/** |
|||
* 获取客户标签详细信息 |
|||
*/ |
|||
|
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") String id) |
|||
{ |
|||
return AjaxResult.success(cmsTagService.getById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增客户标签 |
|||
*/ |
|||
|
|||
@Log(title = "客户标签", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public AjaxResult add(@RequestBody CmsTag cmsTag) |
|||
{ |
|||
BaseEntityUtils.preInsert(cmsTag); |
|||
CmsTag temp = new CmsTag(); |
|||
if(StringUtils.isEmpty(cmsTag.getParentId())){ |
|||
temp.setParentId(YesOrNo.NO); |
|||
} |
|||
temp.setParentId(cmsTag.getParentId()); |
|||
int count = cmsTagService.count(BeanToWrapper.getWrapper(temp)); |
|||
int sort = count*100; |
|||
cmsTag.setSort(Long.parseLong(sort+"")); |
|||
return toAjax(cmsTagService.saveWithRedis(cmsTag)); |
|||
} |
|||
|
|||
/** |
|||
* 修改客户标签 |
|||
*/ |
|||
|
|||
@Log(title = "客户标签", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody CmsTag cmsTag) |
|||
{ |
|||
BaseEntityUtils.preUpdate(cmsTag); |
|||
return toAjax(cmsTagService.updateWithReids(cmsTag)); |
|||
} |
|||
|
|||
/** |
|||
* 删除客户标签 |
|||
*/ |
|||
|
|||
@Log(title = "客户标签", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable String[] ids) |
|||
{ |
|||
return toAjax(cmsTagService.removeWithRedis(ids)); |
|||
} |
|||
|
|||
@PutMapping("batchUpadte") |
|||
public AjaxResult batchUpadte(@RequestBody AddParam<CmsTag> ap) { |
|||
cmsTagService.batchUpdate(ap); |
|||
return AjaxResult.success(); |
|||
} |
|||
} |
@ -1,163 +0,0 @@ |
|||
package com.kms.web.controller.system; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.stream.Collectors; |
|||
|
|||
import com.jianwei.common.core.controller.BaseController; |
|||
import com.jianwei.common.core.domain.MongoOperType; |
|||
import com.jianwei.common.core.domain.SearchParam; |
|||
import com.jianwei.common.core.domain.TimeView; |
|||
import com.jianwei.common.utils.StringUtils; |
|||
import com.jianwei.common.utils.poi.ExcelUtil; |
|||
import com.jianwei.thrift.ir.OrderItem; |
|||
import com.kms.common.utils.BaseEntityUtils; |
|||
|
|||
|
|||
import com.kms.system.es.DataSearchEntity; |
|||
|
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.PutMapping; |
|||
import org.springframework.web.bind.annotation.DeleteMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.jianwei.common.mybaitsplus.BeanToWrapper; |
|||
|
|||
import com.jianwei.common.annotation.Log; |
|||
import com.jianwei.common.core.domain.AjaxResult; |
|||
import com.jianwei.common.enums.BusinessType; |
|||
import com.kms.system.domain.CmsUserCollect; |
|||
import com.kms.system.service.CmsUserCollectService; |
|||
|
|||
|
|||
/** |
|||
* 收藏Controller |
|||
* |
|||
* @author 刘燕军 |
|||
* @date 2023-06-10 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/system/collect") |
|||
@Api(tags = "收藏") |
|||
public class CmsUserCollectController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private CmsUserCollectService cmsUserCollectService; |
|||
/* @Autowired |
|||
private IndexManager indexManager;*/ |
|||
|
|||
/** |
|||
* 查询收藏列表 |
|||
*/ |
|||
@PostMapping("/list") |
|||
@ApiOperation("收藏列表") |
|||
public IPage list(@RequestBody SearchParam<CmsUserCollect> sp) |
|||
{ |
|||
return cmsUserCollectService.selectPage(sp); |
|||
} |
|||
|
|||
/** |
|||
* 导出收藏列表 |
|||
*/ |
|||
@Log(title = "收藏导出", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
@ApiOperation("收藏导出") |
|||
public AjaxResult export(@RequestBody CmsUserCollect cmsUserCollect) |
|||
{ |
|||
List<CmsUserCollect> list = cmsUserCollectService.listByIds(cmsUserCollect.getIds()); |
|||
ExcelUtil<CmsUserCollect> util = new ExcelUtil<>(CmsUserCollect.class); |
|||
return util.exportExcel(list, "collect"); |
|||
} |
|||
|
|||
/** |
|||
* 获取收藏详细信息 |
|||
*/ |
|||
@ApiOperation(" 收藏详情") |
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") String id) |
|||
{ |
|||
return AjaxResult.success(cmsUserCollectService.getById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增收藏 |
|||
*/ |
|||
/*@PostMapping("myCollect/{id}") |
|||
@ApiOperation("我的收藏 收藏加的id") |
|||
public AjaxResult myCollect(@RequestBody DataSearchEntity dsv,@PathVariable("id")String id) |
|||
{ |
|||
*//**
|
|||
* 根据收藏夹获取 |
|||
*//*
|
|||
AjaxResult success = AjaxResult.success(); |
|||
CmsUserCollect param = new CmsUserCollect(); |
|||
param.setFavoritesId(id); |
|||
List<OrderItem> sortList = dsv.getSortList(); |
|||
if(StringUtils.isNotEmpty(sortList)){ |
|||
OrderItem orderItem = sortList.get(0); |
|||
param.setOrderBy(orderItem.getFieldName()); |
|||
param.setSortBy(orderItem.getOrder() == 1 ? MongoOperType.DESC:MongoOperType.ASC); |
|||
dsv.setSortList(null); |
|||
} |
|||
List<CmsUserCollect> list = cmsUserCollectService.list(BeanToWrapper.getWrapper(param)); |
|||
if(StringUtils.isNotEmpty(list)){ |
|||
List<String> collect = list.stream().map(CmsUserCollect::getDocId).collect(Collectors.toList()); |
|||
dsv.setId(collect); |
|||
return indexManager.searchExpert(dsv); |
|||
} |
|||
success.put(AjaxResult.DATA_TAG,new ArrayList<>()); |
|||
return success; |
|||
}*/ |
|||
|
|||
/** |
|||
* 新增收藏 |
|||
*/ |
|||
@Log(title = "添加收藏", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
@ApiOperation("添加收藏") |
|||
public AjaxResult add(@RequestBody CmsUserCollect cmsUserCollect) |
|||
{ |
|||
BaseEntityUtils.preInsert(cmsUserCollect); |
|||
return toAjax(cmsUserCollectService.save(cmsUserCollect)); |
|||
} |
|||
|
|||
|
|||
@Log(title = "取消收藏", businessType = BusinessType.INSERT) |
|||
@PostMapping("cancle") |
|||
@ApiOperation("取消收藏") |
|||
public AjaxResult cancle(@RequestBody CmsUserCollect cmsUserCollect) { |
|||
|
|||
cmsUserCollectService.remove(BeanToWrapper.getWrapper(cmsUserCollect)); |
|||
return AjaxResult.success(); |
|||
} |
|||
/** |
|||
* 修改收藏 |
|||
*/ |
|||
@ApiOperation("收藏修改") |
|||
@Log(title = "收藏修改", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody CmsUserCollect cmsUserCollect) |
|||
{ |
|||
return toAjax(cmsUserCollectService.updateById(cmsUserCollect)); |
|||
} |
|||
|
|||
/** |
|||
* 删除收藏 |
|||
*/ |
|||
@ApiOperation("收藏删除") |
|||
@Log(title = "收藏删除", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable String[] ids) |
|||
{ |
|||
return toAjax(cmsUserCollectService.removeByIds(Arrays.asList(ids))); |
|||
} |
|||
} |
@ -1,158 +0,0 @@ |
|||
package com.kms.web.controller.system; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
import com.jianwei.common.constant.YesOrNo; |
|||
import com.jianwei.common.core.controller.BaseController; |
|||
import com.jianwei.common.core.domain.MongoOperType; |
|||
import com.jianwei.common.core.domain.SearchParam; |
|||
import com.jianwei.common.utils.poi.ExcelUtil; |
|||
import com.kms.common.utils.BaseEntityUtils; |
|||
|
|||
|
|||
import com.kms.common.utils.UserUtils; |
|||
import com.kms.system.domain.CmsUserCollect; |
|||
import com.kms.system.service.CmsUserCollectService; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.PutMapping; |
|||
import org.springframework.web.bind.annotation.DeleteMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.jianwei.common.mybaitsplus.BeanToWrapper; |
|||
|
|||
import com.jianwei.common.annotation.Log; |
|||
import com.jianwei.common.core.domain.AjaxResult; |
|||
import com.jianwei.common.enums.BusinessType; |
|||
import com.kms.system.domain.CmsUserFavorites; |
|||
import com.kms.system.service.CmsUserFavoritesService; |
|||
|
|||
|
|||
/** |
|||
* 收藏夹Controller |
|||
* |
|||
* @author 刘燕军 |
|||
* @date 2023-06-10 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/system/favorites") |
|||
@Api(tags = "收藏夹") |
|||
public class CmsUserFavoritesController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private CmsUserFavoritesService cmsUserFavoritesService; |
|||
@Autowired |
|||
private CmsUserCollectService cmsUserCollectService; |
|||
|
|||
/** |
|||
* 查询收藏夹列表 |
|||
*/ |
|||
@PostMapping("/list") |
|||
@ApiOperation("收藏夹列表") |
|||
public IPage list(@RequestBody SearchParam<CmsUserFavorites> sp) |
|||
{ |
|||
return cmsUserFavoritesService.selectPage(sp); |
|||
} |
|||
|
|||
/** |
|||
* 导出收藏夹列表 |
|||
*/ |
|||
@Log(title = "收藏夹导出", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
@ApiOperation("收藏夹导出") |
|||
public AjaxResult export(@RequestBody CmsUserFavorites cmsUserFavorites) |
|||
{ |
|||
List<CmsUserFavorites> list = cmsUserFavoritesService.listByIds(cmsUserFavorites.getIds()); |
|||
ExcelUtil<CmsUserFavorites> util = new ExcelUtil<>(CmsUserFavorites.class); |
|||
return util.exportExcel(list, "favorites"); |
|||
} |
|||
|
|||
/** |
|||
* 获取收藏夹详细信息 |
|||
*/ |
|||
@ApiOperation(" 收藏夹详情") |
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") String id) |
|||
{ |
|||
return AjaxResult.success(cmsUserFavoritesService.getById(id)); |
|||
} |
|||
|
|||
@ApiOperation("我的收藏夹") |
|||
@PostMapping("selfFavorites") |
|||
public AjaxResult selfFavorites(@RequestBody SearchParam<CmsUserFavorites> cmsUserFavorites){ |
|||
// CmsUserFavorites cmsUserFavorites = new CmsUserFavorites();
|
|||
cmsUserFavorites.addParam(SearchParam.ORDER_BY,"create_time"); |
|||
cmsUserFavorites.addParam(SearchParam.SORT_BY, MongoOperType.DESC); |
|||
CmsUserFavorites data = cmsUserFavorites.getData(); |
|||
if(data == null){ |
|||
data =new CmsUserFavorites(); |
|||
} |
|||
data.setCreateUid(UserUtils.getUser().getId()); |
|||
cmsUserFavorites.setData(data); |
|||
List<CmsUserFavorites> list = cmsUserFavoritesService.list(BeanToWrapper.getWrapper(cmsUserFavorites)); |
|||
if(YesOrNo.YES.equals(data.getIsNeedCout())){ |
|||
//统计每个收藏夹内有多少数据
|
|||
list.forEach(f->{ |
|||
CmsUserCollect collect = new CmsUserCollect(); |
|||
collect.setFavoritesId(f.getId()); |
|||
int count = cmsUserCollectService.count(BeanToWrapper.getWrapper(collect)); |
|||
f.setCount(count); |
|||
}); |
|||
} |
|||
|
|||
//统计状态
|
|||
if(YesOrNo.YES.equals(data.getIsNeedCollectionStatus())){ |
|||
for (CmsUserFavorites userFavorites : list) { |
|||
CmsUserCollect collect = new CmsUserCollect(); |
|||
collect.setDocId(data.getDocId()); |
|||
collect.setFavoritesId(userFavorites.getId()); |
|||
int count = cmsUserCollectService.count(BeanToWrapper.getWrapper(collect)); |
|||
userFavorites.setCollectionStatus(count>0?YesOrNo.YES:YesOrNo.NO); |
|||
} |
|||
|
|||
} |
|||
return AjaxResult.success(list); |
|||
} |
|||
/** |
|||
* 新增收藏夹 |
|||
*/ |
|||
@Log(title = "收藏夹新增", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
@ApiOperation("收藏夹新增") |
|||
public AjaxResult add(@RequestBody CmsUserFavorites cmsUserFavorites) |
|||
{ |
|||
BaseEntityUtils.preInsert(cmsUserFavorites); |
|||
return toAjax(cmsUserFavoritesService.save(cmsUserFavorites)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 修改收藏夹 |
|||
*/ |
|||
@ApiOperation("收藏夹修改") |
|||
@Log(title = "收藏夹修改", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody CmsUserFavorites cmsUserFavorites) |
|||
{ |
|||
return toAjax(cmsUserFavoritesService.updateById(cmsUserFavorites)); |
|||
} |
|||
|
|||
/** |
|||
* 删除收藏夹 |
|||
*/ |
|||
@ApiOperation("收藏夹删除") |
|||
@Log(title = "收藏夹删除", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable String[] ids) |
|||
{ |
|||
return toAjax(cmsUserFavoritesService.removeByIds(Arrays.asList(ids))); |
|||
} |
|||
} |
@ -1,28 +1,3 @@ |
|||
{ |
|||
"requires": true, |
|||
"lockfileVersion": 1, |
|||
"dependencies": { |
|||
"echarts": { |
|||
"version": "5.5.1", |
|||
"resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.5.1.tgz", |
|||
"integrity": "sha512-Fce8upazaAXUVUVsjgV6mBnGuqgO+JNDlcgF79Dksy4+wgGpQB2lmYoO4TSweFg/mZITdpGHomw/cNBJZj1icA==", |
|||
"requires": { |
|||
"tslib": "2.3.0", |
|||
"zrender": "5.6.0" |
|||
} |
|||
}, |
|||
"tslib": { |
|||
"version": "2.3.0", |
|||
"resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz", |
|||
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" |
|||
}, |
|||
"zrender": { |
|||
"version": "5.6.0", |
|||
"resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.6.0.tgz", |
|||
"integrity": "sha512-uzgraf4njmmHAbEUxMJ8Oxg+P3fT04O+9p7gY+wJRVxo8Ge+KmYv0WJev945EH4wFuc4OY2NLXz46FZrWS9xJg==", |
|||
"requires": { |
|||
"tslib": "2.3.0" |
|||
} |
|||
} |
|||
} |
|||
"lockfileVersion": 1 |
|||
} |
|||
|
@ -0,0 +1,118 @@ |
|||
package com.kms.build.controller; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
import com.jianwei.common.core.controller.BaseController; |
|||
import com.jianwei.common.core.domain.SearchParam; |
|||
import com.jianwei.common.core.domain.entity.SysUser; |
|||
import com.jianwei.common.utils.poi.ExcelUtil; |
|||
import com.kms.common.utils.BaseEntityUtils; |
|||
|
|||
|
|||
import com.kms.common.utils.UserUtils; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.PutMapping; |
|||
import org.springframework.web.bind.annotation.DeleteMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.jianwei.common.mybaitsplus.BeanToWrapper; |
|||
|
|||
import com.jianwei.common.annotation.Log; |
|||
import com.jianwei.common.core.domain.AjaxResult; |
|||
import com.jianwei.common.enums.BusinessType; |
|||
import com.kms.build.domain.BsSgcJsjdBuiProInfoDraft; |
|||
import com.kms.build.service.BsSgcJsjdBuiProInfoDraftService; |
|||
|
|||
|
|||
/** |
|||
* 项目基本信息草稿Controller |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-08 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/build/draft") |
|||
@Api(tags = "项目基本信息草稿") |
|||
public class BsSgcJsjdBuiProInfoDraftController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private BsSgcJsjdBuiProInfoDraftService bsSgcJsjdBuiProInfoDraftService; |
|||
|
|||
/** |
|||
* 查询项目基本信息草稿列表 |
|||
*/ |
|||
@PostMapping("/list") |
|||
@ApiOperation("项目基本信息草稿列表") |
|||
public IPage list(@RequestBody SearchParam<BsSgcJsjdBuiProInfoDraft> sp) |
|||
{ |
|||
SysUser sysUser= UserUtils.getUser(); |
|||
sp.getData().setCreateUid(sysUser.getId()); |
|||
return bsSgcJsjdBuiProInfoDraftService.selectPage(sp); |
|||
} |
|||
|
|||
/** |
|||
* 导出项目基本信息草稿列表 |
|||
*/ |
|||
@Log(title = "项目基本信息草稿导出", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
@ApiOperation("项目基本信息草稿导出") |
|||
public AjaxResult export(@RequestBody BsSgcJsjdBuiProInfoDraft bsSgcJsjdBuiProInfoDraft) |
|||
{ |
|||
List<BsSgcJsjdBuiProInfoDraft> list = bsSgcJsjdBuiProInfoDraftService.listByIds(bsSgcJsjdBuiProInfoDraft.getIds()); |
|||
ExcelUtil<BsSgcJsjdBuiProInfoDraft> util = new ExcelUtil<>(BsSgcJsjdBuiProInfoDraft.class); |
|||
return util.exportExcel(list, "draft"); |
|||
} |
|||
|
|||
/** |
|||
* 获取项目基本信息草稿详细信息 |
|||
*/ |
|||
@ApiOperation(" 项目基本信息草稿详情") |
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") String id) |
|||
{ |
|||
return AjaxResult.success(bsSgcJsjdBuiProInfoDraftService.getById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增项目基本信息草稿 |
|||
*/ |
|||
@Log(title = "项目基本信息草稿新增", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
@ApiOperation("项目基本信息草稿新增") |
|||
public AjaxResult add(@RequestBody BsSgcJsjdBuiProInfoDraft bsSgcJsjdBuiProInfoDraft) |
|||
{ |
|||
BaseEntityUtils.preInsert(bsSgcJsjdBuiProInfoDraft); |
|||
return toAjax(bsSgcJsjdBuiProInfoDraftService.save(bsSgcJsjdBuiProInfoDraft)); |
|||
} |
|||
|
|||
/** |
|||
* 修改项目基本信息草稿 |
|||
*/ |
|||
@ApiOperation("项目基本信息草稿修改") |
|||
@Log(title = "项目基本信息草稿修改", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody BsSgcJsjdBuiProInfoDraft bsSgcJsjdBuiProInfoDraft) |
|||
{ |
|||
return toAjax(bsSgcJsjdBuiProInfoDraftService.updateById(bsSgcJsjdBuiProInfoDraft)); |
|||
} |
|||
|
|||
/** |
|||
* 删除项目基本信息草稿 |
|||
*/ |
|||
@ApiOperation("项目基本信息草稿删除") |
|||
@Log(title = "项目基本信息草稿删除", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable String[] ids) |
|||
{ |
|||
return toAjax(bsSgcJsjdBuiProInfoDraftService.removeByIds(Arrays.asList(ids))); |
|||
} |
|||
} |
@ -0,0 +1,118 @@ |
|||
package com.kms.build.controller; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
import com.jianwei.common.core.controller.BaseController; |
|||
import com.jianwei.common.core.domain.SearchParam; |
|||
import com.jianwei.common.core.domain.entity.SysUser; |
|||
import com.jianwei.common.utils.poi.ExcelUtil; |
|||
import com.kms.common.utils.BaseEntityUtils; |
|||
|
|||
|
|||
import com.kms.common.utils.UserUtils; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.PutMapping; |
|||
import org.springframework.web.bind.annotation.DeleteMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.jianwei.common.mybaitsplus.BeanToWrapper; |
|||
|
|||
import com.jianwei.common.annotation.Log; |
|||
import com.jianwei.common.core.domain.AjaxResult; |
|||
import com.jianwei.common.enums.BusinessType; |
|||
import com.kms.build.domain.BsSgcJsjdBuiRegulatoryInspectionsDraft; |
|||
import com.kms.build.service.BsSgcJsjdBuiRegulatoryInspectionsDraftService; |
|||
|
|||
|
|||
/** |
|||
* 监管检查草稿Controller |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-08 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/build/inspectionsDraft") |
|||
@Api(tags = "监管检查草稿") |
|||
public class BsSgcJsjdBuiRegulatoryInspectionsDraftController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private BsSgcJsjdBuiRegulatoryInspectionsDraftService bsSgcJsjdBuiRegulatoryInspectionsDraftService; |
|||
|
|||
/** |
|||
* 查询监管检查草稿列表 |
|||
*/ |
|||
@PostMapping("/list") |
|||
@ApiOperation("监管检查草稿列表") |
|||
public IPage list(@RequestBody SearchParam<BsSgcJsjdBuiRegulatoryInspectionsDraft> sp) |
|||
{ |
|||
SysUser sysUser= UserUtils.getUser(); |
|||
sp.getData().setCreateUid(sysUser.getId()); |
|||
return bsSgcJsjdBuiRegulatoryInspectionsDraftService.selectPage(sp); |
|||
} |
|||
|
|||
/** |
|||
* 导出监管检查草稿列表 |
|||
*/ |
|||
@Log(title = "监管检查草稿导出", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
@ApiOperation("监管检查草稿导出") |
|||
public AjaxResult export(@RequestBody BsSgcJsjdBuiRegulatoryInspectionsDraft bsSgcJsjdBuiRegulatoryInspectionsDraft) |
|||
{ |
|||
List<BsSgcJsjdBuiRegulatoryInspectionsDraft> list = bsSgcJsjdBuiRegulatoryInspectionsDraftService.listByIds(bsSgcJsjdBuiRegulatoryInspectionsDraft.getIds()); |
|||
ExcelUtil<BsSgcJsjdBuiRegulatoryInspectionsDraft> util = new ExcelUtil<>(BsSgcJsjdBuiRegulatoryInspectionsDraft.class); |
|||
return util.exportExcel(list, "inspectionsDraft"); |
|||
} |
|||
|
|||
/** |
|||
* 获取监管检查草稿详细信息 |
|||
*/ |
|||
@ApiOperation(" 监管检查草稿详情") |
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") String id) |
|||
{ |
|||
return AjaxResult.success(bsSgcJsjdBuiRegulatoryInspectionsDraftService.getById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增监管检查草稿 |
|||
*/ |
|||
@Log(title = "监管检查草稿新增", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
@ApiOperation("监管检查草稿新增") |
|||
public AjaxResult add(@RequestBody BsSgcJsjdBuiRegulatoryInspectionsDraft bsSgcJsjdBuiRegulatoryInspectionsDraft) |
|||
{ |
|||
BaseEntityUtils.preInsert(bsSgcJsjdBuiRegulatoryInspectionsDraft); |
|||
return toAjax(bsSgcJsjdBuiRegulatoryInspectionsDraftService.save(bsSgcJsjdBuiRegulatoryInspectionsDraft)); |
|||
} |
|||
|
|||
/** |
|||
* 修改监管检查草稿 |
|||
*/ |
|||
@ApiOperation("监管检查草稿修改") |
|||
@Log(title = "监管检查草稿修改", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody BsSgcJsjdBuiRegulatoryInspectionsDraft bsSgcJsjdBuiRegulatoryInspectionsDraft) |
|||
{ |
|||
return toAjax(bsSgcJsjdBuiRegulatoryInspectionsDraftService.updateById(bsSgcJsjdBuiRegulatoryInspectionsDraft)); |
|||
} |
|||
|
|||
/** |
|||
* 删除监管检查草稿 |
|||
*/ |
|||
@ApiOperation("监管检查草稿删除") |
|||
@Log(title = "监管检查草稿删除", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable String[] ids) |
|||
{ |
|||
return toAjax(bsSgcJsjdBuiRegulatoryInspectionsDraftService.removeByIds(Arrays.asList(ids))); |
|||
} |
|||
} |
@ -0,0 +1,324 @@ |
|||
package com.kms.build.domain; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import com.jianwei.common.annotation.Excel; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
|
|||
import com.jianwei.common.core.domain.BaseEntity; |
|||
|
|||
/** |
|||
* 项目基本信息草稿对象 bs_sgc_jsjd_bui_pro_info_draft |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-08 |
|||
*/ |
|||
@TableName("bs_sgc_jsjd_bui_pro_info_draft") |
|||
@Data |
|||
@ApiModel("项目基本信息草稿") |
|||
public class BsSgcJsjdBuiProInfoDraft extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 项目法人 */ |
|||
@Excel(name = "项目法人") |
|||
@ApiModelProperty("项目法人") |
|||
private String projectLegalPerson; |
|||
|
|||
/** 项目负责人 */ |
|||
@Excel(name = "项目负责人") |
|||
@ApiModelProperty("项目负责人") |
|||
private String projectSuperintendent; |
|||
|
|||
/** 单位负责人电话 */ |
|||
@Excel(name = "单位负责人电话") |
|||
@ApiModelProperty("单位负责人电话") |
|||
private String projectLegalPhone; |
|||
|
|||
/** 项目负责人电话 */ |
|||
@Excel(name = "项目负责人电话") |
|||
@ApiModelProperty("项目负责人电话") |
|||
private String projectSuperintendentPhone; |
|||
|
|||
/** 单位法定代表人 */ |
|||
@Excel(name = "单位法定代表人") |
|||
@ApiModelProperty("单位法定代表人") |
|||
private String projectUnitLegal; |
|||
|
|||
/** 单位法定代表人电话 */ |
|||
@Excel(name = "单位法定代表人电话") |
|||
@ApiModelProperty("单位法定代表人电话") |
|||
private String projectUnitLegalPhone; |
|||
|
|||
/** 工程等别 */ |
|||
@Excel(name = "工程等别") |
|||
@ApiModelProperty("工程等别") |
|||
private String engineeringGrade; |
|||
|
|||
/** 工程用途 */ |
|||
@Excel(name = "工程用途") |
|||
@ApiModelProperty("工程用途") |
|||
private String engineeringPurposes; |
|||
|
|||
/** 项目建设地址 */ |
|||
@Excel(name = "项目建设地址") |
|||
@ApiModelProperty("项目建设地址") |
|||
private String constructionAddress; |
|||
|
|||
/** 建设模式 */ |
|||
@Excel(name = "建设模式") |
|||
@ApiModelProperty("建设模式") |
|||
private String constructionMode; |
|||
|
|||
/** 建设性质 */ |
|||
@Excel(name = "建设性质") |
|||
@ApiModelProperty("建设性质") |
|||
private String constructionNature; |
|||
|
|||
/** 建设内容 */ |
|||
@Excel(name = "建设内容") |
|||
@ApiModelProperty("建设内容") |
|||
private String constructionContent; |
|||
|
|||
/** 所属流域 */ |
|||
@Excel(name = "所属流域") |
|||
@ApiModelProperty("所属流域") |
|||
private String basin; |
|||
|
|||
/** 是否172项重大水利工程 */ |
|||
@Excel(name = "是否172项重大水利工程") |
|||
@ApiModelProperty("是否172项重大水利工程") |
|||
private String isMajorProject; |
|||
|
|||
/** 项目投资主体 */ |
|||
@Excel(name = "项目投资主体") |
|||
@ApiModelProperty("项目投资主体") |
|||
private String investmentSubject; |
|||
|
|||
/** 建设阶段 */ |
|||
@Excel(name = "建设阶段") |
|||
@ApiModelProperty("建设阶段") |
|||
private String constructionPhase; |
|||
|
|||
/** 资金下达文号 */ |
|||
@Excel(name = "资金下达文号") |
|||
@ApiModelProperty("资金下达文号") |
|||
private String fundingNumber; |
|||
|
|||
/** 项目编码 */ |
|||
@Excel(name = "项目编码") |
|||
@ApiModelProperty("项目编码") |
|||
private String proCode; |
|||
|
|||
/** 项目编号 */ |
|||
@Excel(name = "项目编号") |
|||
@ApiModelProperty("项目编号") |
|||
private String proNo; |
|||
|
|||
/** 创建人 */ |
|||
@Excel(name = "创建人") |
|||
@ApiModelProperty("创建人") |
|||
private String createUid; |
|||
|
|||
/** 更新人 */ |
|||
@Excel(name = "更新人") |
|||
@ApiModelProperty("更新人") |
|||
private String updateUid; |
|||
|
|||
/** 数源部门 */ |
|||
@Excel(name = "数源部门") |
|||
@ApiModelProperty("数源部门") |
|||
private String owerDept; |
|||
|
|||
/** 中央安排资金 */ |
|||
@Excel(name = "中央安排资金") |
|||
@ApiModelProperty("中央安排资金") |
|||
private BigDecimal centralArrangedFunds; |
|||
|
|||
/** 中央安排资金比例 */ |
|||
@Excel(name = "中央安排资金比例") |
|||
@ApiModelProperty("中央安排资金比例") |
|||
private String centralArrangedFundsRate; |
|||
|
|||
/** 省级资金 */ |
|||
@Excel(name = "省级资金") |
|||
@ApiModelProperty("省级资金") |
|||
private BigDecimal provincialFunding; |
|||
|
|||
/** 省级资金比例 */ |
|||
@Excel(name = "省级资金比例") |
|||
@ApiModelProperty("省级资金比例") |
|||
private String provincialFundingRate; |
|||
|
|||
/** 地市级资金 */ |
|||
@Excel(name = "地市级资金") |
|||
@ApiModelProperty("地市级资金") |
|||
private BigDecimal cityLevelFunds; |
|||
|
|||
/** 市级基金网站 */ |
|||
@Excel(name = "市级基金网站") |
|||
@ApiModelProperty("市级基金网站") |
|||
private String cityLevelFundsRate; |
|||
|
|||
/** 县级资金 */ |
|||
@Excel(name = "县级资金") |
|||
@ApiModelProperty("县级资金") |
|||
private BigDecimal countyLevelFunds; |
|||
|
|||
/** 县级基金会 */ |
|||
@Excel(name = "县级基金会") |
|||
@ApiModelProperty("县级基金会") |
|||
private String countyLevelFundsRate; |
|||
|
|||
/** 乡镇及群众自筹和其他投资 */ |
|||
@Excel(name = "乡镇及群众自筹和其他投资") |
|||
@ApiModelProperty("乡镇及群众自筹和其他投资") |
|||
private BigDecimal townshipInvestments; |
|||
|
|||
/** 城镇投资率 */ |
|||
@Excel(name = "城镇投资率") |
|||
@ApiModelProperty("城镇投资率") |
|||
private String townshipInvestmentsRate; |
|||
|
|||
/** 总投资金额 */ |
|||
@Excel(name = "总投资金额") |
|||
@ApiModelProperty("总投资金额") |
|||
private String total; |
|||
|
|||
/** 工程类别 */ |
|||
@Excel(name = "工程类别") |
|||
@ApiModelProperty("工程类别") |
|||
private String workCategory; |
|||
|
|||
/** 是否重大项目 */ |
|||
@Excel(name = "是否重大项目") |
|||
@ApiModelProperty("是否重大项目") |
|||
private String isMajor; |
|||
|
|||
/** 下达总金额 */ |
|||
@Excel(name = "下达总金额") |
|||
@ApiModelProperty("下达总金额") |
|||
private BigDecimal releaseFunds; |
|||
|
|||
/** 项目划分 */ |
|||
@Excel(name = "项目划分") |
|||
@ApiModelProperty("项目划分") |
|||
private String projectDivision; |
|||
|
|||
/** 监理公司 */ |
|||
@Excel(name = "监理公司") |
|||
@ApiModelProperty("监理公司") |
|||
private String supervisionCompany; |
|||
|
|||
/** 监理单位主要人员 */ |
|||
@Excel(name = "监理单位主要人员") |
|||
@ApiModelProperty("监理单位主要人员") |
|||
private String supervisionPerson; |
|||
|
|||
/** 监理联系方式 */ |
|||
@Excel(name = "监理联系方式") |
|||
@ApiModelProperty("监理联系方式") |
|||
private String supervisionPhone; |
|||
|
|||
/** 项目是否完成评定 */ |
|||
@Excel(name = "项目是否完成评定") |
|||
@ApiModelProperty("项目是否完成评定") |
|||
private String isEvaluate; |
|||
|
|||
/** 评定时间 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "评定时间", width = 30, dateFormat = "yyyy-MM-dd") |
|||
@ApiModelProperty("评定时间") |
|||
private Date evaluateTime; |
|||
|
|||
/** 质量等级 */ |
|||
@Excel(name = "质量等级") |
|||
@ApiModelProperty("质量等级") |
|||
private String qualityLevel; |
|||
|
|||
/** 项目状态 */ |
|||
@Excel(name = "项目状态") |
|||
@ApiModelProperty("项目状态") |
|||
private String projectStatus; |
|||
|
|||
/** 项目划分确认意见 */ |
|||
@Excel(name = "项目划分确认意见") |
|||
@ApiModelProperty("项目划分确认意见") |
|||
private String projectDivisionAttachment; |
|||
|
|||
/** 开工日期 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "开工日期", width = 30, dateFormat = "yyyy-MM-dd") |
|||
@ApiModelProperty("开工日期") |
|||
private Date commencementDate; |
|||
|
|||
/** 计划竣工日期 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "计划竣工日期", width = 30, dateFormat = "yyyy-MM-dd") |
|||
@ApiModelProperty("计划竣工日期") |
|||
private Date plannedCompletionDate; |
|||
|
|||
/** 项目类型 */ |
|||
@Excel(name = "项目类型") |
|||
@ApiModelProperty("项目类型") |
|||
private String projectType; |
|||
|
|||
/** 绑定状态 */ |
|||
@Excel(name = "绑定状态") |
|||
@ApiModelProperty("绑定状态") |
|||
private String bindStatus; |
|||
|
|||
/** 点纬度研究者 */ |
|||
@Excel(name = "点纬度研究者") |
|||
@ApiModelProperty("点纬度研究者") |
|||
private String pointLatitudeLongitudeList; |
|||
|
|||
/** 线纬度研究者 */ |
|||
@Excel(name = "线纬度研究者") |
|||
@ApiModelProperty("线纬度研究者") |
|||
private String lineLatitudeLongitudeList; |
|||
|
|||
/** 全纬度研究者 */ |
|||
@Excel(name = "全纬度研究者") |
|||
@ApiModelProperty("全纬度研究者") |
|||
private String allLatitudeLongitudeList; |
|||
|
|||
/** 是否批准 */ |
|||
@Excel(name = "是否批准") |
|||
@ApiModelProperty("是否批准") |
|||
private String isApproval; |
|||
|
|||
/** 是否为安全度汛重点工程 */ |
|||
@Excel(name = "是否为安全度汛重点工程") |
|||
@ApiModelProperty("是否为安全度汛重点工程") |
|||
private String isKeyProject; |
|||
|
|||
/** 是否穿破堤坝施工 */ |
|||
@Excel(name = "是否穿破堤坝施工") |
|||
@ApiModelProperty("是否穿破堤坝施工") |
|||
private String isPierceProject; |
|||
|
|||
/** 项目名称 */ |
|||
@Excel(name = "项目名称") |
|||
@ApiModelProperty("项目名称") |
|||
private String projectName; |
|||
|
|||
/** 行政区划 */ |
|||
@Excel(name = "行政区划") |
|||
@ApiModelProperty("行政区划") |
|||
private String adcd; |
|||
|
|||
/** 项目种类 */ |
|||
@Excel(name = "项目种类") |
|||
@ApiModelProperty("项目种类") |
|||
private String projectKinds; |
|||
|
|||
} |
@ -0,0 +1,106 @@ |
|||
package com.kms.build.domain; |
|||
|
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import com.jianwei.common.annotation.Excel; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
|
|||
import com.jianwei.common.core.domain.BaseEntity; |
|||
|
|||
/** |
|||
* 监管检查草稿对象 bs_sgc_jsjd_bui_regulatory_inspections_draft |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-08 |
|||
*/ |
|||
@TableName("bs_sgc_jsjd_bui_regulatory_inspections_draft") |
|||
@Data |
|||
@ApiModel("监管检查草稿") |
|||
public class BsSgcJsjdBuiRegulatoryInspectionsDraft extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 监督检查类型 */ |
|||
@Excel(name = "监督检查类型") |
|||
@ApiModelProperty("监督检查类型") |
|||
private String inspectionTypes; |
|||
|
|||
/** 检查类型 */ |
|||
@Excel(name = "检查类型") |
|||
@ApiModelProperty("检查类型") |
|||
private String checkType; |
|||
|
|||
/** 检查时间 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "检查时间", width = 30, dateFormat = "yyyy-MM-dd") |
|||
@ApiModelProperty("检查时间") |
|||
private Date inspectionTime; |
|||
|
|||
/** 检查人 */ |
|||
@Excel(name = "检查人") |
|||
@ApiModelProperty("检查人") |
|||
private String inspectionPerson; |
|||
|
|||
/** 检查单位 */ |
|||
@Excel(name = "检查单位") |
|||
@ApiModelProperty("检查单位") |
|||
private String inspectionUnit; |
|||
|
|||
/** 组成成员 */ |
|||
@Excel(name = "组成成员") |
|||
@ApiModelProperty("组成成员") |
|||
private String constituentMember; |
|||
|
|||
/** 通知文件 */ |
|||
@Excel(name = "通知文件") |
|||
@ApiModelProperty("通知文件") |
|||
private String noticeAttachment; |
|||
|
|||
/** 检查表 */ |
|||
@Excel(name = "检查表") |
|||
@ApiModelProperty("检查表") |
|||
private String checklist; |
|||
|
|||
/** 整改报告 */ |
|||
@Excel(name = "整改报告") |
|||
@ApiModelProperty("整改报告") |
|||
private String rectificationReport; |
|||
|
|||
/** 创建人 */ |
|||
@Excel(name = "创建人") |
|||
@ApiModelProperty("创建人") |
|||
private String createUid; |
|||
|
|||
/** 更新人 */ |
|||
@Excel(name = "更新人") |
|||
@ApiModelProperty("更新人") |
|||
private String updateUid; |
|||
|
|||
/** 数源部门 */ |
|||
@Excel(name = "数源部门") |
|||
@ApiModelProperty("数源部门") |
|||
private String owerDept; |
|||
|
|||
/** 项目编码 */ |
|||
@Excel(name = "项目编码") |
|||
@ApiModelProperty("项目编码") |
|||
private String proCode; |
|||
|
|||
/** 项目编号 */ |
|||
@Excel(name = "项目编号") |
|||
@ApiModelProperty("项目编号") |
|||
private String proNo; |
|||
|
|||
/** 0法人履职检查 1质量检查 2市场监管专项检查 3防洪度汛检查 */ |
|||
@Excel(name = "0法人履职检查 1质量检查 2市场监管专项检查 3防洪度汛检查") |
|||
@ApiModelProperty("0法人履职检查 1质量检查 2市场监管专项检查 3防洪度汛检查") |
|||
private String menuType; |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.kms.build.mapper; |
|||
|
|||
import org.springframework.stereotype.Repository; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.kms.build.domain.BsSgcJsjdBuiProInfoDraft; |
|||
|
|||
/** |
|||
* 项目基本信息草稿Mapper接口 |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-08 |
|||
*/ |
|||
@Repository |
|||
public interface BsSgcJsjdBuiProInfoDraftMapper extends BaseMapper<BsSgcJsjdBuiProInfoDraft> { |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.kms.build.mapper; |
|||
|
|||
import org.springframework.stereotype.Repository; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.kms.build.domain.BsSgcJsjdBuiRegulatoryInspectionsDraft; |
|||
|
|||
/** |
|||
* 监管检查草稿Mapper接口 |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-08 |
|||
*/ |
|||
@Repository |
|||
public interface BsSgcJsjdBuiRegulatoryInspectionsDraftMapper extends BaseMapper<BsSgcJsjdBuiRegulatoryInspectionsDraft> { |
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.kms.build.service; |
|||
|
|||
import org.springframework.stereotype.Service; |
|||
import com.jianwei.common.core.service.BaseService; |
|||
import com.kms.build.mapper.BsSgcJsjdBuiProInfoDraftMapper; |
|||
import com.kms.build.domain.BsSgcJsjdBuiProInfoDraft; |
|||
|
|||
/** |
|||
* 项目基本信息草稿Service接口 |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-08 |
|||
*/ |
|||
@Service |
|||
public class BsSgcJsjdBuiProInfoDraftService extends BaseService<BsSgcJsjdBuiProInfoDraftMapper, BsSgcJsjdBuiProInfoDraft>{ |
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.kms.build.service; |
|||
|
|||
import org.springframework.stereotype.Service; |
|||
import com.jianwei.common.core.service.BaseService; |
|||
import com.kms.build.mapper.BsSgcJsjdBuiRegulatoryInspectionsDraftMapper; |
|||
import com.kms.build.domain.BsSgcJsjdBuiRegulatoryInspectionsDraft; |
|||
|
|||
/** |
|||
* 监管检查草稿Service接口 |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-08 |
|||
*/ |
|||
@Service |
|||
public class BsSgcJsjdBuiRegulatoryInspectionsDraftService extends BaseService<BsSgcJsjdBuiRegulatoryInspectionsDraftMapper, BsSgcJsjdBuiRegulatoryInspectionsDraft>{ |
|||
|
|||
} |
@ -0,0 +1,154 @@ |
|||
package com.kms.config; |
|||
|
|||
import org.apache.commons.codec.digest.DigestUtils; |
|||
import org.bouncycastle.jce.provider.BouncyCastleProvider; |
|||
import org.bouncycastle.util.encoders.Hex; |
|||
|
|||
import java.security.MessageDigest; |
|||
import java.security.Security; |
|||
|
|||
public abstract class SHACoder { |
|||
|
|||
/** |
|||
* SHA加密 |
|||
* |
|||
* @param data 待加密数据 |
|||
* @return byte[] 消息摘要 |
|||
* @throws Exception |
|||
*/ |
|||
public static byte[] encodeSHA(String data) throws Exception { |
|||
|
|||
// 执行消息摘要
|
|||
return DigestUtils.sha(data); |
|||
} |
|||
|
|||
/** |
|||
* SHAHex加密 |
|||
* |
|||
* @param data 待加密数据 |
|||
* @return String 消息摘要 |
|||
* @throws Exception |
|||
*/ |
|||
public static String encodeSHAHex(String data) throws Exception { |
|||
|
|||
// 执行消息摘要
|
|||
return DigestUtils.shaHex(data); |
|||
} |
|||
|
|||
/** |
|||
* SHA-224加密 |
|||
* |
|||
* @param data |
|||
* 待加密数据 |
|||
* @return byte[] 消息摘要 |
|||
* |
|||
* @throws Exception |
|||
*/ |
|||
public static byte[] encodeSHA224(byte[] data) throws Exception { |
|||
// 加入BouncyCastleProvider支持
|
|||
Security.addProvider(new BouncyCastleProvider()); |
|||
|
|||
// 初始化MessageDigest
|
|||
MessageDigest md = MessageDigest.getInstance("SHA-224"); |
|||
|
|||
// 执行消息摘要
|
|||
return md.digest(data); |
|||
} |
|||
|
|||
/** |
|||
* SHA-224加密 |
|||
* |
|||
* @param data |
|||
* 待加密数据 |
|||
* @return byte[] 消息摘要 |
|||
* @throws Exception |
|||
*/ |
|||
public static String encodeSHA224Hex(byte[] data) throws Exception { |
|||
|
|||
// 执行消息摘要
|
|||
byte[] b = encodeSHA224(data); |
|||
|
|||
// 做十六进制编码处理
|
|||
return new String(Hex.encode(b)); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* SHA256加密 |
|||
* |
|||
* @param data 待加密数据 |
|||
* @return byte[] 消息摘要 |
|||
* @throws Exception |
|||
*/ |
|||
public static byte[] encodeSHA256(String data) throws Exception { |
|||
|
|||
// 执行消息摘要
|
|||
return DigestUtils.sha256(data); |
|||
} |
|||
|
|||
/** |
|||
* SHA256Hex加密 |
|||
* |
|||
* @param data 待加密数据 |
|||
* @return String 消息摘要 |
|||
* @throws Exception |
|||
*/ |
|||
public static String encodeSHA256Hex(String data) throws Exception { |
|||
|
|||
// 执行消息摘要
|
|||
return DigestUtils.sha256Hex(data); |
|||
} |
|||
|
|||
/** |
|||
* SHA384加密 |
|||
* |
|||
* @param data 待加密数据 |
|||
* @return byte[] 消息摘要 |
|||
* @throws Exception |
|||
*/ |
|||
public static byte[] encodeSHA384(String data) throws Exception { |
|||
|
|||
// 执行消息摘要
|
|||
return DigestUtils.sha384(data); |
|||
} |
|||
|
|||
/** |
|||
* SHA384Hex加密 |
|||
* |
|||
* @param data 待加密数据 |
|||
* @return String 消息摘要 |
|||
* @throws Exception |
|||
*/ |
|||
public static String encodeSHA384Hex(String data) throws Exception { |
|||
|
|||
// 执行消息摘要
|
|||
return DigestUtils.sha384Hex(data); |
|||
} |
|||
|
|||
/** |
|||
* SHA512Hex加密 |
|||
* |
|||
* @param data 待加密数据 |
|||
* @return byte[] 消息摘要 |
|||
* @throws Exception |
|||
*/ |
|||
public static byte[] encodeSHA512(String data) throws Exception { |
|||
|
|||
// 执行消息摘要
|
|||
return DigestUtils.sha512(data); |
|||
} |
|||
|
|||
/** |
|||
* SHA512Hex加密 |
|||
* |
|||
* @param data 待加密数据 |
|||
* @return String 消息摘要 |
|||
* @throws Exception |
|||
*/ |
|||
public static String encodeSHA512Hex(String data) throws Exception { |
|||
|
|||
// 执行消息摘要
|
|||
return DigestUtils.sha512Hex(data); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.kms.config; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
@Data |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
public class WaterResult { |
|||
|
|||
private int code; |
|||
private String message; |
|||
private Boolean success; |
|||
private String data; |
|||
private String timestamp; |
|||
|
|||
|
|||
public static WaterResult success(){ |
|||
WaterResult waterResult = new WaterResult(); |
|||
waterResult.setCode(200); |
|||
waterResult.setSuccess(true); |
|||
waterResult.setTimestamp(String.valueOf(System.currentTimeMillis())); |
|||
waterResult.setMessage("发布成功"); |
|||
return waterResult; |
|||
} |
|||
} |
@ -0,0 +1,114 @@ |
|||
package com.kms.message.controller; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
import com.jianwei.common.core.controller.BaseController; |
|||
import com.jianwei.common.core.domain.SearchParam; |
|||
import com.jianwei.common.utils.poi.ExcelUtil; |
|||
import com.kms.common.utils.BaseEntityUtils; |
|||
|
|||
|
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.PutMapping; |
|||
import org.springframework.web.bind.annotation.DeleteMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.jianwei.common.mybaitsplus.BeanToWrapper; |
|||
|
|||
import com.jianwei.common.annotation.Log; |
|||
import com.jianwei.common.core.domain.AjaxResult; |
|||
import com.jianwei.common.enums.BusinessType; |
|||
import com.kms.message.domain.BsSgcSysMessageDraft; |
|||
import com.kms.message.service.BsSgcSysMessageDraftService; |
|||
|
|||
|
|||
/** |
|||
* 推送消息草稿Controller |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-06 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/message/draft") |
|||
@Api(tags = "推送消息草稿") |
|||
public class BsSgcSysMessageDraftController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private BsSgcSysMessageDraftService bsSgcSysMessageDraftService; |
|||
|
|||
/** |
|||
* 查询推送消息草稿列表 |
|||
*/ |
|||
@PostMapping("/list") |
|||
@ApiOperation("推送消息草稿列表") |
|||
public IPage list(@RequestBody SearchParam<BsSgcSysMessageDraft> sp) |
|||
{ |
|||
return bsSgcSysMessageDraftService.selectPage(sp); |
|||
} |
|||
|
|||
/** |
|||
* 导出推送消息草稿列表 |
|||
*/ |
|||
@Log(title = "推送消息草稿导出", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
@ApiOperation("推送消息草稿导出") |
|||
public AjaxResult export(@RequestBody BsSgcSysMessageDraft bsSgcSysMessageDraft) |
|||
{ |
|||
List<BsSgcSysMessageDraft> list = bsSgcSysMessageDraftService.listByIds(bsSgcSysMessageDraft.getIds()); |
|||
ExcelUtil<BsSgcSysMessageDraft> util = new ExcelUtil<>(BsSgcSysMessageDraft.class); |
|||
return util.exportExcel(list, "draft"); |
|||
} |
|||
|
|||
/** |
|||
* 获取推送消息草稿详细信息 |
|||
*/ |
|||
@ApiOperation(" 推送消息草稿详情") |
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") String id) |
|||
{ |
|||
return AjaxResult.success(bsSgcSysMessageDraftService.getById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增推送消息草稿 |
|||
*/ |
|||
@Log(title = "推送消息草稿新增", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
@ApiOperation("推送消息草稿新增") |
|||
public AjaxResult add(@RequestBody BsSgcSysMessageDraft bsSgcSysMessageDraft) |
|||
{ |
|||
BaseEntityUtils.preInsert(bsSgcSysMessageDraft); |
|||
return toAjax(bsSgcSysMessageDraftService.save(bsSgcSysMessageDraft)); |
|||
} |
|||
|
|||
/** |
|||
* 修改推送消息草稿 |
|||
*/ |
|||
@ApiOperation("推送消息草稿修改") |
|||
@Log(title = "推送消息草稿修改", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody BsSgcSysMessageDraft bsSgcSysMessageDraft) |
|||
{ |
|||
return toAjax(bsSgcSysMessageDraftService.updateById(bsSgcSysMessageDraft)); |
|||
} |
|||
|
|||
/** |
|||
* 删除推送消息草稿 |
|||
*/ |
|||
@ApiOperation("推送消息草稿删除") |
|||
@Log(title = "推送消息草稿删除", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable String[] ids) |
|||
{ |
|||
return toAjax(bsSgcSysMessageDraftService.removeByIds(Arrays.asList(ids))); |
|||
} |
|||
} |
@ -0,0 +1,114 @@ |
|||
package com.kms.message.controller; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
import com.jianwei.common.core.controller.BaseController; |
|||
import com.jianwei.common.core.domain.SearchParam; |
|||
import com.jianwei.common.utils.poi.ExcelUtil; |
|||
import com.kms.common.utils.BaseEntityUtils; |
|||
|
|||
|
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.PutMapping; |
|||
import org.springframework.web.bind.annotation.DeleteMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.jianwei.common.mybaitsplus.BeanToWrapper; |
|||
|
|||
import com.jianwei.common.annotation.Log; |
|||
import com.jianwei.common.core.domain.AjaxResult; |
|||
import com.jianwei.common.enums.BusinessType; |
|||
import com.kms.message.domain.BsSgcSysMessageRecords; |
|||
import com.kms.message.service.BsSgcSysMessageRecordsService; |
|||
|
|||
|
|||
/** |
|||
* 推送消息编制Controller |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-06 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/message/records") |
|||
@Api(tags = "推送消息编制") |
|||
public class BsSgcSysMessageRecordsController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private BsSgcSysMessageRecordsService bsSgcSysMessageRecordsService; |
|||
|
|||
/** |
|||
* 查询推送消息编制列表 |
|||
*/ |
|||
@PostMapping("/list") |
|||
@ApiOperation("推送消息编制列表") |
|||
public IPage list(@RequestBody SearchParam<BsSgcSysMessageRecords> sp) |
|||
{ |
|||
return bsSgcSysMessageRecordsService.selectPage(sp); |
|||
} |
|||
|
|||
/** |
|||
* 导出推送消息编制列表 |
|||
*/ |
|||
@Log(title = "推送消息编制导出", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
@ApiOperation("推送消息编制导出") |
|||
public AjaxResult export(@RequestBody BsSgcSysMessageRecords bsSgcSysMessageRecords) |
|||
{ |
|||
List<BsSgcSysMessageRecords> list = bsSgcSysMessageRecordsService.listByIds(bsSgcSysMessageRecords.getIds()); |
|||
ExcelUtil<BsSgcSysMessageRecords> util = new ExcelUtil<>(BsSgcSysMessageRecords.class); |
|||
return util.exportExcel(list, "records"); |
|||
} |
|||
|
|||
/** |
|||
* 获取推送消息编制详细信息 |
|||
*/ |
|||
@ApiOperation(" 推送消息编制详情") |
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") String id) |
|||
{ |
|||
return AjaxResult.success(bsSgcSysMessageRecordsService.getById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增推送消息编制 |
|||
*/ |
|||
@Log(title = "推送消息编制新增", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
@ApiOperation("推送消息编制新增") |
|||
public AjaxResult add(@RequestBody BsSgcSysMessageRecords bsSgcSysMessageRecords) |
|||
{ |
|||
BaseEntityUtils.preInsert(bsSgcSysMessageRecords); |
|||
return toAjax(bsSgcSysMessageRecordsService.save(bsSgcSysMessageRecords)); |
|||
} |
|||
|
|||
/** |
|||
* 修改推送消息编制 |
|||
*/ |
|||
@ApiOperation("推送消息编制修改") |
|||
@Log(title = "推送消息编制修改", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody BsSgcSysMessageRecords bsSgcSysMessageRecords) |
|||
{ |
|||
return toAjax(bsSgcSysMessageRecordsService.updateById(bsSgcSysMessageRecords)); |
|||
} |
|||
|
|||
/** |
|||
* 删除推送消息编制 |
|||
*/ |
|||
@ApiOperation("推送消息编制删除") |
|||
@Log(title = "推送消息编制删除", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable String[] ids) |
|||
{ |
|||
return toAjax(bsSgcSysMessageRecordsService.removeByIds(Arrays.asList(ids))); |
|||
} |
|||
} |
@ -0,0 +1,117 @@ |
|||
package com.kms.message.controller; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.jianwei.common.core.controller.BaseController; |
|||
import com.jianwei.common.core.domain.SearchParam; |
|||
import com.jianwei.common.utils.poi.ExcelUtil; |
|||
import com.kms.common.utils.BaseEntityUtils; |
|||
|
|||
|
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.PutMapping; |
|||
import org.springframework.web.bind.annotation.DeleteMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.jianwei.common.mybaitsplus.BeanToWrapper; |
|||
|
|||
import com.jianwei.common.annotation.Log; |
|||
import com.jianwei.common.core.domain.AjaxResult; |
|||
import com.jianwei.common.enums.BusinessType; |
|||
import com.kms.message.domain.BsSgcSysMessageSend; |
|||
import com.kms.message.service.BsSgcSysMessageSendService; |
|||
|
|||
|
|||
/** |
|||
* 推送消息编制Controller |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-06 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/message/send") |
|||
@Api(tags = "推送消息编制") |
|||
public class BsSgcSysMessageSendController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private BsSgcSysMessageSendService bsSgcSysMessageSendService; |
|||
|
|||
/** |
|||
* 查询推送消息编制列表 |
|||
*/ |
|||
@PostMapping("/list") |
|||
@ApiOperation("推送消息编制列表") |
|||
public IPage list(@RequestBody SearchParam<BsSgcSysMessageSend> sp) |
|||
{ |
|||
return bsSgcSysMessageSendService.selectPage(sp); |
|||
} |
|||
|
|||
/** |
|||
* 导出推送消息编制列表 |
|||
*/ |
|||
@Log(title = "推送消息编制导出", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
@ApiOperation("推送消息编制导出") |
|||
public AjaxResult export(@RequestBody BsSgcSysMessageSend bsSgcSysMessageSend) |
|||
{ |
|||
List<BsSgcSysMessageSend> list = bsSgcSysMessageSendService.listByIds(bsSgcSysMessageSend.getIds()); |
|||
ExcelUtil<BsSgcSysMessageSend> util = new ExcelUtil<>(BsSgcSysMessageSend.class); |
|||
return util.exportExcel(list, "send"); |
|||
} |
|||
|
|||
/** |
|||
* 获取推送消息编制详细信息 |
|||
*/ |
|||
@ApiOperation(" 推送消息编制详情") |
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") String id) |
|||
{ |
|||
return AjaxResult.success(bsSgcSysMessageSendService.getById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增推送消息编制 |
|||
*/ |
|||
@Log(title = "推送消息编制新增", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
@ApiOperation("推送消息编制新增") |
|||
public AjaxResult add(@RequestBody BsSgcSysMessageSend bsSgcSysMessageSend) |
|||
{ |
|||
BaseEntityUtils.preInsert(bsSgcSysMessageSend); |
|||
String personIds = bsSgcSysMessageSend.getPersonIds(); |
|||
|
|||
return toAjax(bsSgcSysMessageSendService.save(bsSgcSysMessageSend)); |
|||
} |
|||
|
|||
/** |
|||
* 修改推送消息编制 |
|||
*/ |
|||
@ApiOperation("推送消息编制修改") |
|||
@Log(title = "推送消息编制修改", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody BsSgcSysMessageSend bsSgcSysMessageSend) |
|||
{ |
|||
return toAjax(bsSgcSysMessageSendService.updateById(bsSgcSysMessageSend)); |
|||
} |
|||
|
|||
/** |
|||
* 删除推送消息编制 |
|||
*/ |
|||
@ApiOperation("推送消息编制删除") |
|||
@Log(title = "推送消息编制删除", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable String[] ids) |
|||
{ |
|||
return toAjax(bsSgcSysMessageSendService.removeByIds(Arrays.asList(ids))); |
|||
} |
|||
} |
@ -0,0 +1,114 @@ |
|||
package com.kms.message.controller; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
import com.jianwei.common.core.controller.BaseController; |
|||
import com.jianwei.common.core.domain.SearchParam; |
|||
import com.jianwei.common.utils.poi.ExcelUtil; |
|||
import com.kms.common.utils.BaseEntityUtils; |
|||
|
|||
|
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.PutMapping; |
|||
import org.springframework.web.bind.annotation.DeleteMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.jianwei.common.mybaitsplus.BeanToWrapper; |
|||
|
|||
import com.jianwei.common.annotation.Log; |
|||
import com.jianwei.common.core.domain.AjaxResult; |
|||
import com.jianwei.common.enums.BusinessType; |
|||
import com.kms.message.domain.BsSgcSysMessageTemplate; |
|||
import com.kms.message.service.BsSgcSysMessageTemplateService; |
|||
|
|||
|
|||
/** |
|||
* 推送消息模板管理Controller |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-06 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/message/template") |
|||
@Api(tags = "推送消息模板管理") |
|||
public class BsSgcSysMessageTemplateController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private BsSgcSysMessageTemplateService bsSgcSysMessageTemplateService; |
|||
|
|||
/** |
|||
* 查询推送消息模板管理列表 |
|||
*/ |
|||
@PostMapping("/list") |
|||
@ApiOperation("推送消息模板管理列表") |
|||
public IPage list(@RequestBody SearchParam<BsSgcSysMessageTemplate> sp) |
|||
{ |
|||
return bsSgcSysMessageTemplateService.selectPage(sp); |
|||
} |
|||
|
|||
/** |
|||
* 导出推送消息模板管理列表 |
|||
*/ |
|||
@Log(title = "推送消息模板管理导出", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
@ApiOperation("推送消息模板管理导出") |
|||
public AjaxResult export(@RequestBody BsSgcSysMessageTemplate bsSgcSysMessageTemplate) |
|||
{ |
|||
List<BsSgcSysMessageTemplate> list = bsSgcSysMessageTemplateService.listByIds(bsSgcSysMessageTemplate.getIds()); |
|||
ExcelUtil<BsSgcSysMessageTemplate> util = new ExcelUtil<>(BsSgcSysMessageTemplate.class); |
|||
return util.exportExcel(list, "template"); |
|||
} |
|||
|
|||
/** |
|||
* 获取推送消息模板管理详细信息 |
|||
*/ |
|||
@ApiOperation(" 推送消息模板管理详情") |
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") String id) |
|||
{ |
|||
return AjaxResult.success(bsSgcSysMessageTemplateService.getById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增推送消息模板管理 |
|||
*/ |
|||
@Log(title = "推送消息模板管理新增", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
@ApiOperation("推送消息模板管理新增") |
|||
public AjaxResult add(@RequestBody BsSgcSysMessageTemplate bsSgcSysMessageTemplate) |
|||
{ |
|||
BaseEntityUtils.preInsert(bsSgcSysMessageTemplate); |
|||
return toAjax(bsSgcSysMessageTemplateService.save(bsSgcSysMessageTemplate)); |
|||
} |
|||
|
|||
/** |
|||
* 修改推送消息模板管理 |
|||
*/ |
|||
@ApiOperation("推送消息模板管理修改") |
|||
@Log(title = "推送消息模板管理修改", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody BsSgcSysMessageTemplate bsSgcSysMessageTemplate) |
|||
{ |
|||
return toAjax(bsSgcSysMessageTemplateService.updateById(bsSgcSysMessageTemplate)); |
|||
} |
|||
|
|||
/** |
|||
* 删除推送消息模板管理 |
|||
*/ |
|||
@ApiOperation("推送消息模板管理删除") |
|||
@Log(title = "推送消息模板管理删除", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable String[] ids) |
|||
{ |
|||
return toAjax(bsSgcSysMessageTemplateService.removeByIds(Arrays.asList(ids))); |
|||
} |
|||
} |
@ -0,0 +1,50 @@ |
|||
package com.kms.message.domain; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import com.jianwei.common.annotation.Excel; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
|
|||
import com.jianwei.common.core.domain.BaseEntity; |
|||
|
|||
/** |
|||
* 推送消息草稿对象 bs_sgc_sys_message_draft |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-06 |
|||
*/ |
|||
@TableName("bs_sgc_sys_message_draft") |
|||
@Data |
|||
@ApiModel("推送消息草稿") |
|||
public class BsSgcSysMessageDraft extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 模板标题 */ |
|||
@Excel(name = "模板标题") |
|||
@ApiModelProperty("模板标题") |
|||
private String title; |
|||
|
|||
/** 内容 */ |
|||
@Excel(name = "内容") |
|||
@ApiModelProperty("内容") |
|||
private String context; |
|||
|
|||
/** 人员id集合 */ |
|||
@ApiModelProperty("内容") |
|||
private String personIds; |
|||
|
|||
/** 创建人 */ |
|||
@ApiModelProperty("内容") |
|||
private String createUid; |
|||
|
|||
/** 更新人 */ |
|||
@ApiModelProperty("内容") |
|||
private String updateUid; |
|||
|
|||
} |
@ -0,0 +1,57 @@ |
|||
package com.kms.message.domain; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import com.jianwei.common.annotation.Excel; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
|
|||
import com.jianwei.common.core.domain.BaseEntity; |
|||
|
|||
/** |
|||
* 推送消息编制对象 bs_sgc_sys_message_records |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-06 |
|||
*/ |
|||
@TableName("bs_sgc_sys_message_records") |
|||
@Data |
|||
@ApiModel("推送消息编制") |
|||
public class BsSgcSysMessageRecords extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 标题 */ |
|||
@Excel(name = "标题") |
|||
@ApiModelProperty("标题") |
|||
private String title; |
|||
|
|||
/** 内容 */ |
|||
@Excel(name = "内容") |
|||
@ApiModelProperty("内容") |
|||
private String context; |
|||
|
|||
/** 接收人 */ |
|||
@Excel(name = "接收人") |
|||
@ApiModelProperty("接收人") |
|||
private String personId; |
|||
|
|||
/** 状态 */ |
|||
@Excel(name = "状态") |
|||
@ApiModelProperty("状态") |
|||
private Long messageStatus; |
|||
|
|||
/** 发送人 */ |
|||
@Excel(name = "发送人") |
|||
@ApiModelProperty("发送人") |
|||
private String createUid; |
|||
|
|||
/** 更新人 */ |
|||
@ApiModelProperty("发送人") |
|||
private String updateUid; |
|||
|
|||
} |
@ -0,0 +1,50 @@ |
|||
package com.kms.message.domain; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import com.jianwei.common.annotation.Excel; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
|
|||
import com.jianwei.common.core.domain.BaseEntity; |
|||
|
|||
/** |
|||
* 推送消息编制对象 bs_sgc_sys_message_send |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-06 |
|||
*/ |
|||
@TableName("bs_sgc_sys_message_send") |
|||
@Data |
|||
@ApiModel("推送消息编制") |
|||
public class BsSgcSysMessageSend extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 模板标题 */ |
|||
@Excel(name = "模板标题") |
|||
@ApiModelProperty("模板标题") |
|||
private String title; |
|||
|
|||
/** 内容 */ |
|||
@Excel(name = "内容") |
|||
@ApiModelProperty("内容") |
|||
private String context; |
|||
|
|||
/** 接收人 */ |
|||
@ApiModelProperty("内容") |
|||
private String personIds; |
|||
|
|||
/** 发送人 */ |
|||
@ApiModelProperty("内容") |
|||
private String createUid; |
|||
|
|||
/** 更新人 */ |
|||
@ApiModelProperty("内容") |
|||
private String updateUid; |
|||
|
|||
} |
@ -0,0 +1,51 @@ |
|||
package com.kms.message.domain; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import com.jianwei.common.annotation.Excel; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
|
|||
import com.jianwei.common.core.domain.BaseEntity; |
|||
|
|||
/** |
|||
* 推送消息模板管理对象 bs_sgc_sys_message_template |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-06 |
|||
*/ |
|||
@TableName("bs_sgc_sys_message_template") |
|||
@Data |
|||
@ApiModel("推送消息模板管理") |
|||
public class BsSgcSysMessageTemplate extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 模板标题 */ |
|||
@Excel(name = "模板标题") |
|||
@ApiModelProperty("模板标题") |
|||
private String title; |
|||
|
|||
/** 模板内容 */ |
|||
@Excel(name = "模板内容") |
|||
@ApiModelProperty("模板内容") |
|||
private String context; |
|||
|
|||
/** 人员id集合 */ |
|||
@ApiModelProperty("模板内容") |
|||
private String personIds; |
|||
|
|||
/** 创建人 */ |
|||
@Excel(name = "创建人") |
|||
@ApiModelProperty("创建人") |
|||
private String createUid; |
|||
|
|||
/** 更新人 */ |
|||
@ApiModelProperty("创建人") |
|||
private String updateUid; |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.kms.message.mapper; |
|||
|
|||
import org.springframework.stereotype.Repository; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.kms.message.domain.BsSgcSysMessageDraft; |
|||
|
|||
/** |
|||
* 推送消息草稿Mapper接口 |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-06 |
|||
*/ |
|||
@Repository |
|||
public interface BsSgcSysMessageDraftMapper extends BaseMapper<BsSgcSysMessageDraft> { |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.kms.message.mapper; |
|||
|
|||
import org.springframework.stereotype.Repository; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.kms.message.domain.BsSgcSysMessageRecords; |
|||
|
|||
/** |
|||
* 推送消息编制Mapper接口 |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-06 |
|||
*/ |
|||
@Repository |
|||
public interface BsSgcSysMessageRecordsMapper extends BaseMapper<BsSgcSysMessageRecords> { |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.kms.message.mapper; |
|||
|
|||
import org.springframework.stereotype.Repository; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.kms.message.domain.BsSgcSysMessageSend; |
|||
|
|||
/** |
|||
* 推送消息编制Mapper接口 |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-06 |
|||
*/ |
|||
@Repository |
|||
public interface BsSgcSysMessageSendMapper extends BaseMapper<BsSgcSysMessageSend> { |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.kms.message.mapper; |
|||
|
|||
import org.springframework.stereotype.Repository; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.kms.message.domain.BsSgcSysMessageTemplate; |
|||
|
|||
/** |
|||
* 推送消息模板管理Mapper接口 |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-06 |
|||
*/ |
|||
@Repository |
|||
public interface BsSgcSysMessageTemplateMapper extends BaseMapper<BsSgcSysMessageTemplate> { |
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.kms.message.service; |
|||
|
|||
import org.springframework.stereotype.Service; |
|||
import com.jianwei.common.core.service.BaseService; |
|||
import com.kms.message.mapper.BsSgcSysMessageDraftMapper; |
|||
import com.kms.message.domain.BsSgcSysMessageDraft; |
|||
|
|||
/** |
|||
* 推送消息草稿Service接口 |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-06 |
|||
*/ |
|||
@Service |
|||
public class BsSgcSysMessageDraftService extends BaseService<BsSgcSysMessageDraftMapper, BsSgcSysMessageDraft>{ |
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.kms.message.service; |
|||
|
|||
import org.springframework.stereotype.Service; |
|||
import com.jianwei.common.core.service.BaseService; |
|||
import com.kms.message.mapper.BsSgcSysMessageRecordsMapper; |
|||
import com.kms.message.domain.BsSgcSysMessageRecords; |
|||
|
|||
/** |
|||
* 推送消息编制Service接口 |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-06 |
|||
*/ |
|||
@Service |
|||
public class BsSgcSysMessageRecordsService extends BaseService<BsSgcSysMessageRecordsMapper, BsSgcSysMessageRecords>{ |
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.kms.message.service; |
|||
|
|||
import org.springframework.stereotype.Service; |
|||
import com.jianwei.common.core.service.BaseService; |
|||
import com.kms.message.mapper.BsSgcSysMessageSendMapper; |
|||
import com.kms.message.domain.BsSgcSysMessageSend; |
|||
|
|||
/** |
|||
* 推送消息编制Service接口 |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-06 |
|||
*/ |
|||
@Service |
|||
public class BsSgcSysMessageSendService extends BaseService<BsSgcSysMessageSendMapper, BsSgcSysMessageSend>{ |
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.kms.message.service; |
|||
|
|||
import org.springframework.stereotype.Service; |
|||
import com.jianwei.common.core.service.BaseService; |
|||
import com.kms.message.mapper.BsSgcSysMessageTemplateMapper; |
|||
import com.kms.message.domain.BsSgcSysMessageTemplate; |
|||
|
|||
/** |
|||
* 推送消息模板管理Service接口 |
|||
* |
|||
* @author kms |
|||
* @date 2025-01-06 |
|||
*/ |
|||
@Service |
|||
public class BsSgcSysMessageTemplateService extends BaseService<BsSgcSysMessageTemplateMapper, BsSgcSysMessageTemplate>{ |
|||
|
|||
} |
@ -1,112 +0,0 @@ |
|||
package com.water; |
|||
|
|||
import cn.hutool.core.util.IdUtil; |
|||
import cn.hutool.http.HttpRequest; |
|||
import cn.hutool.http.HttpResponse; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.kms.config.singleDomain.SingleOrg; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class WaterPortal { |
|||
|
|||
public static String paasToken; |
|||
|
|||
public static String paasId; |
|||
//网关
|
|||
public static String url; |
|||
//登录
|
|||
public static String login; |
|||
|
|||
//单点登录id
|
|||
public static String loginServiceId; |
|||
//单点登录密钥
|
|||
public static String loginAppsecret; |
|||
|
|||
static String ul = "http://19.25.35.204:31190/data_center/gateway/api"; |
|||
static String loginUrl = ul + "/uaa/social/sso"; |
|||
static String getUserUrl = ul + "/usrc/open-api/user/page"; |
|||
static String orgUrl = ul + "/usrc/open-api/org/orgPage"; |
|||
static String roleUrl = ul + "/usrc/open-api/role/page"; |
|||
|
|||
|
|||
public static void main(String[] args) throws Exception { |
|||
String timestamp = String.valueOf(new Date().getTime()); |
|||
String nonce = IdUtil.fastSimpleUUID(); |
|||
String paasToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzeXN0ZW1JZCI6IjE3MzI3MDMxMTE1NDc0ODIxMTQifQ.4oiD3WBwrxT5z8goAvA9O88vsYVxwaE-8vyQmWl7xbg"; |
|||
String paasId = "1732703111547482114"; |
|||
|
|||
String signature = timestamp + paasToken + nonce + timestamp; |
|||
signature = SHACoder.encodeSHA256Hex(signature).toUpperCase(); |
|||
|
|||
// HttpResponse httpGet = HttpRequest.get(loginUrl)
|
|||
// .header("x-tsp-target",paasId)
|
|||
// .header("x-tsp-uid-type","id")
|
|||
// .header("x-tsp-uid","20231207000003")
|
|||
// .header("x-tsp-paasid",paasId)
|
|||
// .header("x-tsp-signature",signature)
|
|||
// .header("x-tsp-timestamp",timestamp)
|
|||
// .header("x-tsp-serviceid","DGSP_1606192265703567361")
|
|||
// .header("x-tsp-nonce", nonce)
|
|||
// .header("x-tsp-appsecret","92c8749c5a424758ba550f3cc79cf882")
|
|||
// .execute();
|
|||
|
|||
//获取用户
|
|||
// HashMap<String, Object> hashMap = new HashMap<>();
|
|||
// hashMap.put("page",1);
|
|||
// hashMap.put("size",100);
|
|||
// hashMap.put("systemCode","sgc-jg");
|
|||
// HttpResponse httpGet = HttpRequest.post(getUserUrl)
|
|||
// .header("x-tsp-paasid","1732703111547482114")
|
|||
// .header("x-tsp-signature",signature)
|
|||
// .header("x-tsp-timestamp",timestamp)
|
|||
// .header("x-tsp-serviceid","DGSP_1606192265703567361")
|
|||
// .header("x-tsp-nonce", nonce)
|
|||
// .header("x-tsp-appsecret","92c8749c5a424758ba550f3cc79cf882")
|
|||
// .body(JSONObject.toJSONString(hashMap))
|
|||
// .execute();
|
|||
|
|||
|
|||
//获取部门信息
|
|||
// HashMap<String, Object> hashMap = new HashMap<>();
|
|||
// hashMap.put("page",1);
|
|||
// hashMap.put("size",100);
|
|||
// hashMap.put("systemCode","sgc-jg");
|
|||
// HttpResponse httpGet = HttpRequest.post(orgUrl)
|
|||
// .header("x-tsp-paasid","1732703111547482114")
|
|||
// .header("x-tsp-signature",signature)
|
|||
// .header("x-tsp-timestamp",timestamp)
|
|||
// .header("x-tsp-serviceid","DGSP_1606192265703567361")
|
|||
// .header("x-tsp-nonce", nonce)
|
|||
// .header("x-tsp-appsecret","92c8749c5a424758ba550f3cc79cf882")
|
|||
// .body(JSONObject.toJSONString(hashMap))
|
|||
// .execute();
|
|||
|
|||
|
|||
//获取角色
|
|||
HashMap<String, Object> hashMap = new HashMap<>(); |
|||
hashMap.put("page",1); |
|||
hashMap.put("size",100); |
|||
hashMap.put("systemCode","sgc-jg"); |
|||
HttpResponse httpGet = HttpRequest.post(roleUrl) |
|||
.header("x-tsp-paasid","1732703111547482114") |
|||
.header("x-tsp-signature",signature) |
|||
.header("x-tsp-timestamp",timestamp) |
|||
.header("x-tsp-serviceid","DGSP_1731517609955848193") |
|||
.header("x-tsp-nonce", nonce) |
|||
.header("x-tsp-appsecret","e49e175c07fd4bbe90b3c928772fa58f") |
|||
.body(JSONObject.toJSONString(hashMap)) |
|||
.execute(); |
|||
String body = httpGet.body(); |
|||
JSONObject jsonObject = JSONObject.parseObject(body); |
|||
String records = jsonObject.getJSONObject("data").getString("records"); |
|||
List<SingleOrg> singleOrgs = JSONObject.parseArray(records, SingleOrg.class); |
|||
// System.out.println(body);
|
|||
|
|||
} |
|||
|
|||
} |
Loading…
Reference in new issue