Commit 1425be68 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents e730e663 656a05cd
...@@ -147,6 +147,11 @@ export default { ...@@ -147,6 +147,11 @@ export default {
areaFlag: false, areaFlag: false,
streetFlag: false, streetFlag: false,
communityFlag: false, communityFlag: false,
provinceName:'',
cityName:'',
areaName:'',
streetName:'',
communityName:''
} }
}, },
...@@ -209,6 +214,11 @@ export default { ...@@ -209,6 +214,11 @@ export default {
this.streetCode = '' this.streetCode = ''
this.communityCode = '' this.communityCode = ''
this.cityName=''
this.areaName=''
this.streetName=''
this.communityName=''
var split = val.split("&"); var split = val.split("&");
this.$emit("input", split[1]); this.$emit("input", split[1]);
this.$emit('addressSelect', split[1]) this.$emit('addressSelect', split[1])
...@@ -230,6 +240,11 @@ export default { ...@@ -230,6 +240,11 @@ export default {
this.areaCode = '' this.areaCode = ''
this.streetCode = '' this.streetCode = ''
this.communityCode = '' this.communityCode = ''
this.areaName=''
this.streetName=''
this.communityName=''
var split = val.split("&"); var split = val.split("&");
this.$emit("input", split[1]); this.$emit("input", split[1]);
this.$emit('addressSelect', split[1]) this.$emit('addressSelect', split[1])
...@@ -250,6 +265,9 @@ export default { ...@@ -250,6 +265,9 @@ export default {
this.streetCode = '' this.streetCode = ''
this.communityCode = '' this.communityCode = ''
this.streetName=''
this.communityName=''
var split = val.split("&"); var split = val.split("&");
this.$emit("input", split[1]); this.$emit("input", split[1]);
this.$emit('addressSelect', split[1]) this.$emit('addressSelect', split[1])
...@@ -271,6 +289,9 @@ export default { ...@@ -271,6 +289,9 @@ export default {
this.fetchData(this.communityList, this.streetCode) this.fetchData(this.communityList, this.streetCode)
this.streetFlag = true this.streetFlag = true
this.communityCode = '' this.communityCode = ''
this.communityName=''
var split = val.split("&"); var split = val.split("&");
this.$emit("input", split[1]); this.$emit("input", split[1]);
this.$emit('addressSelect', split[1]) this.$emit('addressSelect', split[1])
...@@ -289,7 +310,6 @@ export default { ...@@ -289,7 +310,6 @@ export default {
}, },
// 社区修改,拉取社区列表 // 社区修改,拉取社区列表
changeCommunity(val) { changeCommunity(val) {
console.log("changeCommunity",val)
this.fetchData(this.communityList, this.streetCode) this.fetchData(this.communityList, this.streetCode)
this.communityFlag = true this.communityFlag = true
var split = val.split("&"); var split = val.split("&");
...@@ -318,24 +338,29 @@ export default { ...@@ -318,24 +338,29 @@ export default {
if(area.areaLevel=='1'){ if(area.areaLevel=='1'){
//省 //省
this.provinceCode = area.iid + "&" + area.areaCode this.provinceCode = area.iid + "&" + area.areaCode
this.provinceName = area.name
this.fetchData(this.provinceList, pid) this.fetchData(this.provinceList, pid)
return return
}else if(area.areaLevel=='2'){ }else if(area.areaLevel=='2'){
//市 //市
this.cityCode = area.iid + "&" + area.areaCode this.cityCode = area.iid + "&" + area.areaCode
this.cityName = area.name
this.fetchData(this.cityList, pid) this.fetchData(this.cityList, pid)
}else if(area.areaLevel=='3'){ }else if(area.areaLevel=='3'){
//区县 //区县
this.areaCode = area.iid + "&" + area.areaCode this.areaCode = area.iid + "&" + area.areaCode
this.areaName = area.name
this.fetchData(this.areaList, pid) this.fetchData(this.areaList, pid)
}else if(area.areaLevel=='4'){ }else if(area.areaLevel=='4'){
//街道 //街道
let pid = area.pid + "&" + area.areaCode let pid = area.pid + "&" + area.areaCode
this.streetName = area.name
this.fetchData(this.streetList,pid) this.fetchData(this.streetList,pid)
this.streetCode = area.iid + "&" + area.areaCode this.streetCode = area.iid + "&" + area.areaCode
}else if(area.areaLevel=='5'){ }else if(area.areaLevel=='5'){
//社区 //社区
this.fetchData(this.communityList, pid) this.fetchData(this.communityList, pid)
this.communityName = area.name
this.communityCode = area.iid + "&" + area.areaCode this.communityCode = area.iid + "&" + area.areaCode
} }
this.$post("/base/area/list", {iid:area.pid}).then((res) => { this.$post("/base/area/list", {iid:area.pid}).then((res) => {
...@@ -356,7 +381,6 @@ export default { ...@@ -356,7 +381,6 @@ export default {
immediate: true, immediate: true,
handler(newVal) { handler(newVal) {
if (newVal) { if (newVal) {
this.addressCodeToList(newVal) this.addressCodeToList(newVal)
} else { } else {
this.$nextTick(() => { this.$nextTick(() => {
......
<template> <template>
<div>
<el-upload
v-show="isshow"
name="file"
list-type="picture-card"
class="avatar-uploader2"
:data="{filename:'infomation'}"
:show-upload-list="false"
:action="uploadFileUrl"
:before-upload="beforeUpload"
:on-success="uploadSuccessEdit"
>
</el-upload>
<div class="editor" ref="editor" :style="styles"></div> <div class="editor" ref="editor" :style="styles"></div>
</div>
</template> </template>
<script> <script>
...@@ -34,6 +49,8 @@ export default { ...@@ -34,6 +49,8 @@ export default {
}, },
data() { data() {
return { return {
isshow:false,
uploadFileUrl: "/enterprise/file/commonupload", // 上传的地址
Quill: null, Quill: null,
currentValue: "", currentValue: "",
options: { options: {
...@@ -42,18 +59,32 @@ export default { ...@@ -42,18 +59,32 @@ export default {
debug: "warn", debug: "warn",
modules: { modules: {
// 工具栏配置 // 工具栏配置
toolbar: [ toolbar:{
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线 container:[
["blockquote", "code-block"], // 引用 代码块 ["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
[{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表 ["blockquote", "code-block"], // 引用 代码块
[{ indent: "-1" }, { indent: "+1" }], // 缩进 [{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表
[{ size: ["small", false, "large", "huge"] }], // 字体大小 [{ indent: "-1" }, { indent: "+1" }], // 缩进
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题 [{ size: ["small", false, "large", "huge"] }], // 字体大小
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色 [{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
[{ align: [] }], // 对齐方式 [{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
["clean"], // 清除文本格式 [{ align: [] }], // 对齐方式
["link", "image", "video"] // 链接、图片、视频 ["clean"], // 清除文本格式
], ["link", "image", "video"] // 链接、图片、视频
],
handlers: {
"image": function (value) {
if (value) {
// 调用element的图片上传组件
document.querySelector('.avatar-uploader2 input').click()
} else {
this.quill.format('image', false)
}
}
}
}
}, },
placeholder: "请输入内容", placeholder: "请输入内容",
readOnly: this.readOnly, readOnly: this.readOnly,
...@@ -92,6 +123,51 @@ export default { ...@@ -92,6 +123,51 @@ export default {
this.Quill = null; this.Quill = null;
}, },
methods: { methods: {
// 上传图片成功
uploadSuccessEdit(res, file) {
// res为图片服务器返回的数据
// 获取富文本组件实例
let quill = this.Quill
// 如果上传成功
if (res.code == 1) {
// 获取光标所在位置
let length = quill.getSelection().index;
// 插入图片 res.data.url为服务器返回的图片地址
quill.insertEmbed(length, 'image', res.url)
// quill.insertEmbed(length, 'image','https://02c4e834b47bd7c8.jomoxc.com:9082/fs6ca4aaf6.a.bdydns.com/0/bjh/news/5ed45c62f6d447320a096e85187dcc24.gif?r=BzcbRhcCTngfXBtDNFsvRw0nHEIFTAg0QVYXAGlUJwFALQpBFxdUMgsBTQ5wBCtfC3dbAVcKUTZfDE4IfgN8UVgnDFVWDE8wBlMAMwpYB1wPZgBFHQMlUiNY&xcid=3042c042cee643c3b324dcf1d0aefe2f&max_age=2592000&xcsched=1572413558&xclogid=5361435651673602026&xauzkey=mngx_d1cd221672f72b38bac902fc48026343_1697182784&f_ver=v1&bcecdn_trace_info=FGEFXgoaW3UDT0wOMgF6S0NhHxReGhk0C1taEAAzClgHXA9mAEUdAyVSI1g%3D')
// 调整光标到最后
quill.setSelection(length + 1)
} else {
this.$message.error('图片插入失败')
}
// loading动画消失
this.quillUpdateImg = false
},
handleChange(info) {
console.log(info);
// if (info.file.status === 'done') {
// // Get this url from response in real world.
// if(info.file.response && info.file.response.code == 1){
// let imgurl = `${BASE_URL}/${info.file.response.data}`
// let quill = this.$refs.myTextEditor.quill
// // 获取光标所在位置
// let length = quill.getSelection().index;
// // 插入图片,res为服务器返回的图片链接地址
// quill.insertEmbed(length, 'image', imgurl)
// }
// }
},
beforeUpload(file) {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/gif';
if (!isJpgOrPng) {
this.$message.error('请上传jpeg、png或gif格式的图片');
}
return isJpgOrPng;
},
init() { init() {
const editor = this.$refs.editor; const editor = this.$refs.editor;
this.Quill = new Quill(editor, this.options); this.Quill = new Quill(editor, this.options);
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
> >
<el-link :href="file.url" :underline="false" target="_blank"> <el-link :href="file.url" :underline="false" target="_blank">
<span class="el-icon-document" style="font-size: 12px"> <span class="el-icon-document" style="font-size: 12px">
{{ getFileName(file.name) }} {{ getFileName(file.url) }}
</span> </span>
</el-link> </el-link>
<div class="ele-upload-list__item-content-action"> <div class="ele-upload-list__item-content-action">
...@@ -195,7 +195,7 @@ export default { ...@@ -195,7 +195,7 @@ export default {
let newFileList = this.fileList.map(i => i.url); let newFileList = this.fileList.map(i => i.url);
let newFileNameList = this.fileList.map(i => i.name); let newFileNameList = this.fileList.map(i => i.name);
this.$emit("input", newFileList.join(",")); this.$emit("input", newFileList.join(","));
this.$emit("getFileName", newFileNameList.join(",")); this.$emit("getFileName", newFileNameList.join(","));
this.fileList =[] this.fileList =[]
this.$message.success("上传成功"); this.$message.success("上传成功");
} else { } else {
...@@ -215,7 +215,6 @@ export default { ...@@ -215,7 +215,6 @@ export default {
}, },
// 获取文件名称 // 获取文件名称
getFileName(name) { getFileName(name) {
console.log(name);
if (name.lastIndexOf("/") > -1) { if (name.lastIndexOf("/") > -1) {
return name.slice(name.lastIndexOf("/") + 1).toLowerCase(); return name.slice(name.lastIndexOf("/") + 1).toLowerCase();
} else { } else {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<el-button v-if='!noView' type="text" icon="el-icon-view" size='mini' @click='$emit("view", row)' title="查看">查看</el-button> <el-button v-if='!noView' type="text" icon="el-icon-view" size='mini' @click='$emit("view", row)' title="查看">查看</el-button>
<span>&nbsp;</span> <span>&nbsp;</span>
<Confirm @confirm='$emit("del", row.id)' message='确定要删除该条记录吗?'> <Confirm @confirm='$emit("del", row.id)' message='确定要删除该条记录吗?'>
<el-button v-if='!noDel' type="text" icon="el-icon-delete" size='mini' title="删除">删除</el-button> <el-button v-if='!noDel' type="text" icon="el-icon-delete" size='mini' class="del" title="删除">删除</el-button>
</Confirm> </Confirm>
</span> </span>
</template> </template>
...@@ -49,5 +49,9 @@ export default { ...@@ -49,5 +49,9 @@ export default {
} }
} }
</script> </script>
<style lang="less" scoped>
.del{
color: red !important;
}
</style>
...@@ -26,10 +26,9 @@ ...@@ -26,10 +26,9 @@
:span="24" :span="24"
label="经营地址" label="经营地址"
prop="businessAdress" prop="businessAdress"
v-model="form.businessAdress"
placeholder="请输入经营地址" placeholder="请输入经营地址"
> >
<area-select v-model="form.areaCode" @addressSelect="addressSelect"></area-select> <area-select ref="areaselect" v-model="form.areaCode" @addressSelect="addressSelect"></area-select>
</Field> </Field>
<!-- <Field label="所在地" prop="location" v-model="form.location" placeholder="请输入所在地"/> --> <!-- <Field label="所在地" prop="location" v-model="form.location" placeholder="请输入所在地"/> -->
...@@ -125,7 +124,7 @@ ...@@ -125,7 +124,7 @@
</el-row> </el-row>
<el-form-item v-if="pageInfo.type!='view'" class="formbtns"> <el-form-item v-if="pageInfo.type!='view'" class="formbtns">
<el-button type="primary" @click="submitForm" icon="el-icon-circle-check-outline">保存</el-button> <el-button type="primary" @click="hanndleSubmit" icon="el-icon-circle-check-outline">保存</el-button>
<el-button @click="open=false" icon="el-icon-circle-close-outline">取消</el-button> <el-button @click="open=false" icon="el-icon-circle-close-outline">取消</el-button>
</el-form-item> </el-form-item>
</Field> </Field>
...@@ -241,6 +240,28 @@ export default { ...@@ -241,6 +240,28 @@ export default {
}, },
methods: { methods: {
hanndleSubmit(){
this.form.businessAdress = this.$refs.areaselect.provinceName+this.$refs.areaselect.cityName+this.$refs.areaselect.areaName+this.$refs.areaselect.streetName+this.$refs.areaselect.communityName+this.form.location
// 检查知识产权list中类型不能为空
if(this.companyPatentsList && this.companyPatentsList.length>0){
let isNull = false
this.companyPatentsList.forEach((item)=>{
if (!item.intellectPropertyType) {
isNull = true
}
})
if(isNull){
this.$confirm('知识产权类型不能为空', '提示', {
confirmButtonText: '确定',
type: 'warning',
showCancelButton: false, //是否显示取消按钮
showClose: false, //是否显示关闭按钮
})
return;
}
}
this.submitForm()
},
addressSelect(val) { addressSelect(val) {
console.log("addressSelect", val); console.log("addressSelect", val);
}, },
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
width: 240, width: 240,
formatter: row => { formatter: row => {
return ( return (
<table-buttons noAdd 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} />
); );
} }
} }
......
<template> <template>
<div class="page"> <div class="page">
<LayoutTable ref="layouttable" :data="tableData" :config="tableConfig" > <LayoutTable ref="layouttable" :data="tableData" :config="tableConfig" notDel notAdd>
<!-- 热门0为非热门1为热门 --> <!-- 热门0为非热门1为热门 -->
<div slot="table-search-left" class="onlyhot"> <div slot="table-search-left" class="onlyhot">
<el-checkbox <el-checkbox
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
width: 240, width: 240,
formatter: row => { formatter: row => {
return ( return (
<table-buttons noAdd row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} /> <el-button type="text" icon="el-icon-edit" size='mini' onClick={()=>{this.toEdit(row)}} title="详情">详情</el-button>
); );
} }
} }
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<Field label="轮播图" v-if="nowPropaganda==0"><imageUpload v-model="form.productPicPath" prePath="/file/preview"/></Field> <Field label="轮播图" v-if="nowPropaganda==0"><imageUpload v-model="form.productPicPath" prePath="/file/preview"/></Field>
</el-row> </el-row>
<el-row> <el-row>
<Field label="短视频" v-if="nowPropaganda==1"><fileUpload v-model="form.productVideoPath" prePath="/file/fileupload"/></Field> <Field label="短视频" v-if="nowPropaganda==1"><fileUpload v-model="form.productVideoPath" :fileType="[ 'mp4', 'avi']" prePath="/file/fileupload"/></Field>
</el-row> </el-row>
<el-row> <el-row>
<Field label="产品简介" prop="productIntroduction" v-model="form.productIntroduction" type="textarea" placeholder="请输入产品简介"/> <Field label="产品简介" prop="productIntroduction" v-model="form.productIntroduction" type="textarea" placeholder="请输入产品简介"/>
...@@ -170,6 +170,24 @@ ...@@ -170,6 +170,24 @@
// 选中短视频 // 选中短视频
this.form.productPicPath = '' this.form.productPicPath = ''
} }
// 检查常见问题list中问题不能为空
if(this.productQuestionList && this.productQuestionList.length>0){
let isNull = false
this.productQuestionList.forEach((item)=>{
if (!item.question) {
isNull = true
}
})
if(isNull){
this.$confirm('常见问题项的问题标题不能为空', '提示', {
confirmButtonText: '确定',
type: 'warning',
showCancelButton: false, //是否显示取消按钮
showClose: false, //是否显示关闭按钮
})
return;
}
}
this.submitForm() this.submitForm()
}, },
// 修改宣传形式 // 修改宣传形式
......
...@@ -8,14 +8,14 @@ ...@@ -8,14 +8,14 @@
size="50%"> size="50%">
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row> <el-row>
<Field :span="20" label="员工姓名" prop="name" v-model="form.name" placeholder="请输入员工姓名"/> <Field :span="20" label="员工姓名" prop="name" v-model="form.name" placeholder="请输入员工姓名"/>
<Field :span="20" label="所属公司" prop="companyIds" v-model="form.companyIds" :multiple="true" type="select" :enum-data="dict.companyIds" placeholder="请输入所属公司"/> <Field :span="20" label="所属公司" prop="companyIds" v-model="form.companyIds" :multiple="true" type="select" :enum-data="dict.companyIds" placeholder="请输入所属公司"/>
<Field :span="20" label="职位" prop="positionId" v-model="form.positionId" type="select" :enum-data="dict.positionId" placeholder="请输入职位ID"/> <Field :span="20" label="职位" prop="positionId" v-model="form.positionId" type="select" :enum-data="dict.positionId" placeholder="请输入职位ID"/>
<Field :span="20" label="联系电话" prop="phoneNumber" v-model="form.phoneNumber" placeholder="请输入联系电话"/> <Field :span="20" label="联系电话" prop="phoneNumber" v-model="form.phoneNumber" placeholder="请输入联系电话"/>
<Field :span="20" label="员工状态" type="select" prop="staffStatus" v-model="form.staffStatus" :enum-data="dict.staffStatus" placeholder="请输入员工状态"/>
<Field :span="20" label="头像" prop="photoPath" placeholder="请输入照片"><imageUpload v-model="form.photoPath" prePath="/file/preview"/> </Field> <Field :span="20" label="头像" prop="photoPath" placeholder="请输入照片"><imageUpload v-model="form.photoPath" prePath="/file/preview"/> </Field>
<Field :span="20" label="邮件地址" prop="email" v-model="form.email" placeholder="请输入邮件地址"/> <Field :span="20" label="邮件地址" prop="email" v-model="form.email" placeholder="请输入邮件地址"/>
<Field :span="20" label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注"/>
<Field :span="20" label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注"/>
</el-row> </el-row>
......
...@@ -87,12 +87,16 @@ ...@@ -87,12 +87,16 @@
{label: "最近更新时间", prop: "updateTime", formatter: this.formatterDate}, {label: "最近更新时间", prop: "updateTime", formatter: this.formatterDate},
{label: "更新人员", prop: "updateUserId", formatter: this.formatter}, {label: "更新人员", prop: "updateUserId", formatter: this.formatter},
{label: "员工状态", prop: "staffStatus",formatter: this.formatter},
{ {
label: "操作", label: "操作",
width: 240, width: 240,
formatter: row => { formatter: row => {
return ( return (
<table-buttons noAdd row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} /> <div>
<span> </span>
<table-buttons noAdd noView row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
</div>
); );
} }
} }
......
...@@ -24,6 +24,14 @@ module.exports = { ...@@ -24,6 +24,14 @@ module.exports = {
secure: false, secure: false,
cookieDomainRewrite: "localhost", cookieDomainRewrite: "localhost",
}, },
"/file": {
// target: "http://test.office.com:11073",
// target: 'http://8.136.255.30:11078',
target: 'http://192.168.0.98:11086',
changeOrigin: true,
secure: false,
cookieDomainRewrite: "localhost",
},
}, },
}, },
}; };
package com.mortals.xhx.busiz.applets.req;
import com.mortals.xhx.busiz.BaseReq;
import lombok.Data;
/**
* @author ZYW
* @date 2023-10-13 11:19
*/
@Data
public class FeedbackReq extends BaseReq {
private long id;
}
package com.mortals.xhx.busiz.applets.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.busiz.applets.req.FeedbackReq;
import com.mortals.xhx.busiz.applets.req.NewsReq;
import com.mortals.xhx.busiz.applets.req.StaffReq;
import com.mortals.xhx.busiz.applets.rsp.NewsListInfo;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.feedback.model.FeedbackEntity;
import com.mortals.xhx.module.feedback.model.FeedbackQuery;
import com.mortals.xhx.module.feedback.service.FeedbackService;
import com.mortals.xhx.module.news.model.NewsEntity;
import com.mortals.xhx.module.news.model.NewsQuery;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.StaffRecordEntity;
import com.mortals.xhx.module.staff.service.StaffRecordService;
import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static com.mortals.framework.ap.SysConstains.PAGEINFO_KEY;
import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED;
import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED_CONTENT;
/**
* @author ZYW
* @date 2023-10-09 9:39
*/
@RestController
@Slf4j
@RequestMapping("/api/v1/feedback")
public class FeedbackApiController extends AbstractBaseController<FeedbackReq>{
@Autowired
private FeedbackService feedbackService;
/**
* 新闻列表
*/
@PostMapping(value = "feedbackList")
public Rest<Object> feedbackList(FeedbackReq feedbackReq) {
String busiDesc = "反馈列表";
Rest<Object> rest = Rest.ok();
Map<String, Object> model = new HashMap<>();
Context context = this.getContext();
if (ObjectUtils.isEmpty(context) || ObjectUtils.isEmpty(context.getUser())) {
throw new AppException(ERROR_TOKEN_EXPIRED, ERROR_TOKEN_EXPIRED_CONTENT);
}
try {
PageInfo pageInfo = buildPageInfo(feedbackReq);
FeedbackQuery query = new FeedbackQuery();
if(!ObjectUtils.isEmpty(feedbackReq.getId())){
query.setId(feedbackReq.getId());
}
query.setOrderColList(Arrays.asList(new OrderCol("createTime", OrderCol.DESCENDING)));
Result<FeedbackEntity> result = feedbackService.find(query, pageInfo, context);
List<FeedbackEntity> collect = result.getList().stream().map(item -> {
FeedbackEntity feedbackEntity = new FeedbackEntity();
BeanUtils.copyProperties(item, feedbackEntity, BeanUtil.getNullPropertyNames(item));
return feedbackEntity;
}).collect(Collectors.toList());
model.put(KEY_RESULT_DATA, collect);
model.put(PAGEINFO_KEY, result.getPageInfo());
super.parsePageInfo(model, result.getPageInfo());
rest.setData(model);
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error(busiDesc, e);
rest = Rest.fail(super.convertException(e));
}
return rest;
}
}
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