Commit 674566a8 authored by 王启林's avatar 王启林
parents 4631ae09 edbbb9ac
...@@ -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
......
...@@ -5,17 +5,17 @@ ...@@ -5,17 +5,17 @@
<el-col :span="6" :xs="12"> <el-col :span="6" :xs="12">
<el-card> <el-card>
<div class="data_left"> <div class="data_left">
<div class="title">今日数据洞察</div> <div class="title" style="margin-bottom:40px">今日数据洞察</div>
<div class="cell1"> <div class="cell1">
<div class="title">人事数据</div> <div class="title">人事数据</div>
<div class="datas flex flex-align-center flex-pack-justify flex_warp"> <div class="datas flex flex-align-center flex-pack-justify flex_warp">
<div class="item"> <div class="item">
<div>总人数</div> <div>总人数</div>
<div>999</div> <div>{{homeStat.totalPersonNum}}</div>
</div> </div>
<div class="item"> <div class="item">
<div>部门人数</div> <div>部门人数</div>
<div>20</div> <div>{{homeStat.totalDeptNum}}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -24,15 +24,27 @@ ...@@ -24,15 +24,27 @@
<div class="datas flex flex-align-center flex-pack-justify flex_warp"> <div class="datas flex flex-align-center flex-pack-justify flex_warp">
<div class="item"> <div class="item">
<div>打卡人数</div> <div>打卡人数</div>
<div>999</div> <div>{{homeStat.attendPersonNum}}</div>
</div> </div>
<div class="item"> <div class="item">
<div>出勤率</div> <div>出勤率</div>
<div>20</div> <div>{{homeStat.attendRadio}}%</div>
</div> </div>
<div class="item"> <div class="item">
<div>请假人数</div> <div>请假人数</div>
<div>20</div> <div>{{homeStat.levealPersonNum}}</div>
</div>
<div class="item">
<div>迟到人数</div>
<div>{{homeStat.latePersonNum}}</div>
</div>
<div class="item">
<div>早退人数</div>
<div>{{homeStat.leftEarlyPersonNum}}</div>
</div>
<div class="item">
<div>缺卡人数</div>
<div>{{homeStat.missCardPersonNum}}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -48,11 +60,12 @@ ...@@ -48,11 +60,12 @@
创新性与技术性的重要支撑以及效能性与发展性的不懈追求 创新性与技术性的重要支撑以及效能性与发展性的不懈追求
</div> </div>
<div class="selectBars flex flex-align-center flex-pack-justify flex_warp"> <div class="selectBars flex flex-align-center flex-pack-justify flex_warp">
<div class="Bar_item" v-for="(item,index) in barList" :key="index" @click="tabChildren(item.barName)"> <div class="Bar_item" v-for="(item, index) in barList" :key="index"
@click="tabChildren(item.barName)">
<div class="icon"> <div class="icon">
<img :src="item.icon"> <img :src="item.icon">
</div> </div>
<div class="barnam">{{item.barName}}</div> <div class="barnam">{{ item.barName }}</div>
<div class="des" v-html="item.desc"></div> <div class="des" v-html="item.desc"></div>
</div> </div>
</div> </div>
...@@ -73,77 +86,89 @@ export default { ...@@ -73,77 +86,89 @@ export default {
return this.mapMenu(this.userData.barList) return this.mapMenu(this.userData.barList)
} }
}, },
data(){ data() {
return{ return {
barList:[ // 数据洞察
homeStat:{
totalPersonNum:0,//总人数
totalDeptNum:0,//部门数
attendPersonNum:0,//考勤人数
attendRadio:0,//出勤率
levealPersonNum:0,//请假人数
latePersonNum:0,//迟到人数
leftEarlyPersonNum:0,//早退人数
missCardPersonNum:0,//缺卡人数
},
barList: [
{ {
icon:require('@/assets/images/u148.png'), icon: require('@/assets/images/u148.png'),
barName:'智能人事', barName: '智能人事',
desc:'提供包括组织管理、职位管理、人事管理、人事<br>统计报表等相关功能', desc: '提供包括组织管理、职位管理、人事管理、人事<br>统计报表等相关功能',
navList:[] navList: []
}, },
{ {
icon:require('@/assets/images/u153.png'), icon: require('@/assets/images/u153.png'),
barName:'考勤打卡', barName: '考勤打卡',
desc:'提供包括组织管理、职位管理、人事管理、人事<br>统计报表等相关功能', desc: '提供包括组织管理、职位管理、人事管理、人事<br>统计报表等相关功能',
navList:[] navList: []
}, },
{ {
icon:require('@/assets/images/u158.png'), icon: require('@/assets/images/u158.png'),
barName:'绩效管理', barName: '绩效管理',
desc:'根据部门/个人承担的目标和任务完成情况以及工作<br>评价结果、加减分纪实现考核结果自动生成。', desc: '根据部门/个人承担的目标和任务完成情况以及工作<br>评价结果、加减分纪实现考核结果自动生成。',
navList:[] navList: []
}, },
{ {
icon:require('@/assets/images/u167.png'), icon: require('@/assets/images/u167.png'),
barName:'OA审批', barName: 'OA审批',
desc:'无纸化审批流程,轻松完成打卡请假、移动审批等<br>操作,审批资料查找方便', desc: '无纸化审批流程,轻松完成打卡请假、移动审批等<br>操作,审批资料查找方便',
navList:[] navList: []
}, },
{ {
icon:require('@/assets/images/u172.png'), icon: require('@/assets/images/u172.png'),
barName:'数据分析', barName: '数据分析',
desc:'完整团队经营状态的数字化,人财物事数据分析<br>展示,为管理提供智能决策依据', desc: '完整团队经营状态的数字化,人财物事数据分析<br>展示,为管理提供智能决策依据',
navList:[] navList: []
}, },
{ {
icon:require('@/assets/images/u177.png'), icon: require('@/assets/images/u177.png'),
barName:'系统设置', barName: '系统设置',
desc:'提供包括RBAC用户-角色-权限管理、版本管理、<br>操作及登录日志管理等功能', desc: '提供包括RBAC用户-角色-权限管理、版本管理、<br>操作及登录日志管理等功能',
navList:[] navList: []
} }
] ]
} }
}, },
created(){ created() {
this.$store.commit('setHeadBar',[]) this.$store.commit('setHeadBar', [])
this.$store.commit("setCurrentParentName",'') this.$store.commit("setCurrentParentName", '')
this.$store.commit('setCurrentThirdArr',[]) this.$store.commit('setCurrentThirdArr', [])
this.$store.commit('setCurrentSecondPath','') this.$store.commit('setCurrentSecondPath', '')
this.$store.commit('setThirdPath','') this.$store.commit('setThirdPath', '')
this.homeNum()
}, },
methods:{ methods: {
tabChildren(name){ tabChildren(name) {
console.log("name:"+name) console.log("name:" + name)
this.$store.commit("setCurrentParentName",name)//存储选择路由 this.$store.commit("setCurrentParentName", name)//存储选择路由
let result = this.menu.find(item => item.name === name) let result = this.menu.find(item => item.name === name)
this.$store.commit('setHeadBar',result) this.$store.commit('setHeadBar', result)
console.log("result:",result) console.log("result:", result)
// 路由跳转 // 路由跳转
if(result.children.length>0){ if (result.children.length > 0) {
this.$store.commit('setCurrentThirdArr',result.children[0].children) this.$store.commit('setCurrentThirdArr', result.children[0].children)
this.$store.commit('setCurrentSecondPath',result.children[0].path) this.$store.commit('setCurrentSecondPath', result.children[0].path)
this.$store.commit('setThirdPath',result.children[0].path) this.$store.commit('setThirdPath', result.children[0].path)
this.$router.push({path:result.children[0].path}) this.$router.push({ path: result.children[0].path })
}else{ } else {
this.$message.error('暂未完成添加'); this.$message.error('暂未完成添加');
} }
}, },
mapMenu(arr){ mapMenu(arr) {
if(arr.length === 0) return [] if (arr.length === 0) return []
let result = arr.map(item => { let result = arr.map(item => {
const url = item.url const url = item.url
? item.url ? item.url
...@@ -155,96 +180,126 @@ export default { ...@@ -155,96 +180,126 @@ export default {
path: url, path: url,
id: item.id, id: item.id,
icon: item.imgPath, icon: item.imgPath,
children:item.childList.length === 0? []:this.mapMenu(item.childList) children: item.childList.length === 0 ? [] : this.mapMenu(item.childList)
} }
}) })
return result return result
}, },
// 查询统计数据
homeNum() {
this.$post("/login/index").then((res) => {
const { code, data } = res
if (code == 1) {
this.homeStat = Object.assign({},this.homeStat,data.homeStat)
console.log(data,"####")
}
});
}
} }
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.page-home{ .page-home {
width: 100%; width: 100%;
min-width: 1400px; min-width: 1400px;
height: 100vh; height: 100vh;
box-sizing: border-box; box-sizing: border-box;
// padding: 2% 5%; // padding: 2% 5%;
background-color: #f3f2f2; background-color: #f3f2f2;
.data_left{
.cell1{ .data_left {
padding: 50px 20px 0 20px;
.cell1 {
font-size: 16px; font-size: 16px;
.title{
.title {
color: #409EFF; color: #409EFF;
margin-bottom: 20px; margin-bottom: 20px;
} }
.item{
.item {
text-align: left; text-align: left;
width: 50%; width: 50%;
margin-bottom: 20px; margin-bottom: 20px;
} }
.item div:first-child{
.item div:first-child {
color: gray; color: gray;
margin-bottom: 20px; margin-bottom: 20px;
} }
border-bottom: 1px solid rgb(245, 245, 245); border-bottom: 1px solid rgb(245, 245, 245);
padding: 10px 0; padding: 10px 0;
} }
.cell1:last-child{
border:none .cell1:last-child {
border: none
} }
} }
// 数据标题 // 数据标题
.data_left>.title,.data_right>.title{ .data_left>.title,
.data_right>.title {
text-align: center; text-align: center;
font-size: 22px; font-size: 22px;
font-weight: bold; font-weight: bold;
} }
.right_card{
.right_card {
background-image: url('~@/assets/images/u162.svg'); background-image: url('~@/assets/images/u162.svg');
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% auto; background-size: 100% auto;
background-position: bottom; background-position: bottom;
} }
// 导航栏 // 导航栏
.data_right{ .data_right {
.textWord{ padding-top: 40px;
.textWord {
text-align: center; text-align: center;
margin-top: 30px; margin-top: 30px;
font-size: 16px; font-size: 16px;
line-height: 1.5em; line-height: 1.5em;
} }
} }
.selectBars{
.selectBars {
padding: 0 20px; padding: 0 20px;
} }
.Bar_item{
.Bar_item {
width: 30%; width: 30%;
margin-top: 50px; margin-top: 50px;
border-radius: 10px; border-radius: 10px;
padding: 20px 0; padding: 20px 0;
text-align: center; text-align: center;
background: linear-gradient(90deg, rgba(187, 193, 255,0.3), rgb(235, 235, 235)); background: linear-gradient(90deg, rgba(187, 193, 255, 0.3), rgb(235, 235, 235));
cursor: pointer; cursor: pointer;
.icon img{
.icon img {
width: 40px; width: 40px;
height: 40px; height: 40px;
} }
.barnam{
.barnam {
font-size: 18px; font-size: 18px;
margin-top: 10px; margin-top: 10px;
} }
.des{
.des {
font-size: 14px; font-size: 14px;
color: #666; color: #666;
margin-top: 15px; margin-top: 15px;
} }
} }
} }
::v-deep .el-row,::v-deep .el-col{
::v-deep .el-row,
::v-deep .el-col {
height: 100%; height: 100%;
} }
::v-deep .el-card{
::v-deep .el-card {
height: 100%; height: 100%;
} }</style>
</style>
...@@ -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
...@@ -146,7 +151,6 @@ export default { ...@@ -146,7 +151,6 @@ export default {
created() { created() {
// this.getData(); // this.getData();
console.log(123);
this.cateObj = {}; this.cateObj = {};
}, },
......
...@@ -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");
}, },
......
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
+ 创建目标</el-button + 创建目标</el-button
> >
</div> </div>
<div class="mid_content"> <div class="mid_content" style="height: auto;">
<div class="goal_box" v-for="(val, i) in dataList" :key="i"> <div class="goal_box" v-for="(val, i) in dataList" :key="i">
<div class="goal_title"> <div class="goal_title">
<img src="../../../../assets/images/u17641.svg" alt="" /> <img src="../../../../assets/images/u17641.svg" alt="" />
...@@ -556,7 +556,7 @@ export default { ...@@ -556,7 +556,7 @@ export default {
},//看板查询条件 },//看板查询条件
query:{ query:{
page:1, page:1,
size:8, size:-1,
assessmentScope:1//考核范围(1.部门,2.个人) assessmentScope:1//考核范围(1.部门,2.个人)
},//目标管理查询条件 },//目标管理查询条件
StatQuery:{ StatQuery:{
......
...@@ -21,6 +21,11 @@ import com.mortals.xhx.base.system.user.model.UserEntity; ...@@ -21,6 +21,11 @@ import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.service.UserService; import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.base.system.valid.service.ValidCodeService; import com.mortals.xhx.base.system.valid.service.ValidCodeService;
import com.mortals.xhx.common.key.RedisKey; import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.common.pdu.HomeStatInfo;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.staff.model.StaffQuery;
import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -30,6 +35,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -30,6 +35,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -56,22 +62,15 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -56,22 +62,15 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
@Autowired @Autowired
private IAuthTokenService authTokenService; private IAuthTokenService authTokenService;
@Autowired
private StaffService staffService;
@Autowired
private DeptService deptService;
@RequestMapping("login") @RequestMapping("login")
public String login(@RequestBody LoginForm loginForm) throws Exception { public String login(@RequestBody LoginForm loginForm) throws Exception {
/*
JSONObject ret = new JSONObject();
String loginName = loginForm.getLoginName();
String password = loginForm.getPassword();
UserPdu userPdu = new UserPdu();
userPdu.setLoginName(loginName);
userPdu.setPassword(password);
String resp = userFeign.portalLogin(userPdu);
return resp;
*/
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
String loginName = loginForm.getLoginName(); String loginName = loginForm.getLoginName();
String password = loginForm.getPassword(); String password = loginForm.getPassword();
...@@ -149,8 +148,23 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -149,8 +148,23 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
currUserName = "管理员"; currUserName = "管理员";
} }
JSONObject data = new JSONObject(); JSONObject data = new JSONObject();
String token = authTokenService.getToken(request); String token = authTokenService.getToken(request);
HomeStatInfo homeStatInfo = new HomeStatInfo();
int totalPersonNum = staffService.count(new StaffQuery(), this.getContext());
homeStatInfo.setTotalPersonNum(totalPersonNum);
int totalDeptNum = deptService.count(new DeptQuery(), getContext());
homeStatInfo.setTotalDeptNum(totalDeptNum);
//todo
homeStatInfo.setAttendRadio(new BigDecimal(91.00));
homeStatInfo.setLevealPersonNum(6);
homeStatInfo.setLatePersonNum(2);
homeStatInfo.setLeftEarlyPersonNum(1);
homeStatInfo.setMissCardPersonNum(0);
data.put("homeStat", homeStatInfo);
data.put("token", token); data.put("token", token);
data.put("currUserName", currUserName); data.put("currUserName", currUserName);
data.put("barList", outlookBarList); data.put("barList", outlookBarList);
......
...@@ -57,12 +57,12 @@ public class IdgeneratorServiceImpl implements IdgeneratorService { ...@@ -57,12 +57,12 @@ public class IdgeneratorServiceImpl implements IdgeneratorService {
INFO_VERSION_KEY(50L, "getInfoVersion", null), INFO_VERSION_KEY(50L, "getInfoVersion", null),
ATTEND_KEY(50L, "attend", null), ATTEND_KEY(1L, "attend", null),
REVIEW_KEY(50L, "review", null), REVIEW_KEY(1L, "review", null),
COMPLAIN_KEY(50L, "complain", null), COMPLAIN_KEY(1L, "complain", null),
GOWORK_KEY(50L, "gowork", null), GOWORK_KEY(1L, "gowork", null),
EFFECT_KEY(50L, "effect", null), EFFECT_KEY(1L, "effect", null),
OTHER_KEY(50L, "other", null), OTHER_KEY(1L, "other", null),
/** 空,测试用 */ /** 空,测试用 */
DUMMY(DEFAULT_STEP, "", null), DUMMY(DEFAULT_STEP, "", null),
......
...@@ -6,11 +6,11 @@ import java.util.Map; ...@@ -6,11 +6,11 @@ import java.util.Map;
public enum PerformRulesTypeEnum { public enum PerformRulesTypeEnum {
考勤绩效(1, "attend"), 考勤绩效(1, "attend"),
评价差评绩效(2, "review"), 评价绩效(2, "review"),
评价投诉绩效(3, "complain"), // 评价投诉绩效(3, "complain"),
办件绩效(4, "gowork"), 办件绩效(3, "gowork"),
效能绩效(5, "effect"), 效能绩效(4, "effect"),
其它绩效(1, "other"); 其它绩效(5, "other");
private Integer value; private Integer value;
private String desc; private String desc;
......
package com.mortals.xhx.common.pdu;
import lombok.Data;
import java.math.BigDecimal;
/**
* 首页统计
* @author:
* @date: 2023/7/13 15:09
*/
@Data
public class HomeStatInfo {
private Integer totalPersonNum;
private Integer totalDeptNum;
private Integer attendPersonNum;
private BigDecimal attendRadio;
/**
* 请假人数
*/
private Integer levealPersonNum;
/**
* 迟到人数
*/
private Integer latePersonNum;
/**
* 早退人数
*/
private Integer leftEarlyPersonNum;
/**
* 缺卡人数
*/
private Integer missCardPersonNum;
}
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
...@@ -53,12 +53,12 @@ public class PerformRulesServiceImpl extends AbstractCRUDCacheServiceImpl<Perfor ...@@ -53,12 +53,12 @@ public class PerformRulesServiceImpl extends AbstractCRUDCacheServiceImpl<Perfor
case 考勤绩效: case 考勤绩效:
ruleCode = PerformRulesTypeEnum.getByValue(entity.getType()).getDesc().toUpperCase() + idgeneratorService.getLongId(ATTEND_KEY); ruleCode = PerformRulesTypeEnum.getByValue(entity.getType()).getDesc().toUpperCase() + idgeneratorService.getLongId(ATTEND_KEY);
break; break;
case 评价差评绩效: case 评价绩效:
ruleCode = PerformRulesTypeEnum.getByValue(entity.getType()).getDesc().toUpperCase() + idgeneratorService.getLongId(REVIEW_KEY); ruleCode = PerformRulesTypeEnum.getByValue(entity.getType()).getDesc().toUpperCase() + idgeneratorService.getLongId(REVIEW_KEY);
break; break;
case 评价投诉绩效: // case 评价投诉绩效:
ruleCode = PerformRulesTypeEnum.getByValue(entity.getType()).getDesc().toUpperCase() + idgeneratorService.getLongId(COMPLAIN_KEY); // ruleCode = PerformRulesTypeEnum.getByValue(entity.getType()).getDesc().toUpperCase() + idgeneratorService.getLongId(COMPLAIN_KEY);
break; // break;
case 办件绩效: case 办件绩效:
ruleCode = PerformRulesTypeEnum.getByValue(entity.getType()).getDesc().toUpperCase() + idgeneratorService.getLongId(GOWORK_KEY); ruleCode = PerformRulesTypeEnum.getByValue(entity.getType()).getDesc().toUpperCase() + idgeneratorService.getLongId(GOWORK_KEY);
break; break;
......
<?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