Commit 7e650ea6 authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents cf3c02ec c569b630
......@@ -47,16 +47,16 @@ public class FeedbackServiceImpl extends AbstractCRUDServiceImpl<FeedbackDao, Fe
Date feedbackTimeEnd = item.getFeedbackTimeEnd();
if(DateUtil.compare(new Date(),feedbackTimeStart)<0){
item.setProcessStatus(0);
// item.setProcessStatus(0);
}
boolean in = DateUtil.isIn(new Date(), item.getFeedbackTimeStart(), item.getFeedbackTimeEnd());
if(in){
item.setProcessStatus(1);
//item.setProcessStatus(1);
}
if(DateUtil.compare(new Date(),feedbackTimeEnd)>0){
item.setProcessStatus(2);
//item.setProcessStatus(2);
}
});
......
package com.mortals.xhx.module.feedback.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
......@@ -19,8 +20,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.feedback.service.FeedbackService;
import org.apache.commons.lang3.ArrayUtils;
......@@ -28,20 +31,22 @@ import com.mortals.framework.util.StringUtils;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 绩效反馈记录信息
*
* @author zxfei
* @date 2023-07-05
*/
* 绩效反馈记录信息
*
* @author zxfei
* @date 2023-07-05
*/
@RestController
@RequestMapping("feedback")
public class FeedbackController extends BaseCRUDJsonBodyMappingController<FeedbackService,FeedbackEntity,Long> {
public class FeedbackController extends BaseCRUDJsonBodyMappingController<FeedbackService, FeedbackEntity, Long> {
@Autowired
private ParamService paramService;
......@@ -52,41 +57,43 @@ public class FeedbackController extends BaseCRUDJsonBodyMappingController<Feedba
@Autowired
private FeedbackAnswerService feedbackAnswerService;
public FeedbackController(){
super.setModuleDesc( "绩效反馈记录信息");
public FeedbackController() {
super.setModuleDesc("绩效反馈记录信息");
}
@Override
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, "weblink", paramService.getParamBySecondOrganize("Feedback","weblink"));
Map<String, String> backStatus = new HashMap<>();
backStatus.put("0", "未反馈");
backStatus.put("1", "已反馈");
this.addDict(model, "processStatus", paramService.getParamBySecondOrganize("Feedback", "processStatus"));
this.addDict(model, "weblink", paramService.getParamBySecondOrganize("Feedback", "weblink"));
this.addDict(model, "backStatus", backStatus);
super.init(model, context);
}
@Override
protected int infoAfter(Long id, Map<String, Object> model, FeedbackEntity entity, Context context) throws AppException {
if(CollectionUtils.isNotEmpty(entity.getFeedbackQuestionList())){
for(FeedbackQuestionEntity item:entity.getFeedbackQuestionList()){
if (CollectionUtils.isNotEmpty(entity.getFeedbackQuestionList())) {
for (FeedbackQuestionEntity item : entity.getFeedbackQuestionList()) {
List<FeedbackOptionEntity> optionEntities = feedbackOptionService.find(new FeedbackOptionQuery().questionId(item.getId()));
item.setFeedbackOptionList(optionEntities);
}
}
List<FeedbackAnswerEntity> feedbackAnswerEntities = feedbackAnswerService.find(new FeedbackAnswerQuery().feedbackId(entity.getFeedbackId()));
if(!ObjectUtils.isEmpty(feedbackAnswerEntities)){
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
List<FeedbackAnswerEntity> feedbackAnswerEntities = feedbackAnswerService.find(new FeedbackAnswerQuery().feedbackId(entity.getFeedbackId()).staffId(context.getUser().getCustomerId()));
if (!ObjectUtils.isEmpty(feedbackAnswerEntities)) {
entity.setFeedbackAnswerList(feedbackAnswerEntities);
}
}
return super.infoAfter(id, model, entity, context);
}
/**
* 查询问卷反馈人员列表
*
* @param query
* @return
*/
......@@ -98,23 +105,23 @@ public class FeedbackController extends BaseCRUDJsonBodyMappingController<Feedba
Context context = this.getContext();
String busiDesc = "查询问卷反馈人员列表";
int code=1;
int code = 1;
try {
PageInfo pageInfo = this.buildPageInfo(query);
Result<FeedbackStaffInfoVo> result = this.getService().getFeedbackStaffList(query,pageInfo);
if(CollectionUtils.isNotEmpty(result.getList())) {
Result<FeedbackStaffInfoVo> result = this.getService().getFeedbackStaffList(query, pageInfo);
if (CollectionUtils.isNotEmpty(result.getList())) {
Map<Integer, List<FeedbackStaffInfoVo>> groupMap = result.getList().stream().collect(Collectors.groupingBy(FeedbackStaffInfoVo::getBackStatus));
if(groupMap.containsKey(1)) {
if (groupMap.containsKey(1)) {
model.put("feedBack", groupMap.get(1).size());
}else {
} else {
model.put("feedBack", 0);
}
if(groupMap.containsKey(0)) {
if (groupMap.containsKey(0)) {
model.put("notBack", groupMap.get(0).size());
}else {
} else {
model.put("notBack", 0);
}
}else {
} else {
model.put("feedBack", 0);
model.put("notBack", 0);
}
......@@ -138,10 +145,11 @@ public class FeedbackController extends BaseCRUDJsonBodyMappingController<Feedba
/**
* 问卷单选多选反馈统计
*
* @param feedbackId
* @return
*/
@RequestMapping(value = {"getOptionSummaryList"},method = {RequestMethod.POST, RequestMethod.GET})
@RequestMapping(value = {"getOptionSummaryList"}, method = {RequestMethod.POST, RequestMethod.GET})
@UnAuth
public Rest<Object> getOptionSummaryList(Long feedbackId) {
Rest<Object> ret = new Rest();
......@@ -149,11 +157,11 @@ public class FeedbackController extends BaseCRUDJsonBodyMappingController<Feedba
Context context = this.getContext();
String busiDesc = "查询问卷单选多选反馈统计";
int code=1;
int code = 1;
try {
List<OptionSummaryVo> result = this.getService().getOptionSummaryList(feedbackId);
List<OptionSummaryVo> list = new ArrayList<>();
if(CollectionUtils.isNotEmpty(result)) {
if (CollectionUtils.isNotEmpty(result)) {
Map<Long, List<OptionSummaryVo>> groupMap = result.stream().collect(Collectors.groupingBy(OptionSummaryVo::getQuestionId));
for (Long key : groupMap.keySet()) {
OptionSummaryVo vo = new OptionSummaryVo();
......@@ -185,6 +193,7 @@ public class FeedbackController extends BaseCRUDJsonBodyMappingController<Feedba
/**
* 问卷问题反馈详情
*
* @param query
* @return
*/
......@@ -222,6 +231,7 @@ public class FeedbackController extends BaseCRUDJsonBodyMappingController<Feedba
/**
* 反馈记录整体情况统计
*
* @return
*/
@PostMapping({"summary"})
......@@ -234,7 +244,7 @@ public class FeedbackController extends BaseCRUDJsonBodyMappingController<Feedba
int code = 1;
try {
Map<String,Integer> result = this.getService().summaryFeedback();
Map<String, Integer> result = this.getService().summaryFeedback();
model.put("data", result);
model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
......
......@@ -5,7 +5,7 @@
<select id="getList" parameterType="com.mortals.xhx.module.check.model.CheckAllRecordQuery" resultType="com.mortals.xhx.module.check.model.vo.CheckAllRecordVo">
SELECT * FROM (
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,createTime AS deductTime,1 AS checkType ,'attend' AS performType FROM mortals_xhx_check_attend_record WHERE 1=1
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,deductTime,1 AS checkType ,'attend' AS performType FROM mortals_xhx_check_attend_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
......@@ -14,7 +14,7 @@
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,createTime AS deductTime,4 AS checkType ,'effect' AS performType FROM mortals_xhx_check_effect_record WHERE 1=1
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,deductTime,4 AS checkType ,'effect' AS performType FROM mortals_xhx_check_effect_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
......@@ -23,7 +23,7 @@
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,createTime AS deductTime,6 AS checkType ,'complain' AS performType FROM mortals_xhx_check_complain_record WHERE 1=1
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime, deductTime,6 AS checkType ,'complain' AS performType FROM mortals_xhx_check_complain_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
......@@ -32,7 +32,7 @@
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName, subAddType,score,subMethod,checkTime,createTime AS deductTime,3 AS checkType ,'gowork' AS performType FROM mortals_xhx_check_gowork_record WHERE 1=1
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName, subAddType,score,subMethod,checkTime, deductTime,3 AS checkType ,'gowork' AS performType FROM mortals_xhx_check_gowork_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
......@@ -41,7 +41,7 @@
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,createTime AS deductTime,2 AS checkType ,'review' AS performType FROM mortals_xhx_check_review_record WHERE 1=1
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime, deductTime,2 AS checkType ,'review' AS performType FROM mortals_xhx_check_review_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
......@@ -50,7 +50,7 @@
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,createTime AS deductTime,5 AS checkType ,'other' AS performType FROM mortals_xhx_check_other_record WHERE 1=1
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime, deductTime,5 AS checkType ,'other' AS performType FROM mortals_xhx_check_other_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
......@@ -63,7 +63,7 @@
<select id="getListCount" parameterType="com.mortals.xhx.module.check.model.CheckAllRecordQuery" resultType="int">
SELECT count(1) FROM (
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,createTime AS deductTime,1 AS checkType ,'attend' AS performType FROM mortals_xhx_check_attend_record WHERE 1=1
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime, deductTime,1 AS checkType ,'attend' AS performType FROM mortals_xhx_check_attend_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
......@@ -72,7 +72,7 @@
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,createTime AS deductTime,4 AS checkType ,'effect' AS performType FROM mortals_xhx_check_effect_record WHERE 1=1
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime, deductTime,4 AS checkType ,'effect' AS performType FROM mortals_xhx_check_effect_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
......@@ -81,7 +81,7 @@
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,createTime AS deductTime,6 AS checkType ,'complain' AS performType FROM mortals_xhx_check_complain_record WHERE 1=1
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,deductTime,6 AS checkType ,'complain' AS performType FROM mortals_xhx_check_complain_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
......@@ -90,7 +90,7 @@
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,createTime AS deductTime,3 AS checkType ,'gowork' AS performType FROM mortals_xhx_check_gowork_record WHERE 1=1
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime, deductTime,3 AS checkType ,'gowork' AS performType FROM mortals_xhx_check_gowork_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
......@@ -99,7 +99,7 @@
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName, subAddType,score,subMethod,checkTime,createTime AS deductTime,2 AS checkType ,'review' AS performType FROM mortals_xhx_check_review_record WHERE 1=1
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName, subAddType,score,subMethod,checkTime, deductTime,2 AS checkType ,'review' AS performType FROM mortals_xhx_check_review_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
......@@ -108,7 +108,7 @@
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,createTime AS deductTime,5 AS checkType ,'other' AS performType FROM mortals_xhx_check_other_record WHERE 1=1
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime, deductTime,5 AS checkType ,'other' AS performType FROM mortals_xhx_check_other_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
......
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