Commit 8112ae12 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 09d52492 7138d154
...@@ -35,13 +35,13 @@ ...@@ -35,13 +35,13 @@
</ul> </ul>
</div> </div>
<div class="controllBar"> <!-- <div class="controllBar">
<el-badge :value="12" class="item"> <el-badge :value="12" class="item">
<i class="el-icon-bell" style="font-size: 15px;margin-right: 10px"> <i class="el-icon-bell" style="font-size: 15px;margin-right: 10px">
消息</i 消息</i
> >
</el-badge> </el-badge>
</div> </div> -->
<div class="controllBar" @click="returnHome"> <div class="controllBar" @click="returnHome">
<i class="el-icon-s-home" style="font-size: 15px;margin-right: 10px"> <i class="el-icon-s-home" style="font-size: 15px;margin-right: 10px">
首页</i 首页</i
......
...@@ -39,6 +39,16 @@ ...@@ -39,6 +39,16 @@
>核查</el-button >核查</el-button
> >
<span>&nbsp;</span> <span>&nbsp;</span>
<el-button
v-if="chuli"
type="text"
icon="el-icon-edit"
size="mini"
@click="$emit('edit', row)"
title="处理"
>处理</el-button
>
<span>&nbsp;</span>
<Confirm @confirm="$emit('del', row.id)" message="确定要删除该条记录吗?"> <Confirm @confirm="$emit('del', row.id)" message="确定要删除该条记录吗?">
<el-button <el-button
v-if="!noDel" v-if="!noDel"
...@@ -72,6 +82,10 @@ export default { ...@@ -72,6 +82,10 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
chuli: {
type: Boolean,
default: false,
},
switchBtn: { switchBtn: {
type: Boolean, type: Boolean,
default: false, default: false,
......
...@@ -260,11 +260,11 @@ export default { ...@@ -260,11 +260,11 @@ export default {
i.remark = i.field i.remark = i.field
i.questionType = formType(i.type) i.questionType = formType(i.type)
i.require = formatNum(i.$required) i.require = formatNum(i.$required)
i.content = i.info || '' i.content = i.title
if (formType(i.type) == 1 || formType(i.type) == 2) { if (formType(i.type) == 1 || formType(i.type) == 2) {
i.options.forEach(j => { i.options.forEach(j => {
j.content = j.value j.content = j.label
j.remark = j.label j.remark = j.value
}) })
} }
if (formType(i.type) == 1 || formType(i.type) == 2) { if (formType(i.type) == 1 || formType(i.type) == 2) {
......
...@@ -50,7 +50,9 @@ ...@@ -50,7 +50,9 @@
}}</el-col }}</el-col
> >
<el-col :span="9" <el-col :span="9"
>异常结果:{{ form.errorTime ? form.errorTime : "--" }}</el-col >异常结果:{{
form.errorResult ? form.errorResult : "--"
}}</el-col
> >
<el-col :span="5" <el-col :span="5"
>扣分方式:{{ form.subMethod ? form.subMethod : "--" }}</el-col >扣分方式:{{ form.subMethod ? form.subMethod : "--" }}</el-col
...@@ -81,7 +83,9 @@ ...@@ -81,7 +83,9 @@
>绩效规则:{{ form.ruleName ? form.ruleName : "--" }}</el-col >绩效规则:{{ form.ruleName ? form.ruleName : "--" }}</el-col
> >
<el-col :span="8" <el-col :span="8"
>加分/扣除分值:{{ form.score ? form.score : "--" }}</el-col >加分/扣除分值:<span style="color:#ff0000">{{
form.score ? form.score : "--"
}}</span></el-col
> >
</el-row> </el-row>
<el-row> <el-row>
...@@ -104,20 +108,78 @@ ...@@ -104,20 +108,78 @@
<div class="content"> <div class="content">
<el-row> <el-row>
<el-col :span="24" <el-col :span="24"
>申诉说明:{{ >申诉说明:{{ form.appealDesc ? form.appealDesc : "--" }}</el-col
form.appealDesc ? form.appealDesc : "--"
}}</el-col
> >
<el-col :span="24" <el-col :span="24"
>申诉时间:{{ form.appealTime ? form.appealTime : "--" }}</el-col >申诉时间:{{ form.appealTime ? form.appealTime : "--" }}</el-col
> >
<el-col :span="24" <el-col :span="24"
>申诉附件:{{ form.performAttendAppealFilesList ? form.performAttendAppealFilesList : "--" }}</el-col >申诉附件:
<span v-if="!form.performAttendAppealFilesList">
--
</span>
<div class="img_content" v-else>
<div
class="imgBox"
v-for="val in form.performAttendAppealFilesList"
:key="val.id"
@click="hanldeDownloadFile(val)"
>
<img src="../../../../assets/images/fileImg.png" alt="" />
{{ val.fileName }}
</div>
</div>
</el-col>
</el-row>
</div>
</div>
<div class="box" v-if="form.view == '查看' || form.processStatus == 2">
<div class="title">申诉结果</div>
<div class="content">
<el-row>
<el-col :span="8"
>申诉结果:{{
form.appealResult ? form.appealResult : "--"
}}</el-col
>
<el-col :span="8"
>处理人员:{{
form.updateUserId ? form.updateUserId : "--"
}}</el-col
>
<el-col :span="8"
>处理时间:{{ form.appealTime ? form.appealTime : "--" }}</el-col
>
</el-row>
<el-row>
<el-col :span="24"
>说明:{{ form.remark ? form.remark : "--" }}</el-col
> >
</el-row> </el-row>
</div> </div>
</div> </div>
<div class="box"></div> <div class="box" v-else>
<div class="title">申诉结果</div>
<div class="content">
<el-row>
<el-col :span="24">
<el-form-item label="申诉结果:">
<el-radio-group v-model="form.appealResult">
<el-radio :label="1">通过</el-radio>
<el-radio :label="2">不通过</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="说明:">
<el-input type="textarea" v-model="form.remark"></el-input>
</el-form-item>
</el-col>
</el-row>
</div>
</div>
<form-buttons <form-buttons
@submit="submitForm" @submit="submitForm"
v-if="pageInfo.type != 'view'" v-if="pageInfo.type != 'view'"
...@@ -393,6 +455,9 @@ ...@@ -393,6 +455,9 @@
<script> <script>
import form from "@/assets/mixins/formdialog"; import form from "@/assets/mixins/formdialog";
import { timestampToTime } from "@/assets/utils/dateFormat.js";
import { downloadFile } from "@/assets/utils/index";
export default { export default {
name: "PerformAttendAppealDetail", name: "PerformAttendAppealDetail",
mixins: [form], mixins: [form],
...@@ -433,6 +498,26 @@ export default { ...@@ -433,6 +498,26 @@ export default {
}, },
methods: { methods: {
// 下载附件
hanldeDownloadFile(val) {
console.log(val);
downloadFile(val.filePath, val.fileName);
},
picMatter(val) {
if (val || val !== "--") {
return (
<el-image
src={val.indexOf("http") == -1 ? this.baseUrl + val : val}
preview-src-list={
val.indexOf("http") == -1 ? this.baseUrl + val : val
}
style="width: 100px"
></el-image>
);
} else {
return val;
}
},
/** 绩效记录申诉附件信息序号 */ /** 绩效记录申诉附件信息序号 */
rowPerformAttendAppealFilesIndex({ row, rowIndex }) { rowPerformAttendAppealFilesIndex({ row, rowIndex }) {
row.index = rowIndex + 1; row.index = rowIndex + 1;
...@@ -472,9 +557,8 @@ export default { ...@@ -472,9 +557,8 @@ export default {
}, },
// 渲染前置处理 // 渲染前置处理
beforeRender(data) { beforeRender(data) {
if (data.entity.performAttendAppealFilesList) { if (data.performAttendAppealFilesList) {
this.performAttendAppealFilesList = this.performAttendAppealFilesList = data.performAttendAppealFilesList;
data.entity.performAttendAppealFilesList;
} }
return data; return data;
}, },
...@@ -482,10 +566,47 @@ export default { ...@@ -482,10 +566,47 @@ export default {
edit(row) { edit(row) {
this.reset(); this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
this.urls.currUrl = "perform/attend/appeal/edit"; // this.urls.currUrl = "/perform/attend/appeal/info";
this.getData(); // this.getData();
this.$get("/perform/attend/appeal/info", { id: row.id }).then((res) => {
if (res.code == 1) {
this.form = res.data;
} else {
this.reset();
}
for (let key in this.form) {
key == "actualAttendTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "attendanceDate"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "createTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "errorTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "updateTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "checkTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "reviewTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "appealTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "complainTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "happenTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "alarmTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: key == "alarmTime"
? (this.form[key] = timestampToTime(this.form[key], 6))
: "";
}
this.form.appealResult = "";
this.form.remark = "";
this.open = true;
});
this.pageInfo.type = "edit"; this.pageInfo.type = "edit";
this.title = "修改绩效记录申诉信息"; this.title = "处理绩效记录申诉信息";
}, },
/** 新增 */ /** 新增 */
add(row) { add(row) {
...@@ -501,6 +622,7 @@ export default { ...@@ -501,6 +622,7 @@ export default {
this.query = { id: row.id }; this.query = { id: row.id };
this.urls.currUrl = "perform/attend/appeal/view"; this.urls.currUrl = "perform/attend/appeal/view";
this.getData(); this.getData();
this.form.view = "查看";
this.pageInfo.type = "view"; this.pageInfo.type = "view";
this.title = "绩效记录申诉信息详细"; this.title = "绩效记录申诉信息详细";
}, },
...@@ -603,6 +725,27 @@ export default { ...@@ -603,6 +725,27 @@ export default {
/deep/.el-row { /deep/.el-row {
margin-bottom: 20px; margin-bottom: 20px;
} }
.img_content {
width: 100%;
height: auto;
display: flex;
flex-wrap: wrap;
padding: 10px 0 0 10px;
}
.imgBox {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 60px;
height: 80px;
cursor: pointer;
img {
width: 50px;
height: 50px;
margin-top: 10px;
}
}
} }
} }
} }
......
...@@ -13,8 +13,17 @@ ...@@ -13,8 +13,17 @@
<div class="content"> <div class="content">
<div class="search_box"> <div class="search_box">
<div class="search"> <div class="search">
<el-select v-model="dateValue" placeholder="请选择" style="margin: 0 10px;"> <el-select
<el-option v-for="item in optionsMonths" :key="item.value" :label="item.label" :value="item.value"> v-model="dateValue"
placeholder="请选择"
style="margin: 0 10px;"
>
<el-option
v-for="item in optionsMonths"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
<el-button type="primary">搜索</el-button> <el-button type="primary">搜索</el-button>
...@@ -23,17 +32,29 @@ ...@@ -23,17 +32,29 @@
<div class="data_box"> <div class="data_box">
<div class="top"> <div class="top">
<div class="box"> <div class="box">
<bar-charts :title="'申诉次数部门排名TOP20'" :id="'dept_20'" :legendName="'申诉次数'" <bar-charts
:styleObj="{ width: '800px', height: '360px' }" /> :title="'申诉次数部门排名TOP20'"
:id="'dept_20'"
:legendName="'申诉次数'"
:styleObj="{ width: '800px', height: '360px' }"
/>
</div> </div>
<div class="box"> <div class="box">
<bar-charts :title="'申诉次数个人排名TOP20'" :id="'person_20'" :legendName="'申诉次数'" <bar-charts
:styleObj="{ width: '800px', height: '360px' }" /> :title="'申诉次数个人排名TOP20'"
:id="'person_20'"
:legendName="'申诉次数'"
:styleObj="{ width: '800px', height: '360px' }"
/>
</div> </div>
</div> </div>
<div class="down"> <div class="down">
<bar-charts :title="'申诉次数规则排名TOP20'" :id="'rule_20'" :legendName="'申诉次数'" <bar-charts
:styleObj="{ width: '1800px', height: '320px' }" /> :title="'申诉次数规则排名TOP20'"
:id="'rule_20'"
:legendName="'申诉次数'"
:styleObj="{ width: '1800px', height: '320px' }"
/>
</div> </div>
</div> </div>
</div> </div>
...@@ -197,7 +218,7 @@ export default { ...@@ -197,7 +218,7 @@ export default {
{ {
label: "操作", label: "操作",
formatter: (row) => { formatter: (row) => {
return ( return row.processStatus == 2 ? (
<table-buttons <table-buttons
noAdd noAdd
noDel noDel
...@@ -207,74 +228,27 @@ export default { ...@@ -207,74 +228,27 @@ export default {
onView={this.toView} onView={this.toView}
onDel={this.toDel} onDel={this.toDel}
/> />
) : (
<table-buttons
noAdd
noDel
noView
noEdit
chuli
row={row}
onEdit={this.toEdit}
onView={this.toView}
onDel={this.toDel}
/>
); );
}, },
}, },
], ],
}, },
activeName: "1", activeName: "1",
optionsMonths: [ dateValue: "2023-01-00 00:00:00",
{
value: "2023-01-00 00:00:00",
label: "1月",
},
{
value: "2023-02-00 00:00:00",
label: "2月",
},
{
value: "2023-03-00 00:00:00",
label: "3月",
},
{
value: "2023-04-00 00:00:00",
label: "4月",
},
{
value: "2023-05-00 00:00:00",
label: "5月",
},
{
value: "2023-06-00 00:00:00",
label: "6月",
},
{
value: "2023-07-00 00:00:00",
label: "7月",
},
{
value: "2023-08-00 00:00:00",
label: "8月",
},
{
value: "2023-09-00 00:00:00",
label: "9月",
},
{
value: "2023-10-00 00:00:00",
label: "10月",
},
{
value: "2023-11-00 00:00:00",
label: "11月",
},
{
value: "2023-12-00 00:00:00",
label: "12月",
},
],
dateValue: '2023-01-00 00:00:00',
}; };
}, },
mounted() {
// this.$post('/perform/attend/appeal/stat', { appealTimeStart: this.dateValue }).then(res => {
// console.log(res)
// })
},
methods: {
}
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
......
...@@ -24,7 +24,12 @@ ...@@ -24,7 +24,12 @@
<h3>规则管理</h3> <h3>规则管理</h3>
<div class="search_box"> <div class="search_box">
<div class="left_search"> <div class="left_search">
<el-button type="primary" style="margin:20px 0" @click="addRules"> <el-button
type="primary"
style="margin:20px 0"
@click="addRules"
v-if="cateObj && cateObj.type"
>
+ 新增规则</el-button + 新增规则</el-button
> >
<el-switch <el-switch
......
...@@ -156,6 +156,7 @@ export default { ...@@ -156,6 +156,7 @@ export default {
this.reset(); this.reset();
// this.urls.currUrl = "perform/rules/add"; // this.urls.currUrl = "perform/rules/add";
// this.getData(); // this.getData();
this.form.type = obj.type;
this.dict = { this.dict = {
subAddType: { subAddType: {
"1": "增加", "1": "增加",
...@@ -222,7 +223,6 @@ export default { ...@@ -222,7 +223,6 @@ export default {
assoOwner: "", assoOwner: "",
ownerScore: 0.0, ownerScore: 0.0,
remark: "", remark: "",
type: "",
}; };
this.resetForm("form"); this.resetForm("form");
}, },
......
package com.mortals.xhx.module.feedback.dao; package com.mortals.xhx.module.feedback.dao;
import com.mortals.framework.dao.ICRUDDao; import com.mortals.framework.dao.ICRUDDao;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.module.feedback.model.FeedbackEntity; import com.mortals.xhx.module.feedback.model.FeedbackEntity;
import com.mortals.xhx.module.feedback.model.vo.FeedbackStaffInfoVo;
import com.mortals.xhx.module.feedback.model.vo.OptionSummaryVo;
import com.mortals.xhx.module.feedback.model.vo.QuestionAnswerVo;
import java.util.List; import java.util.List;
/** /**
* 绩效反馈记录信息Dao * 绩效反馈记录信息Dao
...@@ -13,5 +19,25 @@ import java.util.List; ...@@ -13,5 +19,25 @@ import java.util.List;
public interface FeedbackDao extends ICRUDDao<FeedbackEntity,Long>{ public interface FeedbackDao extends ICRUDDao<FeedbackEntity,Long>{
/***
* 问卷反馈人员列表
* @param feedbackId
* @return
*/
List<FeedbackStaffInfoVo> getFeedbackStaffList(Long feedbackId);
/**
* 问卷单选多选反馈统计
* @param feedbackId
* @return
*/
List<OptionSummaryVo> getOptionSummaryList(Long feedbackId);
/**
* 问卷问题反馈详情
* @param questionId
* @param pageInfo
* @return
*/
Result<QuestionAnswerVo> getQuestionAnswerList(Long questionId, PageInfo pageInfo);
} }
package com.mortals.xhx.module.feedback.dao.ibatis; package com.mortals.xhx.module.feedback.dao.ibatis;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.ParamDto;
import com.mortals.framework.model.Result;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.module.feedback.model.vo.FeedbackStaffInfoVo;
import com.mortals.xhx.module.feedback.model.vo.OptionSummaryVo;
import com.mortals.xhx.module.feedback.model.vo.QuestionAnswerVo;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.feedback.dao.FeedbackDao; import com.mortals.xhx.module.feedback.dao.FeedbackDao;
import com.mortals.xhx.module.feedback.model.FeedbackEntity; import com.mortals.xhx.module.feedback.model.FeedbackEntity;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis; import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List; import java.util.List;
...@@ -17,5 +27,43 @@ import java.util.List; ...@@ -17,5 +27,43 @@ import java.util.List;
public class FeedbackDaoImpl extends BaseCRUDDaoMybatis<FeedbackEntity,Long> implements FeedbackDao { public class FeedbackDaoImpl extends BaseCRUDDaoMybatis<FeedbackEntity,Long> implements FeedbackDao {
@Override
public List<FeedbackStaffInfoVo> getFeedbackStaffList(Long feedbackId) {
return this.getSqlSession().selectList(this.getSqlId("getFeedbackStaffList"), feedbackId);
}
@Override
public List<OptionSummaryVo> getOptionSummaryList(Long feedbackId) {
return this.getSqlSession().selectList(this.getSqlId("getOptionSummaryList"), feedbackId);
}
@Override
public Result<QuestionAnswerVo> getQuestionAnswerList(Long questionId, PageInfo pageInfo) {
String sqlId = "getQuestionAnswerList";
Result result = new Result();
List list = null;
int count = this.getQuestionAnswerListCount(questionId);
if (count == 0) {
list = new ArrayList();
} else if (pageInfo.getPrePageResult() == -1) {
list = this.getSqlSession().selectList(this.getSqlId(sqlId), questionId);
} else {
if (pageInfo.getBeginIndex() > count) {
pageInfo.setCurrPage(1);
}
RowBounds rowBounds = new RowBounds(pageInfo.getBeginIndex(), pageInfo.getPrePageResult());
list = this.getSqlSession().selectList(this.getSqlId(sqlId), questionId, rowBounds);
}
pageInfo.setTotalResult(count);
result.setPageInfo(pageInfo);
result.setList((List)list);
return result;
}
private int getQuestionAnswerListCount(Long questionId) {
return (Integer)this.getSqlSession().selectOne(this.getSqlId("getQuestionAnswerListCount"), questionId);
}
} }
package com.mortals.xhx.module.feedback.model.vo;
import lombok.Data;
import java.util.Date;
/**
* 问卷反馈人员信息视图
*/
@Data
public class FeedbackStaffInfoVo {
/**
* 反馈问卷id号
*/
private Long feedbackId;
/**
* 用户id
*/
private Long staffId;
/**
* 员工姓名
*/
private String name;
/**
* 所属部门Id
*/
private Long deptId;
/**
* 所属部门名称
*/
private String deptName;
/**
* 职位名称
*/
private String positionName;
/**
* 反馈状态,0:未反馈,1:已反馈
*/
private Integer backStatus;
/**
* 反馈时间
*/
private Date backTime;
}
...@@ -18,4 +18,5 @@ public class FeedbackVo extends BaseEntityLong { ...@@ -18,4 +18,5 @@ public class FeedbackVo extends BaseEntityLong {
private List<Long> staffList; private List<Long> staffList;
private Long questionId;
} }
\ No newline at end of file
package com.mortals.xhx.module.feedback.model.vo;
import lombok.Data;
/**
* 问卷单选多选反馈统计视图
*/
@Data
public class OptionSummaryVo {
/**
* 问题id号
*/
private Long questionId;
/**
* 反馈问卷id号
*/
private Long feedbackId;
/**
* 问题内容
*/
private String question;
/**
* 问题类型 (1.单项选择,2.多项选择,3.文本框,4.多项文本框,5.文字,6.上传附件)
*/
private Integer questionType;
/**
* 选项id号
*/
private Long optionId;
/**
* 选项内容
*/
private String optionContent;
/**
* 选项统计
*/
private Integer optionCount;
}
package com.mortals.xhx.module.feedback.model.vo;
import lombok.Data;
import java.util.Date;
/**
* 问卷问题反馈详情视图
*/
@Data
public class QuestionAnswerVo {
/**
* 问题id号
*/
private Long questionId;
/**
* 反馈问卷id号
*/
private Long feedbackId;
/**
* 问题内容
*/
private String question;
/**
* 问题类型 (1.单项选择,2.多项选择,3.文本框,4.多项文本框,5.文字,6.上传附件)
*/
private Integer questionType;
/**
* 用户id
*/
private Long staffId;
/**
* 员工姓名
*/
private String name;
/**
* 回答内容
*/
private String answer;
/**
* 反馈时间
*/
private Date backTime;
}
package com.mortals.xhx.module.feedback.service; package com.mortals.xhx.module.feedback.service;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICRUDService; import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.feedback.model.FeedbackEntity; import com.mortals.xhx.module.feedback.model.FeedbackEntity;
import com.mortals.xhx.module.feedback.dao.FeedbackDao; import com.mortals.xhx.module.feedback.dao.FeedbackDao;
import com.mortals.xhx.module.feedback.model.vo.FeedbackStaffInfoVo;
import com.mortals.xhx.module.feedback.model.vo.OptionSummaryVo;
import com.mortals.xhx.module.feedback.model.vo.QuestionAnswerVo;
import java.util.List;
/** /**
* FeedbackService * FeedbackService
* *
...@@ -13,4 +22,26 @@ import com.mortals.xhx.module.feedback.dao.FeedbackDao; ...@@ -13,4 +22,26 @@ import com.mortals.xhx.module.feedback.dao.FeedbackDao;
public interface FeedbackService extends ICRUDService<FeedbackEntity,Long>{ public interface FeedbackService extends ICRUDService<FeedbackEntity,Long>{
FeedbackDao getDao(); FeedbackDao getDao();
/***
* 问卷反馈人员列表
* @param feedbackId
* @return
*/
List<FeedbackStaffInfoVo> getFeedbackStaffList(Long feedbackId) throws AppException;
/**
* 问卷单选多选反馈统计
* @param feedbackId
* @return
*/
List<OptionSummaryVo> getOptionSummaryList(Long feedbackId) throws AppException;
/**
* 问卷问题反馈详情
* @param questionId
* @param pageInfo
* @return
*/
Result<QuestionAnswerVo> getQuestionAnswerList(Long questionId, PageInfo pageInfo) throws AppException;
} }
\ No newline at end of file
...@@ -35,8 +35,8 @@ public class FeedbackQuestionServiceImpl extends AbstractCRUDServiceImpl<Feedbac ...@@ -35,8 +35,8 @@ public class FeedbackQuestionServiceImpl extends AbstractCRUDServiceImpl<Feedbac
item.setQuestionId(entity.getId()); item.setQuestionId(entity.getId());
item.setCreateUserId(this.getContextUserId(context)); item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date()); item.setCreateTime(new Date());
feedbackOptionService.save(item);
}).count(); }).count();
feedbackOptionService.save(entity.getFeedbackOptionList());
} }
super.saveAfter(entity, context); super.saveAfter(entity, context);
} }
......
package com.mortals.xhx.module.feedback.service.impl; package com.mortals.xhx.module.feedback.service.impl;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.module.feedback.model.*; import com.mortals.xhx.module.feedback.model.*;
import com.mortals.xhx.module.feedback.model.vo.FeedbackStaffInfoVo;
import com.mortals.xhx.module.feedback.model.vo.OptionSummaryVo;
import com.mortals.xhx.module.feedback.model.vo.QuestionAnswerVo;
import com.mortals.xhx.module.feedback.service.FeedbackStaffService; import com.mortals.xhx.module.feedback.service.FeedbackStaffService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
...@@ -103,4 +108,31 @@ public class FeedbackServiceImpl extends AbstractCRUDServiceImpl<FeedbackDao, Fe ...@@ -103,4 +108,31 @@ public class FeedbackServiceImpl extends AbstractCRUDServiceImpl<FeedbackDao, Fe
feedbackStaffService.removeList(staffEntityList,context); feedbackStaffService.removeList(staffEntityList,context);
super.removeAfter(ids, context, result); super.removeAfter(ids, context, result);
} }
@Override
public List<FeedbackStaffInfoVo> getFeedbackStaffList(Long feedbackId) throws AppException {
if(feedbackId==null){
throw new AppException("绩效反馈记录Id不能为空");
}
return dao.getFeedbackStaffList(feedbackId);
}
@Override
public List<OptionSummaryVo> getOptionSummaryList(Long feedbackId) throws AppException {
if(feedbackId==null){
throw new AppException("绩效反馈记录Id不能为空");
}
return dao.getOptionSummaryList(feedbackId);
}
@Override
public Result<QuestionAnswerVo> getQuestionAnswerList(Long questionId, PageInfo pageInfo) throws AppException {
if(questionId == null){
throw new AppException("绩效反馈记录问题Id不能为空");
}
if(pageInfo==null){
pageInfo = new PageInfo();
}
return dao.getQuestionAnswerList(questionId,pageInfo);
}
} }
\ No newline at end of file
package com.mortals.xhx.module.feedback.web; package com.mortals.xhx.module.feedback.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
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.module.feedback.model.FeedbackAnswerEntity;
import com.mortals.xhx.module.feedback.model.vo.FeedbackStaffInfoVo;
import com.mortals.xhx.module.feedback.model.vo.OptionSummaryVo;
import com.mortals.xhx.module.feedback.model.vo.QuestionAnswerVo;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -42,10 +52,133 @@ public class FeedbackController extends BaseCRUDJsonBodyMappingController<Feedba ...@@ -42,10 +52,133 @@ public class FeedbackController extends BaseCRUDJsonBodyMappingController<Feedba
@Override @Override
protected void init(Map<String, Object> model, Context context) { protected void init(Map<String, Object> model, Context context) {
Map<String,String> backStatus = new HashMap<>();
backStatus.put("0","未反馈");
backStatus.put("1","已反馈");
this.addDict(model, "processStatus", paramService.getParamBySecondOrganize("Feedback","processStatus")); this.addDict(model, "processStatus", paramService.getParamBySecondOrganize("Feedback","processStatus"));
this.addDict(model, "weblink", paramService.getParamBySecondOrganize("Feedback","weblink")); this.addDict(model, "weblink", paramService.getParamBySecondOrganize("Feedback","weblink"));
this.addDict(model, "backStatus", backStatus);
super.init(model, context); super.init(model, context);
} }
/**
* 查询问卷反馈人员列表
* @param feedbackId
* @return
*/
@RequestMapping(value = {"getStaffList"},method = {RequestMethod.POST, RequestMethod.GET})
@UnAuth
public Rest<Object> getFeedbackStaffList(Long feedbackId) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "查询问卷反馈人员列表";
int code=1;
try {
List<FeedbackStaffInfoVo> result = this.getService().getFeedbackStaffList(feedbackId);
if(CollectionUtils.isNotEmpty(result)) {
Map<Integer, List<FeedbackStaffInfoVo>> groupMap = result.stream().collect(Collectors.groupingBy(FeedbackStaffInfoVo::getBackStatus));
if(groupMap.containsKey(1)) {
model.put("feedBack", groupMap.get(1).size());
}else {
model.put("feedBack", 0);
}
if(groupMap.containsKey(0)) {
model.put("notBack", groupMap.get(0).size());
}else {
model.put("notBack", 0);
}
}else {
model.put("feedBack", 0);
model.put("notBack", 0);
}
model.put("data", result);
model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
this.recordSysLog(this.request, busiDesc + " 【成功】");
}
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
this.init(model, context);
ret.setCode(code);
ret.setData(model);
ret.setDict(model.get("dict"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
/**
* 问卷单选多选反馈统计
* @param feedbackId
* @return
*/
@RequestMapping(value = {"getOptionSummaryList"},method = {RequestMethod.POST, RequestMethod.GET})
@UnAuth
public Rest<Object> getOptionSummaryList(Long feedbackId) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "查询问卷单选多选反馈统计";
int code=1;
try {
List<OptionSummaryVo> result = this.getService().getOptionSummaryList(feedbackId);
model.put("data", result);
model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
this.recordSysLog(this.request, busiDesc + " 【成功】");
}
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
this.init(model, context);
ret.setCode(code);
ret.setData(model);
ret.setDict(model.get("dict"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
/**
* 问卷问题反馈详情
* @param query
* @return
*/
@PostMapping({"getQuestionAnswerList"})
@UnAuth
public Rest<Object> getQuestionAnswerList(@RequestBody FeedbackEntity query) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "查询问卷问题反馈详情";
int code=1;
try {
PageInfo pageInfo = this.buildPageInfo(query);
Result<QuestionAnswerVo> result = this.getService().getQuestionAnswerList(query.getQuestionId(), pageInfo);
model.put("data", result.getList());
model.put("pageInfo", result.getPageInfo());
this.parsePageInfo(model, result.getPageInfo());
code = this.doListAfter(query, (Map)model, context);
model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
this.recordSysLog(this.request, busiDesc + " 【成功】");
}
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
this.init(model, context);
ret.setCode(code);
ret.setData(model);
ret.setDict(model.get("dict"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
} }
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.feedback.dao.ibatis.FeedbackDaoImpl">
<!-- 问卷反馈人员列表 -->
<select id="getFeedbackStaffList" parameterType="long" resultType="com.mortals.xhx.module.feedback.model.vo.FeedbackStaffInfoVo">
SELECT
s.feedbackId,
s.staffId,
s1.`name`,
s1.deptId,
s1.deptName,
s1.positionName,
CASE IFNULL(a.id, 0) WHEN 0 THEN 0 ELSE 1 END AS backStatus,
MAX(a.createTime) AS backTime
FROM
mortals_xhx_feedback_staff s
LEFT JOIN mortals_xhx_feedback_answer a ON s.staffId = a.staffId AND s.feedbackId = a.feedbackId
LEFT JOIN mortals_xhx_staff s1 ON s.staffId = s1.id
WHERE
s.feedbackId = #{feedbackId}
GROUP BY
s.staffId;
</select>
<!-- 问卷单选多选反馈统计 -->
<select id="getOptionSummaryList" parameterType="long" resultType="com.mortals.xhx.module.feedback.model.vo.OptionSummaryVo">
SELECT
q.id AS questionId,
q.feedbackId,
q.content AS question,
q.questionType,
o.optionId,
o.optionContent,
count(o.id) optionCount
FROM
mortals_xhx_feedback_question q,
mortals_xhx_feedback_answer a,
mortals_xhx_feedback_answer_option o
WHERE
q.id = a.questionId
AND q.feedbackId = a.feedbackId
AND a.id = o.answerId
AND (q.questionType = 1 OR q.questionType = 2)
AND q.feedbackId = #{feedbackId}
GROUP BY
q.id,
o.optionId;
</select>
<!-- 问卷问题反馈详情 -->
<select id="getQuestionAnswerList" parameterType="long" resultType="com.mortals.xhx.module.feedback.model.vo.QuestionAnswerVo">
SELECT
q.id AS questionId,
q.feedbackId,
q.content AS question,
q.questionType,
a.staffId,
s.`name`,
a.content AS answer,
a.createTime AS backTime
FROM
mortals_xhx_feedback_question q,
mortals_xhx_feedback_answer a,
mortals_xhx_staff s
WHERE
q.id = a.questionId
AND q.feedbackId = a.feedbackId
AND a.staffId = s.id
AND q.questionType != 1
AND q.questionType != 2
AND q.id = #{questionId}
</select>
<!-- 获取 -->
<select id="getQuestionAnswerListCount" parameterType="long" resultType="int">
select count(1)
from
(
SELECT
q.id AS questionId,
q.feedbackId,
q.content AS question,
q.questionType,
a.staffId,
s.`name`,
a.content AS answer,
a.createTime AS backTime
FROM
mortals_xhx_feedback_question q,
mortals_xhx_feedback_answer a,
mortals_xhx_staff s
WHERE
q.id = a.questionId
AND q.feedbackId = a.feedbackId
AND a.staffId = s.id
AND q.questionType != 1
AND q.questionType != 2
AND q.id = #{questionId}
) as a
</select>
</mapper>
\ No newline at end of file
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