Commit 9b3bfd33 authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents 710e0586 f4db9714
<template>
<a-table
:columns="columns"
:data-source="data"
:bordered="bordered"
:defaultExpandAllRows="DefaultExpandAllRows"
:expandRowByClick="ExpandRowByClick"
:showHeader="ShowHeader"
:pagination="Pagination"
:rowKey="rowKey"
@change="handleTableChange"
v-bind="$attrs"
v-on="$listeners"
>
<template
slot-scope="text, record, index"
:slot="slot"
v-for="slot in Object.keys($scopedSlots).filter(
(key) => key !== 'expandedRowRender'
)"
>
<slot :name="slot" v-bind="{ text, record, index }"></slot>
</template>
<template :slot="slot" v-for="slot in Object.keys($slots)">
<slot :name="slot"></slot>
</template>
<template
slot-scope="record, index, indent, expanded"
:slot="$scopedSlots.expandedRowRender ? 'expandedRowRender' : ''"
>
<slot
v-bind="{ record, index, indent, expanded }"
:name="$scopedSlots.expandedRowRender ? 'expandedRowRender' : ''"
></slot>
</template>
</a-table>
</template>
<script>
import { pageSizeOptions } from "@/config/pageConfig.js";
export default {
props: {
columns: {
required: true,
type: Array,
default: () => [],
},
data: {
required: true,
type: Array,
default: () => [],
},
pageSize: {
required: true,
type: Number,
default: 10,
},
page: {
required: true,
type: Number,
default: 1,
},
total: {
required: true,
type: Number,
default: 0,
},
bordered: {
type: Boolean,
default: true,
},
defaultExpandAllRows: {
type: Boolean,
default: false,
},
expandRowByClick: {
type: Boolean,
default: false,
},
showHeader: {
type: Boolean,
default: true,
},
rowKey: {
type: [String, Function],
default: "id",
},
pagination: {
type: Object,
default: () => {},
},
pageSizeOptions: {
type: Array,
default: () => pageSizeOptions,
},
},
data() {
return {};
},
computed: {
Bordered() {
return !!this.bordered;
},
DefaultExpandAllRows() {
return !!this.defaultExpandAllRows;
},
ExpandRowByClick() {
return !!this.expandRowByClick;
},
ShowHeader() {
return !!this.showHeader;
},
PageSize: {
get() {
return this.pageSize;
},
set(value) {
this.$emit("update:pageSize", value);
},
},
Current: {
get() {
return this.page;
},
set(value) {
this.$emit("update:page", value);
},
},
Pagination() {
return {
showTotal: (total) => `共 ${total} 条`,
total: this.total,
current: this.Current,
pageSize: this.pageSize,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: this.pageSizeOptions,
...this.pagination,
};
},
},
methods: {
handleTableChange(pagination, filters, sorter, { currentDataSource }) {
let { current, pageSize } = pagination;
this.Current = current;
this.PageSize = pageSize;
if (this.$listeners.changePagination) {
this.$listeners.changePagination();
}
this.$emit("change", pagination, filters, sorter, { currentDataSource });
},
},
};
</script>
<style lang="less" scoped></style>
<template>
<div class="y-upload">
<a-upload
v-if="listType == 'text' || listType == 'picture'"
:name="name"
:listType="listType"
:multiple="multiple"
:action="action"
:accept="accept"
:beforeUpload="beforeUpload"
:file-list="FileList"
v-bind="$attrs"
v-on="$listeners"
@change="handleChange"
@preview="handlePreview"
>
<slot>
<a-button type="primary"> <a-icon type="upload" />点击上传</a-button>
</slot>
</a-upload>
<a-upload
v-else-if="listType == 'picture-card'"
:name="name"
:listType="listType"
:multiple="multiple"
:action="action"
:accept="accept"
:beforeUpload="beforeUpload"
:file-list="FileList"
v-bind="$attrs"
v-on="$listeners"
@change="handleChange"
@preview="handlePreview"
>
<slot>
<div>
<a-icon type="plus" />
<div class="ant-upload-text">点击上传</div>
</div>
</slot>
</a-upload>
<!-- 视频、音频预览 -->
<div class="modal" v-if="previewVisible">
<video
v-if="previewData.type == 'video'"
:src="previewData.url"
autoplay
muted
controls
></video>
<audio
v-if="previewData.type == 'audio'"
:src="previewData.url"
autoplay
controls
></audio>
<a-icon type="close-circle" @click="previewVisible = false" />
</div>
</div>
</template>
<script>
// import { uploadFile } from "@/services/user";
export default {
model: {
prop: "value",
event: "onChange",
},
components: {},
props: {
name: {
type: String,
default: "file",
},
listType: {
type: String,
default: "text",
},
multiple: {
type: Boolean,
default: false,
},
value: {
type: [String, Array],
default: "",
},
// 文件限制
accept: {
type: String,
default: "",
},
// 上传数量
limit: {
type: Number,
validator: (value) => {
return value >= 0;
},
default: 1, // 0为不限制
},
// 上传文件大小限制mb 0为不限制
MB: {
type: Number,
validator: (value) => {
return value >= 0;
},
default: 10,
},
action: {
type: String,
default: "/base/file/commonupload",
},
},
data() {
return {
FileList: [],
imageType: ["png", "jpg", "jpeg", "gif", "svg"],
videoType: ["mp4", "avi", "wmv", "rmvb", "flv", "mkv"],
audioType: [
"mp3",
"wav",
"amr",
"aac",
"ogg",
"wma",
"flac",
"ape",
"mid",
"m4a",
"m4r",
"m4p",
"m4b",
],
previewData: {
type: "",
url: "",
},
previewVisible: false,
};
},
watch: {
value: {
handler(newValue) {
if (newValue) {
if (Array.isArray(newValue)) {
this.FileList = newValue.map((v) => {
let index = v.lastIndexOf("/");
let name = v.slice(index + 1);
return {
uid: v,
name,
status: "done",
url: v,
};
});
} else {
this.FileList = newValue.split(",").map((v) => {
let index = v.lastIndexOf("/");
let name = v.slice(index + 1);
return {
uid: v,
name,
status: "done",
url: v,
};
});
}
} else {
this.FileList = [];
}
},
deep: true,
immediate: true,
},
},
computed: {},
created() {},
methods: {
customRequest() {
console.log(arguments);
},
handleChange({ file, fileList }) {
this.FileList = [...fileList];
if (file.status == "done" || file.status == "removed") {
if (file.response && file.response.code == -1) {
this.$message.error(file.response.msg);
fileList = fileList.filter((file) => file.response.code != -1);
}
if (this.limit) {
this.FileList = [...fileList].slice(-this.limit);
}
this.FileList = this.FileList.map((v) => {
if (v.response) {
v.url = v.response.url;
}
return v;
});
let value;
if (Array.isArray(this.value)) {
value = this.FileList.map((v) => v.url);
} else {
value = this.FileList.map((v) => v.url).join(",");
}
this.$emit("onChange", value);
this.$emit("onSuccess", { file, fileList });
}
},
beforeUpload(file) {
let isType = true;
let isExceed = true;
return new Promise((resolve) => {
if (this.accept) {
const fileType = this.accept.split(","); // 限制文件类型
let index = file.name.lastIndexOf(".");
let type = file.name.slice(index);
isType = fileType.includes(type);
}
if (!isType) {
let msg = this.accept.replaceAll(",", "或者");
this.$message.error(`请上传${msg}文件!`);
}
if (this.MB) {
isExceed = file.size / 1024 / 1024 <= this.MB;
}
if (!isExceed) {
this.$message.error(`文件大小不能超过${this.MB}MB!`);
}
if (isType && isExceed) {
resolve(file);
}
});
},
// 预览
handlePreview(file) {
let { url } = file;
if (!url) return;
let index = url.lastIndexOf(".");
let type = url.slice(index + 1);
if (this.imageType.includes(type)) {
this.$viewerApi({
images: [url],
});
} else if (this.videoType.includes(type)) {
this.previewData.type = "video";
this.previewData.url = url;
this.previewVisible = true;
} else if (this.audioType.includes(type)) {
this.previewData.type = "audio";
this.previewData.url = url;
this.previewVisible = true;
} else {
let a = document.createElement("a");
a.href = url;
a.download = file.name;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
}
},
handleDownload(file) {
console.log(file);
},
},
};
</script>
<style lang="less" scoped>
/deep/.ant-upload-picture-card-wrapper {
display: flex;
flex-wrap: wrap;
}
.modal {
width: 100%;
height: 100%;
position: fixed;
left: 0px;
top: 0px;
background: rgba(0, 0, 0, 0.5);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 10px;
z-index: 999;
video {
height: 400px;
}
.anticon-close-circle {
font-size: 36px;
color: #fff;
cursor: pointer;
}
}
</style>
<template> <template>
<div> <div>
<a-checkbox :checked="value" @change="onChange"> <a-checkbox :checked="value" @change="onChange">
{{ checkText }}</a-checkbox <slot></slot>
> </a-checkbox>
</div> </div>
</template> </template>
...@@ -16,10 +16,6 @@ export default { ...@@ -16,10 +16,6 @@ export default {
checked: { checked: {
required: true, required: true,
}, },
checkText: {
required: true,
default: "",
},
}, },
computed: { computed: {
value() { value() {
...@@ -34,5 +30,4 @@ export default { ...@@ -34,5 +30,4 @@ export default {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>
\ No newline at end of file
...@@ -88,7 +88,16 @@ ...@@ -88,7 +88,16 @@
<a-input <a-input
v-model="formInfo.leadingOfficialTelephone" v-model="formInfo.leadingOfficialTelephone"
type="text" type="text"
placeholder="请输入负责人电话电话" placeholder="请输入负责人电话"
/>
</a-form-model-item>
</a-col>
<a-col :span="8">
<a-form-model-item label="投诉电话" prop="complaintHotline">
<a-input
v-model="formInfo.complaintHotline"
type="text"
placeholder="请输入投诉电话"
/> />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
...@@ -181,19 +190,26 @@ ...@@ -181,19 +190,26 @@
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="中心Logo" prop="logoPath"> <a-form-model-item label="中心Logo" prop="logoPath">
<a-upload <YUpload
:action="api + 'base/file/commonupload'" accept=".png,.jpg,.jpeg,.svg"
list-type="picture-card" :limit="1"
:file-list="fileList" v-model="formInfo.logoPath"
@preview="handlePreview" listType="picture-card"
@change="handleChange" ></YUpload>
:accept="accept" </a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item
class="site-style"
label="站点风貌"
prop="govAffairStyle"
> >
<div v-if="fileList.length < 1"> <YUpload
<a-icon type="plus" /> accept=".png,.jpg,.jpeg,.svg"
<div class="ant-upload-text">上传图片</div> :limit="0"
</div> v-model="formInfo.govAffairStyle"
</a-upload> listType="picture-card"
></YUpload>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -237,33 +253,12 @@ ...@@ -237,33 +253,12 @@
</a-row> </a-row>
<a-form-model-item label="工作日"> <a-form-model-item label="工作日">
<y-checkbox <y-checkbox
v-model="formInfo.workday1" v-model="formInfo[key]"
checkText="星期一" v-for="(v, key) in workday"
></y-checkbox> :key="key"
<y-checkbox >
v-model="formInfo.workday2" {{ v }}
checkText="星期二" </y-checkbox>
></y-checkbox>
<y-checkbox
v-model="formInfo.workday3"
checkText="星期三"
></y-checkbox>
<y-checkbox
v-model="formInfo.workday4"
checkText="星期四"
></y-checkbox>
<y-checkbox
v-model="formInfo.workday5"
checkText="星期五"
></y-checkbox>
<y-checkbox
v-model="formInfo.workday6"
checkText="星期六"
></y-checkbox>
<y-checkbox
v-model="formInfo.workday7"
checkText="星期天"
></y-checkbox>
</a-form-model-item> </a-form-model-item>
<a-row> <a-row>
<a-col :span="4"> <a-col :span="4">
...@@ -306,9 +301,19 @@ ...@@ -306,9 +301,19 @@
import { modelList, siteSave } from "@/services/basicsetFun"; import { modelList, siteSave } from "@/services/basicsetFun";
import YCheckbox from "@/components/ycheckbox/YCheckbox.vue"; import YCheckbox from "@/components/ycheckbox/YCheckbox.vue";
import YSwitch from "@/components/yswitch/YSwitch.vue"; import YSwitch from "@/components/yswitch/YSwitch.vue";
import YUpload from "@/components/YUpload.vue";
// import options from "@/utils/city"; // import options from "@/utils/city";
import { regionData } from "element-china-area-data"; import { regionData } from "element-china-area-data";
import { checkPort, checkIp } from "@/utils/validate"; import { checkPort, checkIp } from "@/utils/validate";
const workday = {
workday1: "星期一",
workday2: "星期二",
workday3: "星期三",
workday4: "星期四",
workday5: "星期五",
workday6: "星期六",
workday7: "星期天",
};
export default { export default {
props: { props: {
formVisible: { formVisible: {
...@@ -323,6 +328,7 @@ export default { ...@@ -323,6 +328,7 @@ export default {
components: { components: {
YCheckbox, YCheckbox,
YSwitch, YSwitch,
YUpload,
}, },
data() { data() {
// 验证手机号码 // 验证手机号码
...@@ -336,17 +342,8 @@ export default { ...@@ -336,17 +342,8 @@ export default {
callback(); callback();
} }
}; };
// const changeLandline = (rule, value, callback) => {
// if (!value) {
// callback(new Error("请输入中心座机号"));
// callback();
// } else if (!/^[0][1-9]{2,3}-[0-9]{5,10}$/.test(value)) {
// callback(new Error("格式:区号-电话号码"));
// } else {
// callback();
// }
// };
return { return {
workday,
api: process.env.VUE_APP_API_BASE_URL + "/", api: process.env.VUE_APP_API_BASE_URL + "/",
accept: "image/jpeg,image/png", // 上传类型 accept: "image/jpeg,image/png", // 上传类型
loading: false, loading: false,
...@@ -396,10 +393,11 @@ export default { ...@@ -396,10 +393,11 @@ export default {
onlineTake: 0, // 在线取号 onlineTake: 0, // 在线取号
appointment: 0, // 微预约 appointment: 0, // 微预约
gowMap: 0, // 政务地图 gowMap: 0, // 政务地图
govAffairStyle: "", // 站点风貌
complaintHotline: "", // 投诉电话
}, //表单提交数据 }, //表单提交数据
indeterminate: true, indeterminate: true,
checkAll: false, checkAll: false,
fileList: [],
formRules: { formRules: {
siteName: [ siteName: [
{ {
...@@ -595,14 +593,12 @@ export default { ...@@ -595,14 +593,12 @@ export default {
}, },
//重置 //重置
resetForm() { resetForm() {
this.fileList = [];
this.cityData = []; this.cityData = [];
this.$refs.ruleForm.resetFields(); this.$refs.ruleForm.resetFields();
}, },
// 关闭对话框 // 关闭对话框
closeModal() { closeModal() {
this.fileList = []; this.resetForm();
this.$refs.ruleForm.resetFields();
this.Visible = false; this.Visible = false;
}, },
// 新增 // 新增
...@@ -614,31 +610,44 @@ export default { ...@@ -614,31 +610,44 @@ export default {
// 编辑 // 编辑
onEdit(data) { onEdit(data) {
this.$nextTick(() => { this.$nextTick(() => {
this.formInfo = { ...data }; let {
this.areaInfo.areaID = this.formInfo.areaID; areaID,
this.areaInfo.areaCode = this.formInfo.areaCode; areaCode,
this.areaInfo.areaName = this.formInfo.areaName; areaName,
this.cityData = [ proCode,
this.formInfo.proCode, cityCode,
this.formInfo.cityCode, districtCode,
this.formInfo.districtCode, modelIds,
]; amWorkStartTime,
this.formInfo.modelIds = this.formInfo.modelIds.map(Number); amWorkEndTime,
this.formInfo.amWorkStartTime = String(this.formInfo.amWorkStartTime); pmWorkStartTime,
this.formInfo.amWorkEndTime = String(this.formInfo.amWorkEndTime); pmWorkEndTime,
this.formInfo.pmWorkStartTime = String(this.formInfo.pmWorkStartTime); } = (this.formInfo = data);
this.formInfo.pmWorkEndTime = String(this.formInfo.pmWorkEndTime); this.areaInfo.areaID = areaID;
if (this.formInfo.logoPath) { this.areaInfo.areaCode = areaCode;
this.fileList = [ this.areaInfo.areaName = areaName;
{ this.cityData = [proCode, cityCode, districtCode];
uid: -1, if (modelIds) {
status: "done", this.formInfo.modelIds = modelIds && modelIds.map(Number);
name: this.formInfo.logoPath, }
url: this.formInfo.logoPath, [
}, this.formInfo.amWorkStartTime,
]; this.formInfo.amWorkEndTime,
this.formInfo.pmWorkStartTime,
this.formInfo.pmWorkEndTime,
] = [
amWorkStartTime,
amWorkEndTime,
pmWorkStartTime,
pmWorkEndTime,
].map((v) => {
if (v) {
return String(v);
} else {
return "";
} }
}); });
});
}, },
// 保存 // 保存
handleOk() { handleOk() {
...@@ -658,68 +667,20 @@ export default { ...@@ -658,68 +667,20 @@ export default {
this.loading = false; this.loading = false;
if (code === 1) { if (code === 1) {
this.$message.success(msg); this.$message.success(msg);
this.fileList = []; this.closeModal();
this.Visible = false;
this.$parent.getSiteList({ areaID: this.areaInfo.areaID }); this.$parent.getSiteList({ areaID: this.areaInfo.areaID });
} }
} }
}); });
}, },
// 上传限制
beforeUpload(file) {
const isJpgOrPng =
file.type === "image/jpeg" || file.type === "image/png";
if (!isJpgOrPng) {
this.$message.error("请上传jpeg或者png图片!");
}
const isLt10M = file.size / 1024 / 1024 < 10;
if (!isLt10M) {
this.$message.error("图片大小不能超过10MB!");
}
return isJpgOrPng && isLt10M;
},
// 上传图片
handleChange({ file, fileList }) {
if (
file.status &&
file.status != "removed" &&
file.response &&
file.response.code == -1
) {
this.$message.error(file.response.msg);
fileList = fileList.filter((file) => file.response.code != -1);
}
this.fileList = [...fileList].slice(-1);
this.fileList = this.fileList.map((v) => {
if (v.response) {
v.url = v.response.url;
}
return v;
});
if (this.fileList[0]) {
this.formInfo.logoPath = this.fileList[0].url;
} else {
this.formInfo.logoPath = "";
}
// if (info.file.status === "uploading") {
// this.loading = true;
// return;
// }
// if (info.file.status === "done") {
// this.formInfo.logoPath = info.file.response.url;
// this.loading = false;
// }
},
// 预览logo // 预览logo
handlePreview(info) { handlePreview(info) {
this.$viewerApi({ this.$viewerApi({
images: [info.url], images: [info.url],
}); });
}, },
// 删除logo
// handleRemove() {
// this.formInfo.logoPath = "";
// },
// 地址 // 地址
oncityChange(val) { oncityChange(val) {
[ [
...@@ -728,6 +689,7 @@ export default { ...@@ -728,6 +689,7 @@ export default {
this.formInfo.districtCode, this.formInfo.districtCode,
] = val; ] = val;
}, },
// 获取详细地址经纬度
getAddress(address) { getAddress(address) {
this.$refs.ruleForm.validateField("detailAddress", (errVal) => { this.$refs.ruleForm.validateField("detailAddress", (errVal) => {
if (errVal !== "中心详细地址不能为空") { if (errVal !== "中心详细地址不能为空") {
......
...@@ -17,14 +17,14 @@ ...@@ -17,14 +17,14 @@
>同步数据</a-button >同步数据</a-button
> >
<a-button <a-button
type="primary"
v-permission="[1]" v-permission="[1]"
type="primary"
@click="editSiteInfo(siteData[0])" @click="editSiteInfo(siteData[0])"
>编辑</a-button >编辑</a-button
> >
<a-button <a-button
type="danger"
v-permission="[1]" v-permission="[1]"
type="danger"
@click="deleteSite(siteData[0].id, 0)" @click="deleteSite(siteData[0].id, 0)"
>删除</a-button >删除</a-button
> >
...@@ -160,27 +160,14 @@ ...@@ -160,27 +160,14 @@
<a-row> <a-row>
<a-col :span="16"> <a-col :span="16">
<span>工作日:</span> <span>工作日:</span>
<span class="work-day" v-if="item.workday1 === 1" <template v-for="(day, i) in workday">
>星期一</span <span
> :key="day"
<span class="work-day" v-if="item.workday2 === 1" class="work-day"
>星期二</span v-if="item[`workday${i + 1}`]"
> >{{ day }}</span
<span class="work-day" v-if="item.workday3 === 1"
>星期三</span
>
<span class="work-day" v-if="item.workday4 === 1"
>星期四</span
>
<span class="work-day" v-if="item.workday5 === 1"
>星期五</span
>
<span class="work-day" v-if="item.workday6 === 1"
>星期六</span
>
<span class="work-day" v-if="item.workday7 === 1"
>星期天</span
> >
</template>
</a-col> </a-col>
</a-row> </a-row>
</div> </div>
...@@ -196,9 +183,11 @@ ...@@ -196,9 +183,11 @@
v-for="(v, i) in item.modelData" v-for="(v, i) in item.modelData"
:key="i" :key="i"
> >
<div class="item-text">
{{ v }} {{ v }}
</div> </div>
</div> </div>
</div>
</a-col> </a-col>
</a-row> </a-row>
</div> </div>
...@@ -267,6 +256,15 @@ import { ...@@ -267,6 +256,15 @@ import {
getSiteList, getSiteList,
SyncSiteData, SyncSiteData,
} from "@/services/basicsetFun"; } from "@/services/basicsetFun";
const workday = [
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六",
"星期日",
];
export default { export default {
components: { components: {
sitetree, sitetree,
...@@ -277,6 +275,7 @@ export default { ...@@ -277,6 +275,7 @@ export default {
data() { data() {
return { return {
workday,
loading: false, loading: false,
title: "新增站点", title: "新增站点",
formVisible: false, formVisible: false,
...@@ -310,7 +309,7 @@ export default { ...@@ -310,7 +309,7 @@ export default {
if (res.data.code === 1) { if (res.data.code === 1) {
let { data, dict } = res.data.data; let { data, dict } = res.data.data;
data.forEach((v) => { data.forEach((v) => {
v.modelIds = v.modelIds.split(","); v.modelIds = v.modelIds && v.modelIds.split(",");
v.modelData = Object.keys(dict.modelIds) v.modelData = Object.keys(dict.modelIds)
.reduce( .reduce(
(pre, cur) => ( (pre, cur) => (
...@@ -329,10 +328,9 @@ export default { ...@@ -329,10 +328,9 @@ export default {
async getSiteInfo() { async getSiteInfo() {
this.loading = true; this.loading = true;
let res = await siteInfo({ id: this.siteId }); let res = await siteInfo({ id: this.siteId });
this.loading = false;
if (res.data.code === 1) { if (res.data.code === 1) {
let { data, dict } = res.data; let { data, dict } = res.data;
data.modelIds = data.modelIds.split(","); data.modelIds = data.modelIds && data.modelIds.split(",");
data.modelData = Object.keys(dict.modelIds) data.modelData = Object.keys(dict.modelIds)
.reduce( .reduce(
(pre, cur) => ( (pre, cur) => (
...@@ -345,6 +343,7 @@ export default { ...@@ -345,6 +343,7 @@ export default {
}); });
this.siteData = [data]; this.siteData = [data];
} }
this.loading = false;
}, },
// 删除 // 删除
...@@ -378,18 +377,18 @@ export default { ...@@ -378,18 +377,18 @@ export default {
}, },
//查看全部 //查看全部
cookAll(text) { cookAll(text) {
this.allShow = true;
this.details = text; this.details = text;
this.allShow = true;
}, },
//新增站点 //新增站点
addSiteAll() { addSiteAll() {
if (this.areaID) { if (!this.areaID) {
this.$message.warning("请先选择区域");
return;
}
this.title = "新增站点"; this.title = "新增站点";
this.formVisible = true; this.formVisible = true;
this.$refs.addsite.onAdd(); this.$refs.addsite.onAdd();
} else {
this.$message.warning("请先选择区域");
}
}, },
// 切换站点 // 切换站点
changePage(num) { changePage(num) {
...@@ -399,10 +398,11 @@ export default { ...@@ -399,10 +398,11 @@ export default {
this.formVisible = false; this.formVisible = false;
}, },
// 编辑 // 编辑
editSiteInfo(data) { editSiteInfo(row) {
this.title = "编辑站点"; this.title = "编辑站点";
this.formVisible = true; let data = this.$_.cloneDeep(row);
this.$refs.addsite.onEdit(data); this.$refs.addsite.onEdit(data);
this.formVisible = true;
}, },
// 同步数据 // 同步数据
handleSync(id) { handleSync(id) {
...@@ -564,18 +564,24 @@ export default { ...@@ -564,18 +564,24 @@ export default {
.item_box { .item_box {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 10px;
.item { .item {
width: 140px; width: 140px;
height: 54px; height: 54px;
margin-right: 10px;
margin-bottom: 10px;
padding: 6px; padding: 6px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background-color: #38b6ff; background-color: #38b6ff;
text-align: center;
color: #fff; color: #fff;
border-radius: 5px; border-radius: 5px;
.item-text{
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
} }
} }
} }
......
...@@ -170,6 +170,7 @@ module.exports = { ...@@ -170,6 +170,7 @@ module.exports = {
info: `${BASE_URL}/base/workman/info`, info: `${BASE_URL}/base/workman/info`,
save: `${BASE_URL}/base/workman/save`, save: `${BASE_URL}/base/workman/save`,
delete: `${BASE_URL}/base/workman/delete`, delete: `${BASE_URL}/base/workman/delete`,
logicDelete: `${BASE_URL}/base/workman/logicDelete`,
downloadTemplate: `${BASE_URL}/base/workman/downloadTemplate`, downloadTemplate: `${BASE_URL}/base/workman/downloadTemplate`,
importData: `${BASE_URL}/base/workman/importData`, importData: `${BASE_URL}/base/workman/importData`,
exportExcel: `${BASE_URL}/base/workman/exportExcel`, exportExcel: `${BASE_URL}/base/workman/exportExcel`,
......
...@@ -85,7 +85,7 @@ export async function saveWorkman(data) { ...@@ -85,7 +85,7 @@ export async function saveWorkman(data) {
} }
// 删除工作人员 // 删除工作人员
export async function delWorkman(data) { export async function delWorkman(data) {
return request(workman.delete, METHOD.GET, data); return request(workman.logicDelete, METHOD.GET, data);
} }
// 编辑工作人员 // 编辑工作人员
export async function editWorkman(data) { export async function editWorkman(data) {
......
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>release</id>
<formats>
<format>tar.gz</format>
</formats>
<!-- 需要打包的文件集 -->
<fileSets>
<fileSet>
<directory>${project.parent.basedir}/base-manager-ui/admin/dist</directory>
<includes>
<include>**/*</include>
</includes>
<outputDirectory>/dist</outputDirectory>
</fileSet>
</fileSets>
</assembly>
\ No newline at end of file
...@@ -18,16 +18,14 @@ ...@@ -18,16 +18,14 @@
<outputDirectory>boot</outputDirectory> <outputDirectory>boot</outputDirectory>
<fileMode>0755</fileMode> <fileMode>0755</fileMode>
</fileSet> </fileSet>
<!-- <fileSet> <fileSet>
<directory>./db</directory> <directory>./db</directory>
<includes> <includes>
<include>*.sql</include> <include>*.sql</include>
<include>service.exe</include>
<include>service.xml</include>
</includes> </includes>
<outputDirectory>db</outputDirectory> <outputDirectory>db</outputDirectory>
<fileMode>0755</fileMode> <fileMode>0755</fileMode>
</fileSet>--> </fileSet>
</fileSets> </fileSets>
<files> <files>
......
...@@ -12,7 +12,7 @@ INSERT INTO `mortals_xhx_task` VALUES (null, '统计站点部门事项数', 'Sta ...@@ -12,7 +12,7 @@ INSERT INTO `mortals_xhx_task` VALUES (null, '统计站点部门事项数', 'Sta
-- ---------------------------- -- ----------------------------
2023-3-11 -- 2023-3-11
-- ---------------------------- -- ----------------------------
ALTER TABLE mortals_sys_workman ADD COLUMN `operatorId` varchar (128) default "" COMMENT '一体化经办人id' AFTER modelIds; ALTER TABLE mortals_sys_workman ADD COLUMN `operatorId` varchar (128) default "" COMMENT '一体化经办人id' AFTER modelIds;
...@@ -159,7 +159,7 @@ PRIMARY KEY (`id`) ...@@ -159,7 +159,7 @@ PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备应用黑名单'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备应用黑名单';
-- ---------------------------- -- ----------------------------
2023-5-07 -- 2023-5-07
-- ---------------------------- -- ----------------------------
ALTER TABLE mortals_sys_site ADD COLUMN `onlineTake` tinyint(2) DEFAULT '1' COMMENT '在线取号(0.否,1.是)' AFTER workday7; ALTER TABLE mortals_sys_site ADD COLUMN `onlineTake` tinyint(2) DEFAULT '1' COMMENT '在线取号(0.否,1.是)' AFTER workday7;
ALTER TABLE mortals_sys_site ADD COLUMN `appointment` tinyint(2) DEFAULT '1' COMMENT '在线取号(0.否,1.是)' AFTER onlineTake; ALTER TABLE mortals_sys_site ADD COLUMN `appointment` tinyint(2) DEFAULT '1' COMMENT '在线取号(0.否,1.是)' AFTER onlineTake;
...@@ -167,7 +167,7 @@ ALTER TABLE mortals_sys_site ADD COLUMN `gowMap` tinyint(2) DEFAULT '1' COMM ...@@ -167,7 +167,7 @@ ALTER TABLE mortals_sys_site ADD COLUMN `gowMap` tinyint(2) DEFAULT '1' COMM
-- ---------------------------- -- ----------------------------
2023-6-15 -- 2023-6-15
-- ---------------------------- -- ----------------------------
-- ---------------------------- -- ----------------------------
-- 自助终端应用分类表 -- 自助终端应用分类表
...@@ -189,20 +189,20 @@ PRIMARY KEY (`id`) ...@@ -189,20 +189,20 @@ PRIMARY KEY (`id`)
-- ---------------------------- -- ----------------------------
2023-7-05 -- 2023-7-05
-- ---------------------------- -- ----------------------------
ALTER TABLE mortals_sys_app_category ADD COLUMN `cover` varchar(256) DEFAULT '' COMMENT '封面' AFTER sort; ALTER TABLE mortals_sys_app_category ADD COLUMN `cover` varchar(256) DEFAULT '' COMMENT '封面' AFTER sort;
ALTER TABLE mortals_sys_app_category ADD COLUMN `remark` varchar(256) DEFAULT '' COMMENT '备注' AFTER cover; ALTER TABLE mortals_sys_app_category ADD COLUMN `remark` varchar(256) DEFAULT '' COMMENT '备注' AFTER cover;
-- ---------------------------- -- ----------------------------
2023-08-29 -- 2023-08-29
-- ---------------------------- -- ----------------------------
ALTER TABLE `mortals_sys_model` ADD COLUMN `type` tinyint(2) DEFAULT '1' COMMENT '模块分类' AFTER `sort`; ALTER TABLE `mortals_sys_model` ADD COLUMN `type` tinyint(2) DEFAULT '1' COMMENT '模块分类' AFTER `sort`;
-- ---------------------------- -- ----------------------------
2023-9-11 -- 2023-9-11
-- ---------------------------- -- ----------------------------
ALTER TABLE mortals_sys_app_info_field ADD COLUMN `serviceApi` varchar(255) default '' COMMENT '事件服务接口请求地址'; ALTER TABLE mortals_sys_app_info_field ADD COLUMN `serviceApi` varchar(255) default '' COMMENT '事件服务接口请求地址';
ALTER TABLE mortals_sys_app_info_field ADD COLUMN `serviceApiParams` varchar(1024) default '' COMMENT '事件服务接口请求参数'; ALTER TABLE mortals_sys_app_info_field ADD COLUMN `serviceApiParams` varchar(1024) default '' COMMENT '事件服务接口请求参数';
...@@ -214,14 +214,14 @@ ALTER TABLE mortals_sys_app_info_templete_field ADD COLUMN `serviceApiParams` v ...@@ -214,14 +214,14 @@ ALTER TABLE mortals_sys_app_info_templete_field ADD COLUMN `serviceApiParams` v
-- ---------------------------- -- ----------------------------
2023-10-17 -- 2023-10-17
-- ---------------------------- -- ----------------------------
ALTER TABLE mortals_sys_window_hall ADD COLUMN `siteId` bigint(20) default '1' COMMENT '站点Id'; ALTER TABLE mortals_sys_window_hall ADD COLUMN `siteId` bigint(20) default '1' COMMENT '站点Id';
-- ---------------------------- -- ----------------------------
2024-01-03 -- 2024-01-03
-- ---------------------------- -- ----------------------------
ALTER TABLE mortals_sys_site_matter ADD COLUMN `agent` tinyint(2) DEFAULT '0' COMMENT '代办帮办(0.否,1.是)'; ALTER TABLE mortals_sys_site_matter ADD COLUMN `agent` tinyint(2) DEFAULT '0' COMMENT '代办帮办(0.否,1.是)';
ALTER TABLE mortals_sys_site_matter ADD COLUMN `agentName` varchar(64) COMMENT '代办姓名'; ALTER TABLE mortals_sys_site_matter ADD COLUMN `agentName` varchar(64) COMMENT '代办姓名';
...@@ -230,7 +230,7 @@ ALTER TABLE mortals_sys_site_matter ADD COLUMN `agentPost` varchar(64) CO ...@@ -230,7 +230,7 @@ ALTER TABLE mortals_sys_site_matter ADD COLUMN `agentPost` varchar(64) CO
-- ---------------------------- -- ----------------------------
2024-02-29 -- 2024-02-29
-- ---------------------------- -- ----------------------------
UPDATE mortals_sys_skin_base SET imageResolution="1920x1080" WHERE imageResolution="1"; UPDATE mortals_sys_skin_base SET imageResolution="1920x1080" WHERE imageResolution="1";
...@@ -239,7 +239,7 @@ UPDATE mortals_sys_skin_base SET imageResolution="1280x1280" WHERE imageResoluti ...@@ -239,7 +239,7 @@ UPDATE mortals_sys_skin_base SET imageResolution="1280x1280" WHERE imageResoluti
-- ---------------------------- -- ----------------------------
2024-03-08 -- 2024-03-08
-- ---------------------------- -- ----------------------------
ALTER TABLE mortals_sys_site_matter ADD COLUMN `hallCheckIn` tinyint(2) DEFAULT '0' COMMENT '大厅事项入驻(0.否,1.是)' AFTER agentPost; ALTER TABLE mortals_sys_site_matter ADD COLUMN `hallCheckIn` tinyint(2) DEFAULT '0' COMMENT '大厅事项入驻(0.否,1.是)' AFTER agentPost;
...@@ -253,3 +253,32 @@ INSERT INTO mortals_xhx_task VALUES (null, '同步全部站点事项材料附件 ...@@ -253,3 +253,32 @@ INSERT INTO mortals_xhx_task VALUES (null, '同步全部站点事项材料附件
-- 2024-07-20 -- 2024-07-20
-- ---------------------------- -- ----------------------------
INSERT INTO `mortals_sys_base_area`(`id`, `ancestors`, `name`, `iid`, `pid`, `haveSonArea`, `haveSonDept`, `haveGetDept`, `haveGetMatterList`, `areaCode`, `areaLevel`, `shortName`, `domain`, `status`, `createTime`, `createUserId`, `updateTime`) VALUES (null, '', '巴中经济开发区', 'f190133f82dd46f0ae2e2116a8b9b13b', '60a505e9dfa643e9826902e0810de55f', 'false', 'True', 'false', 'false', '511971000000', 3, '巴中经济开发区', 'bzsbzq.sczwfw.gov.cn', 1, '2021-07-19 11:59:30', NULL, NULL); INSERT INTO `mortals_sys_base_area`(`id`, `ancestors`, `name`, `iid`, `pid`, `haveSonArea`, `haveSonDept`, `haveGetDept`, `haveGetMatterList`, `areaCode`, `areaLevel`, `shortName`, `domain`, `status`, `createTime`, `createUserId`, `updateTime`) VALUES (null, '', '巴中经济开发区', 'f190133f82dd46f0ae2e2116a8b9b13b', '60a505e9dfa643e9826902e0810de55f', 'false', 'True', 'false', 'false', '511971000000', 3, '巴中经济开发区', 'bzsbzq.sczwfw.gov.cn', 1, '2021-07-19 11:59:30', NULL, NULL);
-- ----------------------------
-- 2024-11-20 索引添加
-- ----------------------------
CREATE INDEX idx_matterId ON mortals_sys_matter_accept (matterId);
CREATE INDEX idx_matterId ON mortals_sys_matter_datum (matterId);
CREATE INDEX idx_matterId ON mortals_sys_matter_charges (matterId);
CREATE INDEX idx_matterId ON mortals_sys_matter_flowlimit (matterId);
CREATE INDEX idx_matterId ON mortals_sys_matter_intermediary (matterId);
CREATE INDEX idx_matterId ON mortals_sys_matter_question (matterId);
CREATE INDEX idx_matterId ON mortals_sys_matter_setbase (matterId);
CREATE INDEX idx_datumId ON mortals_sys_matter_datum_file (datumId);
-- ----------------------------
-- 2024-12-4 站点风貌添加
-- ----------------------------
ALTER TABLE mortals_sys_site ADD COLUMN `govAffairStyle` varchar(1024) COMMENT '政务风貌,多个逗号分割' AFTER modelIds;
ALTER TABLE mortals_sys_site ADD COLUMN `complaintHotline` varchar(64) COMMENT '投诉电话' AFTER govAffairStyle;
-- ----------------------------
-- 2024-12-5
-- ----------------------------
ALTER TABLE mortals_sys_workman ADD COLUMN `deleted` tinyint(2) DEFAULT '0' COMMENT '是否删除(0.否,1.是)' AFTER modelIds;
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
<id>product</id> <id>product</id>
<properties> <properties>
<profiles.active>product</profiles.active> <profiles.active>product</profiles.active>
<profiles.server.debug>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5513</profiles.server.debug>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
</properties> </properties>
</profile> </profile>
...@@ -101,8 +102,6 @@ ...@@ -101,8 +102,6 @@
<properties> <properties>
<profiles.active>yanyuan</profiles.active> <profiles.active>yanyuan</profiles.active>
<profiles.nacos.server-addr>172.16.30.245:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>172.16.30.245:8848</profiles.nacos.server-addr>
<profiles.trustedReferer>127.0.0.1,localhost,10.233.82.175,172.16.30.245,172.16.30.246,172.16.30.247,172.16.30.248</profiles.trustedReferer>
<profiles.req.json.check>true</profiles.req.json.check>
</properties> </properties>
</profile> </profile>
...@@ -315,51 +314,9 @@ ...@@ -315,51 +314,9 @@
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<configuration>
<skip>${skipUi}</skip>
</configuration>
<executions>
<execution>
<id>exec-npm-install</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>yarn</executable>
<arguments>
<argument></argument>
</arguments>
<workingDirectory>${project.parent.basedir}/base-manager-ui/admin</workingDirectory>
</configuration>
</execution>
<execution>
<id>exec-npm-run-build</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>yarn</executable>
<arguments>
<argument>run</argument>
<arguments>${package.environment}</arguments>
</arguments>
<workingDirectory>${project.parent.basedir}/base-manager-ui/admin</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version> <version>3.3.0</version>
<executions> <executions>
<execution> <execution>
<id>make-assembly</id> <id>make-assembly</id>
...@@ -376,22 +333,6 @@ ...@@ -376,22 +333,6 @@
<outputDirectory>${project.parent.basedir}/dist/${project.artifactId}</outputDirectory> <outputDirectory>${project.parent.basedir}/dist/${project.artifactId}</outputDirectory>
</configuration> </configuration>
</execution> </execution>
<execution>
<id>make-assembly-ui</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<skipAssembly>${skipUi}</skipAssembly>
<finalName>${project.artifactId}-ui</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>./assembly/assembly-manager-ui.xml</descriptor>
</descriptors>
<outputDirectory>${project.parent.basedir}/dist/${project.artifactId}</outputDirectory>
</configuration>
</execution>
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
......
#!/bin/sh
RETVAL=$?
SHELL_NAME="deploy"
BASEDIR=$(dirname $0)
BASEDIR=$( (
cd "$BASEDIR"
pwd
))
LOCK_FILE="/tmp/deploy.lock"
# 时间变量
CDATE=$(date "+%Y-%m-%d")
CTIME=$(date "+%H:%M:%S")
SHELL_LOG="${BASEDIR}/${SHELL_NAME}.log"
JAVA_HOME="/usr/local/java/jdk1.8"
SERVICE_PATH="/usr/lib/systemd/system"
PUBLISH_PATH="/home/publish"
PROJECT_NAME="@project.artifactId@"
PROJECT_EXECPATH="${PUBLISH_PATH}/${PROJECT_NAME}"
PROJECT_FILENAME="${PROJECT_NAME}.tar.gz"
PROJECT_SERVICE="${SERVICE_PATH}/${PROJECT_NAME}.service"
#写日志
writelog() {
LOGINFO=$1
echo "${CDATE} ${CTIME}: ${SHELL_NAME} : ${LOGINFO}" >>${SHELL_LOG}
echo ${LOGINFO}
}
#清理目标
clear_deploy() {
SERVICE=$1
EXECPATH=$2
#清理后台自启服务
rm -f ${SERVICE}
#清理执行文件目录
}
build_service() {
SERVICE=$1
EXECPATH=$2
echo "" >${SERVICE}
echo "[Unit]" >>${SERVICE}
echo "Description=${PROJECT_NAME}" >>${SERVICE}
echo "After=network.target" >>${SERVICE}
echo "" >>${SERVICE}
echo "[Service]" >>${SERVICE}
echo "Environment=\"JAVA_HOME=$JAVA_HOME\"" >>${SERVICE}
echo "Type=forking" >>${SERVICE}
echo "ExecStartPre=-/bin/sleep 5s" >>${SERVICE}
echo "ExecStart=${EXECPATH}/bin/start.sh" >>${SERVICE}
echo "ExecStop=${EXECPATH}/bin/shutdown.sh" >>${SERVICE}
echo "PrivateTmp=true" >>${SERVICE}
echo "" >>${SERVICE}
echo "[Install]" >>${SERVICE}
echo "WantedBy=multi-user.target" >>${SERVICE}
writelog "${PROJECT_NAME}服务创建完成!"
}
#启动服务与nginx
start_service() {
systemctl enable ${PROJECT_NAME}
systemctl daemon-reload
writelog "${PROJECT_NAME}服务启动..."
systemctl stop ${PROJECT_NAME}&&systemctl start ${PROJECT_NAME}
project_status=$(systemctl status "${PROJECT_NAME}"|grep Active |awk '{print $2}')
jcpid=$(ps -ef | grep -v "grep" | grep "${PROJECT_NAME} " | awk '{print $2}')
writelog "${PROJECT_NAME}服务启动,PID is ${jcpid} ,status:${project_status}"
}
#部署后台服务
project_deploy() {
writelog "${PROJECT_NAME}_deploy"
clear_deploy ${PROJECT_SERVICE} ${PROJECT_EXECPATH}
writelog "${PROJECT_NAME}_clear_finish"
tar -zvxf ./${PROJECT_FILENAME} -C ${PUBLISH_PATH}
build_service ${PROJECT_SERVICE} ${PROJECT_EXECPATH}
start_service
writelog "${PROJECT_NAME}_deploy_finish"
}
#主函数
main() {
echo "后台服务部署"
project_deploy
exit ${RETVAL}
}
main $1
...@@ -61,11 +61,9 @@ public class AuthUserInterceptor extends BaseInterceptor { ...@@ -61,11 +61,9 @@ public class AuthUserInterceptor extends BaseInterceptor {
@Override @Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
throws Exception { throws Exception {
//response.setContentType("application/json");
String referer = request.getHeader("Referer"); String referer = request.getHeader("Referer");
RedisTemplate<String, String> redisTemplate = cacheService.selectDbRedisTemplate(portalDb); RedisTemplate<String, String> redisTemplate = cacheService.selectDbRedisTemplate(portalDb);
String trustedReferer =redisTemplate.opsForValue().get(RedisKey.KEY_REFERERS_CACHE); String trustedReferer =redisTemplate.opsForValue().get(RedisKey.KEY_REFERERS_CACHE);
// String referer = cacheService.get(RedisKey.KEY_REFERERS_CACHE);
if (!ObjectUtils.isEmpty(referer)) { if (!ObjectUtils.isEmpty(referer)) {
//校验host即可 //校验host即可
URI host = URLUtil.getHost(new URL(referer)); URI host = URLUtil.getHost(new URL(referer));
...@@ -79,20 +77,6 @@ public class AuthUserInterceptor extends BaseInterceptor { ...@@ -79,20 +77,6 @@ public class AuthUserInterceptor extends BaseInterceptor {
} }
} }
} }
HttpServletResponse httpResponse = response;
Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (Cookie cookie : cookies) {
cookie.setHttpOnly(true);
cookie.setSecure(true);
cookie.setPath("/");
cookie.setMaxAge(3600);
httpResponse.addCookie(cookie);
}
}
if (handler instanceof HandlerMethod) { if (handler instanceof HandlerMethod) {
HandlerMethod handlerMethod = (HandlerMethod) handler; HandlerMethod handlerMethod = (HandlerMethod) handler;
Method method = handlerMethod.getMethod(); Method method = handlerMethod.getMethod();
......
...@@ -62,24 +62,5 @@ public class OperLogController extends BaseCRUDJsonBodyMappingController<OperLog ...@@ -62,24 +62,5 @@ public class OperLogController extends BaseCRUDJsonBodyMappingController<OperLog
}); });
} }
/* @Override
protected void init(HttpServletRequest request, HttpServletResponse response, OperLogForm form,
Map<String, Object> model, Context context) {
Map<String, Object> status = new HashMap<String, Object>(1);
// 返回日志类型
status.put("operType", OperTypeEnum.getEnumMap());
model.put(KEY_RESULT_DICT, status);
super.init(request, response, form, model, context);
}
@Override
protected void doListBefore(HttpServletRequest request, HttpServletResponse response, OperLogForm form, Map<String, Object> model, Context context) throws AppException {
form.getQuery().setOrderColList(new ArrayList<OrderCol>() {
{
add(new OrderCol("a.logDate", "desc"));
}
});
}*/
} }
\ No newline at end of file
...@@ -3,7 +3,10 @@ package com.mortals.xhx.base.system.upload.web; ...@@ -3,7 +3,10 @@ package com.mortals.xhx.base.system.upload.web;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BaseController; import com.mortals.framework.web.BaseController;
import com.mortals.xhx.base.system.resource.model.ResourceEntity;
import com.mortals.xhx.base.system.resource.service.ResourceService;
import com.mortals.xhx.base.system.upload.service.UploadService; import com.mortals.xhx.base.system.upload.service.UploadService;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -23,10 +26,18 @@ import java.util.Map; ...@@ -23,10 +26,18 @@ import java.util.Map;
@RestController @RestController
@RequestMapping("file") @RequestMapping("file")
public class UploadController extends BaseController { public class UploadController extends BaseController {
protected String moduleDesc = "";
@Resource @Resource
private UploadService uploadService; private UploadService uploadService;
public UploadController() {
this.setModuleDesc("资源信息");
}
public void setModuleDesc(String moduleDesc) {
this.moduleDesc = moduleDesc;
}
@RequestMapping(value = "upload") @RequestMapping(value = "upload")
public String doFileUpload(HttpServletRequest request, UploadForm form) { public String doFileUpload(HttpServletRequest request, UploadForm form) {
Map<String, Object> model = new HashMap<>(); Map<String, Object> model = new HashMap<>();
...@@ -52,7 +63,7 @@ public class UploadController extends BaseController { ...@@ -52,7 +63,7 @@ public class UploadController extends BaseController {
@RequestMapping(value = "commonupload") @RequestMapping(value = "commonupload")
public String doFileUpload(MultipartFile file, @RequestParam(value = "prePath",defaultValue = "/file/fileupload") String prePath) { public String doFileUpload(MultipartFile file, @RequestParam(value = "prePath", defaultValue = "/file/fileupload") String prePath) {
Map<String, Object> model = new HashMap<>(); Map<String, Object> model = new HashMap<>();
String jsonStr = ""; String jsonStr = "";
try { try {
...@@ -97,7 +108,7 @@ public class UploadController extends BaseController { ...@@ -97,7 +108,7 @@ public class UploadController extends BaseController {
* @param fileName 文件名称 * @param fileName 文件名称
*/ */
@GetMapping("preview/{fileName}") @GetMapping("preview/{fileName}")
public void preView(@PathVariable(value="fileName") String fileName, HttpServletResponse response) { public void preView(@PathVariable(value = "fileName") String fileName, HttpServletResponse response) {
try { try {
uploadService.preview(fileName, response); uploadService.preview(fileName, response);
} catch (Exception e) { } catch (Exception e) {
...@@ -111,7 +122,7 @@ public class UploadController extends BaseController { ...@@ -111,7 +122,7 @@ public class UploadController extends BaseController {
* @param fileName 文件名称 * @param fileName 文件名称
*/ */
@GetMapping("fileupload/{fileName}") @GetMapping("fileupload/{fileName}")
public void fileupload(@PathVariable(value="fileName") String fileName, HttpServletResponse response) { public void fileupload(@PathVariable(value = "fileName") String fileName, HttpServletResponse response) {
try { try {
uploadService.uploadDownload(fileName, response); uploadService.uploadDownload(fileName, response);
} catch (Exception e) { } catch (Exception e) {
......
...@@ -395,23 +395,6 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE ...@@ -395,23 +395,6 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
siteService.updateAllSiteTree(null); siteService.updateAllSiteTree(null);
/* //单独更新全站点
UserEntity userEntity = new UserEntity();
userEntity.initAttrValue();
userEntity.setId(0L);
Context contextTemp = new Context();
contextTemp.setUser(userEntity);
SyncTreeSiteThread syncTreeSiteThread = new SyncTreeSiteThread(contextTemp);
ThreadPool.getInstance().execute(syncTreeSiteThread);
userEntity = new UserEntity();
userEntity.initAttrValue();
userEntity.setId(1L);
contextTemp = new Context();
contextTemp.setUser(userEntity);
syncTreeSiteThread = new SyncTreeSiteThread(contextTemp);
ThreadPool.getInstance().execute(syncTreeSiteThread);
*/
} }
...@@ -429,7 +412,7 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE ...@@ -429,7 +412,7 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
List<UserEntity> newUserList = userPduList.stream().map(newUser -> { List<UserEntity> newUserList = userPduList.stream().map(newUser -> {
UserEntity userEntity = new UserEntity(); UserEntity userEntity = new UserEntity();
userEntity.initAttrValue(); userEntity.initAttrValue();
BeanUtils.copyProperties(newUser, userEntity, new String[]{ "lastLoginTime", "lastLoginAddress"}); BeanUtils.copyProperties(newUser, userEntity, new String[]{"lastLoginTime", "lastLoginAddress"});
return userEntity; return userEntity;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
......
...@@ -81,10 +81,28 @@ public class MatterDetailHtmlParseUtil { ...@@ -81,10 +81,28 @@ public class MatterDetailHtmlParseUtil {
String blankSampleExp = "//div[@id=\"zhezhao\"]//div[@class='zhezhao4']"; String blankSampleExp = "//div[@id=\"zhezhao\"]//div[@class='zhezhao4']";
String sampleExp = "//div[@id=\"zhezhao\"]//div[@class='zhezhao2']"; String sampleExp = "//div[@id=\"zhezhao\"]//div[@class='zhezhao2']";
String baseInfoExp = "//div[@id=\"zhezhao\"]//div[@class='zhezhao3']"; String baseInfoExp = "//div[@id=\"zhezhao\"]//div[@class='zhezhao3']";
String baseInfoTableNameExp = "//*[@id=\"material\"]//tr//td[2]/span[1]";
// String baseInfoTableNameExp = "//*[@id=\"material\"]//tr/td[2]/span[1]";
String baseInfoTableMustExp = "//*[@id=\"material\"]//tr/td[3]/span[1]";
try { try {
Elements baseInfoTableNameElements = dom.selectXpath(baseInfoTableNameExp);
Elements baseInfoTableMustElements = dom.selectXpath(baseInfoTableMustExp);
int size = baseInfoTableNameElements.size();
int size1 = baseInfoTableMustElements.size();
Map<String, String> nameMustMap = new HashMap<>();
if (size == size1) {
for (int i = 0; i < size; i++) {
Element element = baseInfoTableNameElements.get(i);
Element element1 = baseInfoTableMustElements.get(i);
if (!ObjectUtils.isEmpty(element)&&!ObjectUtils.isEmpty(element1)) {
nameMustMap.put(element.text(), element1.text());
}
}
}
Elements elements = dom.selectXpath(blankSampleExp); Elements elements = dom.selectXpath(blankSampleExp);
int rowNum = elements.size(); int rowNum = elements.size();
for (int i = 1; i <= rowNum; i++) { for (int i = 1; i <= rowNum; i++) {
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
List<MatterDatumFileEntity> datumFileEntities = new ArrayList<>(); List<MatterDatumFileEntity> datumFileEntities = new ArrayList<>();
...@@ -111,20 +129,8 @@ public class MatterDetailHtmlParseUtil { ...@@ -111,20 +129,8 @@ public class MatterDetailHtmlParseUtil {
List<String> allGroup = ReUtil.findAllGroup1("'(.*?)'", onclickStr); List<String> allGroup = ReUtil.findAllGroup1("'(.*?)'", onclickStr);
if (!ObjectUtils.isEmpty(allGroup)) { if (!ObjectUtils.isEmpty(allGroup)) {
/* String encryUrl = "http://www.sczwfw.gov.cn/jiq/interface/item/annex/encryptUrl?id=" + allGroup.get(0);
String resp = HttpUtil.get(encryUrl);
JSONObject obj = JSON.parseObject(resp);
String code = obj.getString("code");
String data = obj.getString("data");
if ("0".equals(code)) {
fileEntity.setFileUrl(data);
fileEntity.setLocalFileUrl(data);
}*/
fileEntity.setFileUrl(allGroup.get(0)); fileEntity.setFileUrl(allGroup.get(0));
} }
// fileEntity.setFileUrl(node.firstChild().attr("href").trim());
datumFileEntities.add(fileEntity); datumFileEntities.add(fileEntity);
} }
} }
...@@ -151,25 +157,13 @@ public class MatterDetailHtmlParseUtil { ...@@ -151,25 +157,13 @@ public class MatterDetailHtmlParseUtil {
List<String> allGroup = ReUtil.findAllGroup1("'(.*?)'", onclickStr); List<String> allGroup = ReUtil.findAllGroup1("'(.*?)'", onclickStr);
if (!ObjectUtils.isEmpty(allGroup)) { if (!ObjectUtils.isEmpty(allGroup)) {
/* String encryUrl = "http://www.sczwfw.gov.cn/jiq/interface/item/annex/encryptUrl?id=" + allGroup.get(0);
String resp = HttpUtil.get(encryUrl);
JSONObject obj = JSON.parseObject(resp);
String code = obj.getString("code");
String data = obj.getString("data");
if ("0".equals(code)) {
fileEntity.setFileUrl(data);
fileEntity.setLocalFileUrl(data);
}*/
fileEntity.setFileUrl(allGroup.get(0)); fileEntity.setFileUrl(allGroup.get(0));
} }
// fileEntity.setFileUrl(node.firstChild().attr("href").trim());
datumSampleFileEntities.add(fileEntity); datumSampleFileEntities.add(fileEntity);
} }
map.put("sampleList", datumSampleFileEntities); map.put("sampleList", datumSampleFileEntities);
} }
//查询基本信息 //查询基本信息
String tempxPath2 = baseInfoExp + String.format("[%d]//table//tr//td", i); String tempxPath2 = baseInfoExp + String.format("[%d]//table//tr//td", i);
Elements baseinfoList = dom.selectXpath(tempxPath2); Elements baseinfoList = dom.selectXpath(tempxPath2);
...@@ -184,6 +178,11 @@ public class MatterDetailHtmlParseUtil { ...@@ -184,6 +178,11 @@ public class MatterDetailHtmlParseUtil {
baseInfoMap.put(prenode.text().trim(), node.text().trim()); baseInfoMap.put(prenode.text().trim(), node.text().trim());
} }
} }
String name = baseInfoMap.get("材料名称");
String must = nameMustMap.get(name);
if(!ObjectUtils.isEmpty(must)){
baseInfoMap.put("材料必要性", must);
}
map.put("baseinfo", baseInfoMap); map.put("baseinfo", baseInfoMap);
mapList.add(map); mapList.add(map);
} }
...@@ -441,7 +440,8 @@ public class MatterDetailHtmlParseUtil { ...@@ -441,7 +440,8 @@ public class MatterDetailHtmlParseUtil {
// String url = "http://www.sczwfw.gov.cn/jiq/front/transition/ywTransToDetail?areaCode=511500000000&itemCode=511A0151400000-511500000000-000-511501-7-1-00&taskType=1&deptCode=511501-7"; // String url = "http://www.sczwfw.gov.cn/jiq/front/transition/ywTransToDetail?areaCode=511500000000&itemCode=511A0151400000-511500000000-000-511501-7-1-00&taskType=1&deptCode=511501-7";
// String url = "http://www.sczwfw.gov.cn/jiq/front/transition/ywTransToDetail?areaCode=511500000000&itemCode=511A0000400004-511500000000-000-1151120000870212XU-1-00&taskType=1&deptCode=3922757070285361152"; // String url = "http://www.sczwfw.gov.cn/jiq/front/transition/ywTransToDetail?areaCode=511500000000&itemCode=511A0000400004-511500000000-000-1151120000870212XU-1-00&taskType=1&deptCode=3922757070285361152";
// String url = "http://www.sczwfw.gov.cn/jiq/front/transition/ywTransToDetail?areaCode=511500000000&itemCode=512036008003-511500000000-000-11511200MB1503849K-1-00&taskType=20&deptCode=3907787168696946688"; // String url = "http://www.sczwfw.gov.cn/jiq/front/transition/ywTransToDetail?areaCode=511500000000&itemCode=512036008003-511500000000-000-11511200MB1503849K-1-00&taskType=20&deptCode=3907787168696946688";
String url = "https://www.sczwfw.gov.cn/jiq/front/transition/ywTransToDetail?areaCode=511500000000&itemCode=511A0101600004-511500000000-000-11511200008702584B-1-00&taskType=1&deptCode=511501-7"; //String url = "https://www.sczwfw.gov.cn/jiq/front/transition/ywTransToDetail?areaCode=511500000000&itemCode=511A0101600004-511500000000-000-11511200008702584B-1-00&taskType=1&deptCode=511501-7";
String url = "http://www.sczwfw.gov.cn/jiq/front/transition/ywTransToDetail?areaCode=511500000000&itemCode=511A0358400001-511500000000-000-11511200MB1666138E-1-00&taskType=1&deptCode=11511200008702664Y";
Document dom = MatterDetailHtmlParseUtil.getDomByHtml(url); Document dom = MatterDetailHtmlParseUtil.getDomByHtml(url);
Map<String, String> baseInfoMap = MatterDetailHtmlParseUtil.getbaseInfoMapByHtml(dom); Map<String, String> baseInfoMap = MatterDetailHtmlParseUtil.getbaseInfoMapByHtml(dom);
......
...@@ -9,7 +9,10 @@ import com.mortals.framework.common.Rest; ...@@ -9,7 +9,10 @@ import com.mortals.framework.common.Rest;
import com.mortals.framework.util.DataUtil; import com.mortals.framework.util.DataUtil;
import com.mortals.xhx.common.code.SourceEnum; import com.mortals.xhx.common.code.SourceEnum;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.matter.model.MatterEntity; import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.utils.SpringUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
import org.jsoup.nodes.Document; import org.jsoup.nodes.Document;
...@@ -126,7 +129,7 @@ public class MatterHtmlParseUtil { ...@@ -126,7 +129,7 @@ public class MatterHtmlParseUtil {
log.info("error href ,title:" + title); log.info("error href ,title:" + title);
} }
buildMatter(matterEntityList, title, href, evaluationUrl, netApplyUrl); buildMatter(matterEntityList, title, href, evaluationUrl, netApplyUrl,params);
} }
elements = dom.selectXpath(matterListLiExp); elements = dom.selectXpath(matterListLiExp);
...@@ -171,7 +174,7 @@ public class MatterHtmlParseUtil { ...@@ -171,7 +174,7 @@ public class MatterHtmlParseUtil {
} }
} }
buildMatter(matterEntityList, title, href, evaluationUrl, netApplyUrl); buildMatter(matterEntityList, title, href, evaluationUrl, netApplyUrl,params);
} }
break; break;
...@@ -187,13 +190,23 @@ public class MatterHtmlParseUtil { ...@@ -187,13 +190,23 @@ public class MatterHtmlParseUtil {
return Rest.ok(matterEntityList); return Rest.ok(matterEntityList);
} }
private static void buildMatter(List<MatterEntity> matterEntityList, String title, String href, String evaluationUrl, String netApplyUrl) { private static void buildMatter(List<MatterEntity> matterEntityList, String title, String href, String evaluationUrl, String netApplyUrl,Map<String, String> params) {
UrlBuilder builder = UrlBuilder.ofHttp(href, CharsetUtil.CHARSET_UTF_8); UrlBuilder builder = UrlBuilder.ofHttp(href, CharsetUtil.CHARSET_UTF_8);
String itemCode = builder.getQuery().get("itemCode").toString(); String itemCode = builder.getQuery().get("itemCode").toString();
String taskType = builder.getQuery().get("taskType").toString(); String taskType = builder.getQuery().get("taskType").toString();
String deptCode = builder.getQuery().get("deptCode").toString(); String deptCode = builder.getQuery().get("deptCode").toString();
String areaCode = builder.getQuery().get("areaCode").toString(); String areaCode = builder.getQuery().get("areaCode").toString();
//todo 如果部门编码与初始编码不一致,切不在部门列表中,添加默认部门
String sourceDeptCode = params.getOrDefault("deptCode", "");
DeptService deptService = SpringUtils.getBean(DeptService.class);
DeptEntity cache = deptService.getCache(deptCode);
if(ObjectUtils.isEmpty(cache)){
//抓取事项的部门编码未找到 用初始的部门编码
deptCode=sourceDeptCode;
}
MatterEntity matterEntity = new MatterEntity(); MatterEntity matterEntity = new MatterEntity();
matterEntity.initAttrValue(); matterEntity.initAttrValue();
matterEntity.setTcode(itemCode); matterEntity.setTcode(itemCode);
......
...@@ -72,7 +72,7 @@ public class SyncGovMatterDetailThread implements Runnable { ...@@ -72,7 +72,7 @@ public class SyncGovMatterDetailThread implements Runnable {
@Override @Override
public void run() { public void run() {
log.info("同步站点事项开始....."); log.info("同步站点事项开始.....");
Rest<String> deptRest = deptService.syncDeptBySiteId(siteEntity, context); deptService.syncDeptBySiteId(siteEntity, context);
//log.info("同步站点部门:" + JSON.toJSONString(deptRest)); //log.info("同步站点部门:" + JSON.toJSONString(deptRest));
Rest<String> rest = siteService.syncMatterBySiteId(siteEntity, context); Rest<String> rest = siteService.syncMatterBySiteId(siteEntity, context);
//Rest<String> rest = Rest.ok(); //Rest<String> rest = Rest.ok();
......
...@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import static com.mortals.xhx.common.key.Constant.USER_SITE_TREE; import static com.mortals.xhx.common.key.Constant.USER_SITE_TREE;
...@@ -22,6 +23,8 @@ public class DemoStartedService implements IApplicationStartedService { ...@@ -22,6 +23,8 @@ public class DemoStartedService implements IApplicationStartedService {
private ICacheService cacheService; private ICacheService cacheService;
@Autowired @Autowired
private SiteService siteService; private SiteService siteService;
@Autowired
private UserService userService;
@Override @Override
public void start() { public void start() {
...@@ -29,7 +32,9 @@ public class DemoStartedService implements IApplicationStartedService { ...@@ -29,7 +32,9 @@ public class DemoStartedService implements IApplicationStartedService {
log.info("开始服务..[初始化用户站点树]"); log.info("开始服务..[初始化用户站点树]");
//删除redis 中的 站点树 //删除redis 中的 站点树
cacheService.del(USER_SITE_TREE); cacheService.del(USER_SITE_TREE);
siteService.updateAllSiteTree(null);
//从门户获取所有站点用户
userService.refreshUser();
} }
@Override @Override
......
package com.mortals.xhx.daemon.task;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.framework.utils.ServletUtils;
import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.module.matter.model.MatterDatumFileEntity;
import com.mortals.xhx.module.matter.model.MatterDatumFileQuery;
import com.mortals.xhx.module.matter.service.MatterDatumFileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StopWatch;
import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.util.ArrayList;
import java.util.List;
import static com.mortals.xhx.common.key.Constant.MAX_RETRY_COUNT;
/**
* 同步全部站点事项材料附件
*
* @author: zxfei
* @date: 2024/2/27 15:34
*/
@Slf4j
//@Service("SyncMatterDaumFileTask")
public class SyncMatterDaumFileTaskImpl implements ITaskExcuteService {
@Autowired
private MatterDatumFileService matterDatumFileService;
@Autowired
private UploadService uploadService;
@Override
public void excuteTask(ITask task) throws AppException {
log.info("开始同步材料列表附件! 分页获取");
int total = matterDatumFileService.count(new MatterDatumFileQuery(), null);
int page = total / 1000 + 1;
StopWatch stopWatch = new StopWatch("watch daum file");
for (int i = 1; i <= page; i++) {
try {
stopWatch.start("同步附件");
PageInfo pageInfo = new PageInfo();
pageInfo.setCurrPage(i);
pageInfo.setPrePageResult(1000);
List<MatterDatumFileEntity> datumFileEntities = matterDatumFileService.find(new MatterDatumFileQuery(), pageInfo, null).getList();
List<MatterDatumFileEntity> updateList = new ArrayList<>();
for (MatterDatumFileEntity datumFileEntity : datumFileEntities) {
String localFileUrl = datumFileEntity.getLocalFileUrl();
if (ObjectUtils.isEmpty(localFileUrl) && !ObjectUtils.isEmpty(datumFileEntity.getFileUrl())) {
String encryUrl = "http://www.sczwfw.gov.cn/jiq/interface/item/annex/encryptUrl?id=" + datumFileEntity.getFileUrl();
// Thread.sleep(300);
String resp = HttpUtil.get(encryUrl, 60000);
JSONObject obj = JSON.parseObject(resp);
String code = obj.getString("code");
String data = obj.getString("data");
if ("0".equals(code)) {
//下载文件
int reCount = 0;
while (reCount < 3) {
try {
byte[] fileData = HttpUtil.downloadBytes(data);
InputStream inputStream = new ByteArrayInputStream(fileData);
MultipartFile file = ServletUtils.getMultipartFile(inputStream, datumFileEntity.getFileName());
String filePath = uploadService.saveFileUpload(file, "file/fileupload/daumfile", null);
if (!ObjectUtils.isEmpty(filePath)) {
datumFileEntity.setLocalFileUrl("/" + filePath);
MatterDatumFileEntity updateEntity = new MatterDatumFileEntity();
updateEntity.setId(datumFileEntity.getId());
updateEntity.setLocalFileUrl(datumFileEntity.getLocalFileUrl());
updateList.add(updateEntity);
}
break;
} catch (Exception e) {
log.error("下载附件异常,id:{},url:{}",datumFileEntity.getFileUrl(),data, e);
reCount++;
try {
Thread.sleep(2000);
} catch (InterruptedException ie) {
}
}
}
}
}
}
if (!ObjectUtils.isEmpty(updateList)) {
log.info("开始更新附件本地地址==》{}", updateList.size());
matterDatumFileService.update(updateList);
}
log.info("同步材料附件{}条完成,耗时:{}s", updateList.size(), stopWatch.getLastTaskTimeMillis() / 1000);
} catch (Exception e) {
log.error("同步材料附件异常", e);
}
stopWatch.stop();
}
}
@Override
public void stopTask(ITask task) throws AppException {
}
public static void main(String[] args) {
int total = 1001;
int page = total / 1000;
System.out.println(page);
}
}
...@@ -36,54 +36,10 @@ public class SyncUserTaskImpl implements ITaskExcuteService { ...@@ -36,54 +36,10 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
@Autowired @Autowired
private UserService userService; private UserService userService;
@Autowired
private IUserFeign userFeign;
@Override @Override
public void excuteTask(ITask task) throws AppException { public void excuteTask(ITask task) throws AppException {
userService.refreshUser();
log.info("同步用户"); log.info("同步用户");
/* UserPdu userPdu = new UserPdu(); userService.refreshUser();
userPdu.setPage(1);
userPdu.setSize(-1);
Rest<RespData<List<UserPdu>>> list = userFeign.list(userPdu);
userService.updateUserList(list.getData().getData());*/
//resourceService.updateUserList();
/* UserPdu userPdu = new UserPdu();
userPdu.setPage(1);
userPdu.setSize(-1);
Rest<RespData<List<UserPdu>>> list = userFeign.list(userPdu);
*//* List<UserPdu> firstList = list.getData().getData();
List<UserEntity> secondList = userService.find(new UserQuery());
//交叉对比后,多的新增 少的删除
List<UserEntity> diffList = secondList.parallelStream()
.filter(item -> !firstList.parallelStream().map(e -> e.getId()).collect(Collectors.toList()).contains(item.getId()))
.collect(Collectors.toList());*//*
//log.info("diffList:{}",JSON.toJSONString(diffList));
//更新本地用户信息,并且更新用户站点树
list.getData().getData().forEach(user -> {
//查询用户是否存在,
//UserEntity userEntity = userService.get(user.getId());
UserEntity userEntity =userService.selectOne(new UserQuery().loginName(user.getLoginName()));
if (ObjectUtils.isEmpty(userEntity)) {
//新增
UserEntity entity = new UserEntity();
entity.initAttrValue();
BeanUtils.copyProperties(user, entity, BeanUtil.getNullPropertyNames(user));
userService.save(entity);
Context context = new Context();
context.setUser(entity);
new Thread(new SyncTreeSiteThread(siteService, context)).start();
}
});*/
} }
......
...@@ -13,5 +13,5 @@ import java.util.List; ...@@ -13,5 +13,5 @@ import java.util.List;
public interface AppDao extends ICRUDDao<AppEntity,Long>{ public interface AppDao extends ICRUDDao<AppEntity,Long>{
String doSting();
} }
...@@ -17,5 +17,12 @@ import java.util.List; ...@@ -17,5 +17,12 @@ import java.util.List;
public class AppDaoImpl extends BaseCRUDDaoMybatis<AppEntity,Long> implements AppDao { public class AppDaoImpl extends BaseCRUDDaoMybatis<AppEntity,Long> implements AppDao {
/**
* @return
*/
@Override
public String doSting() {
//todo
return null;
}
} }
...@@ -33,4 +33,6 @@ public interface AppService extends ICRUDService<AppEntity, Long> { ...@@ -33,4 +33,6 @@ public interface AppService extends ICRUDService<AppEntity, Long> {
AppDao getAppDao(); AppDao getAppDao();
} }
\ No newline at end of file
...@@ -12,6 +12,7 @@ import com.mortals.framework.exception.AppException; ...@@ -12,6 +12,7 @@ import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol; import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.base.system.upload.service.UploadService; import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
...@@ -49,7 +50,7 @@ import static com.mortals.xhx.common.key.Constant.CUSTAPP_ROOT_PATH; ...@@ -49,7 +50,7 @@ import static com.mortals.xhx.common.key.Constant.CUSTAPP_ROOT_PATH;
*/ */
@Service("appService") @Service("appService")
@Slf4j @Slf4j
public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, Long> implements AppService { public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEntity, Long> implements AppService {
@Autowired @Autowired
private UploadService uploadService; private UploadService uploadService;
...@@ -110,42 +111,8 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L ...@@ -110,42 +111,8 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
} else { } else {
item.setAppIconUrl(item.getAppIconPath()); item.setAppIconUrl(item.getAppIconPath());
} }
};
super.findAfter(params, pageInfo, context, list);
}
private void sortAppByIdList(AppEntity params, List<AppEntity> list) {
if (!ObjectUtils.isEmpty(params.getIdList())) {
log.info("请求的排序id列表:{}", JSON.toJSONString(params.getIdList()));
try {
//去除idlist中不存在的
Set<Long> idSet = list.stream().map(item -> item.getId()).collect(Collectors.toSet());
List<Long> idList = params.getIdList();
Iterator<Long> ite = idList.iterator();
while (ite.hasNext()) {
Long next = ite.next();
if (!idSet.contains(next)) {
ite.remove();
}
}
//根据idList进行排序
for (int i = 0; i < idList.size(); i++) {
Long id = idList.get(i);
for (int j = 0; j < list.size(); j++) {
if (id.equals(list.get(j).getId())) {
//判断位置是否一直
if (i != j) {
//交换
Collections.swap(list, i, j);
}
}
}
}
} catch (Exception e) {
log.error("排序异常!", e);
}
} }
super.findAfter(params, pageInfo, context, list);
} }
private void checkDeviceBlackApp(AppEntity params, List<AppEntity> list) { private void checkDeviceBlackApp(AppEntity params, List<AppEntity> list) {
...@@ -445,14 +412,14 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L ...@@ -445,14 +412,14 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
AppVersionEntity curAppVersionEntity = appVersionEntities.get(0); AppVersionEntity curAppVersionEntity = appVersionEntities.get(0);
// String versionNum = StrUtil.subAfter(curAppVersionEntity.getVersion(), Constant.VERSION_PREFIX, false); // String versionNum = StrUtil.subAfter(curAppVersionEntity.getVersion(), Constant.VERSION_PREFIX, false);
Integer versionNum = curAppVersionEntity.getVersion(); Integer versionNum = curAppVersionEntity.getVersion();
// Integer newVersionNum = versionNum++; Integer newVersionNum = ++versionNum;
AppVersionEntity appVersionEntity = new AppVersionEntity(); AppVersionEntity appVersionEntity = new AppVersionEntity();
appVersionEntity.initAttrValue(); appVersionEntity.initAttrValue();
AppVersionEntity versionEntity = new AppVersionEntity(); AppVersionEntity versionEntity = new AppVersionEntity();
versionEntity.initAttrValue(); versionEntity.initAttrValue();
versionEntity.setAppId(entity.getId()); versionEntity.setAppId(entity.getId());
versionEntity.setAppName(entity.getAppName()); versionEntity.setAppName(entity.getAppName());
versionEntity.setVersion(++versionNum); versionEntity.setVersion(newVersionNum);
versionEntity.setNotes(entity.getNotes()); versionEntity.setNotes(entity.getNotes());
versionEntity.setFileName(entity.getFileName()); versionEntity.setFileName(entity.getFileName());
versionEntity.setFilePath(entity.getFilePath()); versionEntity.setFilePath(entity.getFilePath());
......
package com.mortals.xhx.module.base.web; package com.mortals.xhx.module.base.web;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ICacheService; import com.mortals.framework.service.ICacheService;
import com.mortals.framework.util.ThreadPool; import com.mortals.framework.util.ThreadPool;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.keys.RedisCacheKeys; import com.mortals.xhx.common.keys.RedisCacheKeys;
import com.mortals.xhx.common.utils.SyncGovMatterDetailThread; import com.mortals.xhx.common.utils.SyncGovMatterDetailThread;
import com.mortals.xhx.common.utils.SyncSubAreaThread; import com.mortals.xhx.common.utils.SyncSubAreaThread;
...@@ -99,7 +101,13 @@ public class BaseAreaController extends BaseCRUDJsonBodyMappingController<BaseAr ...@@ -99,7 +101,13 @@ public class BaseAreaController extends BaseCRUDJsonBodyMappingController<BaseAr
if (!bool) { if (!bool) {
throw new AppException("当前正在同步区域数据中,请勿重复提交!"); throw new AppException("当前正在同步区域数据中,请勿重复提交!");
} }
ThreadPool.getInstance().execute(new SyncSubAreaThread(this.service, baseAreaEntity, getContext()));
Rest<String> rest = this.service.genSubAreaByRootName(baseAreaEntity, getContext());
if(YesNoEnum.NO.getValue()==rest.getCode()){
throw new AppException("更新子区域失败,"+rest.getMsg());
}
// ThreadPool.getInstance().execute(new SyncSubAreaThread(this.service, baseAreaEntity, getContext()));
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, "初始同步区域数据命令下发成功!"); jsonObject.put(KEY_RESULT_MSG, "初始同步区域数据命令下发成功!");
......
...@@ -1108,6 +1108,9 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -1108,6 +1108,9 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
Map<String, String> baseInfoMap = MatterDetailHtmlParseUtil.getbaseInfoMapByHtml(dom); Map<String, String> baseInfoMap = MatterDetailHtmlParseUtil.getbaseInfoMapByHtml(dom);
Integer matterEditionRemote = DataUtil.converStr2Int(baseInfoMap.getOrDefault("事项版本", "0"), 0); Integer matterEditionRemote = DataUtil.converStr2Int(baseInfoMap.getOrDefault("事项版本", "0"), 0);
//由于附件连接有效性,强制更新材料属性与附件地址
saveDatumInfo(matterEntity, context, dom, sqclInfoSetting);
if (matterEditionLocal >= matterEditionRemote) { if (matterEditionLocal >= matterEditionRemote) {
return Rest.fail("本地事项版本大于等于远端,不需要更新!"); return Rest.fail("本地事项版本大于等于远端,不需要更新!");
} }
...@@ -1118,8 +1121,7 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -1118,8 +1121,7 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
matterEntity.setDeptName(extCache == null ? "" : extCache.getName()); matterEntity.setDeptName(extCache == null ? "" : extCache.getName());
//构建基础信息参数 //构建基础信息参数
savebaseInfo(matterEntity, baseInfoMap, baseInfoSetting); savebaseInfo(matterEntity, baseInfoMap, baseInfoSetting);
//更新材料属性
saveDatumInfo(matterEntity, context, dom, sqclInfoSetting);
//更新受理条件 //更新受理条件
saveSltjInfo(matterEntity, context, dom); saveSltjInfo(matterEntity, context, dom);
//更新办理流程 //更新办理流程
......
...@@ -2,6 +2,9 @@ package com.mortals.xhx.module.site.model; ...@@ -2,6 +2,9 @@ package com.mortals.xhx.module.site.model;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.ArrayList; import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel; import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
...@@ -11,7 +14,7 @@ import lombok.Data; ...@@ -11,7 +14,7 @@ import lombok.Data;
* 站点实体对象 * 站点实体对象
* *
* @author zxfei * @author zxfei
* @date 2023-05-07 * @date 2024-12-11
*/ */
@Data @Data
public class SiteEntity extends SiteVo { public class SiteEntity extends SiteVo {
...@@ -161,6 +164,14 @@ public class SiteEntity extends SiteVo { ...@@ -161,6 +164,14 @@ public class SiteEntity extends SiteVo {
* 部署模块,逗号分隔 * 部署模块,逗号分隔
*/ */
private String modelIds; private String modelIds;
/**
* 政务风貌,多个逗号分割
*/
private String govAffairStyle;
/**
* 投诉电话
*/
private String complaintHotline;
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
...@@ -178,74 +189,43 @@ public class SiteEntity extends SiteVo { ...@@ -178,74 +189,43 @@ public class SiteEntity extends SiteVo {
} }
public void initAttrValue(){ public void initAttrValue(){
this.siteName = ""; this.siteName = "";
this.siteCode = ""; this.siteCode = "";
this.proCode = "";
this.areaID = ""; this.areaID = "";
this.areaCode = ""; this.areaCode = "";
this.areaName = "";
this.proCode = "";
this.cityCode = ""; this.cityCode = "";
this.districtCode = ""; this.districtCode = "";
this.siteIp = ""; this.siteIp = "";
this.sitePort = ""; this.sitePort = "";
this.longitude = ""; this.longitude = "";
this.latitude = ""; this.latitude = "";
this.siteTel = ""; this.siteTel = "";
this.detailAddress = ""; this.detailAddress = "";
this.siteRemark = ""; this.siteRemark = "";
this.amWorkStartTime = null; this.amWorkStartTime = null;
this.amWorkEndTime = null; this.amWorkEndTime = null;
this.pmWorkStartTime = null; this.pmWorkStartTime = null;
this.pmWorkEndTime = null; this.pmWorkEndTime = null;
this.workday1 = 0;
this.workday1 = 1; this.workday2 = 0;
this.workday3 = 0;
this.workday2 = 1; this.workday4 = 0;
this.workday5 = 0;
this.workday3 = 1;
this.workday4 = 1;
this.workday5 = 1;
this.workday6 = 0; this.workday6 = 0;
this.workday7 = 0; this.workday7 = 0;
this.level = 1;
this.building = 1;
this.modelIds = "";
this.areaName = "";
this.onlineTake = 1; this.onlineTake = 1;
this.appointment = 1; this.appointment = 1;
this.gowMap = 1; this.gowMap = 1;
this.level = 0;
this.building = 0;
this.logoPath = ""; this.logoPath = "";
this.englishName = ""; this.englishName = "";
this.leadingOfficial = "";
this.leadingOfficialTelephone = "";
this.modelIds = "";
this.govAffairStyle = "";
this.complaintHotline = "";
} }
} }
\ No newline at end of file
...@@ -7,7 +7,7 @@ import com.mortals.xhx.module.site.model.SiteEntity; ...@@ -7,7 +7,7 @@ import com.mortals.xhx.module.site.model.SiteEntity;
* 站点查询对象 * 站点查询对象
* *
* @author zxfei * @author zxfei
* @date 2023-05-07 * @date 2024-12-11
*/ */
public class SiteQuery extends SiteEntity { public class SiteQuery extends SiteEntity {
/** 开始 序号,主键,自增长 */ /** 开始 序号,主键,自增长 */
...@@ -329,6 +329,11 @@ public class SiteQuery extends SiteEntity { ...@@ -329,6 +329,11 @@ public class SiteQuery extends SiteEntity {
/** 部署模块,逗号分隔排除列表 */ /** 部署模块,逗号分隔排除列表 */
private List <String> modelIdsNotList; private List <String> modelIdsNotList;
/** 政务风貌,多个逗号分割 */
private List<String> govAffairStyleList;
/** 政务风貌,多个逗号分割排除列表 */
private List <String> govAffairStyleNotList;
/** 开始 创建时间 */ /** 开始 创建时间 */
private String createTimeStart; private String createTimeStart;
...@@ -356,6 +361,11 @@ public class SiteQuery extends SiteEntity { ...@@ -356,6 +361,11 @@ public class SiteQuery extends SiteEntity {
/** 结束 修改时间 */ /** 结束 修改时间 */
private String updateTimeEnd; private String updateTimeEnd;
/** 投诉电话 */
private List<String> complaintHotlineList;
/** 投诉电话排除列表 */
private List <String> complaintHotlineNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */ /** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<SiteQuery> orConditionList; private List<SiteQuery> orConditionList;
...@@ -2185,6 +2195,38 @@ public class SiteQuery extends SiteEntity { ...@@ -2185,6 +2195,38 @@ public class SiteQuery extends SiteEntity {
this.modelIdsNotList = modelIdsNotList; this.modelIdsNotList = modelIdsNotList;
} }
/**
* 获取 政务风貌,多个逗号分割
* @return govAffairStyleList
*/
public List<String> getGovAffairStyleList(){
return this.govAffairStyleList;
}
/**
* 设置 政务风貌,多个逗号分割
* @param govAffairStyleList
*/
public void setGovAffairStyleList(List<String> govAffairStyleList){
this.govAffairStyleList = govAffairStyleList;
}
/**
* 获取 政务风貌,多个逗号分割
* @return govAffairStyleNotList
*/
public List<String> getGovAffairStyleNotList(){
return this.govAffairStyleNotList;
}
/**
* 设置 政务风貌,多个逗号分割
* @param govAffairStyleNotList
*/
public void setGovAffairStyleNotList(List<String> govAffairStyleNotList){
this.govAffairStyleNotList = govAffairStyleNotList;
}
/** /**
* 获取 开始 创建时间 * 获取 开始 创建时间
* @return createTimeStart * @return createTimeStart
...@@ -2330,6 +2372,38 @@ public class SiteQuery extends SiteEntity { ...@@ -2330,6 +2372,38 @@ public class SiteQuery extends SiteEntity {
this.updateTimeEnd = updateTimeEnd; this.updateTimeEnd = updateTimeEnd;
} }
/**
* 获取 投诉电话
* @return complaintHotlineList
*/
public List<String> getComplaintHotlineList(){
return this.complaintHotlineList;
}
/**
* 设置 投诉电话
* @param complaintHotlineList
*/
public void setComplaintHotlineList(List<String> complaintHotlineList){
this.complaintHotlineList = complaintHotlineList;
}
/**
* 获取 投诉电话
* @return complaintHotlineNotList
*/
public List<String> getComplaintHotlineNotList(){
return this.complaintHotlineNotList;
}
/**
* 设置 投诉电话
* @param complaintHotlineNotList
*/
public void setComplaintHotlineNotList(List<String> complaintHotlineNotList){
this.complaintHotlineNotList = complaintHotlineNotList;
}
/** /**
* 设置 序号,主键,自增长 * 设置 序号,主键,自增长
* @param id * @param id
...@@ -3417,6 +3491,25 @@ public class SiteQuery extends SiteEntity { ...@@ -3417,6 +3491,25 @@ public class SiteQuery extends SiteEntity {
} }
/**
* 设置 政务风貌,多个逗号分割
* @param govAffairStyle
*/
public SiteQuery govAffairStyle(String govAffairStyle){
setGovAffairStyle(govAffairStyle);
return this;
}
/**
* 设置 政务风貌,多个逗号分割
* @param govAffairStyleList
*/
public SiteQuery govAffairStyleList(List<String> govAffairStyleList){
this.govAffairStyleList = govAffairStyleList;
return this;
}
/** /**
* 设置 创建用户 * 设置 创建用户
* @param createUserId * @param createUserId
...@@ -3472,6 +3565,25 @@ public class SiteQuery extends SiteEntity { ...@@ -3472,6 +3565,25 @@ public class SiteQuery extends SiteEntity {
} }
/**
* 设置 投诉电话
* @param complaintHotline
*/
public SiteQuery complaintHotline(String complaintHotline){
setComplaintHotline(complaintHotline);
return this;
}
/**
* 设置 投诉电话
* @param complaintHotlineList
*/
public SiteQuery complaintHotlineList(List<String> complaintHotlineList){
this.complaintHotlineList = complaintHotlineList;
return this;
}
/** /**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) * 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList * @return orConditionList
......
...@@ -8,6 +8,7 @@ import com.mortals.framework.service.ICRUDService; ...@@ -8,6 +8,7 @@ import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.area.model.AreaEntity; import com.mortals.xhx.module.area.model.AreaEntity;
import com.mortals.xhx.module.area.model.AreaTreeSelect; import com.mortals.xhx.module.area.model.AreaTreeSelect;
import com.mortals.xhx.module.matter.model.MatterEntity; import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.module.site.dao.SiteDao;
import com.mortals.xhx.module.site.model.SiteEntity; import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.site.model.SiteQuery; import com.mortals.xhx.module.site.model.SiteQuery;
import com.mortals.xhx.module.site.model.SiteTreeSelect; import com.mortals.xhx.module.site.model.SiteTreeSelect;
...@@ -28,6 +29,9 @@ import java.util.Set; ...@@ -28,6 +29,9 @@ import java.util.Set;
*/ */
public interface SiteService extends ICRUDCacheService<SiteEntity, Long> { public interface SiteService extends ICRUDCacheService<SiteEntity, Long> {
SiteDao getDao();
/** /**
* 区域站点树 * 区域站点树
* *
...@@ -69,4 +73,8 @@ public interface SiteService extends ICRUDCacheService<SiteEntity, Long> { ...@@ -69,4 +73,8 @@ public interface SiteService extends ICRUDCacheService<SiteEntity, Long> {
void deleteBysiteIdAndSource(Long siteId, Integer source, Context context); void deleteBysiteIdAndSource(Long siteId, Integer source, Context context);
void updateAllSiteTree(Context context); void updateAllSiteTree(Context context);
void updateSiteInfo(SiteEntity siteEntity, Context context);
} }
\ No newline at end of file
...@@ -33,6 +33,12 @@ import com.mortals.xhx.common.utils.MatterHtmlParseUtil; ...@@ -33,6 +33,12 @@ import com.mortals.xhx.common.utils.MatterHtmlParseUtil;
import com.mortals.xhx.common.utils.SyncTreeSiteThread; import com.mortals.xhx.common.utils.SyncTreeSiteThread;
import com.mortals.xhx.feign.device.IDeviceFeign; import com.mortals.xhx.feign.device.IDeviceFeign;
import com.mortals.xhx.feign.user.IUserFeign; import com.mortals.xhx.feign.user.IUserFeign;
import com.mortals.xhx.module.app.model.AppCategoryEntity;
import com.mortals.xhx.module.app.model.AppCategoryQuery;
import com.mortals.xhx.module.app.model.AppEntity;
import com.mortals.xhx.module.app.model.AppQuery;
import com.mortals.xhx.module.app.service.AppCategoryService;
import com.mortals.xhx.module.app.service.AppService;
import com.mortals.xhx.module.area.model.AreaEntity; import com.mortals.xhx.module.area.model.AreaEntity;
import com.mortals.xhx.module.area.model.AreaQuery; import com.mortals.xhx.module.area.model.AreaQuery;
import com.mortals.xhx.module.area.service.AreaService; import com.mortals.xhx.module.area.service.AreaService;
...@@ -117,6 +123,12 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -117,6 +123,12 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
@Autowired @Autowired
private IDeviceFeign deviceFeign; private IDeviceFeign deviceFeign;
@Autowired
private AppService appService;
@Autowired
private AppCategoryService appCategoryService;
private volatile Boolean refresh = false; private volatile Boolean refresh = false;
@Override @Override
...@@ -135,7 +147,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -135,7 +147,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
refresh = true; refresh = true;
} }
if (!oldSite.getEnglishName().equals(entity.getEnglishName())) { if (!ObjectUtils.isEmpty(oldSite.getEnglishName())&&!oldSite.getEnglishName().equals(entity.getEnglishName())) {
refresh = true; refresh = true;
} }
...@@ -201,27 +213,12 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -201,27 +213,12 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
super.saveBefore(entity, context); super.saveBefore(entity, context);
} }
@Override @Override
protected void saveAfter(SiteEntity entity, Context context) throws AppException { protected void saveAfter(SiteEntity entity, Context context) throws AppException {
super.saveAfter(entity, context); super.saveAfter(entity, context);
//刷新站点树 userService.refreshUser();
//ThreadPool.getInstance().execute(new SyncTreeSiteThread(this,context)); // this.updateAllSiteTree(context);
/* Rest<String> rest = userFeign.synchSiteAuth();
if (rest.getCode().equals(YesNoEnum.YES.getValue())) {
UserPdu userPdu = new UserPdu();
userPdu.setPage(1);
userPdu.setSize(-1);
Rest<RespData<List<UserPdu>>> list = userFeign.list(userPdu);
userService.updateUserList(list.getData().getData());
}*/
this.updateAllSiteTree(context);
//新加的站点 只需要更新全树
//更新同步部门相关
//deptService.syncDeptBySiteId(entity, context);
//通知php系统更新 //通知php系统更新
String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://127.0.0.1:11078/zwfw_api"); String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://127.0.0.1:11078/zwfw_api");
HashMap<String, String> paramsMap = new HashMap<>(); HashMap<String, String> paramsMap = new HashMap<>();
...@@ -362,14 +359,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -362,14 +359,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
protected void updateAfter(SiteEntity entity, Context context) throws AppException { protected void updateAfter(SiteEntity entity, Context context) throws AppException {
super.updateAfter(entity, context); super.updateAfter(entity, context);
//刷新站点树 //刷新站点树
/* Rest<String> rest = userFeign.synchSiteAuth();
if (rest.getCode().equals(YesNoEnum.YES.getValue())) {
UserPdu userPdu = new UserPdu();
userPdu.setPage(1);
userPdu.setSize(-1);
Rest<RespData<List<UserPdu>>> list = userFeign.list(userPdu);
userService.updateUserList(list.getData().getData());
}*/
if (refresh) { if (refresh) {
//通知设备更新站点信息 //通知设备更新站点信息
DevicePdu devicePdu = new DevicePdu(); DevicePdu devicePdu = new DevicePdu();
...@@ -377,13 +366,11 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -377,13 +366,11 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
Rest<Void> rest1 = deviceFeign.refreshMessage(devicePdu); Rest<Void> rest1 = deviceFeign.refreshMessage(devicePdu);
log.info("调用刷新结果:{}", JSON.toJSONString(rest1)); log.info("调用刷新结果:{}", JSON.toJSONString(rest1));
refresh = false; refresh = false;
//刷新用户站点树
// cacheService.del(USER_SITE_TREE);
//刷新站点树 // this.updateAllSiteTree(context);
cacheService.del(USER_SITE_TREE); userService.refreshUser();
this.updateAllSiteTree(context);
} }
} }
...@@ -730,13 +717,11 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -730,13 +717,11 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
Integer total = restStat.getData().getOrDefault("total", 0); Integer total = restStat.getData().getOrDefault("total", 0);
//获取事项全列表 //获取事项全列表
Rest<List<MatterEntity>> matterAllRest = this.getMatterAllListByGOV(params, pageNum, context); Rest<List<MatterEntity>> matterAllRest = this.getMatterAllListByGOV(params, pageNum, context);
if (matterAllRest.getCode() == YesNoEnum.YES.getValue()) { if (matterAllRest.getCode() == YesNoEnum.YES.getValue()) {
return matterAllRest.getData(); return matterAllRest.getData();
} }
} }
return new ArrayList<MatterEntity>(); return new ArrayList<MatterEntity>();
} }
...@@ -765,56 +750,8 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -765,56 +750,8 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
} }
} }
log.info("抓取事项结束"); log.info("抓取事项结束");
/* HashMap<String, String> params = new HashMap<>();
params.put("dxType", dxType);
params.put("areaCode", siteEntity.getAreaCode());
params.put("deptCode", "");
params.put("searchtext", "");
params.put("taskType", "");
params.put("pageno", "1");
params.put("type", "2");
List<MatterEntity> govMatterList = this.getMatters(params, context);
dxType = "3";
params = new HashMap<>();
params.put("dxType", dxType);
params.put("areaCode", siteEntity.getAreaCode());
params.put("deptCode", "");
params.put("searchtext", "");
params.put("taskType", "");
params.put("pageno", "1");
params.put("type", "2");
List<MatterEntity> mattersTwo = this.getMatters(params, context);
govMatterList.addAll(mattersTwo);*/
// new MatterQuery().setMatterNoNotList();
// List<MatterEntity> localMatterList = matterService.find(new MatterQuery().areaCode(siteEntity.getAreaCode()));
//HashSet<String> matterNoSet = new HashSet<>();
Set<String> matterNoSet = matterService.getDao().getMatterListByAreaCode(new MatterQuery().areaCode(siteEntity.getAreaCode())).parallelStream().map(i -> i.getMatterNo()).collect(Collectors.toSet()); Set<String> matterNoSet = matterService.getDao().getMatterListByAreaCode(new MatterQuery().areaCode(siteEntity.getAreaCode())).parallelStream().map(i -> i.getMatterNo()).collect(Collectors.toSet());
/* Integer page = 1;
Integer size = 200;
PageInfo pageInfo = new PageInfo();
pageInfo.setCountPage(false);
while (true) {
pageInfo.setCurrPage(page);
pageInfo.setPrePageResult(size);
Result<MatterEntity> matterEntityResult = matterService.find(new MatterQuery().areaCode(siteEntity.getAreaCode()), pageInfo, context);
if (ObjectUtils.isEmpty(matterEntityResult.getList())) {
break;
}
Set<String> collect = matterEntityResult.getList().parallelStream().map(i -> i.getMatterNo()).collect(Collectors.toSet());
matterNoSet.addAll(collect);
page++;
log.info("page:{},size:{}", page, collect.size());
}*/
log.info("计算差集"); log.info("计算差集");
// List<MatterEntity> subList = this.subList(govMatterList, localMatterList); // List<MatterEntity> subList = this.subList(govMatterList, localMatterList);
List<MatterEntity> subList = this.subListSet(govMatterList, matterNoSet); List<MatterEntity> subList = this.subListSet(govMatterList, matterNoSet);
...@@ -830,47 +767,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -830,47 +767,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
matterEntity.setCreateTime(new Date()); matterEntity.setCreateTime(new Date());
matterService.save(matterEntity, context); matterService.save(matterEntity, context);
} }
/* List<List<MatterEntity>> partition = ListUtil.partition(subList, 100);
for (List<MatterEntity> matterEntityList : partition) {
log.info("insert subList size:" + matterEntityList.size());
int count = matterService.save(matterEntityList, context);
log.info("insert subList size success:" + count);
}*/
} }
/* Rest<Map<String, Integer>> restStat = MatterHtmlParseUtil.statSiteMatterDeptCount(params, url);
if (restStat.getCode() == YesNoEnum.YES.getValue()) {
Integer pageNum = restStat.getData().getOrDefault("pageNum", 0);
Integer total = restStat.getData().getOrDefault("total", 0);
//获取事项全列表
Rest<List<MatterEntity>> matterAllRest = this.getMatterAllListByGOV(params, pageNum, context);
if (matterAllRest.getCode() == YesNoEnum.YES.getValue()) {
List<MatterEntity> govMatterList = matterAllRest.getData();
List<MatterEntity> localMatterList = matterService.find(new MatterQuery().areaCode(siteEntity.getAreaCode()));
List<MatterEntity> subList = this.subList(govMatterList, localMatterList);
log.info("需要添加事项数量====" + subList.size());
//差集进行插入并更新详细数据
if (!ObjectUtils.isEmpty(subList)) {
for (MatterEntity matterEntity : subList) {
DeptEntity deptCache = deptService.getExtCache(matterEntity.getDeptCode());
matterEntity.setDeptName(deptCache == null ? "" : deptCache.getName());
matterService.save(matterEntity, context);
}
List<List<MatterEntity>> partition = ListUtil.partition(subList, 100);
for (List<MatterEntity> matterEntityList : partition) {
log.info("insert subList size:" + matterEntityList.size());
int count = matterService.save(matterEntityList, context);
log.info("insert subList size success:" + count);
}
}
}
}
*/
return Rest.ok("同步事项条数成功!"); return Rest.ok("同步事项条数成功!");
} }
...@@ -904,6 +801,45 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -904,6 +801,45 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
ThreadPool.getInstance().execute(syncTreeSiteThread); ThreadPool.getInstance().execute(syncTreeSiteThread);
} }
/**
* 外部添加站点,更新站点相关信息
*
* @param siteEntity
* @param context
*/
@Override
public void updateSiteInfo(SiteEntity siteEntity, Context context) {
List<AppEntity> updateAppList = appService.find(new AppQuery().siteId(siteEntity.getId())).stream().map(item -> {
item.setSiteId(siteEntity.getId());
item.setSiteName(siteEntity.getSiteName());
return item;
}).collect(Collectors.toList());
if(!ObjectUtils.isEmpty(updateAppList)){
appService.update(updateAppList,context);
}
List<AppCategoryEntity> updateAppCategoryList = appCategoryService.find(new AppCategoryQuery().siteId(siteEntity.getId())).stream().map(item -> {
item.setSiteId(siteEntity.getId());
item.setSiteName(siteEntity.getSiteName());
return item;
}).collect(Collectors.toList());
if(!ObjectUtils.isEmpty(updateAppCategoryList)){
appCategoryService.update(updateAppCategoryList,context);
}
List<WindowEntity> updateWindowList = windowService.find(new WindowQuery().siteId(siteEntity.getId())).stream().map(item -> {
item.setSiteId(siteEntity.getId());
item.setSiteName(siteEntity.getSiteName());
return item;
}).collect(Collectors.toList());
if(!ObjectUtils.isEmpty(updateWindowList)){
windowService.update(updateWindowList,context);
}
}
public List<MatterEntity> subList(List<MatterEntity> firstList, List<MatterEntity> secondList) { public List<MatterEntity> subList(List<MatterEntity> firstList, List<MatterEntity> secondList) {
Set<String> secondSet = secondList.parallelStream().map(e -> e.getMatterNo()).collect(Collectors.toSet()); Set<String> secondSet = secondList.parallelStream().map(e -> e.getMatterNo()).collect(Collectors.toSet());
......
...@@ -8,15 +8,21 @@ import com.mortals.framework.model.Context; ...@@ -8,15 +8,21 @@ import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result; import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICacheService; import com.mortals.framework.service.ICacheService;
import com.mortals.framework.util.StringUtils;
import com.mortals.framework.util.ThreadPool; import com.mortals.framework.util.ThreadPool;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.base.system.user.model.UserEntity; import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.common.code.AreaLevelEnum; import com.mortals.xhx.common.code.AreaLevelEnum;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.common.keys.RedisCacheKeys; import com.mortals.xhx.common.keys.RedisCacheKeys;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.user.UserPdu;
import com.mortals.xhx.common.utils.SyncDeptThread; import com.mortals.xhx.common.utils.SyncDeptThread;
import com.mortals.xhx.common.utils.SyncGovMatterDetailThread; import com.mortals.xhx.common.utils.SyncGovMatterDetailThread;
import com.mortals.xhx.common.utils.SyncTreeSiteThread;
import com.mortals.xhx.feign.user.IUserFeign;
import com.mortals.xhx.module.area.model.AreaEntity; import com.mortals.xhx.module.area.model.AreaEntity;
import com.mortals.xhx.module.area.model.AreaQuery; import com.mortals.xhx.module.area.model.AreaQuery;
import com.mortals.xhx.module.area.service.AreaService; import com.mortals.xhx.module.area.service.AreaService;
...@@ -34,6 +40,7 @@ import com.mortals.xhx.module.site.service.SiteService; ...@@ -34,6 +40,7 @@ import com.mortals.xhx.module.site.service.SiteService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -58,15 +65,12 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic ...@@ -58,15 +65,12 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
@Autowired @Autowired
private ICacheService cacheService; private ICacheService cacheService;
@Autowired @Autowired
private MatterService matterService;
@Autowired
private DeptService deptService;
@Autowired
private SiteService siteService; private SiteService siteService;
@Autowired @Autowired
private SiteMatterService siteMatterService;
@Autowired
private AreaService areaService; private AreaService areaService;
@Autowired
@Lazy
private IUserFeign userFeign;
public SiteController() { public SiteController() {
super.setModuleDesc("站点"); super.setModuleDesc("站点");
...@@ -536,4 +540,77 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic ...@@ -536,4 +540,77 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
return jsonObject.toJSONString(); return jsonObject.toJSONString();
} }
/**
* 外部站点添加
*/
@PostMapping(value = "api/add")
@UnAuth
public String apiAdd(@RequestBody SiteEntity siteEntity) {
JSONObject jsonObject = new JSONObject();
String busiDesc = "外部站点添加" + this.getModuleDesc();
try {
String areaCode = siteEntity.getAreaCode();
String siteName = siteEntity.getSiteName();
if (ObjectUtils.isEmpty(areaCode)) {
throw new AppException("区域编码不能为空!");
}
SiteEntity one = this.service.selectOne(new SiteQuery().areaCode(areaCode).siteName(siteName), getContext());
if (!ObjectUtils.isEmpty(one)) throw new AppException("当前区域下站点名称已存在!");
AreaEntity areaEntity = areaService.selectOne(new AreaQuery().areaCode(areaCode), getContext());
siteEntity.initAttrValue();
//查询是否有站点了,如果有站点,这强制更新为站点 id=1的数据
SiteEntity site = this.service.get(1L);
if (!ObjectUtils.isEmpty(site)) {
siteEntity.setId(site.getId());
}
siteEntity.setAreaCode(areaCode);
siteEntity.setSiteName(siteName);
if (!ObjectUtils.isEmpty(areaEntity)) {
siteEntity.setAreaID(areaEntity.getIid());
siteEntity.setAreaName(areaEntity.getName());
siteEntity.setAreaLevel(areaEntity.getAreaLevel());
}
if (!ObjectUtils.isEmpty(siteEntity.getId())) {
List<SiteEntity> siteEntities = this.service.find(new SiteQuery().areaCode(siteEntity.getAreaCode()));
siteEntity.setSiteCode(siteEntity.getAreaCode() + Constant.SITE_SPLIT_MARK + StringUtils.lpad(siteEntities.size() + 1, Constant.SITE_CODE_NUM));
this.service.getDao().update(siteEntity);
//todo 更新用户站点树
/* Rest<String> rest = userFeign.synchSiteAuth();
if (rest.getCode().equals(YesNoEnum.YES.getValue())) {
UserPdu userPdu = new UserPdu();
userPdu.setPage(1);
userPdu.setSize(-1);
Rest<RespData<List<UserPdu>>> list = userFeign.list(userPdu);
this.service.updateUserList(list.getData().getData());
// ThreadPool.getInstance().execute(new SyncTreeSiteThread(this,context));
this.service.updateAllSiteTree(null);*/
} else {
this.service.save(siteEntity, getContext());
}
//todo 更新相关表中的站点名称,站点编码,站点ID
this.service.updateSiteInfo(siteEntity, getContext());
recordSysLog(request, busiDesc + " 【成功】");
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_DATA, siteEntity);
jsonObject.put(KEY_RESULT_MSG, "外部站点添加成功!");
} catch (Exception e) {
log.error("外部站点添加", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
jsonObject.put(KEY_RESULT_MSG, super.convertException(e));
}
return jsonObject.toJSONString();
}
} }
\ No newline at end of file
...@@ -26,7 +26,10 @@ import com.mortals.xhx.feign.skin.ISkinFillFeign; ...@@ -26,7 +26,10 @@ import com.mortals.xhx.feign.skin.ISkinFillFeign;
import com.mortals.xhx.feign.skin.ISkinSampleFeign; import com.mortals.xhx.feign.skin.ISkinSampleFeign;
import com.mortals.xhx.module.app.model.AppEntity; import com.mortals.xhx.module.app.model.AppEntity;
import com.mortals.xhx.module.app.model.AppQuery; import com.mortals.xhx.module.app.model.AppQuery;
import com.mortals.xhx.module.app.model.AppVersionEntity;
import com.mortals.xhx.module.app.model.AppVersionQuery;
import com.mortals.xhx.module.app.service.AppService; import com.mortals.xhx.module.app.service.AppService;
import com.mortals.xhx.module.app.service.AppVersionService;
import com.mortals.xhx.module.model.model.ModelEntity; import com.mortals.xhx.module.model.model.ModelEntity;
import com.mortals.xhx.module.model.model.ModelQuery; import com.mortals.xhx.module.model.model.ModelQuery;
import com.mortals.xhx.module.model.service.ModelService; import com.mortals.xhx.module.model.service.ModelService;
...@@ -93,6 +96,8 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk ...@@ -93,6 +96,8 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
private AppService appService; private AppService appService;
@Autowired @Autowired
private ModelService modelService; private ModelService modelService;
@Autowired
private AppVersionService appVersionService;
@Override @Override
protected void validData(SkinBaseEntity entity, Context context) throws AppException { protected void validData(SkinBaseEntity entity, Context context) throws AppException {
...@@ -329,12 +334,31 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk ...@@ -329,12 +334,31 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
File file = new File(filePath); File file = new File(filePath);
if (file.exists()) { if (file.exists()) {
try { try {
zip.putNextEntry(new ZipEntry(StrUtil.subAfter(cssFilePath, "/", false))); //读取css文件 提取图片地址
List<String> cssLines = FileUtil.readUtf8Lines(file);
for (String cssLine : cssLines) {
String cssFileUrl = StrUtil.subBetween(cssLine, "url(", ")");
if (!ObjectUtils.isEmpty(cssFileUrl)) {
String cssFileUrlPath = uploadService.getFilePath(cssFileUrl);
File cssFile = new File(cssFileUrlPath);
log.info("cssFileUrl:{} ,存在:{}", cssFileUrl, cssFile.exists());
if (cssFile.exists()) {
zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(cssFileUrlPath, "/")));
IOUtils.write(FileUtil.readBytes(cssFile), zip);
zip.flush();
zip.closeEntry();
}
}
}
zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(filePath, "/")));
IOUtils.write(FileUtil.readBytes(file), zip); IOUtils.write(FileUtil.readBytes(file), zip);
zip.flush(); zip.flush();
zip.closeEntry(); zip.closeEntry();
} catch (Exception e) { } catch (Exception e) {
log.error("异常", e.getMessage()); // log.error("异常", e.getMessage());
} }
} }
...@@ -343,7 +367,7 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk ...@@ -343,7 +367,7 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
file = new File(filePath); file = new File(filePath);
if (file.exists()) { if (file.exists()) {
try { try {
zip.putNextEntry(new ZipEntry(StrUtil.subAfter(previewImagePath, "/", false))); zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(filePath, "/")));
IOUtils.write(FileUtil.readBytes(file), zip); IOUtils.write(FileUtil.readBytes(file), zip);
zip.flush(); zip.flush();
zip.closeEntry(); zip.closeEntry();
...@@ -363,7 +387,7 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk ...@@ -363,7 +387,7 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
File file = new File(filePath); File file = new File(filePath);
if (file.exists()) { if (file.exists()) {
try { try {
zip.putNextEntry(new ZipEntry(StrUtil.subAfter(fieldValue, "/", false))); zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(filePath, "/")));
IOUtils.write(FileUtil.readBytes(file), zip); IOUtils.write(FileUtil.readBytes(file), zip);
zip.flush(); zip.flush();
zip.closeEntry(); zip.closeEntry();
...@@ -381,7 +405,7 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk ...@@ -381,7 +405,7 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
File file = new File(filePath); File file = new File(filePath);
if (file.exists()) { if (file.exists()) {
try { try {
zip.putNextEntry(new ZipEntry(StrUtil.subAfter(fieldValue, "/", false))); zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(filePath, "/")));
IOUtils.write(FileUtil.readBytes(file), zip); IOUtils.write(FileUtil.readBytes(file), zip);
zip.flush(); zip.flush();
zip.closeEntry(); zip.closeEntry();
...@@ -394,7 +418,7 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk ...@@ -394,7 +418,7 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
file = new File(filePath); file = new File(filePath);
if (file.exists()) { if (file.exists()) {
try { try {
zip.putNextEntry(new ZipEntry(StrUtil.subAfter(appIconPath, "/", false))); zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(filePath, "/")));
IOUtils.write(FileUtil.readBytes(file), zip); IOUtils.write(FileUtil.readBytes(file), zip);
zip.flush(); zip.flush();
zip.closeEntry(); zip.closeEntry();
...@@ -413,7 +437,31 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk ...@@ -413,7 +437,31 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
File file = new File(filePath); File file = new File(filePath);
if (file.exists()) { if (file.exists()) {
try { try {
zip.putNextEntry(new ZipEntry(StrUtil.subAfter(fieldValue, "/", false))); zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(filePath, "/")));
IOUtils.write(FileUtil.readBytes(file), zip);
zip.flush();
zip.closeEntry();
} catch (Exception e) {
log.error("异常", e.getMessage());
}
}
}
//应用版本
List<Long> appIdList = appService.find(new AppQuery().siteId(1L)).stream().map(i -> i.getId()).collect(Collectors.toList());
AppVersionQuery appVersionQuery = new AppVersionQuery();
if (!ObjectUtils.isEmpty(appIdList)) {
appVersionQuery.setAppIdList(appIdList);
}
appVersionQuery.setUsed(1);
List<AppVersionEntity> appVersionEntities = appVersionService.find(appVersionQuery);
for (AppVersionEntity appVersionEntity : appVersionEntities) {
String filePath = appVersionEntity.getFilePath();
filePath = uploadService.getFilePath(filePath);
File file = new File(filePath);
if (file.exists()) {
try {
zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(filePath, "/")));
IOUtils.write(FileUtil.readBytes(file), zip); IOUtils.write(FileUtil.readBytes(file), zip);
zip.flush(); zip.flush();
zip.closeEntry(); zip.closeEntry();
......
...@@ -139,9 +139,9 @@ public class SkinBaseController extends BaseCRUDJsonBodyMappingController<SkinBa ...@@ -139,9 +139,9 @@ public class SkinBaseController extends BaseCRUDJsonBodyMappingController<SkinBa
/** /**
* 获取皮肤所有相关资源文件并压缩打包成zip * 获取皮肤所有相关资源文件并压缩打包成zip
*/ */
@GetMapping(value = "skinzip") @GetMapping(value = "zip")
@UnAuth @UnAuth
public void skinzip() { public void zip() {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
try { try {
SkinBaseEntity query = new SkinBaseEntity(); SkinBaseEntity query = new SkinBaseEntity();
......
...@@ -30,6 +30,7 @@ import org.springframework.stereotype.Service; ...@@ -30,6 +30,7 @@ import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.module.window.dao.WindowBusinessDao; import com.mortals.xhx.module.window.dao.WindowBusinessDao;
import com.mortals.xhx.module.window.service.WindowBusinessService; import com.mortals.xhx.module.window.service.WindowBusinessService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.*; import java.util.*;
...@@ -133,14 +134,10 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus ...@@ -133,14 +134,10 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
@Override @Override
protected void findAfter(WindowBusinessEntity entity, PageInfo pageInfo, Context context, List<WindowBusinessEntity> list) throws AppException { protected void findAfter(WindowBusinessEntity entity, PageInfo pageInfo, Context context, List<WindowBusinessEntity> list) throws AppException {
// Map<Long, WindowEntity> collect = windowService.getCacheList().stream().collect(Collectors.toMap(x -> x.getId(), y -> y, (o, n) -> n));
//Map<Long, WindowEntity> collect = windowService.findToMap(new WindowQuery(), context);
Map<Long, WindowHallEntity> windowHallEntityMap = windowHallService.getCacheList().stream().collect(Collectors.toMap(x -> x.getWindowId(), y -> y, (o, n) -> n)); Map<Long, WindowHallEntity> windowHallEntityMap = windowHallService.getCacheList().stream().collect(Collectors.toMap(x -> x.getWindowId(), y -> y, (o, n) -> n));
// Map<Long, WindowHallEntity> windowHallEntityMap = windowHallService.find(new WindowHallQuery(), context).parallelStream().collect(Collectors.toMap(x -> x.getWindowId(), Function.identity()));
Iterator iterator = list.iterator(); Iterator iterator = list.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
WindowBusinessEntity item = (WindowBusinessEntity) iterator.next(); WindowBusinessEntity item = (WindowBusinessEntity) iterator.next();
//WindowEntity windowEntity = collect.get(item.getWindowId());
WindowEntity windowEntity = windowService.getCache(item.getWindowId().toString()); WindowEntity windowEntity = windowService.getCache(item.getWindowId().toString());
if (!ObjectUtils.isEmpty(item.getWindowId()) && !ObjectUtils.isEmpty(windowEntity)) { if (!ObjectUtils.isEmpty(item.getWindowId()) && !ObjectUtils.isEmpty(windowEntity)) {
item.setDeptId(windowEntity.getDeptId()); item.setDeptId(windowEntity.getDeptId());
...@@ -189,7 +186,9 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus ...@@ -189,7 +186,9 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
}*/ }*/
/* *//** /* */
/**
* @param entity * @param entity
* @param context * @param context
* @throws AppException * @throws AppException
...@@ -199,7 +198,6 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus ...@@ -199,7 +198,6 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
pushChangeMsg(entity); pushChangeMsg(entity);
super.updateAfter(entity, context); super.updateAfter(entity, context);
}*/ }*/
private void pushChangeMsg(WindowBusinessEntity entity) { private void pushChangeMsg(WindowBusinessEntity entity) {
String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://172.15.28.116:8090"); String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://172.15.28.116:8090");
phpUrl += "/api/window/winNameChange"; phpUrl += "/api/window/winNameChange";
......
package com.mortals.xhx.module.workman.model; package com.mortals.xhx.module.workman.model;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel; import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.workman.model.vo.WorkmanVo; import com.mortals.xhx.module.workman.model.vo.WorkmanVo;
import lombok.Data;
/** /**
* 工作人员实体对象 * 工作人员实体对象
* *
* @author zxfei * @author zxfei
* @date 2022-12-23 * @date 2024-12-05
*/ */
@Data
public class WorkmanEntity extends WorkmanVo { public class WorkmanEntity extends WorkmanVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -34,6 +31,7 @@ public class WorkmanEntity extends WorkmanVo { ...@@ -34,6 +31,7 @@ public class WorkmanEntity extends WorkmanVo {
/** /**
* 部门名称 * 部门名称
*/ */
@Excel(name = "部门名称")
private String deptName; private String deptName;
/** /**
* 窗口id号 * 窗口id号
...@@ -87,6 +85,7 @@ public class WorkmanEntity extends WorkmanVo { ...@@ -87,6 +85,7 @@ public class WorkmanEntity extends WorkmanVo {
/** /**
* 身份证 * 身份证
*/ */
@Excel(name = "身份证")
private String idCard; private String idCard;
/** /**
* 电话 * 电话
...@@ -136,430 +135,21 @@ public class WorkmanEntity extends WorkmanVo { ...@@ -136,430 +135,21 @@ public class WorkmanEntity extends WorkmanVo {
*/ */
private String modelIds; private String modelIds;
/** /**
* 最后一次登录时间 * 是否删除(0.否,1.是)
*/
private Date lastLoginTime;
/**
* 最后一次登录地址
*/ */
private String lastLoginAddress; private Integer deleted;
/** /**
* 一体化经办人id * 一体化经办人id
*/ */
private String operatorId; private String operatorId;
public WorkmanEntity(){}
/**
* 获取 登录用户名
* @return String
*/
public String getLoginName(){
return loginName;
}
/**
* 设置 登录用户名
* @param loginName
*/
public void setLoginName(String loginName){
this.loginName = loginName;
}
/**
* 获取 密码
* @return String
*/
public String getLoginPwd(){
return loginPwd;
}
/**
* 设置 密码
* @param loginPwd
*/
public void setLoginPwd(String loginPwd){
this.loginPwd = loginPwd;
}
/**
* 获取 部门id号
* @return Long
*/
public Long getDeptId(){
return deptId;
}
/**
* 设置 部门id号
* @param deptId
*/
public void setDeptId(Long deptId){
this.deptId = deptId;
}
/**
* 获取 部门名称
* @return String
*/
public String getDeptName(){
return deptName;
}
/**
* 设置 部门名称
* @param deptName
*/
public void setDeptName(String deptName){
this.deptName = deptName;
}
/**
* 获取 窗口id号
* @return Long
*/
public Long getWindowId(){
return windowId;
}
/**
* 设置 窗口id号
* @param windowId
*/
public void setWindowId(Long windowId){
this.windowId = windowId;
}
/**
* 获取 窗口名称
* @return String
*/
public String getWindowName(){
return windowName;
}
/**
* 设置 窗口名称
* @param windowName
*/
public void setWindowName(String windowName){
this.windowName = windowName;
}
/**
* 获取 站点ID
* @return Long
*/
public Long getSiteId(){
return siteId;
}
/**
* 设置 站点ID
* @param siteId
*/
public void setSiteId(Long siteId){
this.siteId = siteId;
}
/**
* 获取 站点名称
* @return String
*/
public String getSiteName(){
return siteName;
}
/**
* 设置 站点名称
* @param siteName
*/
public void setSiteName(String siteName){
this.siteName = siteName;
}
/**
* 获取 姓名
* @return String
*/
public String getName(){
return name;
}
/**
* 设置 姓名
* @param name
*/
public void setName(String name){
this.name = name;
}
/**
* 获取 工号
* @return String
*/
public String getNumber(){
return number;
}
/**
* 设置 工号
* @param number
*/
public void setNumber(String number){
this.number = number;
}
/**
* 获取 职务
* @return String
*/
public String getUserpost(){
return userpost;
}
/**
* 设置 职务
* @param userpost
*/
public void setUserpost(String userpost){
this.userpost = userpost;
}
/**
* 获取 职称
* @return String
*/
public String getPosttitle(){
return posttitle;
}
/**
* 设置 职称
* @param posttitle
*/
public void setPosttitle(String posttitle){
this.posttitle = posttitle;
}
/**
* 获取 政治面貌 (0.中共党员,1.中共预备党员,2.共青团员,3.普通居民,4.其它)
* @return Integer
*/
public Integer getPoliticalstatus(){
return politicalstatus;
}
/**
* 设置 政治面貌 (0.中共党员,1.中共预备党员,2.共青团员,3.普通居民,4.其它)
* @param politicalstatus
*/
public void setPoliticalstatus(Integer politicalstatus){
this.politicalstatus = politicalstatus;
}
/**
* 获取 党员 (0.非党员,1.党员,2.党员示范岗,3.党员先锋岗)
* @return Integer
*/
public Integer getDangyuan(){
return dangyuan;
}
/**
* 设置 党员 (0.非党员,1.党员,2.党员示范岗,3.党员先锋岗)
* @param dangyuan
*/
public void setDangyuan(Integer dangyuan){
this.dangyuan = dangyuan;
}
/**
* 获取 党员扩展
* @return String
*/
public String getDangyuanext(){
return dangyuanext;
}
/**
* 设置 党员扩展
* @param dangyuanext
*/
public void setDangyuanext(String dangyuanext){
this.dangyuanext = dangyuanext;
}
/**
* 获取 身份证
* @return String
*/
public String getIdCard(){
return idCard;
}
/**
* 设置 身份证
* @param idCard
*/
public void setIdCard(String idCard){
this.idCard = idCard;
}
/**
* 获取 电话
* @return String
*/
public String getPhone(){
return phone;
}
/** /**
* 设置 电话 * 最后一次登录时间
* @param phone
*/
public void setPhone(String phone){
this.phone = phone;
}
/**
* 获取 手机
* @return String
*/
public String getMobile(){
return mobile;
}
/**
* 设置 手机
* @param mobile
*/
public void setMobile(String mobile){
this.mobile = mobile;
}
/**
* 获取 星级
* @return Integer
*/
public Integer getStarlevel(){
return starlevel;
}
/**
* 设置 星级
* @param starlevel
*/
public void setStarlevel(Integer starlevel){
this.starlevel = starlevel;
}
/**
* 获取 个人简介
* @return String
*/
public String getSummary(){
return summary;
}
/**
* 设置 个人简介
* @param summary
*/
public void setSummary(String summary){
this.summary = summary;
}
/**
* 获取 照片
* @return String
*/
public String getPhotoPath(){
return photoPath;
}
/**
* 设置 照片
* @param photoPath
*/
public void setPhotoPath(String photoPath){
this.photoPath = photoPath;
}
/**
* 获取 岗位职责
* @return String
*/
public String getDuty(){
return duty;
}
/**
* 设置 岗位职责
* @param duty
*/
public void setDuty(String duty){
this.duty = duty;
}
/**
* 获取 服务承诺
* @return String
*/
public String getPromise(){
return promise;
}
/**
* 设置 服务承诺
* @param promise
*/
public void setPromise(String promise){
this.promise = promise;
}
/**
* 获取 办理事项
* @return String
*/
public String getBusiness(){
return business;
}
/**
* 设置 办理事项
* @param business
*/
public void setBusiness(String business){
this.business = business;
}
/**
* 获取 是否在线(0.离线,1.在线,2.暂离,3.点击暂离,4.回归,5.登陆)
* @return Integer
*/
public Integer getOnline(){
return online;
}
/**
* 设置 是否在线(0.离线,1.在线,2.暂离,3.点击暂离,4.回归,5.登陆)
* @param online
*/
public void setOnline(Integer online){
this.online = online;
}
/**
* 获取 配置站点模块,逗号分隔
* @return String
*/
public String getModelIds(){
return modelIds;
}
/**
* 设置 配置站点模块,逗号分隔
* @param modelIds
*/
public void setModelIds(String modelIds){
this.modelIds = modelIds;
}
/**
* 获取 最后一次登录时间
* @return Date
*/
public Date getLastLoginTime(){
return lastLoginTime;
}
/**
* 设置 最后一次登录时间
* @param lastLoginTime
*/
public void setLastLoginTime(Date lastLoginTime){
this.lastLoginTime = lastLoginTime;
}
/**
* 获取 最后一次登录地址
* @return String
*/
public String getLastLoginAddress(){
return lastLoginAddress;
}
/**
* 设置 最后一次登录地址
* @param lastLoginAddress
*/
public void setLastLoginAddress(String lastLoginAddress){
this.lastLoginAddress = lastLoginAddress;
}
/**
* 获取 一体化经办人id
* @return String
*/ */
public String getOperatorId(){ private Date lastLoginTime;
return operatorId;
}
/** /**
* 设置 一体化经办人id * 最后一次登录地址
* @param operatorId
*/ */
public void setOperatorId(String operatorId){ private String lastLoginAddress;
this.operatorId = operatorId;
}
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
...@@ -576,95 +166,36 @@ public class WorkmanEntity extends WorkmanVo { ...@@ -576,95 +166,36 @@ public class WorkmanEntity extends WorkmanVo {
return false; return false;
} }
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",loginName:").append(getLoginName());
sb.append(",loginPwd:").append(getLoginPwd());
sb.append(",deptId:").append(getDeptId());
sb.append(",deptName:").append(getDeptName());
sb.append(",windowId:").append(getWindowId());
sb.append(",windowName:").append(getWindowName());
sb.append(",siteId:").append(getSiteId());
sb.append(",siteName:").append(getSiteName());
sb.append(",name:").append(getName());
sb.append(",number:").append(getNumber());
sb.append(",userpost:").append(getUserpost());
sb.append(",posttitle:").append(getPosttitle());
sb.append(",politicalstatus:").append(getPoliticalstatus());
sb.append(",dangyuan:").append(getDangyuan());
sb.append(",dangyuanext:").append(getDangyuanext());
sb.append(",idCard:").append(getIdCard());
sb.append(",phone:").append(getPhone());
sb.append(",mobile:").append(getMobile());
sb.append(",starlevel:").append(getStarlevel());
sb.append(",summary:").append(getSummary());
sb.append(",photoPath:").append(getPhotoPath());
sb.append(",duty:").append(getDuty());
sb.append(",promise:").append(getPromise());
sb.append(",business:").append(getBusiness());
sb.append(",online:").append(getOnline());
sb.append(",modelIds:").append(getModelIds());
sb.append(",lastLoginTime:").append(getLastLoginTime());
sb.append(",lastLoginAddress:").append(getLastLoginAddress());
return sb.toString();
}
public void initAttrValue(){ public void initAttrValue(){
this.loginName = ""; this.loginName = "";
this.loginPwd = ""; this.loginPwd = "";
this.deptId = null; this.deptId = null;
this.deptName = ""; this.deptName = "";
this.windowId = null; this.windowId = null;
this.windowName = ""; this.windowName = "";
this.siteId = null; this.siteId = null;
this.siteName = ""; this.siteName = "";
this.name = ""; this.name = "";
this.number = ""; this.number = "";
this.userpost = ""; this.userpost = "";
this.posttitle = ""; this.posttitle = "";
this.politicalstatus = 0; this.politicalstatus = 0;
this.dangyuan = 0; this.dangyuan = 0;
this.dangyuanext = ""; this.dangyuanext = "";
this.idCard = ""; this.idCard = "";
this.phone = ""; this.phone = "";
this.mobile = ""; this.mobile = "";
this.starlevel = 0; this.starlevel = 0;
this.summary = ""; this.summary = "";
this.photoPath = ""; this.photoPath = "";
this.duty = "";
this.duty = null; this.promise = "";
this.business = "";
this.promise = null;
this.business = null;
this.online = 1; this.online = 1;
this.modelIds = ""; this.modelIds = "";
this.deleted = 0;
this.operatorId = "";
this.lastLoginTime = null; this.lastLoginTime = null;
this.lastLoginAddress = "";
this.lastLoginAddress = null;
} }
} }
\ No newline at end of file
...@@ -7,7 +7,7 @@ import com.mortals.xhx.module.workman.model.WorkmanEntity; ...@@ -7,7 +7,7 @@ import com.mortals.xhx.module.workman.model.WorkmanEntity;
* 工作人员查询对象 * 工作人员查询对象
* *
* @author zxfei * @author zxfei
* @date 2023-03-13 * @date 2024-12-05
*/ */
public class WorkmanQuery extends WorkmanEntity { public class WorkmanQuery extends WorkmanEntity {
/** 开始 序号,主键,自增长 */ /** 开始 序号,主键,自增长 */
...@@ -225,6 +225,26 @@ public class WorkmanQuery extends WorkmanEntity { ...@@ -225,6 +225,26 @@ public class WorkmanQuery extends WorkmanEntity {
/** 配置站点模块,逗号分隔排除列表 */ /** 配置站点模块,逗号分隔排除列表 */
private List <String> modelIdsNotList; private List <String> modelIdsNotList;
/** 开始 是否删除(0.否,1.是) */
private Integer deletedStart;
/** 结束 是否删除(0.否,1.是) */
private Integer deletedEnd;
/** 增加 是否删除(0.否,1.是) */
private Integer deletedIncrement;
/** 是否删除(0.否,1.是)列表 */
private List <Integer> deletedList;
/** 是否删除(0.否,1.是)排除列表 */
private List <Integer> deletedNotList;
/** 一体化经办人id */
private List<String> operatorIdList;
/** 一体化经办人id排除列表 */
private List <String> operatorIdNotList;
/** 开始 创建时间 */ /** 开始 创建时间 */
private String createTimeStart; private String createTimeStart;
...@@ -263,11 +283,6 @@ public class WorkmanQuery extends WorkmanEntity { ...@@ -263,11 +283,6 @@ public class WorkmanQuery extends WorkmanEntity {
/** 最后一次登录地址排除列表 */ /** 最后一次登录地址排除列表 */
private List <String> lastLoginAddressNotList; private List <String> lastLoginAddressNotList;
/** 一体化经办人id */
private List<String> operatorIdList;
/** 一体化经办人id排除列表 */
private List <String> operatorIdNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */ /** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<WorkmanQuery> orConditionList; private List<WorkmanQuery> orConditionList;
...@@ -1532,6 +1547,119 @@ public class WorkmanQuery extends WorkmanEntity { ...@@ -1532,6 +1547,119 @@ public class WorkmanQuery extends WorkmanEntity {
this.modelIdsNotList = modelIdsNotList; this.modelIdsNotList = modelIdsNotList;
} }
/**
* 获取 开始 是否删除(0.否,1.是)
* @return deletedStart
*/
public Integer getDeletedStart(){
return this.deletedStart;
}
/**
* 设置 开始 是否删除(0.否,1.是)
* @param deletedStart
*/
public void setDeletedStart(Integer deletedStart){
this.deletedStart = deletedStart;
}
/**
* 获取 结束 是否删除(0.否,1.是)
* @return $deletedEnd
*/
public Integer getDeletedEnd(){
return this.deletedEnd;
}
/**
* 设置 结束 是否删除(0.否,1.是)
* @param deletedEnd
*/
public void setDeletedEnd(Integer deletedEnd){
this.deletedEnd = deletedEnd;
}
/**
* 获取 增加 是否删除(0.否,1.是)
* @return deletedIncrement
*/
public Integer getDeletedIncrement(){
return this.deletedIncrement;
}
/**
* 设置 增加 是否删除(0.否,1.是)
* @param deletedIncrement
*/
public void setDeletedIncrement(Integer deletedIncrement){
this.deletedIncrement = deletedIncrement;
}
/**
* 获取 是否删除(0.否,1.是)
* @return deletedList
*/
public List<Integer> getDeletedList(){
return this.deletedList;
}
/**
* 设置 是否删除(0.否,1.是)
* @param deletedList
*/
public void setDeletedList(List<Integer> deletedList){
this.deletedList = deletedList;
}
/**
* 获取 是否删除(0.否,1.是)
* @return deletedNotList
*/
public List<Integer> getDeletedNotList(){
return this.deletedNotList;
}
/**
* 设置 是否删除(0.否,1.是)
* @param deletedNotList
*/
public void setDeletedNotList(List<Integer> deletedNotList){
this.deletedNotList = deletedNotList;
}
/**
* 获取 一体化经办人id
* @return operatorIdList
*/
public List<String> getOperatorIdList(){
return this.operatorIdList;
}
/**
* 设置 一体化经办人id
* @param operatorIdList
*/
public void setOperatorIdList(List<String> operatorIdList){
this.operatorIdList = operatorIdList;
}
/**
* 获取 一体化经办人id
* @return operatorIdNotList
*/
public List<String> getOperatorIdNotList(){
return this.operatorIdNotList;
}
/**
* 设置 一体化经办人id
* @param operatorIdNotList
*/
public void setOperatorIdNotList(List<String> operatorIdNotList){
this.operatorIdNotList = operatorIdNotList;
}
/** /**
* 获取 开始 创建时间 * 获取 开始 创建时间
* @return createTimeStart * @return createTimeStart
...@@ -1741,38 +1869,6 @@ public class WorkmanQuery extends WorkmanEntity { ...@@ -1741,38 +1869,6 @@ public class WorkmanQuery extends WorkmanEntity {
this.lastLoginAddressNotList = lastLoginAddressNotList; this.lastLoginAddressNotList = lastLoginAddressNotList;
} }
/**
* 获取 一体化经办人id
* @return operatorIdList
*/
public List<String> getOperatorIdList(){
return this.operatorIdList;
}
/**
* 设置 一体化经办人id
* @param operatorIdList
*/
public void setOperatorIdList(List<String> operatorIdList){
this.operatorIdList = operatorIdList;
}
/**
* 获取 一体化经办人id
* @return operatorIdNotList
*/
public List<String> getOperatorIdNotList(){
return this.operatorIdNotList;
}
/**
* 设置 一体化经办人id
* @param operatorIdNotList
*/
public void setOperatorIdNotList(List<String> operatorIdNotList){
this.operatorIdNotList = operatorIdNotList;
}
/** /**
* 设置 序号,主键,自增长 * 设置 序号,主键,自增长
* @param id * @param id
...@@ -2566,6 +2662,79 @@ public class WorkmanQuery extends WorkmanEntity { ...@@ -2566,6 +2662,79 @@ public class WorkmanQuery extends WorkmanEntity {
return this; return this;
} }
/**
* 设置 是否删除(0.否,1.是)
* @param deleted
*/
public WorkmanQuery deleted(Integer deleted){
setDeleted(deleted);
return this;
}
/**
* 设置 开始 是否删除(0.否,1.是)
* @param deletedStart
*/
public WorkmanQuery deletedStart(Integer deletedStart){
this.deletedStart = deletedStart;
return this;
}
/**
* 设置 结束 是否删除(0.否,1.是)
* @param deletedEnd
*/
public WorkmanQuery deletedEnd(Integer deletedEnd){
this.deletedEnd = deletedEnd;
return this;
}
/**
* 设置 增加 是否删除(0.否,1.是)
* @param deletedIncrement
*/
public WorkmanQuery deletedIncrement(Integer deletedIncrement){
this.deletedIncrement = deletedIncrement;
return this;
}
/**
* 设置 是否删除(0.否,1.是)
* @param deletedList
*/
public WorkmanQuery deletedList(List<Integer> deletedList){
this.deletedList = deletedList;
return this;
}
/**
* 设置 是否删除(0.否,1.是)
* @param deletedNotList
*/
public WorkmanQuery deletedNotList(List<Integer> deletedNotList){
this.deletedNotList = deletedNotList;
return this;
}
/**
* 设置 一体化经办人id
* @param operatorId
*/
public WorkmanQuery operatorId(String operatorId){
setOperatorId(operatorId);
return this;
}
/**
* 设置 一体化经办人id
* @param operatorIdList
*/
public WorkmanQuery operatorIdList(List<String> operatorIdList){
this.operatorIdList = operatorIdList;
return this;
}
/** /**
* 设置 创建用户 * 设置 创建用户
...@@ -2642,25 +2811,6 @@ public class WorkmanQuery extends WorkmanEntity { ...@@ -2642,25 +2811,6 @@ public class WorkmanQuery extends WorkmanEntity {
return this; return this;
} }
/**
* 设置 一体化经办人id
* @param operatorId
*/
public WorkmanQuery operatorId(String operatorId){
setOperatorId(operatorId);
return this;
}
/**
* 设置 一体化经办人id
* @param operatorIdList
*/
public WorkmanQuery operatorIdList(List<String> operatorIdList){
this.operatorIdList = operatorIdList;
return this;
}
/** /**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) * 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList * @return orConditionList
......
...@@ -23,6 +23,12 @@ import java.util.List; ...@@ -23,6 +23,12 @@ import java.util.List;
*/ */
@Data @Data
public class WorkmanVo extends BaseEntityLong { public class WorkmanVo extends BaseEntityLong {
/** 序号,主键,自增长列表 */
private List <Long> idList;
/** 序号,主键,自增长排除列表 */
private List <Long> idNotList;
private String oldPwd; private String oldPwd;
private String newPwd; private String newPwd;
...@@ -52,18 +58,4 @@ public class WorkmanVo extends BaseEntityLong { ...@@ -52,18 +58,4 @@ public class WorkmanVo extends BaseEntityLong {
@MobileDesensitize @MobileDesensitize
private String mobile; private String mobile;
public static void main(String[] args) {
WorkmanEntity workmanEntity = new WorkmanEntity();
ArrayList<WorkmanQuery> andConditionList = new ArrayList<>();
WorkmanQuery workmanQuery = new WorkmanQuery();
workmanQuery.setName("张三");
workmanQuery.setNumber("123");
andConditionList.add(workmanQuery);
workmanEntity.setAndConditionList(andConditionList);
System.out.println(JSON.toJSONString(workmanEntity));
}
} }
\ No newline at end of file
...@@ -10,6 +10,7 @@ import com.mortals.framework.util.SecurityUtil; ...@@ -10,6 +10,7 @@ import com.mortals.framework.util.SecurityUtil;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.upload.service.UploadService; import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.base.system.user.service.UserService; import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.utils.ZipUtils; import com.mortals.xhx.common.utils.ZipUtils;
import com.mortals.xhx.module.area.model.AreaEntity; import com.mortals.xhx.module.area.model.AreaEntity;
import com.mortals.xhx.module.workman.dao.WorkmanDao; import com.mortals.xhx.module.workman.dao.WorkmanDao;
...@@ -103,11 +104,8 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao, ...@@ -103,11 +104,8 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao,
@Override @Override
public WorkmanEntity doLogin(String loginName, String password, String loginIp) throws AppException { public WorkmanEntity doLogin(String loginName, String password, String loginIp) throws AppException {
WorkmanEntity workmanEntity = this.getExtCache(loginName); WorkmanEntity workmanEntity = this.selectOne(new WorkmanQuery().loginName(loginName).deleted(YesNoEnum.NO.getValue()));
if(ObjectUtils.isEmpty(workmanEntity)){ if (ObjectUtils.isEmpty(workmanEntity) ) {
workmanEntity = this.selectOne(new WorkmanQuery().loginName(loginName));
}
if (workmanEntity == null || !workmanEntity.getLoginName().equals(loginName)) {
throw new AppException("用户名不存在!"); throw new AppException("用户名不存在!");
} }
try { try {
...@@ -272,6 +270,16 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao, ...@@ -272,6 +270,16 @@ public class WorkmanServiceImpl extends AbstractCRUDCacheServiceImpl<WorkmanDao,
} }
/**
* @param key
*/
@Override
public void removeCache(String key) {
WorkmanEntity cache = this.getCache(key);
if (ObjectUtils.isEmpty(cache)) return;
String extKey = this.getExtKey(cache);
if (ObjectUtils.isEmpty(extKey)) return;
super.removeCache(extKey);
super.removeCache(key);
}
} }
\ No newline at end of file
...@@ -16,7 +16,9 @@ import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; ...@@ -16,7 +16,9 @@ import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.base.system.upload.service.UploadService; import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.common.code.OnlineEnum; import com.mortals.xhx.common.code.OnlineEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.dept.model.DeptEntity; import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService; import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.site.model.SiteEntity; import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.site.service.SiteService; import com.mortals.xhx.module.site.service.SiteService;
...@@ -61,6 +63,7 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman ...@@ -61,6 +63,7 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
super.setModuleDesc("工作人员"); super.setModuleDesc("工作人员");
} }
@Override @Override
protected void init(Map<String, Object> model, Context context) { protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "politicalstatus", paramService.getParamBySecondOrganize("Workman", "politicalstatus")); this.addDict(model, "politicalstatus", paramService.getParamBySecondOrganize("Workman", "politicalstatus"));
...@@ -72,6 +75,20 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman ...@@ -72,6 +75,20 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
} }
/**
* @param query
* @param model
* @param context
* @throws AppException
*/
@Override
protected void doListBefore(WorkmanEntity query, Map<String, Object> model, Context context) throws AppException {
if (!ObjectUtils.isEmpty(query)) {
query.setDeleted(YesNoEnum.NO.getValue());
}
super.doListBefore(query, model, context);
}
/** /**
* *
*/ */
...@@ -202,6 +219,8 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman ...@@ -202,6 +219,8 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
if (!ObjectUtils.isEmpty(siteId)) { if (!ObjectUtils.isEmpty(siteId)) {
siteEntity = siteService.get(Long.parseLong(siteId)); siteEntity = siteService.get(Long.parseLong(siteId));
} }
if (!ObjectUtils.isEmpty(deptId)) { if (!ObjectUtils.isEmpty(deptId)) {
deptEntity = deptService.get(Long.parseLong(deptId)); deptEntity = deptService.get(Long.parseLong(deptId));
} }
...@@ -224,11 +243,21 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman ...@@ -224,11 +243,21 @@ public class WorkmanController extends BaseCRUDJsonBodyMappingController<Workman
if (ObjectUtils.isEmpty(workmanEntity.getLoginPwd()) || "".equals(workmanEntity.getLoginPwd().trim())) { if (ObjectUtils.isEmpty(workmanEntity.getLoginPwd()) || "".equals(workmanEntity.getLoginPwd().trim())) {
workmanEntity.setLoginPwd("123"); workmanEntity.setLoginPwd("123");
} }
if (!ObjectUtils.isEmpty(workmanEntity.getDeptName())) {
DeptEntity dept = deptService.selectOne(new DeptQuery().name(workmanEntity.getDeptName()).siteId(siteEntity.getId()));
if(!ObjectUtils.isEmpty(dept)){
workmanEntity.setDeptId(dept.getId());
workmanEntity.setDeptName(dept.getName());
}
}
if (!ObjectUtils.isEmpty(deptEntity)) { if (!ObjectUtils.isEmpty(deptEntity)) {
workmanEntity.setDeptId(deptEntity.getId()); workmanEntity.setDeptId(deptEntity.getId());
workmanEntity.setDeptName(deptEntity.getName()); workmanEntity.setDeptName(deptEntity.getName());
} }
if (!ObjectUtils.isEmpty(windowEntity)) { if (!ObjectUtils.isEmpty(windowEntity)) {
workmanEntity.setWindowId(windowEntity.getId()); workmanEntity.setWindowId(windowEntity.getId());
workmanEntity.setWindowName(windowEntity.getName()); workmanEntity.setWindowName(windowEntity.getName());
......
...@@ -42,13 +42,13 @@ ...@@ -42,13 +42,13 @@
<result property="leadingOfficial" column="leadingOfficial" /> <result property="leadingOfficial" column="leadingOfficial" />
<result property="leadingOfficialTelephone" column="leadingOfficialTelephone" /> <result property="leadingOfficialTelephone" column="leadingOfficialTelephone" />
<result property="modelIds" column="modelIds" /> <result property="modelIds" column="modelIds" />
<result property="govAffairStyle" column="govAffairStyle" />
<result property="createTime" column="createTime" /> <result property="createTime" column="createTime" />
<result property="createUserId" column="createUserId" /> <result property="createUserId" column="createUserId" />
<result property="updateTime" column="updateTime" /> <result property="updateTime" column="updateTime" />
<result property="complaintHotline" column="complaintHotline" />
</resultMap> </resultMap>
<!-- 表所有列 --> <!-- 表所有列 -->
<sql id="_columns"> <sql id="_columns">
<trim suffixOverrides="," suffix=""> <trim suffixOverrides="," suffix="">
...@@ -163,6 +163,9 @@ ...@@ -163,6 +163,9 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('modelIds') or colPickMode == 1 and data.containsKey('modelIds')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('modelIds') or colPickMode == 1 and data.containsKey('modelIds')))">
a.modelIds, a.modelIds,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('govAffairStyle') or colPickMode == 1 and data.containsKey('govAffairStyle')))">
a.govAffairStyle,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))">
a.createTime, a.createTime,
</if> </if>
...@@ -172,23 +175,26 @@ ...@@ -172,23 +175,26 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
a.updateTime, a.updateTime,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('complaintHotline') or colPickMode == 1 and data.containsKey('complaintHotline')))">
a.complaintHotline,
</if>
</trim> </trim>
</sql> </sql>
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="SiteEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="SiteEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_sys_site insert into mortals_sys_site
(siteName,siteCode,areaID,areaCode,areaName,proCode,cityCode,districtCode,siteIp,sitePort,longitude,latitude,siteTel,detailAddress,siteRemark,amWorkStartTime,amWorkEndTime,pmWorkStartTime,pmWorkEndTime,workday1,workday2,workday3,workday4,workday5,workday6,workday7,onlineTake,appointment,gowMap,level,building,logoPath,englishName,leadingOfficial,leadingOfficialTelephone,modelIds,createTime,createUserId,updateTime) (siteName,siteCode,areaID,areaCode,areaName,proCode,cityCode,districtCode,siteIp,sitePort,longitude,latitude,siteTel,detailAddress,siteRemark,amWorkStartTime,amWorkEndTime,pmWorkStartTime,pmWorkEndTime,workday1,workday2,workday3,workday4,workday5,workday6,workday7,onlineTake,appointment,gowMap,level,building,logoPath,englishName,leadingOfficial,leadingOfficialTelephone,modelIds,govAffairStyle,createTime,createUserId,updateTime,complaintHotline)
VALUES VALUES
(#{siteName},#{siteCode},#{areaID},#{areaCode},#{areaName},#{proCode},#{cityCode},#{districtCode},#{siteIp},#{sitePort},#{longitude},#{latitude},#{siteTel},#{detailAddress},#{siteRemark},#{amWorkStartTime},#{amWorkEndTime},#{pmWorkStartTime},#{pmWorkEndTime},#{workday1},#{workday2},#{workday3},#{workday4},#{workday5},#{workday6},#{workday7},#{onlineTake},#{appointment},#{gowMap},#{level},#{building},#{logoPath},#{englishName},#{leadingOfficial},#{leadingOfficialTelephone},#{modelIds},#{createTime},#{createUserId},#{updateTime}) (#{siteName},#{siteCode},#{areaID},#{areaCode},#{areaName},#{proCode},#{cityCode},#{districtCode},#{siteIp},#{sitePort},#{longitude},#{latitude},#{siteTel},#{detailAddress},#{siteRemark},#{amWorkStartTime},#{amWorkEndTime},#{pmWorkStartTime},#{pmWorkEndTime},#{workday1},#{workday2},#{workday3},#{workday4},#{workday5},#{workday6},#{workday7},#{onlineTake},#{appointment},#{gowMap},#{level},#{building},#{logoPath},#{englishName},#{leadingOfficial},#{leadingOfficialTelephone},#{modelIds},#{govAffairStyle},#{createTime},#{createUserId},#{updateTime},#{complaintHotline})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_sys_site insert into mortals_sys_site
(siteName,siteCode,areaID,areaCode,areaName,proCode,cityCode,districtCode,siteIp,sitePort,longitude,latitude,siteTel,detailAddress,siteRemark,amWorkStartTime,amWorkEndTime,pmWorkStartTime,pmWorkEndTime,workday1,workday2,workday3,workday4,workday5,workday6,workday7,onlineTake,appointment,gowMap,level,building,logoPath,englishName,leadingOfficial,leadingOfficialTelephone,modelIds,createTime,createUserId,updateTime) (siteName,siteCode,areaID,areaCode,areaName,proCode,cityCode,districtCode,siteIp,sitePort,longitude,latitude,siteTel,detailAddress,siteRemark,amWorkStartTime,amWorkEndTime,pmWorkStartTime,pmWorkEndTime,workday1,workday2,workday3,workday4,workday5,workday6,workday7,onlineTake,appointment,gowMap,level,building,logoPath,englishName,leadingOfficial,leadingOfficialTelephone,modelIds,govAffairStyle,createTime,createUserId,updateTime,complaintHotline)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.siteName},#{item.siteCode},#{item.areaID},#{item.areaCode},#{item.areaName},#{item.proCode},#{item.cityCode},#{item.districtCode},#{item.siteIp},#{item.sitePort},#{item.longitude},#{item.latitude},#{item.siteTel},#{item.detailAddress},#{item.siteRemark},#{item.amWorkStartTime},#{item.amWorkEndTime},#{item.pmWorkStartTime},#{item.pmWorkEndTime},#{item.workday1},#{item.workday2},#{item.workday3},#{item.workday4},#{item.workday5},#{item.workday6},#{item.workday7},#{item.onlineTake},#{item.appointment},#{item.gowMap},#{item.level},#{item.building},#{item.logoPath},#{item.englishName},#{item.leadingOfficial},#{item.leadingOfficialTelephone},#{item.modelIds},#{item.createTime},#{item.createUserId},#{item.updateTime}) (#{item.siteName},#{item.siteCode},#{item.areaID},#{item.areaCode},#{item.areaName},#{item.proCode},#{item.cityCode},#{item.districtCode},#{item.siteIp},#{item.sitePort},#{item.longitude},#{item.latitude},#{item.siteTel},#{item.detailAddress},#{item.siteRemark},#{item.amWorkStartTime},#{item.amWorkEndTime},#{item.pmWorkStartTime},#{item.pmWorkEndTime},#{item.workday1},#{item.workday2},#{item.workday3},#{item.workday4},#{item.workday5},#{item.workday6},#{item.workday7},#{item.onlineTake},#{item.appointment},#{item.gowMap},#{item.level},#{item.building},#{item.logoPath},#{item.englishName},#{item.leadingOfficial},#{item.leadingOfficialTelephone},#{item.modelIds},#{item.govAffairStyle},#{item.createTime},#{item.createUserId},#{item.updateTime},#{item.complaintHotline})
</foreach> </foreach>
</insert> </insert>
...@@ -342,6 +348,9 @@ ...@@ -342,6 +348,9 @@
<if test="(colPickMode==0 and data.containsKey('modelIds')) or (colPickMode==1 and !data.containsKey('modelIds'))"> <if test="(colPickMode==0 and data.containsKey('modelIds')) or (colPickMode==1 and !data.containsKey('modelIds'))">
a.modelIds=#{data.modelIds}, a.modelIds=#{data.modelIds},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('govAffairStyle')) or (colPickMode==1 and !data.containsKey('govAffairStyle'))">
a.govAffairStyle=#{data.govAffairStyle},
</if>
<if test="(colPickMode==0 and data.containsKey('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))"> <if test="(colPickMode==0 and data.containsKey('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))">
a.createTime=#{data.createTime}, a.createTime=#{data.createTime},
</if> </if>
...@@ -354,6 +363,9 @@ ...@@ -354,6 +363,9 @@
<if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))"> <if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
a.updateTime=#{data.updateTime}, a.updateTime=#{data.updateTime},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('complaintHotline')) or (colPickMode==1 and !data.containsKey('complaintHotline'))">
a.complaintHotline=#{data.complaintHotline},
</if>
</trim> </trim>
<trim suffixOverrides="where" suffix=""> <trim suffixOverrides="where" suffix="">
where where
...@@ -678,6 +690,13 @@ ...@@ -678,6 +690,13 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="govAffairStyle=(case" suffix="ELSE govAffairStyle end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('govAffairStyle')) or (colPickMode==1 and !item.containsKey('govAffairStyle'))">
when a.id=#{item.id} then #{item.govAffairStyle}
</if>
</foreach>
</trim>
<trim prefix="createTime=(case" suffix="ELSE createTime end),"> <trim prefix="createTime=(case" suffix="ELSE createTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" > <foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('createTime')) or (colPickMode==1 and !item.containsKey('createTime'))"> <if test="(colPickMode==0 and item.containsKey('createTime')) or (colPickMode==1 and !item.containsKey('createTime'))">
...@@ -704,6 +723,13 @@ ...@@ -704,6 +723,13 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="complaintHotline=(case" suffix="ELSE complaintHotline end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('complaintHotline')) or (colPickMode==1 and !item.containsKey('complaintHotline'))">
when a.id=#{item.id} then #{item.complaintHotline}
</if>
</foreach>
</trim>
</trim> </trim>
where id in where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")"> <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
...@@ -815,6 +841,10 @@ ...@@ -815,6 +841,10 @@
<!-- 条件映射-代参数 --> <!-- 条件映射-代参数 -->
<sql id="_condition_param_"> <sql id="_condition_param_">
<bind name="conditionParamRef" value="${_conditionParam_}"/> <bind name="conditionParamRef" value="${_conditionParam_}"/>
<if test="permissionSql != null and permissionSql != ''">
${permissionSql}
</if>
<if test="conditionParamRef.containsKey('id')"> <if test="conditionParamRef.containsKey('id')">
<if test="conditionParamRef.id != null"> <if test="conditionParamRef.id != null">
${_conditionType_} a.id=#{${_conditionParam_}.id} ${_conditionType_} a.id=#{${_conditionParam_}.id}
...@@ -1652,6 +1682,27 @@ ...@@ -1652,6 +1682,27 @@
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('govAffairStyle')">
<if test="conditionParamRef.govAffairStyle != null and conditionParamRef.govAffairStyle != ''">
${_conditionType_} a.govAffairStyle like #{${_conditionParam_}.govAffairStyle}
</if>
<if test="conditionParamRef.govAffairStyle == null">
${_conditionType_} a.govAffairStyle is null
</if>
</if>
<if test="conditionParamRef.containsKey('govAffairStyleList') and conditionParamRef.govAffairStyleList.size() > 0">
${_conditionType_} a.govAffairStyle in
<foreach collection="conditionParamRef.govAffairStyleList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('govAffairStyleNotList') and conditionParamRef.govAffairStyleNotList.size() > 0">
${_conditionType_} a.govAffairStyle not in
<foreach collection="conditionParamRef.govAffairStyleNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('createTime')"> <if test="conditionParamRef.containsKey('createTime')">
<if test="conditionParamRef.createTime != null "> <if test="conditionParamRef.createTime != null ">
${_conditionType_} a.createTime = #{${_conditionParam_}.createTime} ${_conditionType_} a.createTime = #{${_conditionParam_}.createTime}
...@@ -1708,18 +1759,235 @@ ...@@ -1708,18 +1759,235 @@
<if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''"> <if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''">
${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') ${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if> </if>
<if test="conditionParamRef.containsKey('complaintHotline')">
<if test="conditionParamRef.complaintHotline != null and conditionParamRef.complaintHotline != ''">
${_conditionType_} a.complaintHotline like #{${_conditionParam_}.complaintHotline}
</if>
<if test="conditionParamRef.complaintHotline == null">
${_conditionType_} a.complaintHotline is null
</if>
</if>
<if test="conditionParamRef.containsKey('complaintHotlineList') and conditionParamRef.complaintHotlineList.size() > 0">
${_conditionType_} a.complaintHotline in
<foreach collection="conditionParamRef.complaintHotlineList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('complaintHotlineNotList') and conditionParamRef.complaintHotlineNotList.size() > 0">
${_conditionType_} a.complaintHotline not in
<foreach collection="conditionParamRef.complaintHotlineNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
</sql> </sql>
<sql id="_orderCols_"> <sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()"> <if test="orderColList != null and !orderColList.isEmpty()">
order by order by
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
field(a.id,
<foreach collection="conditionParamRef.idList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('workday1List') and conditionParamRef.workday1List.size() > 0">
field(a.workday1,
<foreach collection="conditionParamRef.workday1List" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('workday2List') and conditionParamRef.workday2List.size() > 0">
field(a.workday2,
<foreach collection="conditionParamRef.workday2List" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('workday3List') and conditionParamRef.workday3List.size() > 0">
field(a.workday3,
<foreach collection="conditionParamRef.workday3List" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('workday4List') and conditionParamRef.workday4List.size() > 0">
field(a.workday4,
<foreach collection="conditionParamRef.workday4List" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('workday5List') and conditionParamRef.workday5List.size() > 0">
field(a.workday5,
<foreach collection="conditionParamRef.workday5List" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('workday6List') and conditionParamRef.workday6List.size() > 0">
field(a.workday6,
<foreach collection="conditionParamRef.workday6List" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('workday7List') and conditionParamRef.workday7List.size() > 0">
field(a.workday7,
<foreach collection="conditionParamRef.workday7List" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('onlineTakeList') and conditionParamRef.onlineTakeList.size() > 0">
field(a.onlineTake,
<foreach collection="conditionParamRef.onlineTakeList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('appointmentList') and conditionParamRef.appointmentList.size() > 0">
field(a.appointment,
<foreach collection="conditionParamRef.appointmentList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('gowMapList') and conditionParamRef.gowMapList.size() > 0">
field(a.gowMap,
<foreach collection="conditionParamRef.gowMapList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('levelList') and conditionParamRef.levelList.size() > 0">
field(a.level,
<foreach collection="conditionParamRef.levelList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('buildingList') and conditionParamRef.buildingList.size() > 0">
field(a.building,
<foreach collection="conditionParamRef.buildingList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
field(a.createUserId,
<foreach collection="conditionParamRef.createUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<trim suffixOverrides="," suffix=""> <trim suffixOverrides="," suffix="">
<foreach collection="orderColList" open="" close="" index="index" item="item" separator=","> <foreach collection="orderColList" open="" close="" index="index" item="item" separator=",">
${item.colName} ${item.sortKind} a.${item.colName} ${item.sortKind}
</foreach> </foreach>
</trim> </trim>
</if> </if>
<if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()"> <if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()">
order by order by
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
field(a.id,
<foreach collection="conditionParamRef.idList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('workday1List') and conditionParamRef.workday1List.size() > 0">
field(a.workday1,
<foreach collection="conditionParamRef.workday1List" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('workday2List') and conditionParamRef.workday2List.size() > 0">
field(a.workday2,
<foreach collection="conditionParamRef.workday2List" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('workday3List') and conditionParamRef.workday3List.size() > 0">
field(a.workday3,
<foreach collection="conditionParamRef.workday3List" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('workday4List') and conditionParamRef.workday4List.size() > 0">
field(a.workday4,
<foreach collection="conditionParamRef.workday4List" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('workday5List') and conditionParamRef.workday5List.size() > 0">
field(a.workday5,
<foreach collection="conditionParamRef.workday5List" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('workday6List') and conditionParamRef.workday6List.size() > 0">
field(a.workday6,
<foreach collection="conditionParamRef.workday6List" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('workday7List') and conditionParamRef.workday7List.size() > 0">
field(a.workday7,
<foreach collection="conditionParamRef.workday7List" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('onlineTakeList') and conditionParamRef.onlineTakeList.size() > 0">
field(a.onlineTake,
<foreach collection="conditionParamRef.onlineTakeList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('appointmentList') and conditionParamRef.appointmentList.size() > 0">
field(a.appointment,
<foreach collection="conditionParamRef.appointmentList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('gowMapList') and conditionParamRef.gowMapList.size() > 0">
field(a.gowMap,
<foreach collection="conditionParamRef.gowMapList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('levelList') and conditionParamRef.levelList.size() > 0">
field(a.level,
<foreach collection="conditionParamRef.levelList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('buildingList') and conditionParamRef.buildingList.size() > 0">
field(a.building,
<foreach collection="conditionParamRef.buildingList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
field(a.createUserId,
<foreach collection="conditionParamRef.createUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<trim suffixOverrides="," suffix=""> <trim suffixOverrides="," suffix="">
<if test="orderCol.containsKey('id')"> <if test="orderCol.containsKey('id')">
a.id a.id
...@@ -1906,6 +2174,11 @@ ...@@ -1906,6 +2174,11 @@
<if test='orderCol.modelIds != null and "DESC".equalsIgnoreCase(orderCol.modelIds)'>DESC</if> <if test='orderCol.modelIds != null and "DESC".equalsIgnoreCase(orderCol.modelIds)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('govAffairStyle')">
a.govAffairStyle
<if test='orderCol.govAffairStyle != null and "DESC".equalsIgnoreCase(orderCol.govAffairStyle)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('createTime')"> <if test="orderCol.containsKey('createTime')">
a.createTime a.createTime
<if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if> <if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if>
...@@ -1921,8 +2194,15 @@ ...@@ -1921,8 +2194,15 @@
<if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if> <if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('complaintHotline')">
a.complaintHotline
<if test='orderCol.complaintHotline != null and "DESC".equalsIgnoreCase(orderCol.complaintHotline)'>DESC</if>
,
</if>
</trim> </trim>
</if> </if>
</sql> </sql>
<sql id="_group_by_"> <sql id="_group_by_">
<if test="groupList != null and !groupList.isEmpty()"> <if test="groupList != null and !groupList.isEmpty()">
......
...@@ -32,16 +32,15 @@ ...@@ -32,16 +32,15 @@
<result property="business" column="business" /> <result property="business" column="business" />
<result property="online" column="online" /> <result property="online" column="online" />
<result property="modelIds" column="modelIds" /> <result property="modelIds" column="modelIds" />
<result property="deleted" column="deleted" />
<result property="operatorId" column="operatorId" />
<result property="createTime" column="createTime" /> <result property="createTime" column="createTime" />
<result property="createUserId" column="createUserId" /> <result property="createUserId" column="createUserId" />
<result property="updateTime" column="updateTime" /> <result property="updateTime" column="updateTime" />
<result property="lastLoginTime" column="lastLoginTime" /> <result property="lastLoginTime" column="lastLoginTime" />
<result property="lastLoginAddress" column="lastLoginAddress" /> <result property="lastLoginAddress" column="lastLoginAddress" />
<result property="operatorId" column="operatorId" />
</resultMap> </resultMap>
<!-- 表所有列 --> <!-- 表所有列 -->
<sql id="_columns"> <sql id="_columns">
<trim suffixOverrides="," suffix=""> <trim suffixOverrides="," suffix="">
...@@ -126,6 +125,12 @@ ...@@ -126,6 +125,12 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('modelIds') or colPickMode == 1 and data.containsKey('modelIds')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('modelIds') or colPickMode == 1 and data.containsKey('modelIds')))">
a.modelIds, a.modelIds,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deleted') or colPickMode == 1 and data.containsKey('deleted')))">
a.deleted,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('operatorId') or colPickMode == 1 and data.containsKey('operatorId')))">
a.operatorId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))">
a.createTime, a.createTime,
</if> </if>
...@@ -141,26 +146,23 @@ ...@@ -141,26 +146,23 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('lastLoginAddress') or colPickMode == 1 and data.containsKey('lastLoginAddress')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('lastLoginAddress') or colPickMode == 1 and data.containsKey('lastLoginAddress')))">
a.lastLoginAddress, a.lastLoginAddress,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('operatorId') or colPickMode == 1 and data.containsKey('operatorId')))">
a.operatorId,
</if>
</trim> </trim>
</sql> </sql>
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="WorkmanEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="WorkmanEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_sys_workman insert into mortals_sys_workman
(loginName,loginPwd,deptId,deptName,windowId,windowName,siteId,siteName,name,number,userpost,posttitle,politicalstatus,dangyuan,dangyuanext,idCard,phone,mobile,starlevel,summary,photoPath,duty,promise,business,online,modelIds,createTime,createUserId,updateTime,lastLoginTime,lastLoginAddress,operatorId) (loginName,loginPwd,deptId,deptName,windowId,windowName,siteId,siteName,name,number,userpost,posttitle,politicalstatus,dangyuan,dangyuanext,idCard,phone,mobile,starlevel,summary,photoPath,duty,promise,business,online,modelIds,deleted,operatorId,createTime,createUserId,updateTime,lastLoginTime,lastLoginAddress)
VALUES VALUES
(#{loginName},#{loginPwd},#{deptId},#{deptName},#{windowId},#{windowName},#{siteId},#{siteName},#{name},#{number},#{userpost},#{posttitle},#{politicalstatus},#{dangyuan},#{dangyuanext},#{idCard},#{phone},#{mobile},#{starlevel},#{summary},#{photoPath},#{duty},#{promise},#{business},#{online},#{modelIds},#{createTime},#{createUserId},#{updateTime},#{lastLoginTime},#{lastLoginAddress},#{operatorId}) (#{loginName},#{loginPwd},#{deptId},#{deptName},#{windowId},#{windowName},#{siteId},#{siteName},#{name},#{number},#{userpost},#{posttitle},#{politicalstatus},#{dangyuan},#{dangyuanext},#{idCard},#{phone},#{mobile},#{starlevel},#{summary},#{photoPath},#{duty},#{promise},#{business},#{online},#{modelIds},#{deleted},#{operatorId},#{createTime},#{createUserId},#{updateTime},#{lastLoginTime},#{lastLoginAddress})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_sys_workman insert into mortals_sys_workman
(loginName,loginPwd,deptId,deptName,windowId,windowName,siteId,siteName,name,number,userpost,posttitle,politicalstatus,dangyuan,dangyuanext,idCard,phone,mobile,starlevel,summary,photoPath,duty,promise,business,online,modelIds,createTime,createUserId,updateTime,lastLoginTime,lastLoginAddress,operatorId) (loginName,loginPwd,deptId,deptName,windowId,windowName,siteId,siteName,name,number,userpost,posttitle,politicalstatus,dangyuan,dangyuanext,idCard,phone,mobile,starlevel,summary,photoPath,duty,promise,business,online,modelIds,deleted,operatorId,createTime,createUserId,updateTime,lastLoginTime,lastLoginAddress)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.loginName},#{item.loginPwd},#{item.deptId},#{item.deptName},#{item.windowId},#{item.windowName},#{item.siteId},#{item.siteName},#{item.name},#{item.number},#{item.userpost},#{item.posttitle},#{item.politicalstatus},#{item.dangyuan},#{item.dangyuanext},#{item.idCard},#{item.phone},#{item.mobile},#{item.starlevel},#{item.summary},#{item.photoPath},#{item.duty},#{item.promise},#{item.business},#{item.online},#{item.modelIds},#{item.createTime},#{item.createUserId},#{item.updateTime},#{item.lastLoginTime},#{item.lastLoginAddress},#{item.operatorId}) (#{item.loginName},#{item.loginPwd},#{item.deptId},#{item.deptName},#{item.windowId},#{item.windowName},#{item.siteId},#{item.siteName},#{item.name},#{item.number},#{item.userpost},#{item.posttitle},#{item.politicalstatus},#{item.dangyuan},#{item.dangyuanext},#{item.idCard},#{item.phone},#{item.mobile},#{item.starlevel},#{item.summary},#{item.photoPath},#{item.duty},#{item.promise},#{item.business},#{item.online},#{item.modelIds},#{item.deleted},#{item.operatorId},#{item.createTime},#{item.createUserId},#{item.updateTime},#{item.lastLoginTime},#{item.lastLoginAddress})
</foreach> </foreach>
</insert> </insert>
...@@ -269,6 +271,15 @@ ...@@ -269,6 +271,15 @@
<if test="(colPickMode==0 and data.containsKey('modelIds')) or (colPickMode==1 and !data.containsKey('modelIds'))"> <if test="(colPickMode==0 and data.containsKey('modelIds')) or (colPickMode==1 and !data.containsKey('modelIds'))">
a.modelIds=#{data.modelIds}, a.modelIds=#{data.modelIds},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('deleted')) or (colPickMode==1 and !data.containsKey('deleted'))">
a.deleted=#{data.deleted},
</if>
<if test="(colPickMode==0 and data.containsKey('deletedIncrement')) or (colPickMode==1 and !data.containsKey('deletedIncrement'))">
a.deleted=ifnull(a.deleted,0) + #{data.deletedIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('operatorId')) or (colPickMode==1 and !data.containsKey('operatorId'))">
a.operatorId=#{data.operatorId},
</if>
<if test="(colPickMode==0 and data.containsKey('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))"> <if test="(colPickMode==0 and data.containsKey('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))">
a.createTime=#{data.createTime}, a.createTime=#{data.createTime},
</if> </if>
...@@ -287,9 +298,6 @@ ...@@ -287,9 +298,6 @@
<if test="(colPickMode==0 and data.containsKey('lastLoginAddress')) or (colPickMode==1 and !data.containsKey('lastLoginAddress'))"> <if test="(colPickMode==0 and data.containsKey('lastLoginAddress')) or (colPickMode==1 and !data.containsKey('lastLoginAddress'))">
a.lastLoginAddress=#{data.lastLoginAddress}, a.lastLoginAddress=#{data.lastLoginAddress},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('operatorId')) or (colPickMode==1 and !data.containsKey('operatorId'))">
a.operatorId=#{data.operatorId},
</if>
</trim> </trim>
<trim suffixOverrides="where" suffix=""> <trim suffixOverrides="where" suffix="">
where where
...@@ -519,6 +527,25 @@ ...@@ -519,6 +527,25 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="deleted=(case" suffix="ELSE deleted end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('deleted')) or (colPickMode==1 and !item.containsKey('deleted'))">
when a.id=#{item.id} then #{item.deleted}
</when>
<when test="(colPickMode==0 and item.containsKey('deletedIncrement')) or (colPickMode==1 and !item.containsKey('deletedIncrement'))">
when a.id=#{item.id} then ifnull(a.deleted,0) + #{item.deletedIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="operatorId=(case" suffix="ELSE operatorId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('operatorId')) or (colPickMode==1 and !item.containsKey('operatorId'))">
when a.id=#{item.id} then #{item.operatorId}
</if>
</foreach>
</trim>
<trim prefix="createTime=(case" suffix="ELSE createTime end),"> <trim prefix="createTime=(case" suffix="ELSE createTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" > <foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('createTime')) or (colPickMode==1 and !item.containsKey('createTime'))"> <if test="(colPickMode==0 and item.containsKey('createTime')) or (colPickMode==1 and !item.containsKey('createTime'))">
...@@ -559,13 +586,6 @@ ...@@ -559,13 +586,6 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="operatorId=(case" suffix="ELSE operatorId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('operatorId')) or (colPickMode==1 and !item.containsKey('operatorId'))">
when a.id=#{item.id} then #{item.operatorId}
</if>
</foreach>
</trim>
</trim> </trim>
where id in where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")"> <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
...@@ -677,6 +697,10 @@ ...@@ -677,6 +697,10 @@
<!-- 条件映射-代参数 --> <!-- 条件映射-代参数 -->
<sql id="_condition_param_"> <sql id="_condition_param_">
<bind name="conditionParamRef" value="${_conditionParam_}"/> <bind name="conditionParamRef" value="${_conditionParam_}"/>
<if test="permissionSql != null and permissionSql != ''">
${permissionSql}
</if>
<if test="conditionParamRef.containsKey('id')"> <if test="conditionParamRef.containsKey('id')">
<if test="conditionParamRef.id != null"> <if test="conditionParamRef.id != null">
${_conditionType_} a.id=#{${_conditionParam_}.id} ${_conditionType_} a.id=#{${_conditionParam_}.id}
...@@ -1297,6 +1321,54 @@ ...@@ -1297,6 +1321,54 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('deleted')">
<if test="conditionParamRef.deleted != null ">
${_conditionType_} a.deleted = #{${_conditionParam_}.deleted}
</if>
<if test="conditionParamRef.deleted == null">
${_conditionType_} a.deleted is null
</if>
</if>
<if test="conditionParamRef.containsKey('deletedList') and conditionParamRef.deletedList.size() > 0">
${_conditionType_} a.deleted in
<foreach collection="conditionParamRef.deletedList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deletedNotList') and conditionParamRef.deletedNotList.size() > 0">
${_conditionType_} a.deleted not in
<foreach collection="conditionParamRef.deletedNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deletedStart') and conditionParamRef.deletedStart != null">
${_conditionType_} a.deleted <![CDATA[ >= ]]> #{${_conditionParam_}.deletedStart}
</if>
<if test="conditionParamRef.containsKey('deletedEnd') and conditionParamRef.deletedEnd != null">
${_conditionType_} a.deleted <![CDATA[ <= ]]> #{${_conditionParam_}.deletedEnd}
</if>
<if test="conditionParamRef.containsKey('operatorId')">
<if test="conditionParamRef.operatorId != null and conditionParamRef.operatorId != ''">
${_conditionType_} a.operatorId like #{${_conditionParam_}.operatorId}
</if>
<if test="conditionParamRef.operatorId == null">
${_conditionType_} a.operatorId is null
</if>
</if>
<if test="conditionParamRef.containsKey('operatorIdList') and conditionParamRef.operatorIdList.size() > 0">
${_conditionType_} a.operatorId in
<foreach collection="conditionParamRef.operatorIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('operatorIdNotList') and conditionParamRef.operatorIdNotList.size() > 0">
${_conditionType_} a.operatorId not in
<foreach collection="conditionParamRef.operatorIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('createTime')"> <if test="conditionParamRef.containsKey('createTime')">
<if test="conditionParamRef.createTime != null "> <if test="conditionParamRef.createTime != null ">
...@@ -1390,39 +1462,158 @@ ...@@ -1390,39 +1462,158 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
</sql>
<if test="conditionParamRef.containsKey('operatorId')"> <sql id="_orderCols_">
<if test="conditionParamRef.operatorId != null and conditionParamRef.operatorId != ''"> <if test="orderColList != null and !orderColList.isEmpty()">
${_conditionType_} a.operatorId like #{${_conditionParam_}.operatorId} order by
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
field(a.id,
<foreach collection="conditionParamRef.idList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if> </if>
<if test="conditionParamRef.operatorId == null"> <if test="conditionParamRef.containsKey('deptIdList') and conditionParamRef.deptIdList.size() > 0">
${_conditionType_} a.operatorId is null field(a.deptId,
<foreach collection="conditionParamRef.deptIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if> </if>
<if test="conditionParamRef.containsKey('windowIdList') and conditionParamRef.windowIdList.size() > 0">
field(a.windowId,
<foreach collection="conditionParamRef.windowIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if> </if>
<if test="conditionParamRef.containsKey('operatorIdList') and conditionParamRef.operatorIdList.size() > 0"> <if test="conditionParamRef.containsKey('siteIdList') and conditionParamRef.siteIdList.size() > 0">
${_conditionType_} a.operatorId in field(a.siteId,
<foreach collection="conditionParamRef.operatorIdList" open="(" close=")" index="index" item="item" separator=","> <foreach collection="conditionParamRef.siteIdList" open="" close=")" index="index" item="item" separator=",">
#{item} #{item}
</foreach> </foreach>
,
</if> </if>
<if test="conditionParamRef.containsKey('operatorIdNotList') and conditionParamRef.operatorIdNotList.size() > 0"> <if test="conditionParamRef.containsKey('politicalstatusList') and conditionParamRef.politicalstatusList.size() > 0">
${_conditionType_} a.operatorId not in field(a.politicalstatus,
<foreach collection="conditionParamRef.operatorIdNotList" open="(" close=")" index="index" item="item" separator=","> <foreach collection="conditionParamRef.politicalstatusList" open="" close=")" index="index" item="item" separator=",">
#{item} #{item}
</foreach> </foreach>
,
</if>
<if test="conditionParamRef.containsKey('dangyuanList') and conditionParamRef.dangyuanList.size() > 0">
field(a.dangyuan,
<foreach collection="conditionParamRef.dangyuanList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('starlevelList') and conditionParamRef.starlevelList.size() > 0">
field(a.starlevel,
<foreach collection="conditionParamRef.starlevelList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('onlineList') and conditionParamRef.onlineList.size() > 0">
field(a.online,
<foreach collection="conditionParamRef.onlineList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('deletedList') and conditionParamRef.deletedList.size() > 0">
field(a.deleted,
<foreach collection="conditionParamRef.deletedList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
field(a.createUserId,
<foreach collection="conditionParamRef.createUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if> </if>
</sql>
<sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()">
order by
<trim suffixOverrides="," suffix=""> <trim suffixOverrides="," suffix="">
<foreach collection="orderColList" open="" close="" index="index" item="item" separator=","> <foreach collection="orderColList" open="" close="" index="index" item="item" separator=",">
${item.colName} ${item.sortKind} a.${item.colName} ${item.sortKind}
</foreach> </foreach>
</trim> </trim>
</if> </if>
<if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()"> <if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()">
order by order by
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
field(a.id,
<foreach collection="conditionParamRef.idList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('deptIdList') and conditionParamRef.deptIdList.size() > 0">
field(a.deptId,
<foreach collection="conditionParamRef.deptIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('windowIdList') and conditionParamRef.windowIdList.size() > 0">
field(a.windowId,
<foreach collection="conditionParamRef.windowIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('siteIdList') and conditionParamRef.siteIdList.size() > 0">
field(a.siteId,
<foreach collection="conditionParamRef.siteIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('politicalstatusList') and conditionParamRef.politicalstatusList.size() > 0">
field(a.politicalstatus,
<foreach collection="conditionParamRef.politicalstatusList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('dangyuanList') and conditionParamRef.dangyuanList.size() > 0">
field(a.dangyuan,
<foreach collection="conditionParamRef.dangyuanList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('starlevelList') and conditionParamRef.starlevelList.size() > 0">
field(a.starlevel,
<foreach collection="conditionParamRef.starlevelList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('onlineList') and conditionParamRef.onlineList.size() > 0">
field(a.online,
<foreach collection="conditionParamRef.onlineList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('deletedList') and conditionParamRef.deletedList.size() > 0">
field(a.deleted,
<foreach collection="conditionParamRef.deletedList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
field(a.createUserId,
<foreach collection="conditionParamRef.createUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<trim suffixOverrides="," suffix=""> <trim suffixOverrides="," suffix="">
<if test="orderCol.containsKey('id')"> <if test="orderCol.containsKey('id')">
a.id a.id
...@@ -1559,6 +1750,16 @@ ...@@ -1559,6 +1750,16 @@
<if test='orderCol.modelIds != null and "DESC".equalsIgnoreCase(orderCol.modelIds)'>DESC</if> <if test='orderCol.modelIds != null and "DESC".equalsIgnoreCase(orderCol.modelIds)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('deleted')">
a.deleted
<if test='orderCol.deleted != null and "DESC".equalsIgnoreCase(orderCol.deleted)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('operatorId')">
a.operatorId
<if test='orderCol.operatorId != null and "DESC".equalsIgnoreCase(orderCol.operatorId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('createTime')"> <if test="orderCol.containsKey('createTime')">
a.createTime a.createTime
<if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if> <if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if>
...@@ -1584,13 +1785,10 @@ ...@@ -1584,13 +1785,10 @@
<if test='orderCol.lastLoginAddress != null and "DESC".equalsIgnoreCase(orderCol.lastLoginAddress)'>DESC</if> <if test='orderCol.lastLoginAddress != null and "DESC".equalsIgnoreCase(orderCol.lastLoginAddress)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('operatorId')">
a.operatorId
<if test='orderCol.operatorId != null and "DESC".equalsIgnoreCase(orderCol.operatorId)'>DESC</if>
,
</if>
</trim> </trim>
</if> </if>
</sql> </sql>
<sql id="_group_by_"> <sql id="_group_by_">
<if test="groupList != null and !groupList.isEmpty()"> <if test="groupList != null and !groupList.isEmpty()">
......
...@@ -24,9 +24,8 @@ POST {{baseUrl}}/app/interlist ...@@ -24,9 +24,8 @@ POST {{baseUrl}}/app/interlist
Content-Type: application/json Content-Type: application/json
{ {
"idList": [2,3,1],
"siteId": 1, "siteId": 1,
"appTypeNotList": [4],
"aaa": 111,
"page": 1, "page": 1,
"size": -1 "size": -1
} }
......
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
"baseUrl": "http://192.168.0.98:11071/base" "baseUrl": "http://192.168.0.98:11071/base"
}, },
"base-product": {
"baseUrl": "http://192.168.0.250:11071/base"
},
"base-yanyuan-test": { "base-yanyuan-test": {
"baseUrl": "http://192.168.0.119:11078/base" "baseUrl": "http://192.168.0.119:11078/base"
}, },
......
...@@ -45,12 +45,14 @@ Content-Type: application/json ...@@ -45,12 +45,14 @@ Content-Type: application/json
###基础事项列表 ###基础事项列表
POST {{baseUrl}}/site/matter/list POST {{baseUrl}}/site/matter/interlist
Content-Type: application/json Content-Type: application/json
{ {
"page": 1, "page": 1,
"size": 10 "size": 10,
"siteId": 1,
"matterName": "特种设备作业人员资格认定取证"
} }
###微官网事项列表 ###微官网事项列表
...@@ -151,7 +153,7 @@ client.global.set("Matter_id", JSON.parse(response.body).data.id); ...@@ -151,7 +153,7 @@ client.global.set("Matter_id", JSON.parse(response.body).data.id);
%} %}
###基础事项查看 ###基础事项查看
GET {{baseUrl}}/matter/interinfo?id=34081 GET {{baseUrl}}/matter/interinfo?id=40248
Accept: application/json Accept: application/json
###基础事项编辑 ###基础事项编辑
......
...@@ -109,9 +109,20 @@ POST {{baseUrl}}/site/getAreaSitesByAreaLevel ...@@ -109,9 +109,20 @@ POST {{baseUrl}}/site/getAreaSitesByAreaLevel
Content-Type: application/json Content-Type: application/json
{ {
"areaLevel":2
"areaLevelList": [3,4,5]
} }
###根据区域等级获取站点列表
POST {{baseUrl}}/site/getSitesGroupByAreaLevel
Content-Type: application/json
{
"areaLevel":3,
"areaLevelList": [3]
}
###站点列表 ###站点列表
POST {{baseUrl}}/site/getAreaSitesBySite POST {{baseUrl}}/site/getAreaSitesBySite
Content-Type: application/json Content-Type: application/json
......
...@@ -9,7 +9,7 @@ Content-Type: application/json ...@@ -9,7 +9,7 @@ Content-Type: application/json
{ {
"loginName":"admin", "loginName":"admin",
"password":"xhxADMIN8@a", "password":"admin",
"securityCode":"admin" "securityCode":"admin"
} }
...@@ -217,7 +217,7 @@ Content-Type: application/json ...@@ -217,7 +217,7 @@ Content-Type: application/json
{ {
"page":1, "page":1,
"secondOrganize": "hongqi" "name": "%domain%"
} }
......
...@@ -3,7 +3,7 @@ POST {{baseUrl}}/workman/doLogin ...@@ -3,7 +3,7 @@ POST {{baseUrl}}/workman/doLogin
Content-Type: application/json Content-Type: application/json
{ {
"loginName":"yangying", "loginName":"wangtao123",
"loginPwd":"123", "loginPwd":"123",
"siteId": 1 "siteId": 1
} }
...@@ -40,7 +40,14 @@ Accept: application/json ...@@ -40,7 +40,14 @@ Accept: application/json
###工作人员删除 ###工作人员删除
GET {{baseUrl}}/workman/delete?id={{Workman_id}} GET {{baseUrl}}/workman/delete?id=35
Authorization: {{authToken}}
Accept: application/json
###工作人员逻辑删除
GET {{baseUrl}}/workman/logicDelete?id=36
Authorization: {{authToken}}
Accept: application/json Accept: application/json
......
...@@ -316,6 +316,22 @@ img { ...@@ -316,6 +316,22 @@ img {
background-color: rgba(5, 149, 253, 1); background-color: rgba(5, 149, 253, 1);
} }
.ant-table-fixed-header .ant-table-scroll .ant-table-header {
overflow: hidden !important;
margin-bottom: 0 !important;
padding-right: 6px;
tr:only-child > th:last-child {
border-right-color: #f0f0f0 !important;
}
}
.ant-table-placeholder {
width: calc(100% - 6px);
}
// .ant-table-header {
// background: #fff;
// }
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 6px; width: 6px;
height: 6px; height: 6px;
......
...@@ -73,6 +73,11 @@ Vue.config.productionTip = false; ...@@ -73,6 +73,11 @@ Vue.config.productionTip = false;
import Viewer from "v-viewer"; import Viewer from "v-viewer";
import "viewerjs/dist/viewer.css"; import "viewerjs/dist/viewer.css";
Vue.use(Viewer); Vue.use(Viewer);
// echarts
import * as echarts from "echarts";
Vue.prototype.$echarts = echarts;
// 图片懒加载插件 // 图片懒加载插件
import VueLazyload from "vue-lazyload"; import VueLazyload from "vue-lazyload";
Vue.use(VueLazyload, { Vue.use(VueLazyload, {
......
<template> <template>
<div class="h-full w-full flex flex-col"> <div class="h-full w-full flex flex-col">
<div class="total-info"> <div class="total-info">
<span class="mr-[30px]">次数:{{ total ?? 0 }}</span> <span class="mr-[30px]">异常次数:{{ total ?? 0 }}</span>
<span>统计时间段:{{ time[0] }} - {{ time[1] }}</span> <span>统计时间段:{{ time[0] }} - {{ time[1] }}</span>
</div> </div>
<div class="reportforms-out-box"> <div class="reportforms-out-box">
...@@ -56,6 +56,4 @@ export default { ...@@ -56,6 +56,4 @@ export default {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>
<template> <template>
<div class="h-full w-full flex flex-col"> <div class="h-full w-full flex flex-col">
<div class="total-info"> <div class="total-info">
<span class="mr-[30px]">次数:{{ total ?? 0 }}</span> <span class="mr-[30px]">异常次数:{{ total ?? 0 }}</span>
<span>统计时间段:{{ time[0] }} - {{ time[1] }}</span> <span>统计时间段:{{ time[0] }} - {{ time[1] }}</span>
</div> </div>
<div class="reportforms-out-box"> <div class="reportforms-out-box">
...@@ -56,6 +56,4 @@ export default { ...@@ -56,6 +56,4 @@ export default {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>
<template> <template>
<div class="h-full w-full flex flex-col"> <div class="h-full w-full flex flex-col">
<div class="total-info"> <div class="total-info">
<span class="mr-[30px]" v-if="isShow">评价次数{{ total || 0 }}</span> <span class="mr-[30px]">{{ totalTitle }}{{ total || 0 }}</span>
<span>统计时间段:{{ time[0] }} - {{ time[1] }}</span> <span>统计时间段:{{ time[0] }} - {{ time[1] }}</span>
</div> </div>
<div class="reportforms-out-box"> <div class="reportforms-out-box">
...@@ -30,6 +30,16 @@ export default { ...@@ -30,6 +30,16 @@ export default {
mixins: [common], mixins: [common],
data() { data() {
return { return {
pathList: {
"/home/dataManagement/evaluationRecordReport/windowsEvaluation":
"评价次数",
"/home/dataManagement/evaluationRecordReport/departmentEvaluation":
"评价次数",
"/home/dataManagement/evaluationRecordReport/matterEvaluation":
"评价次数",
"/home/dataManagement/evaluationRecordReport/windowLeft": "暂离记录",
"/home/dataManagement/evaluationRecordReport/staffLeft": "暂离记录",
},
total: 0, total: 0,
time: [ time: [
this.$moment().format("YYYY-MM-DD"), this.$moment().format("YYYY-MM-DD"),
...@@ -38,6 +48,10 @@ export default { ...@@ -38,6 +48,10 @@ export default {
}; };
}, },
computed: { computed: {
totalTitle() {
let path = this.$route.path;
return this.pathList[path];
},
tabsList() { tabsList() {
return getItemData( return getItemData(
this.$router.options.routes, this.$router.options.routes,
...@@ -45,15 +59,18 @@ export default { ...@@ -45,15 +59,18 @@ export default {
"evaluationRecordReport" "evaluationRecordReport"
); );
}, },
isShow(){ isShow() {
let val = this.$route.path let val = this.$route.path;
if ((val=='/home/dataManagement/evaluationRecordReport/windowLeft')||(val=='/home/dataManagement/evaluationRecordReport/staffLeft')) { if (
return false val == "/home/dataManagement/evaluationRecordReport/windowLeft" ||
}else{ val == "/home/dataManagement/evaluationRecordReport/staffLeft"
return true ) {
} return false;
} else {
return true;
} }
}, },
},
mounted() {}, mounted() {},
methods: { methods: {
changeRouter(path) { changeRouter(path) {
...@@ -68,6 +85,4 @@ export default { ...@@ -68,6 +85,4 @@ export default {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>
<template> <template>
<div class="h-full w-full flex flex-col"> <div class="h-full w-full flex flex-col">
<div class="total-info"> <div class="total-info">
<span class="mr-[30px]">次数{{ total ?? 0 }}</span> <span class="mr-[30px]">{{ totalTitle }}{{ total ?? 0 }}</span>
<span>统计时间段:{{ time[0] }} - {{ time[1] }}</span> <span>统计时间段:{{ time[0] }} - {{ time[1] }}</span>
</div> </div>
<div class="reportforms-out-box"> <div class="reportforms-out-box">
...@@ -30,6 +30,11 @@ export default { ...@@ -30,6 +30,11 @@ export default {
mixins: [common], mixins: [common],
data() { data() {
return { return {
pathList: {
"/home/dataManagement/pickUp/pickUpRecord": "取件记录",
"/home/dataManagement/pickUp/depositRecord": "存件记录",
"/home/dataManagement/pickUp/otherRecord": "其他记录",
},
total: 0, total: 0,
time: [ time: [
this.$moment().format("YYYY-MM-DD"), this.$moment().format("YYYY-MM-DD"),
...@@ -38,6 +43,10 @@ export default { ...@@ -38,6 +43,10 @@ export default {
}; };
}, },
computed: { computed: {
totalTitle() {
let path = this.$route.path;
return this.pathList[path];
},
tabsList() { tabsList() {
return getItemData(this.$router.options.routes, "name", "pickUp"); return getItemData(this.$router.options.routes, "name", "pickUp");
}, },
...@@ -56,6 +65,4 @@ export default { ...@@ -56,6 +65,4 @@ export default {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>
<template> <template>
<div class="h-full w-full flex flex-col"> <div class="h-full w-full flex flex-col">
<div class="total-info"> <div class="total-info">
<span <span class="mr-[30px]">{{ totalTitle }}{{ total ?? 0 }}</span>
v-if="$route.path == '/home/dataManagement/queueCall/queueRecord'"
class="mr-[30px]"
>取号次数:{{ total ?? 0 }}</span
>
<span
v-if="$route.path == '/home/dataManagement/queueCall/numAcquisition'"
class="mr-[30px]"
>取号次数:{{ total ?? 0 }}</span
>
<span
v-if="$route.path == '/home/dataManagement/queueCall/callRecord'"
class="mr-[30px]"
>呼叫次数:{{ total ?? 0 }}</span
>
<span>统计时间段:{{ time[0] }} - {{ time[1] }}</span> <span>统计时间段:{{ time[0] }} - {{ time[1] }}</span>
</div> </div>
<div class="reportforms-out-box"> <div class="reportforms-out-box">
...@@ -53,6 +39,11 @@ export default { ...@@ -53,6 +39,11 @@ export default {
mixins: [common], mixins: [common],
data() { data() {
return { return {
pathList: {
"/home/dataManagement/queueCall/queueRecord": "取号次数",
"/home/dataManagement/queueCall/numAcquisition": "取号次数",
"/home/dataManagement/queueCall/callRecord": "呼叫次数",
},
total: 0, total: 0,
time: [ time: [
this.$moment().format("YYYY-MM-DD"), this.$moment().format("YYYY-MM-DD"),
...@@ -61,6 +52,10 @@ export default { ...@@ -61,6 +52,10 @@ export default {
}; };
}, },
computed: { computed: {
totalTitle() {
let path = this.$route.path;
return this.pathList[path];
},
tabsList() { tabsList() {
return getItemData(this.$router.options.routes, "name", "queueCall"); return getItemData(this.$router.options.routes, "name", "queueCall");
}, },
...@@ -79,6 +74,4 @@ export default { ...@@ -79,6 +74,4 @@ export default {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>
...@@ -90,7 +90,7 @@ export default { ...@@ -90,7 +90,7 @@ export default {
area: [], area: [],
sign: [], sign: [],
chart: null, chart: null,
dayValue: "", dayValue: "0",
}; };
}, },
components: { components: {
......
...@@ -123,8 +123,6 @@ export default { ...@@ -123,8 +123,6 @@ export default {
.ant-layout-content { .ant-layout-content {
background: #fff; background: #fff;
flex: 1; flex: 1;
overflow-y: auto;
overflow-x: hidden;
} }
} }
&::before { &::before {
...@@ -152,4 +150,3 @@ export default { ...@@ -152,4 +150,3 @@ export default {
} }
} }
</style> </style>
...@@ -427,12 +427,6 @@ export default { ...@@ -427,12 +427,6 @@ export default {
// } // }
} }
&:nth-child(1) { &:nth-child(1) {
.type-list {
border-style: solid;
border-right-width: 2px;
border-image: linear-gradient(180deg, #0000 0%, #fff 30%, #0000 90%) 1;
// border-image-slice: 2;
}
.item-logo { .item-logo {
background: linear-gradient(180deg, #c7e1f6 0%, #ffffff 85%); background: linear-gradient(180deg, #c7e1f6 0%, #ffffff 85%);
} }
...@@ -440,6 +434,8 @@ export default { ...@@ -440,6 +434,8 @@ export default {
&:nth-child(2) { &:nth-child(2) {
.type-list { .type-list {
border-style: solid; border-style: solid;
border-width: 0px;
border-left-width: 2px;
border-right-width: 2px; border-right-width: 2px;
border-image: linear-gradient(180deg, #0000 0%, #fff 30%, #0000 90%) 1; border-image: linear-gradient(180deg, #0000 0%, #fff 30%, #0000 90%) 1;
// border-image-slice: 2; // border-image-slice: 2;
......
...@@ -11,7 +11,9 @@ ...@@ -11,7 +11,9 @@
v-model="BegindAndEndTime" v-model="BegindAndEndTime"
> >
</a-range-picker> </a-range-picker>
<a-button type="primary" class="addclass" @click="handleSearch">搜索</a-button> <a-button type="primary" class="addclass" @click="handleSearch"
>搜索</a-button
>
<a-button @click="resetSearch">重置</a-button> <a-button @click="resetSearch">重置</a-button>
</a-space> </a-space>
</div> </div>
...@@ -110,7 +112,10 @@ export default { ...@@ -110,7 +112,10 @@ export default {
tableHeaders, tableHeaders,
searchName: "", searchName: "",
tableLoading: false, tableLoading: false,
BegindAndEndTime: [], BegindAndEndTime: [
this.$moment().format("YYYY-MM-DD"),
this.$moment().format("YYYY-MM-DD"),
],
tableSourceData: [], tableSourceData: [],
pageSizeOptions: ["10", "30", "50", "100"], pageSizeOptions: ["10", "30", "50", "100"],
current: 1, current: 1,
...@@ -127,17 +132,19 @@ export default { ...@@ -127,17 +132,19 @@ export default {
// 获取日志列表 // 获取日志列表
async getOperLogList() { async getOperLogList() {
this.tableLoading = true; this.tableLoading = true;
let query = {
logDateStart: this.BegindAndEndTime[0],
logDateEnd: this.BegindAndEndTime[1],
};
if (this.searchName != "") {
query.content = `%${this.searchName}%`;
}
let res = await getOperLogList({ let res = await getOperLogList({
pageInfo: { pageInfo: {
prePageResult: this.size, prePageResult: this.size,
currPage: this.size, currPage: this.current,
},
query: {
logDateStart: this.BegindAndEndTime[0],
logDateEnd: this.BegindAndEndTime[1],
// siteId: this.siteId,
content: `%${this.searchName}%`,
}, },
query,
}); });
this.tableLoading = false; this.tableLoading = false;
this.dict = res.data.dict; this.dict = res.data.dict;
...@@ -162,7 +169,10 @@ export default { ...@@ -162,7 +169,10 @@ export default {
}, },
resetSearch() { resetSearch() {
this.current = 1; this.current = 1;
this.BegindAndEndTime = []; this.BegindAndEndTime = [
this.$moment().format("YYYY-MM-DD"),
this.$moment().format("YYYY-MM-DD"),
];
this.searchName = ""; this.searchName = "";
this.getOperLogList(); this.getOperLogList();
}, },
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
} }
} }
html{ html {
font-size: var(--base-font-size); font-size: var(--base-font-size);
} }
...@@ -25,8 +25,8 @@ html{ ...@@ -25,8 +25,8 @@ html{
.effect-box { .effect-box {
position: sticky; position: sticky;
top: 0; top: 0;
/* height: 100vh; */ height: 100vh;
min-height: 930rem; /* min-height: 930rem; */
background-color: #031233; background-color: #031233;
perspective: 800px; perspective: 800px;
overflow: hidden; overflow: hidden;
......
...@@ -43,7 +43,7 @@ CREATE TABLE `mortals_xhx_user_pwd_record` ( ...@@ -43,7 +43,7 @@ CREATE TABLE `mortals_xhx_user_pwd_record` (
UPDATE mortals_xhx_user SET lastUpdatePwdTime=NOW(); UPDATE mortals_xhx_user SET lastUpdatePwdTime=NOW();
-- ---------------------------- -- ----------------------------
2023-08-29 -- 2023-08-29
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_user_model_collect`; DROP TABLE IF EXISTS `mortals_xhx_user_model_collect`;
CREATE TABLE `mortals_xhx_user_model_collect` ( CREATE TABLE `mortals_xhx_user_model_collect` (
...@@ -56,7 +56,7 @@ CREATE TABLE `mortals_xhx_user_model_collect` ( ...@@ -56,7 +56,7 @@ CREATE TABLE `mortals_xhx_user_model_collect` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户模块收藏'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户模块收藏';
-- ---------------------------- -- ----------------------------
2023-10-10 -- 2023-10-10
-- ---------------------------- -- ----------------------------
ALTER TABLE `mortals_xhx_user_model_collect` ALTER TABLE `mortals_xhx_user_model_collect`
ADD COLUMN `siteId` bigint(20) DEFAULT NULL COMMENT '站点ID'; ADD COLUMN `siteId` bigint(20) DEFAULT NULL COMMENT '站点ID';
...@@ -64,9 +64,94 @@ ADD COLUMN `siteId` bigint(20) DEFAULT NULL COMMENT '站点ID'; ...@@ -64,9 +64,94 @@ ADD COLUMN `siteId` bigint(20) DEFAULT NULL COMMENT '站点ID';
UPDATE mortals_xhx_user_model_collect SET siteId=1; UPDATE mortals_xhx_user_model_collect SET siteId=1;
-- ---------------------------- -- ----------------------------
2023-11-13 -- 2023-11-13
-- ---------------------------- -- ----------------------------
ALTER TABLE mortals_xhx_role_auth ADD COLUMN `resourceId` bigint(20) COMMENT '资源ID'; ALTER TABLE mortals_xhx_role_auth ADD COLUMN `resourceId` bigint(20) COMMENT '资源ID';
ALTER TABLE mortals_xhx_role_auth ADD COLUMN `createTime` datetime COMMENT '创建时间'; ALTER TABLE mortals_xhx_role_auth ADD COLUMN `createTime` datetime COMMENT '创建时间';
ALTER TABLE mortals_xhx_role_auth ADD COLUMN `createUserId` bigint(20) COMMENT '创建用户'; ALTER TABLE mortals_xhx_role_auth ADD COLUMN `createUserId` bigint(20) COMMENT '创建用户';
ALTER TABLE mortals_xhx_role_auth ADD COLUMN `createUserName` varchar(50) COMMENT '创建用户名称'; ALTER TABLE mortals_xhx_role_auth ADD COLUMN `createUserName` varchar(50) COMMENT '创建用户名称';
-- ----------------------------
-- 2024-12-9 添加消息模板表与发送任务表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_message_template`;
CREATE TABLE `mortals_xhx_message_template` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`code` varchar(255) DEFAULT '' COMMENT '模板编码,唯一',
`site_id` bigint(20) DEFAULT NULL COMMENT '站点ID',
`site_name` varchar(255) DEFAULT NULL COMMENT '站点名称',
`site_code` varchar(255) DEFAULT NULL COMMENT '站点编码',
`app_name` varchar(64) DEFAULT NULL COMMENT '应用平台标识',
`category` varchar(64) DEFAULT NULL COMMENT '分组,便于将模板归类,如“系统通知”、“营销推广”',
`name` varchar(255) DEFAULT NULL COMMENT '模板名称,用于标识模板的用途或类型。例如 "注册成功通知"、"验证码短信"。',
`type` varchar(255) DEFAULT NULL COMMENT '模板类型,指定消息模板适用的发送渠道或用途',
`content` varchar(1024) COMMENT '模板内容,支持包含动态占位符。占位符用特殊语法(如 {{变量名}})表示,发送时动态替换。例如:"您好,{{name}},您的验证码是 {{code}}"。',
`placeholders` varchar(255) DEFAULT NULL COMMENT '模板占位符的定义,描述模板中各占位符的名称和含义。以 JSON 格式存储,例如:{"name": "用户姓名", "code": "验证码"},用于接口生成提示或校验必需参数。',
`description` varchar(255) DEFAULT NULL COMMENT '模板描述,简要说明模板的用途和使用场景,方便管理员理解。例如:"此模板用于向用户发送验证码短信。"',
`priority` tinyint(2) DEFAULT '0' COMMENT '优先级,用于在消息任务调度时区分重要性 (0.普通,1.优先,2.紧急)',
`enabled` tinyint(2) DEFAULT '0' COMMENT '启用状态 (0.停用,1.启用)',
`create_user_id` bigint(20) DEFAULT NULL COMMENT '创建用户',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uni_code`(`code`) USING BTREE,
INDEX `idx_site_id`(`site_id`) USING BTREE,
INDEX `idx_app_name`(`app_name`) USING BTREE,
INDEX `idx_category`(`category`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='消息模板表';
DROP TABLE IF EXISTS `mortals_xhx_message_task`;
CREATE TABLE `mortals_xhx_message_task` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`code` varchar(255) DEFAULT '' COMMENT '模板编码,唯一',
`template_id` bigint(20) DEFAULT NULL COMMENT '消息模板ID',
`app_name` varchar(64) DEFAULT NULL COMMENT '应用平台标识',
`site_id` bigint(20) DEFAULT NULL COMMENT '站点ID',
`site_name` varchar(255) DEFAULT NULL COMMENT '站点名称',
`site_code` varchar(255) DEFAULT NULL COMMENT '站点编码',
`recipient` varchar(64) DEFAULT NULL COMMENT '接收者信息,例如手机号、邮箱或用户 ID,具体格式依据模板类型(SMS 为手机号,EMAIL 为邮箱,PUSH 为用户 ID)',
`parameters` varchar(64) DEFAULT NULL COMMENT '动态参数,用于替换消息模板中的占位符。例如:{"name": "张三", "code": "123456"}',
`channel` varchar(64) DEFAULT NULL COMMENT '消息发送渠道,例如 SMS(短信)、EMAIL(邮件)、PUSH(推送通知)',
`priority` tinyint(2) DEFAULT '0' COMMENT '优先级,用于在消息任务调度时区分重要性 (0.普通,1.优先,2.紧急)',
`send_status` tinyint(2) DEFAULT '0' COMMENT '状态 (0.待发送,1.发送中,2.成功,3.失败)',
`retry_count` tinyint(2) DEFAULT '0' COMMENT '任务重试次数,记录任务失败后已尝试重新发送的次数。默认值为 0,用于防止无限重试。',
`create_user_id` bigint(20) DEFAULT NULL COMMENT '创建用户',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_code`(`code`) USING BTREE,
INDEX `idx_template_id`(`template_id`) USING BTREE,
INDEX `idx_site_id`(`site_id`) USING BTREE,
INDEX `idx_app_name`(`app_name`) USING BTREE,
INDEX `idx_send_status`(`send_status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='消息任务表';
DROP TABLE IF EXISTS `mortals_xhx_message_log`;
CREATE TABLE `mortals_xhx_message_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`code` varchar(255) DEFAULT '' COMMENT '模板编码,唯一',
`task_id` bigint(20) DEFAULT NULL COMMENT '任务ID',
`app_name` varchar(64) DEFAULT NULL COMMENT '应用平台标识',
`site_id` bigint(20) DEFAULT NULL COMMENT '站点ID',
`site_name` varchar(255) DEFAULT NULL COMMENT '站点名称',
`site_code` varchar(255) DEFAULT NULL COMMENT '站点编码',
`response` varchar(64) DEFAULT NULL COMMENT '返回的响应结果,记录发送的详细反馈信息',
`error_code` varchar(64) DEFAULT NULL COMMENT '错误代码,标识具体的失败原因。例如 "400"(参数错误)、"503"(服务不可用)',
`error_msg` varchar(512) DEFAULT NULL COMMENT '错误描述信息,对 error_code 进行补充说明。例如:"Invalid recipient address"',
`priority` tinyint(2) DEFAULT '0' COMMENT '优先级,用于在消息任务调度时区分重要性 (0.普通,1.优先,2.紧急)',
`send_status` tinyint(2) DEFAULT '0' COMMENT '状态 (0.待发送,1.发送中,2.成功,3.失败)',
`retry_count` tinyint(2) DEFAULT '0' COMMENT '任务重试次数,记录任务失败后已尝试重新发送的次数。默认值为 0,用于防止无限重试。',
`send_time` datetime DEFAULT NULL COMMENT '发送时间',
`create_user_id` bigint(20) DEFAULT NULL COMMENT '创建用户',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_task_id`(`task_id`) USING BTREE,
INDEX `idx_code`(`code`) USING BTREE,
INDEX `idx_site_id`(`site_id`) USING BTREE,
INDEX `idx_app_name`(`app_name`) USING BTREE,
INDEX `idx_send_status`(`send_status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='消息日志表';
This source diff could not be displayed because it is too large. You can view the blob instead.
#!/bin/sh
RETVAL=$?
SHELL_NAME="deploy"
BASEDIR=$(dirname $0)
BASEDIR=$( (
cd "$BASEDIR"
pwd
))
LOCK_FILE="/tmp/deploy.lock"
# 时间变量
CDATE=$(date "+%Y-%m-%d")
CTIME=$(date "+%H:%M:%S")
SHELL_LOG="${BASEDIR}/${SHELL_NAME}.log"
JAVA_HOME="/usr/local/java/jdk1.8"
SERVICE_PATH="/usr/lib/systemd/system"
PUBLISH_PATH="/home/publish"
PROJECT_NAME="@project.artifactId@"
PROJECT_EXECPATH="${PUBLISH_PATH}/${PROJECT_NAME}"
PROJECT_FILENAME="${PROJECT_NAME}.tar.gz"
PROJECT_SERVICE="${SERVICE_PATH}/${PROJECT_NAME}.service"
#写日志
writelog() {
LOGINFO=$1
echo "${CDATE} ${CTIME}: ${SHELL_NAME} : ${LOGINFO}" >>${SHELL_LOG}
echo ${LOGINFO}
}
#清理目标
clear_deploy() {
SERVICE=$1
EXECPATH=$2
#清理后台自启服务
rm -f ${SERVICE}
#清理执行文件目录
}
build_service() {
SERVICE=$1
EXECPATH=$2
echo "" >${SERVICE}
echo "[Unit]" >>${SERVICE}
echo "Description=${PROJECT_NAME}" >>${SERVICE}
echo "After=network.target" >>${SERVICE}
echo "" >>${SERVICE}
echo "[Service]" >>${SERVICE}
echo "Environment=\"JAVA_HOME=$JAVA_HOME\"" >>${SERVICE}
echo "Type=forking" >>${SERVICE}
echo "ExecStartPre=-/bin/sleep 5s" >>${SERVICE}
echo "ExecStart=${EXECPATH}/bin/start.sh" >>${SERVICE}
echo "ExecStop=${EXECPATH}/bin/shutdown.sh" >>${SERVICE}
echo "PrivateTmp=true" >>${SERVICE}
echo "" >>${SERVICE}
echo "[Install]" >>${SERVICE}
echo "WantedBy=multi-user.target" >>${SERVICE}
writelog "${PROJECT_NAME}服务创建完成!"
}
#启动服务与nginx
start_service() {
systemctl enable ${PROJECT_NAME}
systemctl daemon-reload
writelog "${PROJECT_NAME}服务启动..."
systemctl stop ${PROJECT_NAME}&&systemctl start ${PROJECT_NAME}
project_status=$(systemctl status "${PROJECT_NAME}"|grep Active |awk '{print $2}')
jcpid=$(ps -ef | grep -v "grep" | grep "${PROJECT_NAME} " | awk '{print $2}')
writelog "${PROJECT_NAME}服务启动,PID is ${jcpid} ,status:${project_status}"
}
#部署后台服务
project_deploy() {
writelog "${PROJECT_NAME}_deploy"
clear_deploy ${PROJECT_SERVICE} ${PROJECT_EXECPATH}
writelog "${PROJECT_NAME}_clear_finish"
tar -zvxf ./${PROJECT_FILENAME} -C ${PUBLISH_PATH}
build_service ${PROJECT_SERVICE} ${PROJECT_EXECPATH}
start_service
writelog "${PROJECT_NAME}_deploy_finish"
}
#主函数
main() {
echo "后台服务部署"
project_deploy
exit ${RETVAL}
}
main $1
#!/bin/sh #!/bin/sh
PORT="@profiles.server.port@" PORT="@profiles.server.port@"
DEBUG=@profiles.server.debug@
BASEDIR=`dirname $0`/.. BASEDIR=`dirname $0`/..
BASEDIR=`(cd "$BASEDIR"; pwd)` BASEDIR=`(cd "$BASEDIR"; pwd)`
PROJECT_NAME="@project.artifactId@"; PROJECT_NAME="@project.artifactId@";
MAIN_CLASS="$PROJECT_NAME-@project.version@.jar"; MAIN_CLASS="$PROJECT_NAME-@project.version@.jar";
LOG_PATH="@profiles.log.path@/$PROJECT_NAME" LOG_PATH="@profiles.log.path@/$PROJECT_NAME"
GC_PATH=$LOG_PATH/PROJECT_NAME"-gc.log" GC_PATH=$LOG_PATH/$PROJECT_NAME"-gc.log"
HS_ERR_PATH=$LOG_PATH/PROJECT_NAME"-hs_err.log" HS_ERR_PATH=$LOG_PATH/$PROJECT_NAME"-hs_err.log"
HEAP_DUMP_PATH=$LOG_PATH/PROJECT_NAME"-heap_dump.hprof" HEAP_DUMP_PATH=$LOG_PATH/$PROJECT_NAME"-heap_dump.hprof"
TEMP_PATH=$LOG_PATH/temp/ TEMP_PATH=$LOG_PATH/temp/
SUCCESS=0 SUCCESS=0
FAIL=9 FAIL=9
...@@ -45,7 +46,7 @@ fi ...@@ -45,7 +46,7 @@ fi
if [ -e "$BASEDIR" ] if [ -e "$BASEDIR" ]
then then
JAVA_OPTS="-Xms512M -Xmx1024M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$GC_PATH -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=$HS_ERR_PATH -XX:HeapDumpPath=$HEAP_DUMP_PATH" JAVA_OPTS="-Xms1024M -Xmx2048M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$GC_PATH -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=$HS_ERR_PATH -XX:HeapDumpPath=$HEAP_DUMP_PATH"
fi fi
CLASSPATH=$CLASSPATH_PREFIX: CLASSPATH=$CLASSPATH_PREFIX:
...@@ -56,13 +57,12 @@ cd "$BASEDIR/boot"; ...@@ -56,13 +57,12 @@ cd "$BASEDIR/boot";
echo "starting application $PROJECT_NAME......" echo "starting application $PROJECT_NAME......"
exec "$JAVACMD" $JAVA_OPTS \ exec "$JAVACMD" $JAVA_OPTS \
$EXTRA_JVM_ARGUMENTS \ $EXTRA_JVM_ARGUMENTS \
$DEBUG \
-Dapp.name="$PROJECT_NAME" \ -Dapp.name="$PROJECT_NAME" \
-Dapp.port="$PORT" \ -Dapp.port="$PORT" \
-Dbasedir="$BASEDIR" \ -Dbasedir="$BASEDIR" \
-Dfile.encoding=utf-8 \ -Dfile.encoding=utf-8 \
-Djava.io.tmpdir=$TEMP_PATH \ -Djava.io.tmpdir=$TEMP_PATH \
-Dloader.path="file://$BASEDIR/conf,file://$BASEDIR/lib" \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=21072 \
-jar $MAIN_CLASS \ -jar $MAIN_CLASS \
> /dev/null & > /dev/null &
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
package com.mortals.xhx.base.system.oper.model; package com.mortals.xhx.base.system.oper.model;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.base.system.oper.model.vo.OperLogVo;
import java.util.Date; import java.util.Date;
...@@ -20,7 +21,7 @@ import java.util.Date; ...@@ -20,7 +21,7 @@ import java.util.Date;
* @author * @author
* @version 1.0.0 * @version 1.0.0
*/ */
public class OperLogEntity extends BaseEntityLong{ public class OperLogEntity extends OperLogVo {
private static final long serialVersionUID = 1547777703333L; private static final long serialVersionUID = 1547777703333L;
/** 平台标识 */ /** 平台标识 */
......
package com.mortals.xhx.base.system.oper.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import lombok.Data;
/**
* 自助终端应用分类视图对象
*
* @author zxfei
* @date 2023-06-15
*/
@Data
public class OperLogVo extends BaseEntityLong {
/** 开始 操作时间 */
private String logDateStart;
/** 结束 操作时间 */
private String logDateEnd;
}
\ No newline at end of file
...@@ -113,6 +113,9 @@ public class OperLogServiceImpl extends AbstractCRUDServiceImpl<OperLogDao,OperL ...@@ -113,6 +113,9 @@ public class OperLogServiceImpl extends AbstractCRUDServiceImpl<OperLogDao,OperL
operLogEntity.setContent(content); operLogEntity.setContent(content);
save(operLogEntity, null); save(operLogEntity, null);
} }
private void formatterLogContent(OperLogEntity operLogEntity, String content, String id, OperTypeEnum operType) { private void formatterLogContent(OperLogEntity operLogEntity, String content, String id, OperTypeEnum operType) {
if (operType == OperTypeEnum.SAVE) { if (operType == OperTypeEnum.SAVE) {
......
/**
* 文件:OperLogController.java
* 版本:1.0.0
* 日期:
* Copyright &reg;
* All right reserved.
*/
package com.mortals.xhx.base.system.oper.web; package com.mortals.xhx.base.system.oper.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol; import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.Result; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BaseCRUDJsonMappingController;
import com.mortals.xhx.base.system.oper.model.OperLogEntity; import com.mortals.xhx.base.system.oper.model.OperLogEntity;
import com.mortals.xhx.base.system.oper.service.OperLogService; import com.mortals.xhx.base.system.oper.service.OperLogService;
import com.mortals.xhx.common.code.OperTypeEnum; import com.mortals.xhx.common.code.OperTypeEnum;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -39,65 +25,42 @@ import java.util.Map; ...@@ -39,65 +25,42 @@ import java.util.Map;
*/ */
@RestController @RestController
@RequestMapping("oper/log") @RequestMapping("oper/log")
public class OperLogController extends BaseCRUDJsonMappingController<OperLogService,OperLogForm,OperLogEntity,Long> { public class OperLogController extends BaseCRUDJsonBodyMappingController<OperLogService,OperLogEntity,Long> {
public OperLogController(){ public OperLogController(){
super.setFormClass(OperLogForm.class); super.setFormClass(OperLogForm.class);
super.setModuleDesc("操作日志"); super.setModuleDesc("操作日志");
} }
/**
* @param model
* @param context
*/
@Override @Override
protected void init(HttpServletRequest request, HttpServletResponse response, OperLogForm form, protected void init(Map<String, Object> model, Context context) {
Map<String, Object> model, Context context) {
Map<String, Object> status = new HashMap<String, Object>(1); Map<String, Object> status = new HashMap<String, Object>(1);
// 返回日志类型 // 返回日志类型
status.put("operType", OperTypeEnum.getEnumMap()); status.put("operType", OperTypeEnum.getEnumMap());
model.put(KEY_RESULT_DICT, status); model.put(KEY_RESULT_DICT, status);
super.init(request, response, form, model, context); super.init(model, context);
}
@Override
@PostMapping({"list"})
@UnAuth
public String list(@RequestBody OperLogForm form) {
Map<String, Object> model = new HashMap();
JSONObject ret = new JSONObject();
Context context = this.getContext();
String busiDesc = "查询" + this.getModuleDesc();
int code;
try {
this.doListBefore(this.request, this.response, form, model, context);
Result result = this.getService().find(form.getQuery(), form.getPageInfo(), context);
model.put("result", result.getList());
model.put("pageInfo", result.getPageInfo());
model.put("total", result.getPageInfo().getTotalResult());
model.putAll(form.getModel());
code = this.doListAfter(this.request, this.response, form, model, context);
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var8) {
code = -1;
this.doException(this.request, busiDesc, model, var8);
}
form.getModel().clear();
this.init(this.request, this.response, form, model, context);
ret.put("code", code);
ret.put("msg", model.remove("message_info"));
ret.put("query", form.getQuery());
ret.put("data", model);
return ret.toJSONString();
} }
/**
* @param query
* @param model
* @param context
* @throws AppException
*/
@Override @Override
protected void doListBefore(HttpServletRequest request, HttpServletResponse response, OperLogForm form, Map<String, Object> model, Context context) throws AppException { protected void doListBefore(OperLogEntity query, Map<String, Object> model, Context context) throws AppException {
form.getQuery().setOrderColList(new ArrayList<OrderCol>() { super.doListBefore(query, model, context);
query.setOrderColList(new ArrayList<OrderCol>() {
{ {
add(new OrderCol("a.logDate", "desc")); add(new OrderCol("a.logDate", "desc"));
} }
}); });
} }
} }
\ No newline at end of file
...@@ -3,6 +3,7 @@ package com.mortals.xhx.module.cipher.web; ...@@ -3,6 +3,7 @@ package com.mortals.xhx.module.cipher.web;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.ZipUtil; import cn.hutool.core.util.ZipUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -13,8 +14,11 @@ import com.mortals.xhx.base.system.upload.service.UploadService; ...@@ -13,8 +14,11 @@ import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.common.utils.CipherUtil; import com.mortals.xhx.common.utils.CipherUtil;
import com.mortals.xhx.common.utils.DecodeUtil; import com.mortals.xhx.common.utils.DecodeUtil;
import com.mortals.xhx.common.utils.LicenseUtil; import com.mortals.xhx.common.utils.LicenseUtil;
import com.mortals.xhx.module.menu.model.MenuEntity;
import com.mortals.xhx.module.menu.service.MenuService;
import com.mortals.xhx.utils.EncodeUtil; import com.mortals.xhx.utils.EncodeUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -23,11 +27,16 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -23,11 +27,16 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import static com.mortals.framework.web.BaseController.VALUE_RESULT_SUCCESS; import static com.mortals.framework.web.BaseController.VALUE_RESULT_SUCCESS;
import static com.mortals.xhx.base.framework.exception.ExceptionHandle.*; import static com.mortals.xhx.base.framework.exception.ExceptionHandle.*;
...@@ -59,6 +68,7 @@ public class CipherController { ...@@ -59,6 +68,7 @@ public class CipherController {
private UploadService uploadService; private UploadService uploadService;
/** /**
* 用户在点击,查看`授权信息`按钮时,请求check接口,进行一次授权验证(每天第一次通过其他接口访问系统时,也会验证一次 ) * 用户在点击,查看`授权信息`按钮时,请求check接口,进行一次授权验证(每天第一次通过其他接口访问系统时,也会验证一次 )
* 如果通过则返回授权信息(开始+结束时间) * 如果通过则返回授权信息(开始+结束时间)
...@@ -131,4 +141,7 @@ public class CipherController { ...@@ -131,4 +141,7 @@ public class CipherController {
return jsonStr; return jsonStr;
} }
} }
package com.mortals.xhx.module.uploadfile.web; package com.mortals.xhx.module.uploadfile.web;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.module.menu.model.MenuEntity;
import com.mortals.xhx.module.menu.service.MenuService;
import com.mortals.xhx.module.param.service.ParamService; import com.mortals.xhx.module.param.service.ParamService;
import com.mortals.xhx.module.product.model.ProductAppsEntity;
import com.mortals.xhx.module.product.model.ProductDocumentEntity;
import com.mortals.xhx.module.product.service.ProductAppsService;
import com.mortals.xhx.module.product.service.ProductDocumentService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -18,6 +30,9 @@ import com.mortals.xhx.module.uploadfile.service.UploadfileService; ...@@ -18,6 +30,9 @@ import com.mortals.xhx.module.uploadfile.service.UploadfileService;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -26,11 +41,15 @@ import java.util.stream.Collectors; ...@@ -26,11 +41,15 @@ import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import java.util.Arrays; import java.util.Arrays;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*; import static com.mortals.framework.ap.SysConstains.*;
import static com.mortals.framework.web.BaseController.VALUE_RESULT_SUCCESS;
import static com.mortals.xhx.base.framework.exception.ExceptionHandle.*;
/** /**
* 上传文件业务 * 上传文件业务
...@@ -40,11 +59,22 @@ import static com.mortals.framework.ap.SysConstains.*; ...@@ -40,11 +59,22 @@ import static com.mortals.framework.ap.SysConstains.*;
*/ */
@RestController @RestController
@RequestMapping("uploadfile") @RequestMapping("uploadfile")
@Slf4j
public class UploadfileController extends BaseCRUDJsonBodyMappingController<UploadfileService, UploadfileEntity, Long> { public class UploadfileController extends BaseCRUDJsonBodyMappingController<UploadfileService, UploadfileEntity, Long> {
@Autowired @Autowired
private ParamService paramService; private ParamService paramService;
@Autowired
private UploadService uploadService;
@Autowired
private MenuService menuService;
@Autowired
private ProductDocumentService productDocumentService;
@Autowired
private ProductAppsService productAppsService;
public UploadfileController() { public UploadfileController() {
super.setFormClass(UploadfileForm.class); super.setFormClass(UploadfileForm.class);
super.setModuleDesc("上传文件业务"); super.setModuleDesc("上传文件业务");
...@@ -57,4 +87,95 @@ public class UploadfileController extends BaseCRUDJsonBodyMappingController<Uplo ...@@ -57,4 +87,95 @@ public class UploadfileController extends BaseCRUDJsonBodyMappingController<Uplo
} }
/**
* 获取所有相关资源文件并压缩打包成zip
*/
@GetMapping(value = "zip")
@UnAuth
public void zip() {
JSONObject jsonObject = new JSONObject();
try {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
ZipOutputStream zip = new ZipOutputStream(outputStream);
List<MenuEntity> menuEntities = menuService.find(new MenuEntity());
for (MenuEntity menuEntity : menuEntities) {
String imgPath = menuEntity.getImgPath();
String filePath = uploadService.getFilePath(imgPath);
File file = new File(filePath);
if (file.exists()) {
try {
//zip.putNextEntry(new ZipEntry(StrUtil.subAfter(filePath, "/", false)));
zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(filePath, "/")));
IOUtils.write(FileUtil.readBytes(file), zip);
zip.flush();
zip.closeEntry();
} catch (Exception e) {
log.error("异常", e);
}
}
}
List<ProductDocumentEntity> productDocumentEntities = productDocumentService.find(new ProductDocumentEntity());
for (ProductDocumentEntity productDocumentEntity : productDocumentEntities) {
String docFileUrl = productDocumentEntity.getDocFileUrl();
String filePath = uploadService.getFilePath(docFileUrl);
File file = new File(filePath);
if (file.exists()) {
try {
zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(filePath, "/")));
IOUtils.write(FileUtil.readBytes(file), zip);
zip.flush();
zip.closeEntry();
} catch (Exception e) {
log.error("异常", e.getMessage());
}
}
}
List<ProductAppsEntity> productAppsEntities = productAppsService.find(new ProductAppsEntity());
for (ProductAppsEntity productAppsEntity : productAppsEntities) {
String appFileUrl = productAppsEntity.getAppFileUrl();
String filePath = uploadService.getFilePath(appFileUrl);
File file = new File(filePath);
if (file.exists()) {
try {
zip.putNextEntry(new ZipEntry(StrUtil.removePrefix(filePath, "/")));
IOUtils.write(FileUtil.readBytes(file), zip);
zip.flush();
zip.closeEntry();
} catch (Exception e) {
log.error("异常", e.getMessage());
}
}
}
IOUtils.closeQuietly(zip);
byte[] bytes = outputStream.toByteArray();
genCode(response, bytes);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, "压缩文件成功!");
} catch (Exception e) {
log.error("获取异常", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
}
}
/**
* 生成zip文件
*/
private void genCode(HttpServletResponse response, byte[] data) throws IOException {
response.reset();
response.addHeader("Access-Control-Allow-Origin", "*");
response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
response.setHeader("Content-Disposition", "attachment; filename=\"skin.zip\"");
response.addHeader("Content-Length", "" + data.length);
response.setContentType("application/octet-stream; charset=UTF-8");
IOUtils.write(data, response.getOutputStream());
}
} }
\ No newline at end of file
...@@ -5,6 +5,7 @@ import com.mortals.framework.model.Context; ...@@ -5,6 +5,7 @@ import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result; import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICRUDCacheService; import com.mortals.framework.service.ICRUDCacheService;
import com.mortals.xhx.module.user.dao.UserDao;
import com.mortals.xhx.module.user.model.UserEntity; import com.mortals.xhx.module.user.model.UserEntity;
import com.mortals.xhx.module.user.model.UserEntityExt; import com.mortals.xhx.module.user.model.UserEntityExt;
...@@ -17,6 +18,9 @@ import com.mortals.xhx.module.user.model.UserEntityExt; ...@@ -17,6 +18,9 @@ import com.mortals.xhx.module.user.model.UserEntityExt;
* @date 2022-05-25 * @date 2022-05-25
*/ */
public interface UserService extends ICRUDCacheService<UserEntity,Long> { public interface UserService extends ICRUDCacheService<UserEntity,Long> {
UserDao getDao();
/** /**
* 用户登录 * 用户登录
* *
......
...@@ -11,6 +11,7 @@ import com.mortals.framework.service.ICacheService; ...@@ -11,6 +11,7 @@ import com.mortals.framework.service.ICacheService;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.common.utils.LoginAESUtil; import com.mortals.xhx.common.utils.LoginAESUtil;
import com.mortals.xhx.feign.area.IApiAreaFeign;
import com.mortals.xhx.module.param.service.ParamService; import com.mortals.xhx.module.param.service.ParamService;
import com.mortals.xhx.module.role.model.RoleEntity; import com.mortals.xhx.module.role.model.RoleEntity;
import com.mortals.xhx.module.role.model.RoleQuery; import com.mortals.xhx.module.role.model.RoleQuery;
...@@ -20,8 +21,10 @@ import com.mortals.xhx.module.role.service.RoleService; ...@@ -20,8 +21,10 @@ import com.mortals.xhx.module.role.service.RoleService;
import com.mortals.xhx.module.role.service.RoleUserService; import com.mortals.xhx.module.role.service.RoleUserService;
import com.mortals.xhx.module.user.model.UserEntity; import com.mortals.xhx.module.user.model.UserEntity;
import com.mortals.xhx.module.user.model.UserEntityExt; import com.mortals.xhx.module.user.model.UserEntityExt;
import com.mortals.xhx.module.user.model.UserQuery;
import com.mortals.xhx.module.user.service.UserService; import com.mortals.xhx.module.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -50,6 +53,9 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic ...@@ -50,6 +53,9 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
private RoleService roleService; private RoleService roleService;
@Autowired @Autowired
private ICacheService cacheService; private ICacheService cacheService;
@Autowired
@Lazy
private IApiAreaFeign apiAreaFeign;
private static final String AES_KEY = "0000000671595991"; private static final String AES_KEY = "0000000671595991";
private static final String AES_IV = "tdrdadq59tbss5n7"; private static final String AES_IV = "tdrdadq59tbss5n7";
...@@ -82,9 +88,9 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic ...@@ -82,9 +88,9 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
@Override @Override
protected void saveBefore(UserEntity entity, Map<String, Object> model, Context context) throws AppException { protected void saveBefore(UserEntity entity, Map<String, Object> model, Context context) throws AppException {
String loginName = LoginAESUtil.decrypt(entity.getLoginName(),AES_KEY,AES_IV,LoginAESUtil.AES_CBC); String loginName = LoginAESUtil.decrypt(entity.getLoginName(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setLoginName(loginName); entity.setLoginName(loginName);
if(StringUtils.isNotEmpty(entity.getLoginPwd())) { if (StringUtils.isNotEmpty(entity.getLoginPwd())) {
String loginPwd = LoginAESUtil.decrypt(entity.getLoginPwd(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC); String loginPwd = LoginAESUtil.decrypt(entity.getLoginPwd(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setLoginPwd(loginPwd); entity.setLoginPwd(loginPwd);
} }
...@@ -156,8 +162,8 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic ...@@ -156,8 +162,8 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
try { try {
String busiDesc = this.getModuleDesc() + "密码修改"; String busiDesc = this.getModuleDesc() + "密码修改";
String oldPwd = LoginAESUtil.decrypt(entity.getOldPwd(),AES_KEY,AES_IV,LoginAESUtil.AES_CBC); String oldPwd = LoginAESUtil.decrypt(entity.getOldPwd(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
String newPwd = LoginAESUtil.decrypt(entity.getNewPwd(),AES_KEY,AES_IV,LoginAESUtil.AES_CBC); String newPwd = LoginAESUtil.decrypt(entity.getNewPwd(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setOldPwd(oldPwd); entity.setOldPwd(oldPwd);
entity.setNewPwd(newPwd); entity.setNewPwd(newPwd);
service.updateUserPwd(super.getCurUser().getLoginName(), entity.getOldPwd(), entity.getNewPwd()); service.updateUserPwd(super.getCurUser().getLoginName(), entity.getOldPwd(), entity.getNewPwd());
...@@ -176,8 +182,8 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic ...@@ -176,8 +182,8 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
public String forgotPassword(@RequestBody UserEntity entity) { public String forgotPassword(@RequestBody UserEntity entity) {
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
try { try {
String oldPwd = LoginAESUtil.decrypt(entity.getOldPwd(),AES_KEY,AES_IV,LoginAESUtil.AES_CBC); String oldPwd = LoginAESUtil.decrypt(entity.getOldPwd(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
String newPwd = LoginAESUtil.decrypt(entity.getNewPwd(),AES_KEY,AES_IV,LoginAESUtil.AES_CBC); String newPwd = LoginAESUtil.decrypt(entity.getNewPwd(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setOldPwd(oldPwd); entity.setOldPwd(oldPwd);
entity.setNewPwd(newPwd); entity.setNewPwd(newPwd);
service.updateUserPwd(entity.getLoginName(), entity.getOldPwd(), entity.getNewPwd()); service.updateUserPwd(entity.getLoginName(), entity.getOldPwd(), entity.getNewPwd());
...@@ -262,7 +268,7 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic ...@@ -262,7 +268,7 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
Map<String, Object> model = new HashMap(); Map<String, Object> model = new HashMap();
Context context = this.getContext(); Context context = this.getContext();
String busiDesc = "查询" + this.getModuleDesc(); String busiDesc = "查询" + this.getModuleDesc();
int code=VALUE_RESULT_SUCCESS; int code = VALUE_RESULT_SUCCESS;
try { try {
PageInfo pageInfo = this.buildPageInfo(query); PageInfo pageInfo = this.buildPageInfo(query);
Result<UserEntity> result = this.getService().find(query, pageInfo, context); Result<UserEntity> result = this.getService().find(query, pageInfo, context);
...@@ -286,11 +292,11 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic ...@@ -286,11 +292,11 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
try { try {
String busiDesc = this.getModuleDesc() + "密码重置"; String busiDesc = this.getModuleDesc() + "密码重置";
String newPwd = LoginAESUtil.decrypt(entity.getNewPwd(),AES_KEY,AES_IV,LoginAESUtil.AES_CBC); String newPwd = LoginAESUtil.decrypt(entity.getNewPwd(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setNewPwd(newPwd); entity.setNewPwd(newPwd);
String loginName = LoginAESUtil.decrypt(entity.getLoginName(),AES_KEY,AES_IV,LoginAESUtil.AES_CBC); String loginName = LoginAESUtil.decrypt(entity.getLoginName(), AES_KEY, AES_IV, LoginAESUtil.AES_CBC);
entity.setLoginName(loginName); entity.setLoginName(loginName);
service.resetUserPwd(entity.getLoginName(), entity.getNewPwd(),this.getContext()); service.resetUserPwd(entity.getLoginName(), entity.getNewPwd(), this.getContext());
recordSysLog(request, busiDesc + "【成功】"); recordSysLog(request, busiDesc + "【成功】");
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_MSG, "密码修改成功!"); ret.put(KEY_RESULT_MSG, "密码修改成功!");
...@@ -327,14 +333,24 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic ...@@ -327,14 +333,24 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
/** /**
* 初始化用户数据 * 初始化用户数据
*
* @return * @return
*/ */
@PostMapping(value = "initData") @PostMapping(value = "initData")
@UnAuth @UnAuth
public Rest<String> initData(UserEntity user) { public Rest<String> initData(@RequestBody UserEntity user) {
try { try {
this.service.initUser(user); List<UserEntity> userEntities = this.service.find(new UserQuery());
for (UserEntity userEntity : userEntities) {
userEntity.setSiteIds(user.getSiteIds());
userEntity.setAreaNames(user.getAreaNames());
userEntity.setAreaCodes(user.getAreaCodes());
this.service.getDao().update(userEntity);
}
//通知基础服务更新
apiAreaFeign.refreshUser();
return Rest.ok("初始化用户数据成功!"); return Rest.ok("初始化用户数据成功!");
} catch (Exception e) { } catch (Exception e) {
log.error("初始化用户数据错误", e); log.error("初始化用户数据错误", e);
......
...@@ -8,8 +8,6 @@ ...@@ -8,8 +8,6 @@
<setting name="useColumnLabel" value="true" /> <setting name="useColumnLabel" value="true" />
<setting name="useGeneratedKeys" value="false" /> <setting name="useGeneratedKeys" value="false" />
<setting name="defaultExecutorType" value="REUSE" /> <setting name="defaultExecutorType" value="REUSE" />
<!-- 是否开始sql日志控制台打印 -->
<!-- <setting name="logImpl" value="STDOUT_LOGGING" />-->
</settings> </settings>
<plugins> <plugins>
<plugin interceptor="com.mortals.framework.thirty.mybatis.MortalsPagePlugin"> <plugin interceptor="com.mortals.framework.thirty.mybatis.MortalsPagePlugin">
......
#!/bin/sh
RETVAL=$?
SHELL_NAME="deploy"
BASEDIR=$(dirname $0)
BASEDIR=$( (
cd "$BASEDIR"
pwd
))
LOCK_FILE="/tmp/deploy.lock"
# 时间变量
CDATE=$(date "+%Y-%m-%d")
CTIME=$(date "+%H:%M:%S")
SHELL_LOG="${BASEDIR}/${SHELL_NAME}.log"
JAVA_HOME="/usr/local/java/jdk1.8"
SERVICE_PATH="/usr/lib/systemd/system"
PUBLISH_PATH="/home/publish"
PROJECT_NAME="@project.artifactId@"
PROJECT_EXECPATH="${PUBLISH_PATH}/${PROJECT_NAME}"
PROJECT_FILENAME="${PROJECT_NAME}.tar.gz"
PROJECT_SERVICE="${SERVICE_PATH}/${PROJECT_NAME}.service"
#写日志
writelog() {
LOGINFO=$1
echo "${CDATE} ${CTIME}: ${SHELL_NAME} : ${LOGINFO}" >>${SHELL_LOG}
echo ${LOGINFO}
}
#清理目标
clear_deploy() {
SERVICE=$1
EXECPATH=$2
#清理后台自启服务
rm -f ${SERVICE}
}
build_service() {
SERVICE=$1
EXECPATH=$2
echo "" >${SERVICE}
echo "[Unit]" >>${SERVICE}
echo "Description=${PROJECT_NAME}" >>${SERVICE}
echo "After=network.target" >>${SERVICE}
echo "" >>${SERVICE}
echo "[Service]" >>${SERVICE}
echo "Environment=\"JAVA_HOME=$JAVA_HOME\"" >>${SERVICE}
echo "Type=forking" >>${SERVICE}
echo "ExecStartPre=-/bin/sleep 5s" >>${SERVICE}
echo "ExecStart=${EXECPATH}/bin/start.sh" >>${SERVICE}
echo "ExecStop=${EXECPATH}/bin/shutdown.sh" >>${SERVICE}
echo "PrivateTmp=true" >>${SERVICE}
echo "" >>${SERVICE}
echo "[Install]" >>${SERVICE}
echo "WantedBy=multi-user.target" >>${SERVICE}
writelog "${PROJECT_NAME}服务创建完成!"
}
#启动服务与nginx
start_service() {
systemctl enable ${PROJECT_NAME}
systemctl daemon-reload
writelog "${PROJECT_NAME}服务启动..."
systemctl stop ${PROJECT_NAME} && systemctl start ${PROJECT_NAME}
project_status=$(systemctl status "${PROJECT_NAME}"|grep Active |awk '{print $2}')
jcpid=$(ps -ef | grep -v "grep" | grep "${PROJECT_NAME} " | awk '{print $2}')
writelog "${PROJECT_NAME}服务启动,PID is ${jcpid} ,status:${project_status}"
}
#部署后台服务
project_deploy() {
writelog "${PROJECT_NAME}_deploy"
systemctl stop ${PROJECT_NAME}
clear_deploy ${PROJECT_SERVICE} ${PROJECT_EXECPATH}
writelog "${PROJECT_NAME}_clear_finish"
tar -zvxf ./${PROJECT_FILENAME} -C ${PUBLISH_PATH}
build_service ${PROJECT_SERVICE} ${PROJECT_EXECPATH}
start_service
writelog "${PROJECT_NAME}_deploy_finish"
}
#主函数
main() {
echo "后台服务部署"
project_deploy
exit ${RETVAL}
}
main $1
...@@ -28,6 +28,7 @@ set JVM_CONFIG=%JVM_CONFIG% -Dapp.port=%PORT% ...@@ -28,6 +28,7 @@ set JVM_CONFIG=%JVM_CONFIG% -Dapp.port=%PORT%
set JVM_CONFIG=%JVM_CONFIG% -Djava.io.tmpdir=%TEMP_PATH% set JVM_CONFIG=%JVM_CONFIG% -Djava.io.tmpdir=%TEMP_PATH%
set JVM_CONFIG=%JVM_CONFIG% -Dbasedir=%BASEDIR% set JVM_CONFIG=%JVM_CONFIG% -Dbasedir=%BASEDIR%
set JVM_CONFIG=%JVM_CONFIG% -Dloader.path=file://%BASEDIR%/conf,file://%BASEDIR%/lib set JVM_CONFIG=%JVM_CONFIG% -Dloader.path=file://%BASEDIR%/conf,file://%BASEDIR%/lib
set JVM_CONFIG=%JVM_CONFIG% -Dfile.encoding=utf-8
set DEBUG_OPTS= set DEBUG_OPTS=
......
#!/bin/sh #!/bin/sh
PORT="@profiles.server.port@" PORT="@profiles.server.port@"
DEBUG=@profiles.server.debug@
BASEDIR=`dirname $0`/.. BASEDIR=`dirname $0`/..
BASEDIR=`(cd "$BASEDIR"; pwd)` BASEDIR=`(cd "$BASEDIR"; pwd)`
PROJECT_NAME="@project.artifactId@"; PROJECT_NAME="@project.artifactId@";
MAIN_CLASS="$PROJECT_NAME-@project.version@.jar"; MAIN_CLASS="$PROJECT_NAME-@project.version@.jar";
LOG_PATH="@profiles.log.path@/$PROJECT_NAME" LOG_PATH="@profiles.log.path@/$PROJECT_NAME"
GC_PATH=$LOG_PATH/PROJECT_NAME"-gc.log" GC_PATH=$LOG_PATH/$PROJECT_NAME"-gc.log"
HS_ERR_PATH=$LOG_PATH/PROJECT_NAME"-hs_err.log" HS_ERR_PATH=$LOG_PATH/$PROJECT_NAME"-hs_err.log"
HEAP_DUMP_PATH=$LOG_PATH/PROJECT_NAME"-heap_dump.hprof" HEAP_DUMP_PATH=$LOG_PATH/$PROJECT_NAME"-heap_dump.hprof"
TEMP_PATH=$LOG_PATH/temp/ TEMP_PATH=$LOG_PATH/temp/
SUCCESS=0 SUCCESS=0
FAIL=9 FAIL=9
...@@ -45,7 +46,7 @@ fi ...@@ -45,7 +46,7 @@ fi
if [ -e "$BASEDIR" ] if [ -e "$BASEDIR" ]
then then
JAVA_OPTS="-Xms512M -Xmx1024M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$GC_PATH -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=$HS_ERR_PATH -XX:HeapDumpPath=$HEAP_DUMP_PATH" JAVA_OPTS="-Xms1024M -Xmx1024M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$GC_PATH -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=$HS_ERR_PATH -XX:HeapDumpPath=$HEAP_DUMP_PATH"
fi fi
CLASSPATH=$CLASSPATH_PREFIX: CLASSPATH=$CLASSPATH_PREFIX:
...@@ -56,12 +57,12 @@ cd "$BASEDIR/boot"; ...@@ -56,12 +57,12 @@ cd "$BASEDIR/boot";
echo "starting application $PROJECT_NAME......" echo "starting application $PROJECT_NAME......"
exec "$JAVACMD" $JAVA_OPTS \ exec "$JAVACMD" $JAVA_OPTS \
$EXTRA_JVM_ARGUMENTS \ $EXTRA_JVM_ARGUMENTS \
$DEBUG \
-Dapp.name="$PROJECT_NAME" \ -Dapp.name="$PROJECT_NAME" \
-Dapp.port="$PORT" \ -Dapp.port="$PORT" \
-Dbasedir="$BASEDIR" \ -Dbasedir="$BASEDIR" \
-Dfile.encoding=utf-8 \ -Dfile.encoding=utf-8 \
-Djava.io.tmpdir=$TEMP_PATH \ -Djava.io.tmpdir=$TEMP_PATH \
-Dloader.path="file://$BASEDIR/conf,file://$BASEDIR/lib" \
-jar $MAIN_CLASS \ -jar $MAIN_CLASS \
> /dev/null & > /dev/null &
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment