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

Merge remote-tracking branch 'origin/master'

parents b9b4a0d7 f5a933de
-- ---------------------------- -- ----------------------------
2023-9-11 -- 2023-9-11
-- ---------------------------- -- ----------------------------
ALTER TABLE mortals_xhx_user ADD COLUMN `staffId` varchar(64) COMMENT '员工Id,关联用户员工表'; ALTER TABLE mortals_xhx_user ADD COLUMN `staffId` varchar(64) COMMENT '员工Id,关联用户员工表';
ALTER TABLE mortals_xhx_user ADD COLUMN `openId` varchar(64) COMMENT '微信openId'; ALTER TABLE mortals_xhx_user ADD COLUMN `openId` varchar(64) COMMENT '微信openId';
...@@ -108,3 +108,10 @@ CREATE TABLE mortals_xhx_news_up( ...@@ -108,3 +108,10 @@ CREATE TABLE mortals_xhx_news_up(
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
,KEY `upName` (`upName`) USING BTREE ,KEY `upName` (`upName`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='新闻点赞记录信息'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='新闻点赞记录信息';
-- ----------------------------
-- 2024-12-5
-- ----------------------------
ALTER TABLE mortals_xhx_company ADD COLUMN `background` varchar(256) default '' COMMENT '背景图片';
#开发环境
NODE_ENV = "development"
VUE_APP_API_BASE_URL= http://192.168.0.98:11086
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
height: 100% !important; height: 100% !important;
} }
.layout-menu-wrapper { .layout-menu-wrapper {
padding: 0 24px;
height: 64px !important; height: 64px !important;
line-height: 64px !important; line-height: 64px !important;
background: linear-gradient(90deg, #1845c6, #2999ff) !important; background: linear-gradient(90deg, #1845c6, #2999ff) !important;
...@@ -9,6 +10,13 @@ ...@@ -9,6 +10,13 @@
.layout-menu-wrapper .layout-logo { .layout-menu-wrapper .layout-logo {
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
width: 200px;
}
.layout-menu-wrapper .menu-list {
margin-left: 50px;
}
.layout-menu-wrapper .menu-list li {
padding: 0 20px;
} }
.layout-menu-wrapper .menu-list li a { .layout-menu-wrapper .menu-list li a {
display: block; display: block;
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
} }
.layout-menu-wrapper { .layout-menu-wrapper {
padding: 0 24px;
height: 64px !important; height: 64px !important;
line-height: 64px !important; line-height: 64px !important;
background: linear-gradient(90deg, #1845c6, #2999ff) !important; background: linear-gradient(90deg, #1845c6, #2999ff) !important;
...@@ -10,16 +11,19 @@ ...@@ -10,16 +11,19 @@
.layout-logo { .layout-logo {
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
width: 200px;
} }
.menu-list { .menu-list {
margin-left: 50px;
li { li {
padding: 0 20px;
a { a {
display: block; display: block;
padding: 0 12px; padding: 0 12px;
height: 100%; height: 100%;
font-size: 14px !important; font-size: 14px !important;
color: rgba(254, 254, 254, .65) !important; color: rgba(254, 254, 254, 0.65) !important;
text-align: center !important; text-align: center !important;
i { i {
...@@ -33,7 +37,6 @@ ...@@ -33,7 +37,6 @@
&:hover { &:hover {
color: #fff !important; color: #fff !important;
} }
&.router-link-active, &.router-link-active,
...@@ -47,10 +50,7 @@ ...@@ -47,10 +50,7 @@
} }
} }
} }
} }
} }
.layout-header .layout-submenu-wrapper { .layout-header .layout-submenu-wrapper {
......
export const timestampToTime = (timestamp, transLength) => {
// 时间戳为10位需*1000,时间戳为13位不需乘1000
let date = null;
if (timestamp) {
if (timestamp.length < 13) {
date = new Date(timestamp * 1000);
} else {
date = new Date(timestamp);
}
let Y = date.getFullYear() + "-";
let M =
date.getMonth() + 1 < 10
? "0" + (date.getMonth() + 1)
: date.getMonth() + 1;
let D =
date.getDate() < 10 ? "-" + "0" + date.getDate() : "-" + date.getDate();
let h =
" " +
(date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) +
":";
let m =
(date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) +
":";
let s =
date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
switch (transLength) {
case 2:
return Y + M;
case 3:
return Y + M + D;
case 6:
return Y + M + D + h + m + s;
}
} else {
return "";
}
};
// 小时:分钟 ==》 转分钟
export const transFormMinut = (String) => {
if (typeof String === "number") {
return;
}
if (!String) {
return 0;
}
let arr = String.split(":");
let hour =
arr[0].indexOf("0") === 0 ? arr[0].substring(1, arr[0].length) : arr[0];
let minu =
arr[1].indexOf("0") === 0 ? arr[1].substring(1, arr[1].length) : arr[1];
return hour * 60 + minu * 1;
// return JSON.stringify(hour * 60 + minu * 1);
};
// // 分钟 ==》 小时
export const transFormTime = (num) => {
if (typeof num != "string" && num !== 0) {
return Math.floor(num / 60).toString() + ":" + (num % 60).toString();
} else {
return "0:00";
}
};
//当前月第一天
export const getFirstDay = () => {
let y = new Date().getFullYear(); //获取年份
let m = new Date().getMonth() + 1; //获取月份
let d = "01";
m = m < 10 ? "0" + m : m; //月份补 0
return [y, m, d].join("-");
};
//当前月最后一天
export const getLastDay = () => {
let y = new Date().getFullYear(); //获取年份
let m = new Date().getMonth() + 1; //获取月份
let d = new Date(y, m, 0).getDate(); //获取当月最后一日
m = m < 10 ? "0" + m : m; //月份补 0
d = d < 10 ? "0" + d : d; //日数补 0
return [y, m, d].join("-");
};
//获取两日期之间日期列表函数
export const getdiffdate = (stime, etime) => {
//初始化日期列表,数组
let diffdate = new Array();
let i = 0;
//开始日期小于等于结束日期,并循环
while (stime <= etime) {
diffdate[i] = stime;
//获取开始日期时间戳
let stime_ts = new Date(stime).getTime();
//增加一天时间戳后的日期
let next_date = stime_ts + 24 * 60 * 60 * 1000;
//拼接年月日,这里的月份会返回(0-11),所以要+1
let next_dates_y = new Date(next_date).getFullYear() + "-";
let next_dates_m =
new Date(next_date).getMonth() + 1 < 10
? "0" + (new Date(next_date).getMonth() + 1) + "-"
: new Date(next_date).getMonth() + 1 + "-";
let next_dates_d =
new Date(next_date).getDate() < 10
? "0" + new Date(next_date).getDate()
: new Date(next_date).getDate();
stime = next_dates_y + next_dates_m + next_dates_d;
//增加数组key
i++;
}
return diffdate;
};
// 获取某个日期是周几
export const getMyDay = (date) => {
let week;
if (date.getDay() == 0) week = "周日";
if (date.getDay() == 1) week = "周一";
if (date.getDay() == 2) week = "周二";
if (date.getDay() == 3) week = "周三";
if (date.getDay() == 4) week = "周四";
if (date.getDay() == 5) week = "周五";
if (date.getDay() == 6) week = "周六";
return week;
};
// 求两个日期的 分钟差
export const getMinu = (s1, s2) => {
var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
s1 = new Date((reDate.test(s1) ? s1 : "2023-01-01 " + s1).replace(/-/g, "/"));
s2 = new Date((reDate.test(s2) ? s2 : "2023-01-01 " + s2).replace(/-/g, "/"));
var ms = s2.getTime() - s1.getTime();
if (ms < 0) return 0;
return Math.floor(ms / 1000 / 60); //分钟
};
// 求两个日期的 秒差
export const getSec = (s1, s2) => {
var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
s1 = new Date((reDate.test(s1) ? s1 : "2023-01-01 " + s1).replace(/-/g, "/"));
s2 = new Date((reDate.test(s2) ? s2 : "2023-01-01 " + s2).replace(/-/g, "/"));
var ms = s2.getTime() - s1.getTime();
if (ms < 0) return 0;
return Math.floor(ms / 1000); //秒
};
// 表单节点封装,支持 input textarea select radio checkbox 及slot方式 // 表单节点封装,支持 input textarea select radio checkbox 及slot方式
<template> <template>
<el-col :span='span'> <el-col :span="span">
<el-form-item :label="label" :prop="prop" class="my-form-field">
<el-form-item :label="label" :prop="prop" class='my-form-field'>
<slot> <slot>
<el-input :disabled='disabled' :placeholder='placeholder' v-model="field" @change="emit" @input="emit" v-if='type === "text"' :class="inputClass" :clearable='clearable'></el-input> <el-input
<el-input :disabled='disabled' :placeholder='placeholder' v-model="field" @change="emit" @input="emit" type='password' v-if='type === "password"'></el-input> :disabled="disabled"
:placeholder="placeholder"
<el-input-number :disabled='disabled' v-model="field" size="small" :placeholder='placeholder' @change="emit" @input="emit" v-if='type === "num"'></el-input-number> v-model="field"
@change="emit"
@input="emit"
v-if="type === 'text'"
:class="inputClass"
:clearable="clearable"
></el-input>
<el-input
:disabled="disabled"
:placeholder="placeholder"
v-model="field"
@change="emit"
@input="emit"
type="password"
v-if="type === 'password'"
></el-input>
<el-input-number
:disabled="disabled"
v-model="field"
size="small"
:placeholder="placeholder"
@change="emit"
@input="emit"
v-if="type === 'num'"
></el-input-number>
<el-input :disabled='disabled' :placeholder='placeholder' v-model="field" @change="emit" :rows='rows' @input="emit" v-if='type === "textarea"' type='textarea' :autosize="textareaSize" :class="inputClass"></el-input> <el-input
:disabled="disabled"
:placeholder="placeholder"
v-model="field"
@change="emit"
:rows="rows"
@input="emit"
v-if="type === 'textarea'"
type="textarea"
:autosize="textareaSize"
:class="inputClass"
></el-input>
<el-select :disabled='disabled' v-model="field" @change="emit" :multiple='multiple' :filterable='filterable' :clearable='clearable' v-if='type === "select"'> <el-select
:disabled="disabled"
v-model="field"
@change="emit"
:multiple="multiple"
:filterable="filterable"
:clearable="clearable"
v-if="type === 'select'"
>
<el-option <el-option
v-for="($label, $value) in enumData" v-for="($label, $value) in enumData"
:key="$value" :key="$value"
...@@ -21,25 +63,54 @@ ...@@ -21,25 +63,54 @@
></el-option> ></el-option>
</el-select> </el-select>
<el-radio-group :disabled='disabled' v-model="field" @change="emit" v-if='type === "radio"'> <el-radio-group
:disabled="disabled"
v-model="field"
@change="emit"
v-if="type === 'radio'"
>
<el-radio <el-radio
v-for='($label, $value) in enumData' v-for="($label, $value) in enumData"
:key='$value' :key="$value"
:label="$value" :label="$value"
>{{$label}}</el-radio> >{{ $label }}</el-radio
>
</el-radio-group> </el-radio-group>
<el-checkbox-group :disabled='disabled' v-model="field" @change="emit" v-if='type === "checkbox"'> <el-checkbox-group
:disabled="disabled"
v-model="field"
@change="emit"
v-if="type === 'checkbox'"
>
<el-checkbox <el-checkbox
v-for='($label, $value) in enumData' v-for="($label, $value) in enumData"
:key='$value' :key="$value"
:label="$value" :label="$value"
>{{$label}}</el-checkbox> >{{ $label }}</el-checkbox
>
</el-checkbox-group> </el-checkbox-group>
<el-date-picker :disabled='disabled' type="date" value-format="yyyy-MM-dd HH:mm:ss" v-model="field" @change="emit" @input="emit" placeholder="选择日期" v-if='type === "date"'></el-date-picker> <el-date-picker
<el-date-picker :disabled='disabled' type="datetime" value-format="yyyy-MM-dd HH:mm:ss" v-model="field" @change="emit" @input="emit" placeholder="选择日期" v-if='type === "datetime"'></el-date-picker> :disabled="disabled"
type="date"
value-format="yyyy-MM-dd HH:mm:ss"
v-model="field"
@change="emit"
@input="emit"
placeholder="选择日期"
v-if="type === 'date'"
></el-date-picker>
<el-date-picker
:disabled="disabled"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
v-model="field"
@change="emit"
@input="emit"
placeholder="选择日期"
v-if="type === 'datetime'"
></el-date-picker>
</slot> </slot>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -60,17 +131,17 @@ export default { ...@@ -60,17 +131,17 @@ export default {
// 字段类型: text,password,textarea,select,radio,checkbox,date,datetime // 字段类型: text,password,textarea,select,radio,checkbox,date,datetime
type: { type: {
type: String, type: String,
default: 'text', default: "text",
}, },
// 字段name // 字段name
prop: { prop: {
type: String, type: String,
default: '', default: "",
}, },
// 字段中文标题 // 字段中文标题
label: { label: {
type: String, type: String,
default: '', default: "",
}, },
// 是否禁用 // 是否禁用
disabled: { disabled: {
...@@ -80,18 +151,18 @@ export default { ...@@ -80,18 +151,18 @@ export default {
// 是否提示 // 是否提示
placeholder: { placeholder: {
type: String, type: String,
default: '', default: "",
}, },
// 字段所需的枚举类型 // 字段所需的枚举类型
enumData: { enumData: {
type: Object, type: Object,
default: ()=>{}, default: () => {},
}, },
// textarea专用-自适应内容高度 // textarea专用-自适应内容高度
textareaSize: { textareaSize: {
type: Object, type: Object,
default: ()=>{}, default: () => {},
}, },
// select专用-是否可搜索 // select专用-是否可搜索
filterable: { filterable: {
...@@ -111,38 +182,39 @@ export default { ...@@ -111,38 +182,39 @@ export default {
// 字段所需的枚举类型 // 字段所需的枚举类型
options: { options: {
type: Array, type: Array,
default: ()=>[], default: () => [],
}, },
children: { children: {
type: Array, type: Array,
default: ()=>[], default: () => [],
}, },
inputClass: { inputClass: {
type: String, type: String,
default: '', default: "",
} },
}, },
methods: { methods: {
emit() { emit() {
this.$emit('input', this.newVal) this.$emit("input", this.newVal);
this.$emit('change', this.newVal) this.$emit("change", this.newVal);
} console.log(this.newVal);
},
}, },
computed: { computed: {
field: { field: {
get() { get() {
return this.value return this.value;
}, },
set(val) { set(val) {
this.newVal = val; this.newVal = val;
} },
} },
}, },
data() { data() {
return { return {
newVal: this.value, newVal: this.value,
} };
} },
} };
</script> </script>
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
<router-link to="/"> <router-link to="/">
<img <img
:src="sysLogo ? sysLogo : require('../assets/images/logo.png')" :src="sysLogo ? sysLogo : require('../assets/images/logo.png')"
style="margin-bottom:5px" style="margin-bottom: 5px"
height="40" height="40"
alt="" alt=""
/> />
<b style="color:white;font-size:18px;" <b style="color: white; font-size: 18px"
>&nbsp;&nbsp;&nbsp; >&nbsp;&nbsp;&nbsp;
{{ sysName ? sysName : "企业服务平台" }} {{ sysName ? sysName : "企业服务平台" }}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
</span> --> </span> -->
<el-dropdown @command="handleCommand"> <el-dropdown @command="handleCommand">
<span class="el-dropdown-link" style="color:white"> <span class="el-dropdown-link" style="color: white">
{{ userData.currUserName }} {{ userData.currUserName }}
<i class="el-icon-arrow-down el-icon--right"></i> <i class="el-icon-arrow-down el-icon--right"></i>
</span> </span>
...@@ -249,9 +249,7 @@ export default { ...@@ -249,9 +249,7 @@ export default {
} }
} }
} }
.layout-profile {
padding-right: 30px;
}
} }
.layout-submenu-wrapper { .layout-submenu-wrapper {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<template> <template>
<div class="component-upload-image"> <div class="component-upload-image">
<el-upload <el-upload
:action="uploadImgUrl+'?prePath=' +prePath" :action="uploadImgUrl + '?prePath=' + prePath"
list-type="picture-card" list-type="picture-card"
:on-success="handleUploadSuccess" :on-success="handleUploadSuccess"
:before-upload="handleBeforeUpload" :before-upload="handleBeforeUpload"
...@@ -11,14 +11,22 @@ ...@@ -11,14 +11,22 @@
:show-file-list="false" :show-file-list="false"
:headers="headers" :headers="headers"
style="display: inline-block; vertical-align: top" style="display: inline-block; vertical-align: top"
v-if="!isList"
>
<el-image
v-if="!value"
:src="value.indexOf('http') == -1 ? baseUrl + value : value"
> >
<el-image v-if="!value" :src="value">
<div slot="error" class="image-slot"> <div slot="error" class="image-slot">
<i class="el-icon-plus" /> <i class="el-icon-plus" />
</div> </div>
</el-image> </el-image>
<div v-else class="image"> <div v-else class="image">
<el-image :src="value" :style="`width:150px;height:150px;`" fit="fill"/> <el-image
:src="value.indexOf('http') == -1 ? baseUrl + value : value"
:style="`width:150px;height:150px;`"
fit="fill"
/>
<div class="mask"> <div class="mask">
<div class="actions"> <div class="actions">
<span title="预览" @click.stop="dialogVisible = true"> <span title="预览" @click.stop="dialogVisible = true">
...@@ -31,8 +39,36 @@ ...@@ -31,8 +39,36 @@
</div> </div>
</div> </div>
</el-upload> </el-upload>
<el-dialog :visible.sync="dialogVisible" title="预览" width="800" append-to-body> <el-upload
<img :src="value" style="display: block; max-width: 100%; margin: 0 auto;"> :action="uploadImgUrl + '?prePath=' + prePath"
list-type="picture-card"
:on-remove="handleRemove"
:on-success="handleUploadSuccess"
:before-upload="handleBeforeUpload"
:on-preview="handlePictureCardPreview"
:file-list="imgList"
accept=".jpeg,.png,.jpg,.bmp,.gif"
:headers="headers"
v-else
>
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog
:visible.sync="dialogVisible"
title="预览"
width="800"
append-to-body
>
<img
:src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto"
v-if="isList"
/>
<img
:src="value"
style="display: block; max-width: 100%; margin: 0 auto"
v-else
/>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -41,8 +77,11 @@ ...@@ -41,8 +77,11 @@
export default { export default {
data() { data() {
return { return {
baseUrl: process.env.VUE_APP_API_BASE_URL + "/",
dialogVisible: false, dialogVisible: false,
uploadImgUrl: "/enterprise/file/commonupload", // 上传的图片服务器地址 uploadImgUrl: "/enterprise/file/commonupload", // 上传的图片服务器地址
imgList: [],
dialogImageUrl: "",
}; };
}, },
props: { props: {
...@@ -53,16 +92,52 @@ export default { ...@@ -53,16 +92,52 @@ export default {
//保存服务器路径前缀地址 //保存服务器路径前缀地址
prePath: { prePath: {
type: String, type: String,
default: '', default: "",
},
isList: {
type: Boolean,
default: false,
},
},
mounted() {
// 判断是否为多图上传
if (this.isList) {
if (this.value && this.value != "") {
this.imgList = [];
let arr = [];
arr = this.value?.split(",");
arr.forEach((v) => {
let obj = {};
obj.name = "轮播图";
obj.uid = parseInt(Math.random(0, 100));
v.indexOf("http") == -1
? (obj.url = this.baseUrl + v)
: (obj.url = v);
this.imgList.push(obj);
});
}
} }
}, },
methods: { methods: {
handleRemove(file, fileList) {
console.log(fileList);
this.imgList = fileList;
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
removeImage() { removeImage() {
this.$emit("input", ""); this.$emit("input", "");
}, },
handleUploadSuccess(res) { handleUploadSuccess(res, file, fileList) {
if (this.isList) {
this.loading.close();
this.imgList = fileList;
} else {
this.$emit("input", res.url); this.$emit("input", res.url);
this.loading.close(); this.loading.close();
}
}, },
handleBeforeUpload() { handleBeforeUpload() {
this.loading = this.$loading({ this.loading = this.$loading({
......
...@@ -5,50 +5,115 @@ ...@@ -5,50 +5,115 @@
:visible.sync="open" :visible.sync="open"
:direction="direction" :direction="direction"
:destroy-on-close="true" :destroy-on-close="true"
size="100%"> size="100%"
>
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<div class="form"> <div class="form">
<div class="formleft"> <div class="formleft">
<Field label="标题" :span="24" prop="title" v-model="form.title" placeholder="请输入标题"/> <Field
<Field :span="24" label="内容"><editor v-model="form.content" :min-height="256"/></Field> label="标题"
:span="24"
prop="title"
v-model="form.title"
placeholder="请输入标题"
/>
<Field :span="24" label="内容"
><editor v-model="form.content" :min-height="256"
/></Field>
</div> </div>
<div class="formright"> <div class="formright">
<el-row> <el-row>
<Field label="类型" :span="20" prop="categoryId" v-model="form.categoryId" type="radio" :enum-data="dict.categoryId" placeholder="请输入分类id"/> <Field
<Field :span="20" label="封面"><imageUpload v-model="form.titleLogoPath" prePath="/file/preview"/></Field> label="类型"
:span="20"
prop="categoryId"
v-model="form.categoryId"
type="radio"
:enum-data="dict.categoryId"
placeholder="请输入分类id"
/>
<Field :span="20" label="封面">
<imageUpload
v-model="form.titleLogoPath"
prePath="/file/preview"
:isList="true"
ref="imgList"
/>
</Field>
<Field :span="20" label="责任编辑" prop="editor" v-model="form.editor" placeholder="请输入责任编辑"/> <Field
:span="20"
label="责任编辑"
prop="editor"
v-model="form.editor"
placeholder="请输入责任编辑"
/>
<Field :span="20" label="发布部门" prop="deptId" v-model="form.deptId" type="select" :enum-data="dict.deptId" placeholder="请输入发布部门"/> <Field
:span="20"
label="发布部门"
prop="deptId"
v-model="form.deptId"
type="select"
:enum-data="dict.deptId"
placeholder="请输入发布部门"
/>
<Field :span="20" label="文章来源" prop="source" v-model="form.source" placeholder="请输入文章来源"/> <Field
:span="20"
label="文章来源"
prop="source"
v-model="form.source"
placeholder="请输入文章来源"
/>
<Field label="发布时间" prop="publishTime" v-model="form.publishTime" type="date" /> <Field
label="发布时间"
<Field :span="20" label="声明" prop="statement" v-model="form.statement" type="textarea" placeholder="请输入声明"/> prop="publishTime"
v-model="form.publishTime"
type="date"
/>
<Field
:span="20"
label="声明"
prop="statement"
v-model="form.statement"
type="textarea"
placeholder="请输入声明"
/>
</el-row> </el-row>
</div> </div>
</div> </div>
<el-form-item class="footerbtns"> <el-form-item class="footerbtns">
<el-button type="primary" @click='submitForm' icon='el-icon-circle-check-outline'>发布</el-button> <el-button
<el-button @click='()=>{open = false}' icon='el-icon-circle-close-outline'>取消</el-button> type="primary"
@click="submitForm"
icon="el-icon-circle-check-outline"
>发布</el-button
>
<el-button
@click="
() => {
open = false;
}
"
icon="el-icon-circle-close-outline"
>取消</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-drawer> </el-drawer>
</template> </template>
<script> <script>
import form from "@/assets/mixins/formdialog"; import form from "@/assets/mixins/formdialog";
export default { export default {
name: "NewsDetail", name: "NewsDetail",
mixins: [form], mixins: [form],
components: { components: {},
},
created() { created() {
this.changePath("news") this.changePath("news");
}, },
data() { data() {
return { return {
...@@ -58,59 +123,51 @@ ...@@ -58,59 +123,51 @@
title: "新闻", title: "新闻",
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
direction:"rtl", direction: "rtl",
toString:[ toString: ["top", "viewNums", "categoryId"],
"top", toDate: ["publishTime"],
"viewNums",
"categoryId"
],
toDate:[
"publishTime",
],
// 表单校验 // 表单校验
rules: { rules: {
categoryId: [ categoryId: [
{required: true,message: "请选择频道类型", trigger: "blur" }, { required: true, message: "请选择频道类型", trigger: "blur" },
], ],
title: [ title: [
{required: true,message: "请输入标题", trigger: "blur" }, { required: true, message: "请输入标题", trigger: "blur" },
{max: 512,message: "最多只能录入512个字符",trigger: "blur",}, { max: 512, message: "最多只能录入512个字符", trigger: "blur" },
], ],
titleLogoPath: [ titleLogoPath: [
{required: true,message: "请输入标题logo", trigger: "blur" }, { required: true, message: "请输入标题logo", trigger: "blur" },
], ],
publishTime: [ publishTime: [{ required: true, message: "请选择发布时间" }],
{required: true,message: "请选择发布时间" }, },
]
}
}; };
}, },
methods: { methods: {
/** 编辑 */ /** 编辑 */
edit(row) { edit(row) {
this.reset() this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
this.urls.currUrl ="news/edit"; this.urls.currUrl = "news/edit";
this.getData(); this.getData();
this.pageInfo.type="edit" this.pageInfo.type = "edit";
this.title = "修改新闻"; this.title = "修改新闻";
}, },
/** 新增 */ /** 新增 */
add(row) { add(row) {
this.reset() this.reset();
this.urls.currUrl = "news/add"; this.urls.currUrl = "news/add";
this.getData(); this.getData();
this.pageInfo.type="add" this.pageInfo.type = "add";
this.title = "新增新闻"; this.title = "新增新闻";
}, },
/** 查看*/ /** 查看*/
view(row) { view(row) {
this.reset() this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
this.urls.currUrl ="news/view"; this.urls.currUrl = "news/view";
this.getData(); this.getData();
this.pageInfo.type="view" this.pageInfo.type = "view";
this.title = "新闻详细"; this.title = "新闻详细";
}, },
/**取消按钮 */ /**取消按钮 */
...@@ -121,7 +178,16 @@ ...@@ -121,7 +178,16 @@
afterRender(data) { afterRender(data) {
this.open = true; this.open = true;
}, },
// 提交前数据处理
beforeSubmit(data) {
console.log(data, "123");
let arr = [];
arr = this.$refs.imgList.imgList.map((v) => {
return v.response ? v.response.url : v.url.substr(v.url.indexOf("f"));
});
data.titleLogoPath = arr.join(",");
return data;
},
afterSubmit(data) { afterSubmit(data) {
this.open = false; this.open = false;
this.$emit("ok"); this.$emit("ok");
...@@ -130,14 +196,14 @@ ...@@ -130,14 +196,14 @@
// 表单重置 // 表单重置
reset() { reset() {
this.form = { this.form = {
categoryId : null, categoryId: null,
categoryName : "", categoryName: "",
title : "", title: "",
titleLogoPath : "", titleLogoPath: "",
content : "", content: "",
top : 0, top: 0,
viewNums : 0, viewNums: 0,
publishTime : null, publishTime: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -147,10 +213,10 @@ ...@@ -147,10 +213,10 @@
} }
}, },
}, },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.footerbtns{ .footerbtns {
margin-top: 20px; margin-top: 20px;
padding-top: 20px; padding-top: 20px;
border-top: 1px solid gainsboro; border-top: 1px solid gainsboro;
...@@ -158,16 +224,16 @@ ...@@ -158,16 +224,16 @@
justify-content: center; justify-content: center;
align-content: center; align-content: center;
} }
.form{ .form {
display: flex; display: flex;
width: 100%; width: 100%;
.formleft{ .formleft {
flex:1; flex: 1;
width: 60%; width: 60%;
height: calc(100vh - 200px); height: calc(100vh - 200px);
overflow: auto; overflow: auto;
} }
.formright{ .formright {
width: 40%; width: 40%;
flex-shrink: 0; flex-shrink: 0;
flex-grow: 0; flex-grow: 0;
......
<template> <template>
<div class="page"> <div class="page">
<LayoutTable :data="tableData" :config="tableConfig" notDel> <LayoutTable :data="tableData" :config="tableConfig" notDel> </LayoutTable>
</LayoutTable>
<drawer-show ref="drawerform" @ok="getData" /> <drawer-show ref="drawerform" @ok="getData" />
<drawer-view ref="drawerview" @handletop="handleTop" @del="toDel"/> <share-drawershow
ref="shareDrawershow"
:drawerTableData="drawerTableData"
/>
<drawer-view ref="drawerview" @handletop="handleTop" @del="toDel" />
</div> </div>
</template> </template>
<script> <script>
/** 表单弹出框模式需引入 */ /** 表单弹出框模式需引入 */
import drawerShow from "./drawershow"; import drawerShow from "./drawershow";
import drawerView from "./drawerview"; import drawerView from "./drawerview";
import table from "@/assets/mixins/table"; import table from "@/assets/mixins/table";
export default { import ShareDrawershow from "./shareDrawershow.vue";
export default {
name: "NewsList", name: "NewsList",
components: { components: {
drawerShow, drawerShow,
drawerView drawerView,
}, ShareDrawershow,
mixins: [table],
created() {
}, },
mixins: [table],
created() {},
methods: { methods: {
/** 重写新增方法 */ /** 重写新增方法 */
toAdd(row) { toAdd(row) {
...@@ -33,82 +36,90 @@ ...@@ -33,82 +36,90 @@
this.$refs.drawerform.edit(row); this.$refs.drawerform.edit(row);
}, },
/** 重写查看方法 */ /** 重写查看方法 */
toView(row,isopen) { toView(row, isopen) {
// this.$refs.drawerform.view(row); // this.$refs.drawerform.view(row);
// 这里查看不再和编辑共用界面,多写一个抽屉,但调用view方法接口 // 这里查看不再和编辑共用界面,多写一个抽屉,但调用view方法接口
// this.$refs.drawerform.reset() // this.$refs.drawerform.reset()
this.$refs.drawerform.query = { id: row.id }; this.$refs.drawerform.query = { id: row.id };
this.$refs.drawerform.urls.currUrl ="news/view"; this.$refs.drawerform.urls.currUrl = "news/view";
this.$refs.drawerform.$get('news/view', this.$refs.drawerform.query) this.$refs.drawerform
.$get("news/view", this.$refs.drawerform.query)
.then(({ data }) => { .then(({ data }) => {
if(!isopen){ if (!isopen) {
this.$refs.drawerview.open = true this.$refs.drawerview.open = true;
} }
this.$refs.drawerview.form = data.entity this.$refs.drawerview.form = data.entity;
})
.catch(error => {
this.$refs.drawerview.form = {}
this.$message.error(error.message)
throw error
}) })
.catch((error) => {
this.$refs.drawerview.form = {};
this.$message.error(error.message);
throw error;
});
}, },
handleTop(row,top) { handleTop(row, top) {
this.$post("/news/save", { id: row.id, top: top })
this.$post("/news/save",{id:row.id,top:top}).then((res) => { .then((res) => {
if (res.code == 1) { if (res.code == 1) {
if(top==0){ if (top == 0) {
this.$message.success("取消置顶成功!"); this.$message.success("取消置顶成功!");
}else{ } else {
this.$message.success("置顶成功!"); this.$message.success("置顶成功!");
} }
this.toView({id:row.id},true) this.toView({ id: row.id }, true);
this.getData(); this.getData();
} }
}) })
.catch((error) => { .catch((error) => {
this.$message.error(error.message); this.$message.error(error.message);
}); });
}, },
handleViews(row) { handleViews(row) {
//查询详细 //查询详细
this.$post("/news/record/list",{newsId:row.id}).then((res) => { this.$post("/news/record/list", { newsId: row.id })
.then((res) => {
if (res.code == 1) { if (res.code == 1) {
console.log("views-data",res) console.log("views-data", res);
this.getData(); // this.getData();
this.drawerTableData = res.data;
this.drawerTableData.row = row;
this.drawerTableData.title = "浏览";
this.$refs.shareDrawershow.open = true;
} }
}).catch((error) => { })
.catch((error) => {
this.$message.error(error.message); this.$message.error(error.message);
}); });
}, },
handleShares(row) { handleShares(row) {
//分享详细 //分享详细
this.$post("/news/share/list",{newsId:row.id}).then((res) => { this.$post("/news/share/list", { newsId: row.id })
.then((res) => {
if (res.code == 1) { if (res.code == 1) {
console.log("shares-data",res) this.drawerTableData = res.data;
this.getData(); this.drawerTableData.row = row;
this.drawerTableData.title = "分享";
this.$refs.shareDrawershow.open = true;
} }
}).catch((error) => { })
.catch((error) => {
this.$message.error(error.message); this.$message.error(error.message);
}); });
}, },
}, },
data() { data() {
return { return {
drawerTableData: [],
config: { config: {
search: [ search: [
{ {
name: "categoryId", name: "categoryId",
type: "select", type: "select",
placeholder:"请选择新闻类型", placeholder: "请选择新闻类型",
label: "新闻类型" label: "新闻类型",
}, },
{ {
name: "title", name: "title",
...@@ -119,44 +130,67 @@ ...@@ -119,44 +130,67 @@
], ],
columns: [ columns: [
// {type: "selection", width: 60}, // {type: "selection", width: 60},
{type: "index",label: "序号",width: 50}, { type: "index", label: "序号", width: 50 },
{label: "新闻标题", prop: "title"}, { label: "新闻标题", prop: "title" },
{label: "新闻类型", prop: "categoryId",formatter: this.formatter}, { label: "新闻类型", prop: "categoryId", formatter: this.formatter },
{label: "创建时间", prop: "createDateTime", formatter: this.formatterDate}, {
label: "创建时间",
prop: "createDateTime",
formatter: this.formatterDate,
},
{label: "数据",formatter: row => { {
let bool=false; label: "数据",
formatter: (row) => {
let bool = false;
return ( return (
<div> <div>
<el-link underline={bool} onClick={() => { <el-link
underline={bool}
onClick={() => {
this.handleViews(row); this.handleViews(row);
}} type="primary">浏览({row.viewNums})</el-link><br/> }}
type="primary"
>
浏览({row.viewNums})
</el-link>
<br />
<el-link underline={bool} onClick={() => { <el-link
underline={bool}
onClick={() => {
this.handleShares(row); this.handleShares(row);
}} type="primary">分享({row.shareNums})</el-link> }}
type="primary"
>
分享({row.shareNums})
</el-link>
</div> </div>
);}}, );
},
},
{label: "创建用户", prop: "createUserId", formatter: this.formatter}, {
label: "创建用户",
prop: "createUserId",
formatter: this.formatter,
},
{ {
label: "操作", label: "操作",
width: 240, width: 240,
formatter: row => { formatter: (row) => {
return ( return (
<div> <div>
{row.top === 0 ? ( {row.top === 0 ? (
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-open" icon="el-icon-open"
onClick={() => { onClick={() => {
this.handleTop(row,1); this.handleTop(row, 1);
}} }}
> >
置顶 置顶
...@@ -167,7 +201,7 @@ ...@@ -167,7 +201,7 @@
type="text" type="text"
icon="el-icon-open" icon="el-icon-open"
onClick={() => { onClick={() => {
this.handleTop(row,0); this.handleTop(row, 0);
}} }}
> >
取消置顶 取消置顶
...@@ -181,14 +215,13 @@ ...@@ -181,14 +215,13 @@
onView={this.toView} onView={this.toView}
onDel={this.toDel} onDel={this.toDel}
/> />
</div> </div>
); );
} },
} },
] ],
} },
};
}
}; };
},
};
</script> </script>
<template>
<!-- 弹出框表单 -->
<el-drawer
:visible.sync="open"
:direction="direction"
:destroy-on-close="true"
size="40%"
>
<div slot="title" class="title">
<h4
:class="activeTitle == 0 ? 'title_text active' : 'title_text'"
@click="handleTitle(0)"
>
浏览({{ drawerTableData.row ? drawerTableData.row.viewNums : 0 }}
</h4>
<h4
:class="activeTitle == 1 ? 'title_text active' : 'title_text'"
@click="handleTitle(1)"
>
分享({{ drawerTableData.row ? drawerTableData.row.shareNums : 0 }}
</h4>
</div>
<div class="form">
<el-table :data="tableData.data" border style="width: 100%">
<el-table-column type="index" width="50" label="序号">
</el-table-column>
<el-table-column prop="viewName" label="浏览人员"> </el-table-column>
<el-table-column prop="sumViews" label="浏览次数"> </el-table-column>
<el-table-column prop="viewTime" label="最近浏览时间">
<template slot-scope="scope">
<span>{{ timeFix(scope.row.viewTime) }}</span>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
@current-change="handleCurrentChange"
:current-page.sync="tableData.current_page"
:page-size="10"
layout="total, prev, pager, next"
:total="tableData.total"
>
</el-pagination>
</div>
</div>
</el-drawer>
</template>
<script>
import form from "@/assets/mixins/formdialog";
import { timestampToTime } from "@/assets/utils/dateFormat.js";
export default {
name: "NewsDetail",
props: {
drawerTableData: {
type: Object,
default: {},
},
},
mixins: [form],
components: {},
computed: {
timeFix(val) {
console.log(val);
return (val) => {
let time = timestampToTime(val, 6);
return time;
};
},
},
data() {
return {
// 遮罩层
loading: false,
// 弹出层标题
title: "新闻",
// 是否显示弹出层
open: false,
tableData: [],
activeTitle: 0,
};
},
methods: {
// 标题切换操作
handleTitle(i) {
this.activeTitle = i;
this.activeTitle == 0 ? this.handleView() : this.handleShare();
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.activeTitle == 0 ? this.handleView(val) : this.handleShare(val);
},
//查询详细
handleView(val = 1) {
this.$post("/news/record/list", {
newsId: this.drawerTableData.row.id,
page: val,
})
.then((res) => {
if (res.code == 1) {
this.tableData = res.data;
}
})
.catch((error) => {
this.$message.error(error.message);
});
},
//分享详细
handleShare(val = 1) {
this.$post("/news/share/list", {
newsId: this.drawerTableData.row.id,
page: val,
})
.then((res) => {
if (res.code == 1) {
console.log("shares-data", res);
this.tableData = res.data;
}
})
.catch((error) => {
this.$message.error(error.message);
});
},
/** 编辑 */
edit(row) {
this.reset();
this.query = { id: row.id };
this.urls.currUrl = "news/edit";
this.getData();
this.pageInfo.type = "edit";
this.title = "修改新闻";
},
/** 新增 */
add(row) {
this.reset();
this.urls.currUrl = "news/add";
this.getData();
this.pageInfo.type = "add";
this.title = "新增新闻";
},
/** 查看*/
view(row) {
this.reset();
this.query = { id: row.id };
this.urls.currUrl = "news/view";
this.getData();
this.pageInfo.type = "view";
this.title = "新闻详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
},
watch: {
open: {
handler(val) {
if (val) {
this.tableData = this.drawerTableData;
console.log(this.drawerTableData);
this.drawerTableData.title == "浏览"
? (this.activeTitle = 0)
: (this.activeTitle = 1);
}
},
},
},
};
</script>
<style lang="less" scoped>
.footerbtns {
margin-top: 20px;
padding-top: 20px;
border-top: 1px solid gainsboro;
display: flex;
justify-content: center;
align-content: center;
}
.form {
width: 100%;
padding: 20px;
}
.title {
width: 100%;
display: flex;
align-items: center;
.title_text {
width: 20%;
color: #333;
opacity: 0.5;
cursor: pointer;
}
.active {
opacity: 1;
color: #333;
}
}
.block {
width: 100%;
text-align: end;
}
</style>
\ No newline at end of file
<template> <template>
<div class="page"> <div class="page">
<LayoutTable ref="layouttable" :data="tableData" :config="tableConfig" notDel > <LayoutTable
ref="layouttable"
:data="tableData"
:config="tableConfig"
notDel
>
<!-- 热门0为非热门1为热门 --> <!-- 热门0为非热门1为热门 -->
<div slot="table-search-left" class="onlyhot"> <div slot="table-search-left" class="onlyhot">
<el-checkbox <el-checkbox
...@@ -9,33 +14,30 @@ ...@@ -9,33 +14,30 @@
:checked="ishot" :checked="ishot"
@change="changeIshot" @change="changeIshot"
> >
</el-checkbox> </el-checkbox>
只看热门 只看热门
</div> </div>
</LayoutTable> </LayoutTable>
<drawer-show ref="drawerform" @ok="getData" /> <drawer-show ref="drawerform" @ok="getData" />
</div> </div>
</template> </template>
<script> <script>
/** 表单弹出框模式需引入 */ /** 表单弹出框模式需引入 */
import drawerShow from "./drawershow"; import drawerShow from "./drawershow";
import table from "@/assets/mixins/table"; import table from "@/assets/mixins/table";
export default { export default {
name: "ProductList", name: "ProductList",
components: { components: {
drawerShow drawerShow,
}, },
mixins: [table], mixins: [table],
mounted() { mounted() {
// 重写查询 // 重写查询
this.$refs.layouttable.$refs.searchform.onSubmit = this.onSearch this.$refs.layouttable.$refs.searchform.onSubmit = this.onSearch;
// 重写搜索清除 // 重写搜索清除
this.$refs.layouttable.$refs.searchform.cleanForm = this.cleanForm this.$refs.layouttable.$refs.searchform.cleanForm = this.cleanForm;
}, },
methods: { methods: {
renderTable(tableData) { renderTable(tableData) {
...@@ -52,8 +54,7 @@ ...@@ -52,8 +54,7 @@
label={options.label} label={options.label}
width={options.width} width={options.width}
formatter={options.formatter} formatter={options.formatter}
> ></el-table-column>
</el-table-column>
); );
}, },
/** 重写新增方法 */ /** 重写新增方法 */
...@@ -69,46 +70,51 @@ ...@@ -69,46 +70,51 @@
this.$refs.drawerform.view(row); this.$refs.drawerform.view(row);
}, },
// 重写查询 // 重写查询
onSearch(){ onSearch() {
if(this.ishot){ if (this.ishot) {
this.$refs.layouttable.$refs.searchform.form = Object.assign({}, this.$refs.layouttable.$refs.searchform.form, {hot:1}) this.$refs.layouttable.$refs.searchform.form = Object.assign(
{},
this.$refs.layouttable.$refs.searchform.form,
{ hot: 1 }
);
} }
let { path, query } = this.$refs.layouttable.$refs.searchform.$route; let { path, query } = this.$refs.layouttable.$refs.searchform.$route;
let data = this.$refs.layouttable.$refs.searchform.decode(this.$refs.layouttable.$refs.searchform.form); let data = this.$refs.layouttable.$refs.searchform.decode(
this.$refs.layouttable.$refs.searchform.form
);
this.$refs.layouttable.$refs.searchform.$router.push({ this.$refs.layouttable.$refs.searchform.$router.push({
path: path, path: path,
query: Object.assign({}, query, data), query: Object.assign({}, query, data),
}); });
}, },
// 重写搜索清除 // 重写搜索清除
cleanForm(){ cleanForm() {
this.ishot = false this.ishot = false;
this.$refs.layouttable.$refs.searchform.form.hot = undefined this.$refs.layouttable.$refs.searchform.form.hot = undefined;
this.$forceUpdate() this.$forceUpdate();
this.$refs.layouttable.$refs.searchform.clean(); this.$refs.layouttable.$refs.searchform.clean();
this.$refs.layouttable.$refs.searchform.onSubmit(); this.$refs.layouttable.$refs.searchform.onSubmit();
}, },
changeIshot(val){ changeIshot(val) {
this.ishot = val this.ishot = val;
} },
}, },
data() { data() {
return { return {
ishot:false, ishot: false,
config: { config: {
search: [ search: [
{ {
name: "categoryId", name: "categoryId",
type: "select", type: "select",
placeholder:"请选择产品分类", placeholder: "请选择产品分类",
label: "产品分类" label: "产品分类",
}, },
{ {
name: "companyId", name: "companyId",
type: "select", type: "select",
placeholder:"请选择所属企业", placeholder: "请选择所属企业",
label: "所属企业" label: "所属企业",
}, },
{ {
name: "productName", name: "productName",
...@@ -118,42 +124,67 @@ ...@@ -118,42 +124,67 @@
}, },
], ],
columns: [ columns: [
{type: "index",label: "序号",width: 50}, { type: "index", label: "序号", width: 50 },
{label: "产品名称", prop: "productName"}, { label: "产品名称", prop: "productName" },
{label: "产品分类", prop: "categoryId",formatter: this.formatters}, { label: "产品分类", prop: "categoryId", formatter: this.formatters },
{label: "所属企业", prop: "companyId",formatter: this.formatters}, { label: "所属企业", prop: "companyId", formatter: this.formatters },
{label: "产品介绍", prop: "productIntroduction" , width: 500,formatter: this.formatters}, {
label: "产品介绍",
prop: "productIntroduction",
width: 500,
formatter: this.formatters,
},
{label: "发布时间", prop: "publishTime", formatter: this.formatterDate}, {
label: "发布时间",
prop: "publishTime",
formatter: this.formatterDate,
},
{label: "热门", prop: "hot",formatter: this.formatterYES, width: 50}, {
label: "热门",
prop: "hot",
formatter: this.formatterYES,
width: 50,
},
{label: "最近更新时间", prop: "updateTime", formatter: this.formatterDate}, {
label: "最近更新时间",
prop: "updateTime",
formatter: this.formatterDate,
},
{ {
label: "操作", label: "操作",
width: 240, width: 240,
formatter: row => { formatter: (row) => {
return ( return (
<table-buttons noAdd noView row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} /> <table-buttons
noAdd
noView
row={row}
onEdit={this.toEdit}
onView={this.toView}
onDel={this.toDel}
/>
); );
} },
} },
] ],
} },
};
}
}; };
},
};
</script> </script>
<style lang="less" > <style lang="less" >
.table-form{ .table-form {
display: flex ; display: flex;
} }
.onlyhot{ .onlyhot {
margin-right: 20px; margin-right: 20px;
line-height: 30px; line-height: 30px;
font-size: 14px; font-size: 14px;
......
...@@ -14,6 +14,22 @@ ...@@ -14,6 +14,22 @@
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<properties>
<!-- 默认值 -->
<profiles.server.debug></profiles.server.debug>
<profiles.server.path>/enterprise</profiles.server.path>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.log.level>info</profiles.log.level>
<profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.filepath>/mortals/app/data</profiles.filepath>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.req.json.check>false</profiles.req.json.check>
<profiles.trustedReferer></profiles.trustedReferer>
<package.environment>build</package.environment>
<skipUi>true</skipUi>
</properties>
<profiles> <profiles>
<profile> <profile>
<id>develop</id> <id>develop</id>
...@@ -42,6 +58,7 @@ ...@@ -42,6 +58,7 @@
<profiles.active>test</profiles.active> <profiles.active>test</profiles.active>
<profiles.platform.type>standalone</profiles.platform.type> <profiles.platform.type>standalone</profiles.platform.type>
<profiles.server.port>21086</profiles.server.port> <profiles.server.port>21086</profiles.server.port>
<profiles.server.debug>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=6519</profiles.server.debug>
<profiles.server.path>/enterprise</profiles.server.path> <profiles.server.path>/enterprise</profiles.server.path>
<profiles.publish.path>/home/publish</profiles.publish.path> <profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr>
...@@ -55,36 +72,25 @@ ...@@ -55,36 +72,25 @@
<profiles.log.path>/home/mortals/app/logs</profiles.log.path> <profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.log.level>INFO</profiles.log.level> <profiles.log.level>INFO</profiles.log.level>
<package.environment>test</package.environment> <package.environment>test</package.environment>
<skipUi>false</skipUi> <skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
<profile> <profile>
<id>product</id> <id>product</id>
<properties> <properties>
<profiles.active>product</profiles.active> <profiles.active>product</profiles.active>
<profiles.platform.type>cloud</profiles.platform.type> <profiles.platform.type>standalone</profiles.platform.type>
<profiles.server.port>11086</profiles.server.port> <profiles.server.port>21086</profiles.server.port>
<profiles.server.path>/office</profiles.server.path> <profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.server-addr>172.15.28.120:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group> <profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace> <profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.rabbitmq.host>172.15.28.115</profiles.rabbitmq.host> <package.environment>build:prod</package.environment>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port> <skipDeploy>true</skipDeploy>
<profiles.rabbitmq.username>taxi_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>admin@2020</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.log.level>info</profiles.log.level>
<profiles.publish.path>/home/publish</profiles.publish.path>
<package.environment>build</package.environment>
<skipUi>false</skipUi>
</properties> </properties>
</profile> </profile>
</profiles> </profiles>
<properties>
</properties>
<dependencies> <dependencies>
......
...@@ -14,7 +14,7 @@ SHELL_LOG="${BASEDIR}/${SHELL_NAME}.log" ...@@ -14,7 +14,7 @@ SHELL_LOG="${BASEDIR}/${SHELL_NAME}.log"
JAVA_HOME="/usr/local/java/jdk1.8" JAVA_HOME="/usr/local/java/jdk1.8"
SERVICE_PATH="/usr/lib/systemd/system" SERVICE_PATH="/usr/lib/systemd/system"
PUBLISH_PATH="@profiles.publish.path@" PUBLISH_PATH="/home/publish"
PROJECT_NAME="@project.artifactId@" PROJECT_NAME="@project.artifactId@"
PROJECT_EXECPATH="${PUBLISH_PATH}/${PROJECT_NAME}" PROJECT_EXECPATH="${PUBLISH_PATH}/${PROJECT_NAME}"
...@@ -35,7 +35,7 @@ clear_deploy() { ...@@ -35,7 +35,7 @@ clear_deploy() {
SERVICE=$1 SERVICE=$1
EXECPATH=$2 EXECPATH=$2
#清理后台自启服务 #清理后台自启服务
rm -rf ${SERVICE} rm -f ${SERVICE}
#清理执行文件目录 #清理执行文件目录
rm -rf ${EXECPATH} rm -rf ${EXECPATH}
} }
...@@ -58,6 +58,7 @@ build_service() { ...@@ -58,6 +58,7 @@ build_service() {
echo "[Service]" >>${SERVICE} echo "[Service]" >>${SERVICE}
echo "Environment=\"JAVA_HOME=$JAVA_HOME\"" >>${SERVICE} echo "Environment=\"JAVA_HOME=$JAVA_HOME\"" >>${SERVICE}
echo "Type=forking" >>${SERVICE} echo "Type=forking" >>${SERVICE}
echo "ExecStartPre=-/bin/sleep 5s" >>${SERVICE}
echo "ExecStart=${EXECPATH}/bin/start.sh" >>${SERVICE} echo "ExecStart=${EXECPATH}/bin/start.sh" >>${SERVICE}
echo "ExecStop=${EXECPATH}/bin/shutdown.sh" >>${SERVICE} echo "ExecStop=${EXECPATH}/bin/shutdown.sh" >>${SERVICE}
echo "PrivateTmp=true" >>${SERVICE} echo "PrivateTmp=true" >>${SERVICE}
...@@ -103,8 +104,11 @@ project_ui_deploy() { ...@@ -103,8 +104,11 @@ project_ui_deploy() {
main() { main() {
echo "后台服务部署" echo "后台服务部署"
project_deploy project_deploy
#判断是否需要部署ui
if [ "@skipUi@" == "false" ];then
echo "前端服务部署" echo "前端服务部署"
project_ui_deploy project_ui_deploy
fi;
exit ${RETVAL} exit ${RETVAL}
} }
......
#! /bin/sh #!/bin/sh
PORT="@profiles.server.port@" PORT="@profiles.server.port@"
BASEDIR=$(dirname $0) BASEDIR=`dirname $0`
BASEDIR=$( ( BASEDIR=`(cd "$BASEDIR"; pwd)`
cd "$BASEDIR"
pwd
))
PROJECT_NAME="@project.artifactId@" PROJECT_NAME="@project.artifactId@"
MAIN_CLASS="$PROJECT_NAME" MAIN_CLASS="$PROJECT_NAME";
SUCCESS=0
FAIL=9
if [ ! -n "$PORT" ]; then if [ ! -n "$PORT" ]; then
echo $"Usage: $0 {port}" echo $"Usage: $0 {port}"
exit $FAIL exit $FAIL
fi fi
pid=$(ps ax | grep -i "$MAIN_CLASS" | grep java | grep -v grep | awk '{print $1}')
if [ -z "$pid" ]; then pid=`ps ax | grep -i "$MAIN_CLASS" | grep java | grep -v grep | awk '{print $1}'`
if [ -z "$pid" ] ; then
echo "No Server running." echo "No Server running."
exit 1 exit $FAIL;
fi fi
echo "stoping application $PROJECT_NAME......" echo "stoping application $PROJECT_NAME......"
...@@ -24,3 +23,5 @@ echo "stoping application $PROJECT_NAME......" ...@@ -24,3 +23,5 @@ echo "stoping application $PROJECT_NAME......"
kill -15 ${pid} kill -15 ${pid}
echo "Send shutdown request to Server $PROJECT_NAME OK" echo "Send shutdown request to Server $PROJECT_NAME OK"
#!/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
...@@ -32,8 +33,9 @@ if [ -z "$JAVACMD" ] ; then ...@@ -32,8 +33,9 @@ if [ -z "$JAVACMD" ] ; then
JAVACMD="$JAVA_HOME/bin/java" JAVACMD="$JAVA_HOME/bin/java"
fi fi
else else
JAVACMD=`which java` JAVACMD=`which java > /dev/null 2>&1`
echo "Error: JAVA_HOME is $JAVACMD" echo "Error: JAVA_HOME is not defined correctly."
exit $ERR_NO_JAVA
fi fi
fi fi
...@@ -44,7 +46,7 @@ fi ...@@ -44,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="-Xms128M -Xmx512M -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:
...@@ -55,12 +57,12 @@ cd "$BASEDIR/boot"; ...@@ -55,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 \
-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=41086 \
-jar $MAIN_CLASS \ -jar $MAIN_CLASS \
> /dev/null & > /dev/null &
......
package com.mortals.xhx.busiz.controller; package com.mortals.xhx.busiz.controller;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.idempotent.helper.IdempotentHelper; import com.mortals.framework.idempotent.helper.IdempotentHelper;
import com.mortals.xhx.busiz.service.TestIdempotentService; import com.mortals.xhx.busiz.service.TestIdempotentService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -28,6 +29,7 @@ public class TestIdempotentController { ...@@ -28,6 +29,7 @@ public class TestIdempotentController {
* url: localhost:12345/v1/idempotent/test-with-result?source=taobao&operationType=publish_product&businessKey=pd_20230105007&name=lisi * url: localhost:12345/v1/idempotent/test-with-result?source=taobao&operationType=publish_product&businessKey=pd_20230105007&name=lisi
*/ */
@GetMapping("/test-with-result") @GetMapping("/test-with-result")
@UnAuth
public String testWithResult(String source, public String testWithResult(String source,
String operationType, String operationType,
String businessKey, String businessKey,
...@@ -44,6 +46,7 @@ public class TestIdempotentController { ...@@ -44,6 +46,7 @@ public class TestIdempotentController {
* url : localhost:12345/v1/idempotent/test-with-no-result?source=taobao&operationType=publish_product&businessKey=pd_20230105008&name=zhangsan * url : localhost:12345/v1/idempotent/test-with-no-result?source=taobao&operationType=publish_product&businessKey=pd_20230105008&name=zhangsan
*/ */
@GetMapping("/test-with-no-result") @GetMapping("/test-with-no-result")
@UnAuth
public String testWithNoResult(String source, public String testWithNoResult(String source,
String operationType, String operationType,
String businessKey, String businessKey,
......
...@@ -13,11 +13,11 @@ import com.mortals.xhx.module.company.model.vo.CompanyVo; ...@@ -13,11 +13,11 @@ import com.mortals.xhx.module.company.model.vo.CompanyVo;
import com.mortals.xhx.module.company.model.CompanyLabelsEntity; import com.mortals.xhx.module.company.model.CompanyLabelsEntity;
import lombok.Data; import lombok.Data;
/** /**
* 公司实体对象 * 公司实体对象
* *
* @author zxfei * @author zxfei
* @date 2023-09-18 * @date 2024-12-05
*/ */
@Data @Data
public class CompanyEntity extends CompanyVo { public class CompanyEntity extends CompanyVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -151,6 +151,10 @@ public class CompanyEntity extends CompanyVo { ...@@ -151,6 +151,10 @@ public class CompanyEntity extends CompanyVo {
* 备注 * 备注
*/ */
private String remark; private String remark;
/**
* 背景图片
*/
private String background;
/** /**
* 公司标注信息 * 公司标注信息
*/ */
...@@ -209,7 +213,8 @@ public class CompanyEntity extends CompanyVo { ...@@ -209,7 +213,8 @@ public class CompanyEntity extends CompanyVo {
this.companyIntroduction = ""; this.companyIntroduction = "";
this.companyCulture = ""; this.companyCulture = "";
this.sort = 0; this.sort = 0;
this.establishDate = new Date(); this.establishDate = null;
this.remark = ""; this.remark = "";
this.background = "";
} }
} }
\ No newline at end of file
...@@ -5,11 +5,11 @@ import java.util.Date; ...@@ -5,11 +5,11 @@ import java.util.Date;
import java.util.List; import java.util.List;
import com.mortals.xhx.module.company.model.CompanyEntity; import com.mortals.xhx.module.company.model.CompanyEntity;
/** /**
* 公司查询对象 * 公司查询对象
* *
* @author zxfei * @author zxfei
* @date 2023-09-18 * @date 2024-12-05
*/ */
public class CompanyQuery extends CompanyEntity { public class CompanyQuery extends CompanyEntity {
/** 开始 主键ID,主键,自增长 */ /** 开始 主键ID,主键,自增长 */
private Long idStart; private Long idStart;
...@@ -269,6 +269,11 @@ public class CompanyQuery extends CompanyEntity { ...@@ -269,6 +269,11 @@ public class CompanyQuery extends CompanyEntity {
/** 结束 更新时间 */ /** 结束 更新时间 */
private String updateTimeEnd; private String updateTimeEnd;
/** 背景图片 */
private List<String> backgroundList;
/** 背景图片排除列表 */
private List <String> backgroundNotList;
/** 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<CompanyQuery> orConditionList; private List<CompanyQuery> orConditionList;
...@@ -1804,6 +1809,38 @@ public class CompanyQuery extends CompanyEntity { ...@@ -1804,6 +1809,38 @@ public class CompanyQuery extends CompanyEntity {
this.updateTimeEnd = updateTimeEnd; this.updateTimeEnd = updateTimeEnd;
} }
/**
* 获取 背景图片
* @return backgroundList
*/
public List<String> getBackgroundList(){
return this.backgroundList;
}
/**
* 设置 背景图片
* @param backgroundList
*/
public void setBackgroundList(List<String> backgroundList){
this.backgroundList = backgroundList;
}
/**
* 获取 背景图片
* @return backgroundNotList
*/
public List<String> getBackgroundNotList(){
return this.backgroundNotList;
}
/**
* 设置 背景图片
* @param backgroundNotList
*/
public void setBackgroundNotList(List<String> backgroundNotList){
this.backgroundNotList = backgroundNotList;
}
/** /**
* 设置 主键ID,主键,自增长 * 设置 主键ID,主键,自增长
* @param id * @param id
...@@ -2698,6 +2735,25 @@ public class CompanyQuery extends CompanyEntity { ...@@ -2698,6 +2735,25 @@ public class CompanyQuery extends CompanyEntity {
} }
/**
* 设置 背景图片
* @param background
*/
public CompanyQuery background(String background){
setBackground(background);
return this;
}
/**
* 设置 背景图片
* @param backgroundList
*/
public CompanyQuery backgroundList(List<String> backgroundList){
this.backgroundList = backgroundList;
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
......
...@@ -86,7 +86,34 @@ public class CompanyServiceImpl extends AbstractCRUDServiceImpl<CompanyDao, Comp ...@@ -86,7 +86,34 @@ public class CompanyServiceImpl extends AbstractCRUDServiceImpl<CompanyDao, Comp
@Autowired @Autowired
private LabelsService labelsService; private LabelsService labelsService;
@Override
protected void findAfter(CompanyEntity params,PageInfo pageInfo, Context context, List<CompanyEntity> list) throws AppException {
fillSubData(list);
super.findAfter(params,pageInfo, context, list);
}
@Override
protected void findAfter(CompanyEntity params, Context context, List<CompanyEntity> list) throws AppException {
fillSubData(list);
super.findAfter(params, context, list);
}
private void fillSubData(List<CompanyEntity> list) {
List<Long> idList = list.stream().map(i -> i.getId()).collect(Collectors.toList());
if(ObjectUtils.isEmpty(idList))return;
Map<Long, List<CompanyLabelsEntity>> companyLabelsListMap = companyLabelsService
.find(new CompanyLabelsQuery().companyIdList(idList)).parallelStream()
.collect(Collectors.groupingBy(CompanyLabelsEntity::getCompanyId));
List<CompanyPatentEntity> companyPatentEntities = companyPatentService.find(new CompanyPatentQuery().companyIdList(idList));
Map<Long, List<CompanyPatentEntity>> companyPatentListMap = companyPatentEntities.parallelStream().collect((Collectors.groupingBy(CompanyPatentEntity::getCompanyId)));
list.forEach(item -> {
item.setCompanyLabelsList(companyLabelsListMap.get(item.getId()));
item.setCompanyPatentsList(companyPatentListMap.get(item.getId()));
});
}
/*
@Override @Override
protected void findAfter(CompanyEntity params, PageInfo pageInfo, Context context, List<CompanyEntity> list) throws AppException { protected void findAfter(CompanyEntity params, PageInfo pageInfo, Context context, List<CompanyEntity> list) throws AppException {
...@@ -95,6 +122,7 @@ public class CompanyServiceImpl extends AbstractCRUDServiceImpl<CompanyDao, Comp ...@@ -95,6 +122,7 @@ public class CompanyServiceImpl extends AbstractCRUDServiceImpl<CompanyDao, Comp
item.setCompanyPatentsList(companyPatentEntities); item.setCompanyPatentsList(companyPatentEntities);
}).count(); }).count();
} }
*/
@Override @Override
protected void saveAfter(CompanyEntity entity, Context context) throws AppException { protected void saveAfter(CompanyEntity entity, Context context) throws AppException {
......
...@@ -7,8 +7,7 @@ import com.mortals.framework.exception.AppException; ...@@ -7,8 +7,7 @@ import com.mortals.framework.exception.AppException;
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.code.YesNoEnum;
import com.mortals.xhx.module.company.model.CompanyPatentEntity; import com.mortals.xhx.module.company.model.*;
import com.mortals.xhx.module.company.model.CompanyPatentQuery;
import com.mortals.xhx.module.company.model.vo.HomeStatInfo; import com.mortals.xhx.module.company.model.vo.HomeStatInfo;
import com.mortals.xhx.module.company.service.CompanyLabelsService; import com.mortals.xhx.module.company.service.CompanyLabelsService;
import com.mortals.xhx.module.company.service.CompanyPatentService; import com.mortals.xhx.module.company.service.CompanyPatentService;
...@@ -26,7 +25,6 @@ import javax.servlet.http.HttpServletRequest; ...@@ -26,7 +25,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.company.model.CompanyEntity;
import com.mortals.xhx.module.company.service.CompanyService; import com.mortals.xhx.module.company.service.CompanyService;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
...@@ -62,6 +60,9 @@ public class CompanyController extends BaseCRUDJsonBodyMappingController<Company ...@@ -62,6 +60,9 @@ public class CompanyController extends BaseCRUDJsonBodyMappingController<Company
private LabelsService labelsService; private LabelsService labelsService;
@Autowired @Autowired
private CompanyPatentService companyPatentService; private CompanyPatentService companyPatentService;
@Autowired
private CompanyLabelsService companyLabelsService;
public CompanyController() { public CompanyController() {
...@@ -84,6 +85,10 @@ public class CompanyController extends BaseCRUDJsonBodyMappingController<Company ...@@ -84,6 +85,10 @@ public class CompanyController extends BaseCRUDJsonBodyMappingController<Company
protected int editAfter(Long id, Map<String, Object> model, CompanyEntity entity, Context context) throws AppException { protected int editAfter(Long id, Map<String, Object> model, CompanyEntity entity, Context context) throws AppException {
List<CompanyPatentEntity> companyPatentEntities = companyPatentService.find(new CompanyPatentQuery().companyId(entity.getId())); List<CompanyPatentEntity> companyPatentEntities = companyPatentService.find(new CompanyPatentQuery().companyId(entity.getId()));
List<CompanyLabelsEntity> companyLabelsEntities = companyLabelsService.find(new CompanyLabelsQuery().companyId(entity.getId()));
entity.setCompanyLabelsList(companyLabelsEntities);
entity.setCompanyPatentsList(companyPatentEntities); entity.setCompanyPatentsList(companyPatentEntities);
...@@ -95,6 +100,8 @@ public class CompanyController extends BaseCRUDJsonBodyMappingController<Company ...@@ -95,6 +100,8 @@ public class CompanyController extends BaseCRUDJsonBodyMappingController<Company
protected int viewAfter(Long id, Map<String, Object> model, CompanyEntity entity, Context context) throws AppException { protected int viewAfter(Long id, Map<String, Object> model, CompanyEntity entity, Context context) throws AppException {
List<CompanyPatentEntity> companyPatentEntities = companyPatentService.find(new CompanyPatentQuery().companyId(entity.getId())); List<CompanyPatentEntity> companyPatentEntities = companyPatentService.find(new CompanyPatentQuery().companyId(entity.getId()));
List<CompanyLabelsEntity> companyLabelsEntities = companyLabelsService.find(new CompanyLabelsQuery().companyId(entity.getId()));
entity.setCompanyLabelsList(companyLabelsEntities);
entity.setCompanyPatentsList(companyPatentEntities); entity.setCompanyPatentsList(companyPatentEntities);
return super.viewAfter(id, model, entity, context); return super.viewAfter(id, model, entity, context);
......
...@@ -58,7 +58,7 @@ public class NewsServiceImpl extends AbstractCRUDServiceImpl<NewsDao, NewsEntity ...@@ -58,7 +58,7 @@ public class NewsServiceImpl extends AbstractCRUDServiceImpl<NewsDao, NewsEntity
List<NewsUpEntity> upList = newsUpService.find(new NewsUpQuery().newsIdList(newsIdList).upId(context.getUser().getId())); List<NewsUpEntity> upList = newsUpService.find(new NewsUpQuery().newsIdList(newsIdList).upId(context.getUser().getId()));
Map<Long,NewsUpEntity> upMap = new HashMap<>(); Map<Long,NewsUpEntity> upMap = new HashMap<>();
if(CollectionUtils.isNotEmpty(upList)){ if(CollectionUtils.isNotEmpty(upList)){
upMap = upList.parallelStream().collect(Collectors.toMap(x -> x.getId(), z -> z, (o, n) -> n)); upMap = upList.parallelStream().collect(Collectors.toMap(x -> x.getNewsId(), z -> z, (o, n) -> n));
} }
List<NewsShareEntity> shareList = newsShareService.find(new NewsShareQuery().newsIdList(newsIdList).createUserId(context.getUser().getId())); List<NewsShareEntity> shareList = newsShareService.find(new NewsShareQuery().newsIdList(newsIdList).createUserId(context.getUser().getId()));
Map<Long,NewsShareEntity> shareMap = new HashMap<>(); Map<Long,NewsShareEntity> shareMap = new HashMap<>();
......
...@@ -14,10 +14,11 @@ client.global.set("authToken", JSON.parse(response.body).data.token); ...@@ -14,10 +14,11 @@ client.global.set("authToken", JSON.parse(response.body).data.token);
%} %}
###公司列表 ###公司列表
POST {{baseUrl}}/company/list POST {{baseUrl}}/company/interlist
Content-Type: application/json Content-Type: application/json
{ {
"id": 5,
"page":1, "page":1,
"size":10 "size":10
} }
......
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