Commit a4d1d4b3 authored by 赵啸非's avatar 赵啸非

反馈问题规则字段添加

parent bfbd457c
...@@ -12,7 +12,7 @@ public class FeedbackReq extends BaseReq { ...@@ -12,7 +12,7 @@ public class FeedbackReq extends BaseReq {
//反馈结束时间 //反馈结束时间
private String feedBackEndDate; private String feedBackEndDate;
//反馈状态(1.未反馈,2.已反馈) //反馈状态(0.未反馈,1.已反馈)
private Integer feedbackStatus; private Integer feedbackStatus;
//详细 //详细
private Long Id; private Long Id;
......
...@@ -4,9 +4,12 @@ import java.math.BigDecimal; ...@@ -4,9 +4,12 @@ import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.web.BaseJsonBodyController; import com.mortals.framework.web.BaseJsonBodyController;
import com.mortals.xhx.busiz.req.AppealReq; import com.mortals.xhx.busiz.req.AppealReq;
import com.mortals.xhx.busiz.req.PerformReq; import com.mortals.xhx.busiz.req.PerformReq;
...@@ -15,9 +18,15 @@ import com.mortals.xhx.busiz.rsp.PerformDetailInfo; ...@@ -15,9 +18,15 @@ import com.mortals.xhx.busiz.rsp.PerformDetailInfo;
import com.mortals.xhx.busiz.rsp.PerformInfo; import com.mortals.xhx.busiz.rsp.PerformInfo;
import com.mortals.xhx.busiz.rsp.PerformStatInfo; import com.mortals.xhx.busiz.rsp.PerformStatInfo;
import com.mortals.xhx.common.code.PerformTypeEnum; import com.mortals.xhx.common.code.PerformTypeEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.*;
import com.mortals.xhx.module.check.service.*; import com.mortals.xhx.module.check.service.*;
import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity; import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity;
import com.mortals.xhx.module.perform.model.PerformAttendAppealQuery;
import com.mortals.xhx.module.perform.service.PerformAttendAppealService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -26,8 +35,12 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -26,8 +35,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static com.mortals.framework.ap.SysConstains.*;
import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED; import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED;
import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED_CONTENT; import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED_CONTENT;
...@@ -42,19 +55,21 @@ import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED_CONTENT; ...@@ -42,19 +55,21 @@ import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED_CONTENT;
@RequestMapping("/api/v1/appeal") @RequestMapping("/api/v1/appeal")
public class AppealApiController extends BaseJsonBodyController { public class AppealApiController extends BaseJsonBodyController {
@Autowired // @Autowired
private CheckAttendRecordService checkAttendRecordService; // private CheckAttendRecordService checkAttendRecordService;
@Autowired // @Autowired
private CheckReviewRecordService checkReviewRecordService; // private CheckReviewRecordService checkReviewRecordService;
@Autowired // @Autowired
private CheckComplainRecordService checkComplainRecordService; // private CheckComplainRecordService checkComplainRecordService;
@Autowired // @Autowired
private CheckEffectRecordService checkEffectRecordService; // private CheckEffectRecordService checkEffectRecordService;
@Autowired // @Autowired
private CheckGoworkRecordService checkGoworkRecordService; // private CheckGoworkRecordService checkGoworkRecordService;
@Autowired // @Autowired
private CheckOtherRecordService checkOtherRecordService; // private CheckOtherRecordService checkOtherRecordService;
@Autowired
private PerformAttendAppealService attendAppealService;
/** /**
* 个人申诉绩效统计 * 个人申诉绩效统计
...@@ -67,6 +82,7 @@ public class AppealApiController extends BaseJsonBodyController { ...@@ -67,6 +82,7 @@ public class AppealApiController extends BaseJsonBodyController {
if (ObjectUtils.isEmpty(context) || ObjectUtils.isEmpty(context.getUser())) { if (ObjectUtils.isEmpty(context) || ObjectUtils.isEmpty(context.getUser())) {
throw new AppException(ERROR_TOKEN_EXPIRED, ERROR_TOKEN_EXPIRED_CONTENT); throw new AppException(ERROR_TOKEN_EXPIRED, ERROR_TOKEN_EXPIRED_CONTENT);
} }
log.info("【{}】【请求体】--> 用户:{}", busiDesc, context.getUser().getRealName());
try { try {
//todo 查询当前登录人的绩效分数 //todo 查询当前登录人的绩效分数
AppealStatInfo appealStatInfo = new AppealStatInfo(); AppealStatInfo appealStatInfo = new AppealStatInfo();
...@@ -87,15 +103,32 @@ public class AppealApiController extends BaseJsonBodyController { ...@@ -87,15 +103,32 @@ public class AppealApiController extends BaseJsonBodyController {
* 申诉列表 * 申诉列表
*/ */
@PostMapping(value = "list") @PostMapping(value = "list")
public Rest<List<PerformAttendAppealEntity>> performList(@RequestBody AppealReq appealReq) { public Rest<Object> performList(@RequestBody AppealReq appealReq) {
String busiDesc = "个人申诉列表"; String busiDesc = "个人申诉列表";
Rest<List<PerformAttendAppealEntity>> rest = Rest.ok(busiDesc + " 【成功】"); log.info("【{}】【请求体】--> {}", busiDesc, JSONObject.toJSONString(appealReq));
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 { try {
if (ObjectUtils.isEmpty(appealReq.getApperalStartDate())) { if (ObjectUtils.isEmpty(appealReq.getApperalStartDate())) {
//未设置时间的情况,默认为当月 //未设置时间的情况,默认为当月
appealReq.setApperalStartDate(DateUtil.beginOfMonth(new Date()).toDateStr()); appealReq.setApperalStartDate(DateUtil.beginOfMonth(new Date()).toDateStr());
appealReq.setAppealEndDate(DateUtil.today()); appealReq.setAppealEndDate(DateUtil.today());
} }
PageInfo pageInfo = buildPageInfo(appealReq);
PerformAttendAppealQuery query = new PerformAttendAppealQuery();
query.setAppealTimeStart(appealReq.getApperalStartDate());
query.setAppealTimeEnd(appealReq.getAppealEndDate());
query.setStaffId(context.getUser().getCustomerId());
Result<PerformAttendAppealEntity> result = attendAppealService.find(query, pageInfo, context);
model.put(KEY_RESULT_DATA, result.getList());
model.put(PAGEINFO_KEY, result.getPageInfo());
parsePageInfo(model, result.getPageInfo());
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) { } catch (Exception e) {
...@@ -110,13 +143,17 @@ public class AppealApiController extends BaseJsonBodyController { ...@@ -110,13 +143,17 @@ public class AppealApiController extends BaseJsonBodyController {
* 申诉详细 * 申诉详细
*/ */
@PostMapping(value = "info") @PostMapping(value = "info")
public Rest<PerformAttendAppealEntity> performInfo(@RequestBody AppealReq appealReq) { public Rest<PerformAttendAppealEntity> appealInfo(@RequestBody AppealReq appealReq) {
String busiDesc = "个人申诉详细"; String busiDesc = "个人申诉详细";
log.info("【{}】【请求体】--> {}", busiDesc, JSONObject.toJSONString(appealReq));
Rest<PerformAttendAppealEntity> rest = Rest.ok(busiDesc + " 【成功】"); Rest<PerformAttendAppealEntity> rest = Rest.ok(busiDesc + " 【成功】");
Context context = this.getContext();
try { try {
if (ObjectUtils.isEmpty(appealReq.getId())) { if (ObjectUtils.isEmpty(appealReq.getId())) {
throw new AppException("详细查询id不能为空!"); throw new AppException("详细查询id不能为空!");
} }
PerformAttendAppealEntity performAttendAppealEntity = attendAppealService.get(appealReq.getId(), context);
rest.setData(performAttendAppealEntity);
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) { } catch (Exception e) {
...@@ -131,20 +168,48 @@ public class AppealApiController extends BaseJsonBodyController { ...@@ -131,20 +168,48 @@ public class AppealApiController extends BaseJsonBodyController {
* 申诉新增 * 申诉新增
*/ */
@PostMapping(value = "save") @PostMapping(value = "save")
public Rest<String> appealSave(@RequestBody PerformAttendAppealEntity appealEntity) { public Rest<PerformAttendAppealEntity> appealSave(@RequestBody PerformAttendAppealEntity appealEntity) {
String busiDesc = "个人申诉新增"; String busiDesc = "个人申诉新增";
Rest<String> rest = Rest.ok(busiDesc + " 【成功】"); log.info("【{}】【请求体】--> {}", busiDesc, JSONObject.toJSONString(appealEntity));
Rest<PerformAttendAppealEntity> rest = Rest.ok(busiDesc + " 【成功】");
Context context = this.getContext();
try { try {
//校验 去重
PerformAttendAppealEntity saveEntity = attendAppealService.save(appealEntity, context);
rest.setData(saveEntity);
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) { } catch (Exception e) {
log.error(busiDesc, e); log.error(busiDesc, e);
rest = Rest.fail(super.convertException(e)); rest = Rest.fail(super.convertException(e));
} }
log.info("【{}】【响应体】--> {}", busiDesc, JSONObject.toJSONString(appealEntity));
return rest; return rest;
} }
protected PageInfo buildPageInfo(AppealReq query) {
PageInfo pageInfo = new PageInfo();
if (!ObjectUtils.isEmpty(query) && !ObjectUtils.isEmpty(query.getPage())) {
pageInfo.setCurrPage(query.getPage());
}
if (!ObjectUtils.isEmpty(query) && !ObjectUtils.isEmpty(query.getSize())) {
pageInfo.setPrePageResult(query.getSize());
}
return pageInfo;
}
protected void parsePageInfo(Map<String, Object> model, PageInfo pageInfo) {
model.put(TOTAL, pageInfo.getTotalResult());
model.put(PER_PAGE, pageInfo.getPrePageResult());
model.put(CURRENT_PAGE, pageInfo.getCurrPage());
model.put(LAST_PAGE, pageInfo.getTotalPage());
model.put(PAGEINFO_KEY, pageInfo);
}
public static void main(String[] args) { public static void main(String[] args) {
} }
......
...@@ -2,14 +2,23 @@ package com.mortals.xhx.busiz.web; ...@@ -2,14 +2,23 @@ package com.mortals.xhx.busiz.web;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.web.BaseJsonBodyController; import com.mortals.framework.web.BaseJsonBodyController;
import com.mortals.xhx.busiz.req.AppealReq; import com.mortals.xhx.busiz.req.AppealReq;
import com.mortals.xhx.busiz.req.FeedbackReq; import com.mortals.xhx.busiz.req.FeedbackReq;
import com.mortals.xhx.busiz.rsp.AppealStatInfo; import com.mortals.xhx.busiz.rsp.AppealStatInfo;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.check.service.*; import com.mortals.xhx.module.check.service.*;
import com.mortals.xhx.module.feedback.model.FeedbackEntity;
import com.mortals.xhx.module.feedback.model.FeedbackStaffEntity;
import com.mortals.xhx.module.feedback.service.FeedbackService;
import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity; import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity;
import com.mortals.xhx.module.perform.model.PerformAttendAppealQuery;
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;
...@@ -19,7 +28,13 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -19,7 +28,13 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import static com.mortals.framework.ap.SysConstains.*;
import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED;
import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED_CONTENT;
/** /**
* h5 申诉 * h5 申诉
...@@ -33,52 +48,41 @@ import java.util.List; ...@@ -33,52 +48,41 @@ import java.util.List;
public class FeedbackApiController extends BaseJsonBodyController { public class FeedbackApiController extends BaseJsonBodyController {
@Autowired @Autowired
private CheckAttendRecordService checkAttendRecordService; private FeedbackService feedbackService;
@Autowired
private CheckReviewRecordService checkReviewRecordService;
@Autowired
private CheckComplainRecordService checkComplainRecordService;
@Autowired
private CheckEffectRecordService checkEffectRecordService;
@Autowired
private CheckGoworkRecordService checkGoworkRecordService;
@Autowired
private CheckOtherRecordService checkOtherRecordService;
/** /**
* 反馈列表 * 反馈列表
*/ */
@PostMapping(value = "list") @PostMapping(value = "list")
public Rest<List<PerformAttendAppealEntity>> feedbackList(@RequestBody FeedbackReq feedbackReq) { public Rest<Object> feedbackList(@RequestBody FeedbackReq feedbackReq) {
String busiDesc = "个人反馈列表"; String busiDesc = "个人反馈列表";
Rest<List<PerformAttendAppealEntity>> rest = Rest.ok(busiDesc + " 【成功】"); log.info("【{}】【请求体】--> {}", busiDesc, JSONObject.toJSONString(feedbackReq));
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 { try {
if (ObjectUtils.isEmpty(feedbackReq.getFeedbackStatus())) { if (ObjectUtils.isEmpty(feedbackReq.getFeedBackStartDate())) {
//未设置时间的情况,默认为当月 //未设置时间的情况,默认为当月
feedbackReq.setFeedBackStartDate(DateUtil.beginOfMonth(new Date()).toDateStr()); feedbackReq.setFeedBackStartDate(DateUtil.beginOfMonth(new Date()).toDateStr());
feedbackReq.setFeedBackEndDate(DateUtil.today()); feedbackReq.setFeedBackEndDate(DateUtil.today());
} }
PageInfo pageInfo = buildPageInfo(feedbackReq);
//todo
recordSysLog(request, busiDesc + " 【成功】"); if (YesNoEnum.YES.getValue() == feedbackReq.getFeedbackStatus()) {
} catch (Exception e) { //已反馈
log.error(busiDesc, e); } else {
rest = Rest.fail(super.convertException(e)); //未反馈
} }
return rest;
}
/** // model.put(KEY_RESULT_DATA, result.getList());
* 反馈详细 // model.put(PAGEINFO_KEY, result.getPageInfo());
*/ // parsePageInfo(model, result.getPageInfo());
@PostMapping(value = "question")
public Rest<PerformAttendAppealEntity> performDetail(@RequestBody AppealReq appealReq) {
String busiDesc = "个人申诉详细";
Rest<PerformAttendAppealEntity> rest = Rest.ok(busiDesc + " 【成功】");
try {
if (ObjectUtils.isEmpty(appealReq.getId())) {
throw new AppException("详细查询id不能为空!");
}
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) { } catch (Exception e) {
...@@ -88,16 +92,23 @@ public class FeedbackApiController extends BaseJsonBodyController { ...@@ -88,16 +92,23 @@ public class FeedbackApiController extends BaseJsonBodyController {
return rest; return rest;
} }
/** /**
* 申诉新增 * 反馈问卷新增
*/ */
@PostMapping(value = "save") @PostMapping(value = "save")
public Rest<String> feedbackSave(@RequestBody PerformAttendAppealEntity appealEntity) { public Rest<FeedbackEntity> feedbackSave(@RequestBody FeedbackEntity feedbackEntity) {
Context context = this.getContext();
String busiDesc = "反馈回答"; String busiDesc = "反馈回答";
Rest<String> rest = Rest.ok(busiDesc + " 【成功】"); Rest<FeedbackEntity> rest = Rest.ok(busiDesc + " 【成功】");
if (ObjectUtils.isEmpty(context) || ObjectUtils.isEmpty(context.getUser())) {
throw new AppException(ERROR_TOKEN_EXPIRED, ERROR_TOKEN_EXPIRED_CONTENT);
}
try { try {
//todo
FeedbackEntity saveEntity = feedbackService.save(feedbackEntity, context);
rest.setData(saveEntity);
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) { } catch (Exception e) {
log.error(busiDesc, e); log.error(busiDesc, e);
...@@ -107,6 +118,29 @@ public class FeedbackApiController extends BaseJsonBodyController { ...@@ -107,6 +118,29 @@ public class FeedbackApiController extends BaseJsonBodyController {
} }
protected PageInfo buildPageInfo(FeedbackReq query) {
PageInfo pageInfo = new PageInfo();
if (!ObjectUtils.isEmpty(query) && !ObjectUtils.isEmpty(query.getPage())) {
pageInfo.setCurrPage(query.getPage());
}
if (!ObjectUtils.isEmpty(query) && !ObjectUtils.isEmpty(query.getSize())) {
pageInfo.setPrePageResult(query.getSize());
}
return pageInfo;
}
protected void parsePageInfo(Map<String, Object> model, PageInfo pageInfo) {
model.put(TOTAL, pageInfo.getTotalResult());
model.put(PER_PAGE, pageInfo.getPrePageResult());
model.put(CURRENT_PAGE, pageInfo.getCurrPage());
model.put(LAST_PAGE, pageInfo.getTotalPage());
model.put(PAGEINFO_KEY, pageInfo);
}
public static void main(String[] args) { public static void main(String[] args) {
} }
......
...@@ -4,6 +4,7 @@ import java.math.BigDecimal; ...@@ -4,6 +4,7 @@ import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
...@@ -78,6 +79,7 @@ public class PerformApiController extends BaseJsonBodyController { ...@@ -78,6 +79,7 @@ public class PerformApiController extends BaseJsonBodyController {
if (ObjectUtils.isEmpty(context) || ObjectUtils.isEmpty(context.getUser())) { if (ObjectUtils.isEmpty(context) || ObjectUtils.isEmpty(context.getUser())) {
throw new AppException(ERROR_TOKEN_EXPIRED, ERROR_TOKEN_EXPIRED_CONTENT); throw new AppException(ERROR_TOKEN_EXPIRED, ERROR_TOKEN_EXPIRED_CONTENT);
} }
log.info("【{}】【请求体】--> 用户:{}", busiDesc, context.getUser().getRealName());
try { try {
//todo //todo
PerformStatInfo performStatInfo = new PerformStatInfo(); PerformStatInfo performStatInfo = new PerformStatInfo();
...@@ -99,7 +101,8 @@ public class PerformApiController extends BaseJsonBodyController { ...@@ -99,7 +101,8 @@ public class PerformApiController extends BaseJsonBodyController {
*/ */
@PostMapping(value = "list") @PostMapping(value = "list")
public Rest<Object> performList(@RequestBody PerformReq performReq) { public Rest<Object> performList(@RequestBody PerformReq performReq) {
String busiDesc = "个人绩效列表";
log.info("【{}】【请求体】--> {}", busiDesc, JSONObject.toJSONString(performReq));
Rest<Object> rest = Rest.ok(); Rest<Object> rest = Rest.ok();
Map<String, Object> model = new HashMap<>(); Map<String, Object> model = new HashMap<>();
Context context = this.getContext(); Context context = this.getContext();
...@@ -107,7 +110,6 @@ public class PerformApiController extends BaseJsonBodyController { ...@@ -107,7 +110,6 @@ public class PerformApiController extends BaseJsonBodyController {
if (ObjectUtils.isEmpty(context) || ObjectUtils.isEmpty(context.getUser())) { if (ObjectUtils.isEmpty(context) || ObjectUtils.isEmpty(context.getUser())) {
throw new AppException(ERROR_TOKEN_EXPIRED, ERROR_TOKEN_EXPIRED_CONTENT); throw new AppException(ERROR_TOKEN_EXPIRED, ERROR_TOKEN_EXPIRED_CONTENT);
} }
String busiDesc = "个人绩效列表";
try { try {
if (ObjectUtils.isEmpty(performReq.getPerformStartDate())) { if (ObjectUtils.isEmpty(performReq.getPerformStartDate())) {
//未设置时间的情况,默认为当月 //未设置时间的情况,默认为当月
...@@ -115,7 +117,6 @@ public class PerformApiController extends BaseJsonBodyController { ...@@ -115,7 +117,6 @@ public class PerformApiController extends BaseJsonBodyController {
performReq.setPerformEndDate(DateUtil.today()); performReq.setPerformEndDate(DateUtil.today());
} }
PageInfo pageInfo = buildPageInfo(performReq); PageInfo pageInfo = buildPageInfo(performReq);
//todo 查询全部扣分绩效 //todo 查询全部扣分绩效
if (PerformTypeEnum.全部.getValue().equals(performReq.getPerformType())) { if (PerformTypeEnum.全部.getValue().equals(performReq.getPerformType())) {
...@@ -218,6 +219,9 @@ public class PerformApiController extends BaseJsonBodyController { ...@@ -218,6 +219,9 @@ public class PerformApiController extends BaseJsonBodyController {
} else { } else {
throw new AppException("不支持当前绩效类型"); throw new AppException("不支持当前绩效类型");
} }
rest.setData(model);
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) { } catch (Exception e) {
log.error(busiDesc, e); log.error(busiDesc, e);
...@@ -234,6 +238,7 @@ public class PerformApiController extends BaseJsonBodyController { ...@@ -234,6 +238,7 @@ public class PerformApiController extends BaseJsonBodyController {
public Rest<PerformDetailInfo> performInfo(@RequestBody PerformReq performReq) { public Rest<PerformDetailInfo> performInfo(@RequestBody PerformReq performReq) {
Context context = this.getContext(); Context context = this.getContext();
String busiDesc = "个人绩效增减详细"; String busiDesc = "个人绩效增减详细";
log.info("【{}】【请求体】--> {}", busiDesc, JSONObject.toJSONString(performReq));
Rest<PerformDetailInfo> rest = Rest.ok(busiDesc + " 【成功】"); Rest<PerformDetailInfo> rest = Rest.ok(busiDesc + " 【成功】");
try { try {
if (ObjectUtils.isEmpty(performReq.getId())) { if (ObjectUtils.isEmpty(performReq.getId())) {
......
...@@ -13,7 +13,7 @@ import lombok.Data; ...@@ -13,7 +13,7 @@ import lombok.Data;
* 绩效反馈记录信息实体对象 * 绩效反馈记录信息实体对象
* *
* @author zxfei * @author zxfei
* @date 2023-07-07 * @date 2023-07-10
*/ */
@Data @Data
public class FeedbackEntity extends FeedbackVo { public class FeedbackEntity extends FeedbackVo {
...@@ -59,6 +59,10 @@ public class FeedbackEntity extends FeedbackVo { ...@@ -59,6 +59,10 @@ public class FeedbackEntity extends FeedbackVo {
* 表单内容 * 表单内容
*/ */
private String formContent; private String formContent;
/**
* 规则内容
*/
private String ruleContent;
/** /**
* 绩效反馈问题信息 * 绩效反馈问题信息
*/ */
...@@ -107,5 +111,7 @@ public class FeedbackEntity extends FeedbackVo { ...@@ -107,5 +111,7 @@ public class FeedbackEntity extends FeedbackVo {
this.remark = ""; this.remark = "";
this.formContent = ""; this.formContent = "";
this.ruleContent = "";
} }
} }
\ No newline at end of file
...@@ -8,7 +8,7 @@ import com.mortals.xhx.module.feedback.model.FeedbackEntity; ...@@ -8,7 +8,7 @@ import com.mortals.xhx.module.feedback.model.FeedbackEntity;
* 绩效反馈记录信息查询对象 * 绩效反馈记录信息查询对象
* *
* @author zxfei * @author zxfei
* @date 2023-07-07 * @date 2023-07-10
*/ */
public class FeedbackQuery extends FeedbackEntity { public class FeedbackQuery extends FeedbackEntity {
/** 开始 序号,主键,自增长 */ /** 开始 序号,主键,自增长 */
...@@ -160,6 +160,11 @@ public class FeedbackQuery extends FeedbackEntity { ...@@ -160,6 +160,11 @@ public class FeedbackQuery extends FeedbackEntity {
/** 表单内容排除列表 */ /** 表单内容排除列表 */
private List <String> formContentNotList; private List <String> formContentNotList;
/** 规则内容 */
private List<String> ruleContentList;
/** 规则内容排除列表 */
private List <String> ruleContentNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */ /** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<FeedbackQuery> orConditionList; private List<FeedbackQuery> orConditionList;
...@@ -991,6 +996,38 @@ public class FeedbackQuery extends FeedbackEntity { ...@@ -991,6 +996,38 @@ public class FeedbackQuery extends FeedbackEntity {
this.formContentNotList = formContentNotList; this.formContentNotList = formContentNotList;
} }
/**
* 获取 规则内容
* @return ruleContentList
*/
public List<String> getRuleContentList(){
return this.ruleContentList;
}
/**
* 设置 规则内容
* @param ruleContentList
*/
public void setRuleContentList(List<String> ruleContentList){
this.ruleContentList = ruleContentList;
}
/**
* 获取 规则内容
* @return ruleContentNotList
*/
public List<String> getRuleContentNotList(){
return this.ruleContentNotList;
}
/**
* 设置 规则内容
* @param ruleContentNotList
*/
public void setRuleContentNotList(List<String> ruleContentNotList){
this.ruleContentNotList = ruleContentNotList;
}
/** /**
* 设置 序号,主键,自增长 * 设置 序号,主键,自增长
* @param id * @param id
...@@ -1430,6 +1467,7 @@ public class FeedbackQuery extends FeedbackEntity { ...@@ -1430,6 +1467,7 @@ public class FeedbackQuery extends FeedbackEntity {
} }
/** /**
* 设置 表单内容 * 设置 表单内容
* @param formContent * @param formContent
...@@ -1448,6 +1486,25 @@ public class FeedbackQuery extends FeedbackEntity { ...@@ -1448,6 +1486,25 @@ public class FeedbackQuery extends FeedbackEntity {
return this; return this;
} }
/**
* 设置 规则内容
* @param ruleContent
*/
public FeedbackQuery ruleContent(String ruleContent){
setRuleContent(ruleContent);
return this;
}
/**
* 设置 规则内容
* @param ruleContentList
*/
public FeedbackQuery ruleContentList(List<String> ruleContentList){
this.ruleContentList = ruleContentList;
return this;
}
/** /**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) * 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList * @return orConditionList
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<result property="updateUserId" column="updateUserId" /> <result property="updateUserId" column="updateUserId" />
<result property="updateTime" column="updateTime" /> <result property="updateTime" column="updateTime" />
<result property="formContent" column="formContent" /> <result property="formContent" column="formContent" />
<result property="ruleContent" column="ruleContent" />
<collection property="feedbackQuestionList" column="id" ofType="FeedbackQuestionEntity" javaType="ArrayList" select="getFeedbackQuestionByFeedbackId"></collection> <collection property="feedbackQuestionList" column="id" ofType="FeedbackQuestionEntity" javaType="ArrayList" select="getFeedbackQuestionByFeedbackId"></collection>
</resultMap> </resultMap>
<resultMap type="FeedbackQuestionEntity" id="FeedbackQuestionEntity-Map"> <resultMap type="FeedbackQuestionEntity" id="FeedbackQuestionEntity-Map">
...@@ -85,6 +86,9 @@ ...@@ -85,6 +86,9 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('formContent') or colPickMode == 1 and data.containsKey('formContent')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('formContent') or colPickMode == 1 and data.containsKey('formContent')))">
a.formContent, a.formContent,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('ruleContent') or colPickMode == 1 and data.containsKey('ruleContent')))">
a.ruleContent,
</if>
</trim> </trim>
</sql> </sql>
<!-- 子表所有列 --> <!-- 子表所有列 -->
...@@ -96,18 +100,18 @@ ...@@ -96,18 +100,18 @@
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="FeedbackEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="FeedbackEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_feedback insert into mortals_xhx_feedback
(title,feedbackTimeStart,feedbackTimeEnd,inviteNum,feedbackNum,processStatus,weblink,webUrl,remark,createUserId,createTime,updateUserId,updateTime,formContent) (title,feedbackTimeStart,feedbackTimeEnd,inviteNum,feedbackNum,processStatus,weblink,webUrl,remark,createUserId,createTime,updateUserId,updateTime,formContent,ruleContent)
VALUES VALUES
(#{title},#{feedbackTimeStart},#{feedbackTimeEnd},#{inviteNum},#{feedbackNum},#{processStatus},#{weblink},#{webUrl},#{remark},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{formContent}) (#{title},#{feedbackTimeStart},#{feedbackTimeEnd},#{inviteNum},#{feedbackNum},#{processStatus},#{weblink},#{webUrl},#{remark},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{formContent},#{ruleContent})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_feedback insert into mortals_xhx_feedback
(title,feedbackTimeStart,feedbackTimeEnd,inviteNum,feedbackNum,processStatus,weblink,webUrl,remark,createUserId,createTime,updateUserId,updateTime,formContent) (title,feedbackTimeStart,feedbackTimeEnd,inviteNum,feedbackNum,processStatus,weblink,webUrl,remark,createUserId,createTime,updateUserId,updateTime,formContent,ruleContent)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.title},#{item.feedbackTimeStart},#{item.feedbackTimeEnd},#{item.inviteNum},#{item.feedbackNum},#{item.processStatus},#{item.weblink},#{item.webUrl},#{item.remark},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.formContent}) (#{item.title},#{item.feedbackTimeStart},#{item.feedbackTimeEnd},#{item.inviteNum},#{item.feedbackNum},#{item.processStatus},#{item.weblink},#{item.webUrl},#{item.remark},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.formContent},#{item.ruleContent})
</foreach> </foreach>
</insert> </insert>
...@@ -177,6 +181,9 @@ ...@@ -177,6 +181,9 @@
<if test="(colPickMode==0 and data.containsKey('formContent')) or (colPickMode==1 and !data.containsKey('formContent'))"> <if test="(colPickMode==0 and data.containsKey('formContent')) or (colPickMode==1 and !data.containsKey('formContent'))">
a.formContent=#{data.formContent}, a.formContent=#{data.formContent},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('ruleContent')) or (colPickMode==1 and !data.containsKey('ruleContent'))">
a.ruleContent=#{data.ruleContent},
</if>
</trim> </trim>
<trim suffixOverrides="where" suffix=""> <trim suffixOverrides="where" suffix="">
where where
...@@ -317,6 +324,13 @@ ...@@ -317,6 +324,13 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="ruleContent=(case" suffix="ELSE ruleContent end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('ruleContent')) or (colPickMode==1 and !item.containsKey('ruleContent'))">
when a.id=#{item.id} then #{item.ruleContent}
</if>
</foreach>
</trim>
</trim> </trim>
where id in where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")"> <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
...@@ -774,6 +788,27 @@ ...@@ -774,6 +788,27 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('ruleContent')">
<if test="conditionParamRef.ruleContent != null and conditionParamRef.ruleContent != ''">
${_conditionType_} a.ruleContent like #{${_conditionParam_}.ruleContent}
</if>
<if test="conditionParamRef.ruleContent == null">
${_conditionType_} a.ruleContent is null
</if>
</if>
<if test="conditionParamRef.containsKey('ruleContentList') and conditionParamRef.ruleContentList.size() > 0">
${_conditionType_} a.ruleContent in
<foreach collection="conditionParamRef.ruleContentList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('ruleContentNotList') and conditionParamRef.ruleContentNotList.size() > 0">
${_conditionType_} a.ruleContent not in
<foreach collection="conditionParamRef.ruleContentNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
</sql> </sql>
<sql id="_orderCols_"> <sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()"> <if test="orderColList != null and !orderColList.isEmpty()">
...@@ -862,6 +897,11 @@ ...@@ -862,6 +897,11 @@
<if test='orderCol.formContent != null and "DESC".equalsIgnoreCase(orderCol.formContent)'>DESC</if> <if test='orderCol.formContent != null and "DESC".equalsIgnoreCase(orderCol.formContent)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('ruleContent')">
a.ruleContent
<if test='orderCol.ruleContent != null and "DESC".equalsIgnoreCase(orderCol.ruleContent)'>DESC</if>
,
</if>
</trim> </trim>
</if> </if>
</sql> </sql>
......
...@@ -329,3 +329,11 @@ ALTER TABLE mortals_xhx_perform_other_record ADD COLUMN `filePaths` varchar(256 ...@@ -329,3 +329,11 @@ ALTER TABLE mortals_xhx_perform_other_record ADD COLUMN `filePaths` varchar(256
ALTER TABLE mortals_xhx_check_other_record ADD COLUMN `fileNames` varchar(256) DEFAULT '' COMMENT '附件名称,多个逗号分割' AFTER remark; ALTER TABLE mortals_xhx_check_other_record ADD COLUMN `fileNames` varchar(256) DEFAULT '' COMMENT '附件名称,多个逗号分割' AFTER remark;
ALTER TABLE mortals_xhx_check_other_record ADD COLUMN `filePaths` varchar(256) DEFAULT '' COMMENT '附件下载地址,多个逗号分割' AFTER fileNames; ALTER TABLE mortals_xhx_check_other_record ADD COLUMN `filePaths` varchar(256) DEFAULT '' COMMENT '附件下载地址,多个逗号分割' AFTER fileNames;
-- ----------------------------
2023-7-09
-- ----------------------------
ALTER TABLE mortals_xhx_feedback ADD COLUMN `ruleContent` varchar(1024) DEFAULT '' COMMENT '规则内容' AFTER formContent;
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