Commit 2e2a627f authored by 廖旭伟's avatar 廖旭伟

达州东部经开区考勤系统(已删除绩效部分)

parent 80ea368c
...@@ -11,8 +11,6 @@ import com.mortals.framework.common.Rest; ...@@ -11,8 +11,6 @@ import com.mortals.framework.common.Rest;
import com.mortals.framework.service.ICacheService; import com.mortals.framework.service.ICacheService;
import com.mortals.framework.utils.ServletUtils; import com.mortals.framework.utils.ServletUtils;
import com.mortals.xhx.base.system.upload.service.UploadService; import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.model.UserQuery;
import com.mortals.xhx.base.system.user.service.UserService; import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.attendance.model.AttendanceLeaveRecordEntity; import com.mortals.xhx.module.attendance.model.AttendanceLeaveRecordEntity;
...@@ -23,7 +21,6 @@ import com.mortals.xhx.module.dept.model.DeptEntity; ...@@ -23,7 +21,6 @@ import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptQuery; import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService; import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.door.model.DoorEntity; import com.mortals.xhx.module.door.model.DoorEntity;
import com.mortals.xhx.module.door.model.DoorQuery;
import com.mortals.xhx.module.door.service.DoorService; import com.mortals.xhx.module.door.service.DoorService;
import com.mortals.xhx.module.hik.door.model.req.door.DoorEventReq; import com.mortals.xhx.module.hik.door.model.req.door.DoorEventReq;
import com.mortals.xhx.module.hik.door.model.req.door.HikDoorEventReq; import com.mortals.xhx.module.hik.door.model.req.door.HikDoorEventReq;
...@@ -35,7 +32,6 @@ import com.mortals.xhx.module.hik.staff.service.IHikStaffService; ...@@ -35,7 +32,6 @@ import com.mortals.xhx.module.hik.staff.service.IHikStaffService;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.StaffQuery; import com.mortals.xhx.module.staff.model.StaffQuery;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import com.mortals.xhx.module.workman.model.WorkmanEntity;
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;
...@@ -227,54 +223,6 @@ public class TestController { ...@@ -227,54 +223,6 @@ public class TestController {
return "ok"; return "ok";
} }
//
@GetMapping("updatePersons")
@UnAuth
public String updatePersons() {
log.info("更新用户手机号码");
cacheService.select(1);
Map<String, String> map = cacheService.hgetAll("com:mortals:xhx:module:workman:model:WorkmanEntity");
cacheService.select(14);
Map<String, WorkmanEntity> userMap = new HashMap<>();
map.entrySet().stream().forEach(item -> {
String value = item.getValue();
WorkmanEntity workmanEntity = JSONObject.parseObject(value, WorkmanEntity.class);
userMap.put(workmanEntity.getName(), workmanEntity);
});
List<StaffEntity> staffEntities = staffService.find(new StaffQuery());
ArrayList<StaffEntity> updateList = new ArrayList<>();
for (StaffEntity staffEntity : staffEntities) {
if (ObjectUtils.isEmpty(staffEntity.getPhoneNumber())) {
WorkmanEntity workmanEntity = userMap.get(staffEntity.getName());
if (!ObjectUtils.isEmpty(workmanEntity)) {
staffEntity.setPhoneNumber(workmanEntity.getMobile());
updateList.add(staffEntity);
}
}
}
if (!ObjectUtils.isEmpty(updateList)) {
log.info("更新数量:" + updateList.size());
for (StaffEntity staffEntity : updateList) {
staffService.update(staffEntity);
//更新绑定的系统用户手机号码
UserQuery userQuery = new UserQuery();
userQuery.setCustomerId(staffEntity.getId());
UserEntity userEntity = userService.selectOne(userQuery);
if (userEntity != null) {
Map<String, Object> condition = new HashMap<>(1);
condition.put("id", userEntity.getId());
Map<String, Object> data = new HashMap<>(1);
data.put("mobile", staffEntity.getPhoneNumber());
userService.getUserDao().update(data, condition);
}
}
}
return "更新数量:" + updateList.size();
}
@GetMapping("downPersonsPic") @GetMapping("downPersonsPic")
......
package com.mortals.xhx.busiz.h5.req;
import com.mortals.framework.annotation.Excel;
import com.mortals.xhx.busiz.BaseReq;
import com.mortals.xhx.module.perform.model.PerformAttendAppealFilesEntity;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Data
public class AppealReq extends BaseReq {
//申诉开始时间
private String apperalStartDate;
//申诉结束时间
private String appealEndDate;
//类型
private String performType;
private Integer appealResult;
private Integer processStatus;
/**
* 当前员工id
*/
private Long staffId;
/**
* 核查记录id
*/
private Long Id;
/**
* 申诉说明
*/
private String appealDesc;
/**
* 绩效记录申诉附件信息信息
*/
private List<PerformAttendAppealFilesEntity> performAttendAppealFilesList = new ArrayList<>();
;
private Long checkRecordId;
}
package com.mortals.xhx.busiz.h5.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.xhx.busiz.BaseReq;
import com.mortals.xhx.module.feedback.model.FeedbackAnswerEntity;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class FeedbackSaveReq extends BaseReq {
private Long feedbackId;
/**
* 用户id号
*/
private Long staffId;
private List<FeedbackAnswerEntity> feedbackAnswerList;
}
...@@ -2,36 +2,20 @@ package com.mortals.xhx.busiz.h5.web; ...@@ -2,36 +2,20 @@ package com.mortals.xhx.busiz.h5.web;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.ap.CookieService;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.ap.SysConstains;
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.service.IAuthTokenService; import com.mortals.framework.service.IAuthTokenService;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.IUser; import com.mortals.framework.service.IUser;
import com.mortals.framework.util.AESUtil;
import com.mortals.framework.util.DateUtils; import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.HttpUtil;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BaseJsonBodyController; import com.mortals.framework.web.BaseJsonBodyController;
import com.mortals.xhx.base.login.web.LoginForm; import com.mortals.xhx.base.login.web.LoginForm;
import com.mortals.xhx.base.system.menu.model.MenuEntity;
import com.mortals.xhx.base.system.menu.service.MenuService;
import com.mortals.xhx.base.system.resource.service.ResourceService;
import com.mortals.xhx.base.system.user.model.UserEntity; import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.model.UserQuery;
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.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService; import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import com.mortals.xhx.module.window.model.WindowOwnerEntity;
import com.mortals.xhx.module.window.model.WindowOwnerQuery;
import com.mortals.xhx.module.window.service.WindowOwnerService;
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;
...@@ -41,10 +25,8 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -41,10 +25,8 @@ 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.util.*;
import java.util.stream.Collectors;
import static com.mortals.xhx.common.key.ErrorCode.*; import static com.mortals.xhx.common.key.ErrorCode.DING_AUTH_FAIL;
@RestController @RestController
@Slf4j @Slf4j
...@@ -60,8 +42,6 @@ public class ApiLoginController extends BaseJsonBodyController { ...@@ -60,8 +42,6 @@ public class ApiLoginController extends BaseJsonBodyController {
private IDingPersonService dingPersonService; private IDingPersonService dingPersonService;
@Autowired @Autowired
private StaffService staffService; private StaffService staffService;
@Autowired
private WindowOwnerService windowOwnerService;
@RequestMapping("login") @RequestMapping("login")
...@@ -99,26 +79,7 @@ public class ApiLoginController extends BaseJsonBodyController { ...@@ -99,26 +79,7 @@ public class ApiLoginController extends BaseJsonBodyController {
if(userEntity.getCustomerId()!=null){ if(userEntity.getCustomerId()!=null){
staffEntity = staffService.getCache(userEntity.getCustomerId().toString()); staffEntity = staffService.getCache(userEntity.getCustomerId().toString());
} }
if(staffEntity!=null){ if(staffEntity==null){
WindowOwnerEntity windowOwnerEntity = windowOwnerService.selectOne(new WindowOwnerQuery().staffId(staffEntity.getId()));
if(windowOwnerEntity == null){
userEntity.setUserType(1); //工作人员
}else {
if(windowOwnerEntity.getInspect()==1){
userEntity.setUserType(3); //具有巡检的窗口负责人
}else {
userEntity.setUserType(2); //普通窗口负责人
}
if(StringUtils.isNotEmpty(windowOwnerEntity.getStaffIds())){
List<Long> staffIdList = Arrays.asList(windowOwnerEntity.getStaffIds().split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList());
windowOwnerEntity.setStaffCount(staffIdList.size());
}else {
windowOwnerEntity.setStaffCount(0);
}
windowOwnerEntity.setWindowOwnerDetailList(null);
data.put("windowOwner", windowOwnerEntity);
}
}else {
throw new AppException("当前用户不支持H5登录!"); throw new AppException("当前用户不支持H5登录!");
} }
// HashSet<Integer> set = new HashSet<>(); // HashSet<Integer> set = new HashSet<>();
......
package com.mortals.xhx.busiz.h5.web; package com.mortals.xhx.busiz.h5.web;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.ap.CookieService; import com.mortals.framework.ap.CookieService;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.ap.SysConstains;
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.service.IAuthTokenService; import com.mortals.framework.service.IAuthTokenService;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.IUser; import com.mortals.framework.service.IUser;
import com.mortals.framework.util.AESUtil;
import com.mortals.framework.util.DateUtils; import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.HttpUtil;
import com.mortals.framework.util.StringUtils;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.login.web.LoginForm;
import com.mortals.xhx.base.system.menu.model.MenuEntity;
import com.mortals.xhx.base.system.menu.service.MenuService;
import com.mortals.xhx.base.system.resource.service.ResourceService;
import com.mortals.xhx.base.system.user.model.UserEntity; import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.model.UserQuery; import com.mortals.xhx.base.system.user.model.UserQuery;
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.busiz.h5.req.DingTalkReq; import com.mortals.xhx.busiz.h5.req.DingTalkReq;
import com.mortals.xhx.common.code.GoWorkResultEnum;
import com.mortals.xhx.common.code.OffWorkResultEnum;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.common.pdu.HomeStatInfo;
import com.mortals.xhx.module.attendance.model.AttendanceRecordEntity;
import com.mortals.xhx.module.attendance.model.AttendanceRecordQuery;
import com.mortals.xhx.module.attendance.model.AttendanceVacationRecordQuery;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.dingding.IDingTalkService;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService; import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.StaffQuery; import com.mortals.xhx.module.staff.model.StaffQuery;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import com.mortals.xhx.module.window.model.WindowOwnerEntity;
import com.mortals.xhx.module.window.model.WindowOwnerQuery;
import com.mortals.xhx.module.window.service.WindowOwnerService;
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;
...@@ -53,9 +28,8 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -53,9 +28,8 @@ 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.HashMap;
import java.util.*; import java.util.Map;
import java.util.stream.Collectors;
import static com.mortals.xhx.common.key.ErrorCode.*; import static com.mortals.xhx.common.key.ErrorCode.*;
...@@ -81,8 +55,6 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U ...@@ -81,8 +55,6 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U
@Autowired @Autowired
private IDingPersonService dingPersonService; private IDingPersonService dingPersonService;
@Autowired
private WindowOwnerService windowOwnerService;
@RequestMapping("authlogin") @RequestMapping("authlogin")
...@@ -113,32 +85,6 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U ...@@ -113,32 +85,6 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U
} }
data.put("id", userEntity.getId()); data.put("id", userEntity.getId());
if(userEntity!=null) {
StaffEntity staffEntity = null;
if (userEntity.getCustomerId() != null) {
staffEntity = staffService.getCache(userEntity.getCustomerId().toString());
}
if (staffEntity != null) {
WindowOwnerEntity windowOwnerEntity = windowOwnerService.selectOne(new WindowOwnerQuery().staffId(staffEntity.getId()));
if (windowOwnerEntity == null) {
userEntity.setUserType(1); //工作人员
} else {
if (windowOwnerEntity.getInspect() == 1) {
userEntity.setUserType(3); //具有巡检的窗口负责人
} else {
userEntity.setUserType(2); //普通窗口负责人
}
if (StringUtils.isNotEmpty(windowOwnerEntity.getStaffIds())) {
List<Long> staffIdList = Arrays.asList(windowOwnerEntity.getStaffIds().split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList());
windowOwnerEntity.setStaffCount(staffIdList.size());
} else {
windowOwnerEntity.setStaffCount(0);
}
windowOwnerEntity.setWindowOwnerDetailList(null);
data.put("windowOwner", windowOwnerEntity);
}
}
}
data.put("staffId", userEntity.getCustomerId()); data.put("staffId", userEntity.getCustomerId());
data.put("userType", userEntity.getUserType()); data.put("userType", userEntity.getUserType());
userEntity.setLoginTime(System.currentTimeMillis()); userEntity.setLoginTime(System.currentTimeMillis());
...@@ -239,32 +185,6 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U ...@@ -239,32 +185,6 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U
String token = authTokenService.getToken(request); String token = authTokenService.getToken(request);
data.put("id", user.getId()); data.put("id", user.getId());
data.put("token", token); data.put("token", token);
if(userEntity!=null) {
StaffEntity staffEntity = null;
if (userEntity.getCustomerId() != null) {
staffEntity = staffService.getCache(userEntity.getCustomerId().toString());
}
if (staffEntity != null) {
WindowOwnerEntity windowOwnerEntity = windowOwnerService.selectOne(new WindowOwnerQuery().staffId(staffEntity.getId()));
if (windowOwnerEntity == null) {
userEntity.setUserType(1); //工作人员
} else {
if (windowOwnerEntity.getInspect() == 1) {
userEntity.setUserType(3); //具有巡检的窗口负责人
} else {
userEntity.setUserType(2); //普通窗口负责人
}
if (StringUtils.isNotEmpty(windowOwnerEntity.getStaffIds())) {
List<Long> staffIdList = Arrays.asList(windowOwnerEntity.getStaffIds().split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList());
windowOwnerEntity.setStaffCount(staffIdList.size());
} else {
windowOwnerEntity.setStaffCount(0);
}
windowOwnerEntity.setWindowOwnerDetailList(null);
data.put("windowOwner", windowOwnerEntity);
}
}
}
data.put("staffId", userEntity.getCustomerId()); data.put("staffId", userEntity.getCustomerId());
data.put("userType", userEntity.getUserType()); data.put("userType", userEntity.getUserType());
ret.put(KEY_RESULT_DATA, data); ret.put(KEY_RESULT_DATA, data);
......
package com.mortals.xhx.busiz.h5.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.model.Context;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.busiz.h5.req.PerformReq;
import com.mortals.xhx.common.code.AppealStatusEnum;
import com.mortals.xhx.module.perform.model.PerformErrorMessageEntity;
import com.mortals.xhx.module.perform.service.PerformErrorMessageService;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.text.SimpleDateFormat;
import java.util.*;
@RestController
@Slf4j
@RequestMapping("/api/v1/perform/error/message")
public class PerformErrorMessagePerformApiController extends AbstractBaseController<PerformReq>{
@Autowired
private StaffPerformSummaryService staffPerformSummaryService;
@Autowired
private PerformErrorMessageService performErrorMessageService;
/**
* 个人绩效汇总分数信息
* @param query
* @return
*/
@PostMapping({"summary"})
public String getSummary(@RequestBody PerformErrorMessageEntity query){
JSONObject ret = new JSONObject();
String busiDesc = "查看个人绩效汇总";
Context context = this.getContext();
Map<String, Object> model = new HashMap();
if(query.getStaffId()==null){
return this.createFailJsonResp("绩效人员信息不能为空");
}else {
StaffPerformSummaryEntity summaryQuery = new StaffPerformSummaryEntity();
summaryQuery.setStaffId(query.getStaffId());
if(StringUtils.isNotEmpty(query.getErrorTimeStart())){
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = sdf.parse(query.getErrorTimeStart());
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
summaryQuery.setYear(calendar.get(Calendar.YEAR));
summaryQuery.setMonth(calendar.get(Calendar.MONTH)+1);
}catch (Exception e){
}
}else {
query.setErrorTimeStart(DateUtils.getCurrDateTime("yyyy-MM")+"-01");
Calendar calendar = Calendar.getInstance();
summaryQuery.setYear(calendar.get(Calendar.YEAR));
summaryQuery.setMonth(calendar.get(Calendar.MONTH)+1);
}
StaffPerformSummaryEntity staffPerformSummaryEntity = staffPerformSummaryService.selectOne(summaryQuery);
if(staffPerformSummaryEntity!=null) {
model.put("totalScore",staffPerformSummaryEntity.getTotalScore());
}
int errorCount = performErrorMessageService.count(query,null);
model.put("errorCount", errorCount);
List<Integer> appeal = Arrays.asList(1,2,3);
query.setAppealStatusList(appeal);
int appealCount = performErrorMessageService.count(query,null);
model.put("appealCount", appealCount);
ret.put("data", model);
ret.put("code", 1);
ret.put("msg", model.remove("message_info"));
ret.put("dict", model.remove("dict"));
return ret.toJSONString();
}
}
/**
* 个人绩效申诉情况
* @param query
* @return
*/
@PostMapping({"appeal"})
public String getAppeal(@RequestBody PerformErrorMessageEntity query){
JSONObject ret = new JSONObject();
String busiDesc = "查看个人申诉情况";
Context context = this.getContext();
Map<String, Object> model = new HashMap();
if(query.getStaffId()==null){
return this.createFailJsonResp("绩效人员信息不能为空");
}else {
if(CollectionUtils.isEmpty(query.getAppealStatusList())) {
List<Integer> appeal = Arrays.asList(1, 2, 3);
query.setAppealStatusList(appeal);
}
List<PerformErrorMessageEntity> list = performErrorMessageService.find(query);
int appeal1 = 0;
int appeal2 = 0;
int appeal3 = 0;
for(PerformErrorMessageEntity item:list){
if(item.getAppealStatus()==AppealStatusEnum.申诉中.getValue()){
appeal1++;
}
if(item.getAppealStatus()==AppealStatusEnum.申诉拒绝.getValue()){
appeal2++;
}
if(item.getAppealStatus()==AppealStatusEnum.申诉通过.getValue()){
appeal3++;
}
}
model.put("shensuzhong", appeal1);
model.put("shensujujue", appeal2);
model.put("shensutongguo", appeal3);
// int errorCount = performErrorMessageService.count(query,null);
// model.put("errorCount", errorCount);
//
// int appealCount = performErrorMessageService.count(query,null);
// model.put("appealCount", appealCount);
ret.put("data", model);
ret.put("code", 1);
ret.put("msg", model.remove("message_info"));
ret.put("dict", model.remove("dict"));
return ret.toJSONString();
}
}
}
package com.mortals.xhx.common.utils;
import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.module.check.model.CheckAttendRecordEntity;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.check.service.CheckAttendRecordService;
import com.mortals.xhx.utils.SpringUtils;
import lombok.AllArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
/**
* 考勤核查后续处理线程
*
* @author:
* @date: 2023/7/17 14:42
*/
@RequiredArgsConstructor
@Slf4j
public class AttendPostServiceThread implements Runnable {
private CheckAttendRecordService checkAttendRecordService;
@NonNull
private CheckAttendRecordEntity entity;
@Override
public void run() {
checkAttendRecordService = SpringUtils.getBean(CheckAttendRecordService.class);
try {
checkAttendRecordService.sendCheckDingTalk(entity);
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(entity.getStaffId());
query.setCheckTimeStart(DateUtils.getStrDate(entity.getCheckTime()));
query.setCheckTimeEnd(query.getCheckTimeStart());
checkAttendRecordService.summaryCheck(query);
} catch (Exception e) {
log.error("汇总已审核的核查记录出错", e);
}
}
}
package com.mortals.xhx.common.utils;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.base.system.message.MessageService;
import com.mortals.xhx.common.code.PerformTypeEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.dingding.CheckDingMsg;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService;
import com.mortals.xhx.utils.SpringUtils;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import java.util.Date;
@RequiredArgsConstructor
@Slf4j
public class SendAppealDingDingMsgThread implements Runnable {
private IDingPersonService dingPersonService;
private StaffService staffService;
private MessageService messageService;
@NonNull
private PerformAttendAppealEntity entity;
@Override
public void run() {
String ruleStr = String.format("%s/%s/%s", PerformTypeEnum.考勤绩效.getDesc(), entity.getCategoryName(), entity.getRuleName());
dingPersonService = SpringUtils.getBean(IDingPersonService.class);
staffService = SpringUtils.getBean(StaffService.class);
messageService = SpringUtils.getBean(MessageService.class);
StaffEntity staffCache = staffService.getCache(entity.getStaffId().toString());
Rest<String> personRest = dingPersonService.getPersonByMobile(staffCache.getPhoneNumber());
if (YesNoEnum.YES.getValue() == personRest.getCode()) {
CheckDingMsg checkDingMsg = new CheckDingMsg();
checkDingMsg.setUserIds(personRest.getData());
checkDingMsg.setDateTime(DateUtil.formatDateTime(entity.getAppealTime() == null ? new Date() : entity.getAppealTime()));
checkDingMsg.setRuleStr(ruleStr);
checkDingMsg.setScore(entity.getScore().toString());
checkDingMsg.setAppealResult(entity.getAppealResult());
checkDingMsg.setAppealDesc(entity.getAppealDesc());
Rest<String> msgRest = messageService.sendDingTalkAppealMsg(checkDingMsg);
log.info("钉钉消息发送结果:{}", JSONObject.toJSONString(msgRest));
} else {
log.error("根据手机号码获取人员错误,msg:{}", personRest.getMsg());
}
}
}
package com.mortals.xhx.common.utils;
import com.mortals.xhx.common.pdu.WeightPdu;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryEditEntity;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity;
import java.math.BigDecimal;
/**
* 员工绩效分数计算
*/
public class StaffPerformUtil {
/** 群众评议总分 **/
//public static BigDecimal REVIEW_SCORE = new BigDecimal(20);
public static BigDecimal SCORE100 = new BigDecimal(100);
public static void computeSummary(StaffPerformSummaryEntity staffPerformSummaryEntity, WeightPdu weightPdu, StaffEntity staffEntity){
BigDecimal reviewScore = weightPdu.reviewWeight().add(staffPerformSummaryEntity.getReviewScore()); //评价分数默认20分扣完为止
if(reviewScore.compareTo(BigDecimal.ZERO)< 0){
reviewScore = BigDecimal.ZERO;
}
BigDecimal attendScore = weightPdu.attendWeight().add(staffPerformSummaryEntity.getAttendScore()); //考勤
if(attendScore.compareTo(BigDecimal.ZERO)< 0){
attendScore = BigDecimal.ZERO;
}
BigDecimal otherScore = staffPerformSummaryEntity.getOtherScore(); //其他绩效加分项
BigDecimal goworkScore = weightPdu.goworkWeight().add(staffPerformSummaryEntity.getGoworkScore()); //办件
if(goworkScore.compareTo(BigDecimal.ZERO)< 0){
goworkScore = BigDecimal.ZERO;
}
BigDecimal effectScore = weightPdu.effectWeight().add(staffPerformSummaryEntity.getEffectScore()); //效能
if(effectScore.compareTo(BigDecimal.ZERO)< 0){
effectScore = BigDecimal.ZERO;
}
BigDecimal complainScore = staffPerformSummaryEntity.getComplainScore(); //自评不用加100
if(complainScore.compareTo(BigDecimal.ZERO)==0){
complainScore = SCORE100;
}
complainScore = complainScore.multiply(weightPdu.selfWeight());
BigDecimal summary = new BigDecimal(0);
if(staffEntity.getReviewCheck()==1) {
summary = summary.add(reviewScore);
}else {
summary = summary.add(weightPdu.reviewWeight());
staffPerformSummaryEntity.setErrorScore(staffPerformSummaryEntity.getErrorScore().subtract(staffPerformSummaryEntity.getReviewScore()));
staffPerformSummaryEntity.setReviewScore(BigDecimal.ZERO);
}
if(staffEntity.getAttendCheck()==1) {
summary = summary.add(attendScore);
}else {
summary = summary.add(weightPdu.attendWeight());
staffPerformSummaryEntity.setErrorScore(staffPerformSummaryEntity.getErrorScore().subtract(staffPerformSummaryEntity.getAttendScore()));
staffPerformSummaryEntity.setAttendScore(BigDecimal.ZERO);
}
summary = summary.add(otherScore);
if(staffEntity.getEffectCheck()==1){
summary = summary.add(effectScore);
}else {
summary = summary.add(weightPdu.effectWeight());
staffPerformSummaryEntity.setErrorScore(staffPerformSummaryEntity.getErrorScore().subtract(staffPerformSummaryEntity.getEffectScore()));
staffPerformSummaryEntity.setEffectScore(BigDecimal.ZERO);
}
if(staffEntity.getGoworkCheck()==1) {
summary = summary.add(goworkScore);
}else {
summary = summary.add(weightPdu.goworkWeight());
staffPerformSummaryEntity.setErrorScore(staffPerformSummaryEntity.getErrorScore().subtract(staffPerformSummaryEntity.getGoworkScore()));
staffPerformSummaryEntity.setGoworkScore(BigDecimal.ZERO);
}
if(staffEntity.getComplainCheck()==1){
summary = summary.add(complainScore);
}else {
summary = summary.add(weightPdu.selfWeight());
BigDecimal complainScoreErro = SCORE100.subtract(staffPerformSummaryEntity.getComplainScore());
staffPerformSummaryEntity.setErrorScore(staffPerformSummaryEntity.getErrorScore().subtract(BigDecimal.ZERO.subtract(complainScoreErro)));
staffPerformSummaryEntity.setComplainScore(BigDecimal.ZERO);
}
staffPerformSummaryEntity.setTotalScore(summary);
if(staffPerformSummaryEntity.getAddTotalScore()!=null){
staffPerformSummaryEntity.setSumScore(staffPerformSummaryEntity.getTotalScore().add(staffPerformSummaryEntity.getAddTotalScore()));
}
}
public static void computeSummary(StaffPerformSummaryEditEntity staffPerformSummaryEntity, WeightPdu weightPdu){
BigDecimal reviewScore = weightPdu.reviewWeight().add(staffPerformSummaryEntity.getReviewScore()); //评价分数默认20分扣完为止
if(reviewScore.compareTo(BigDecimal.ZERO)< 0){
reviewScore = BigDecimal.ZERO;
}
BigDecimal attendScore = weightPdu.attendWeight().add(staffPerformSummaryEntity.getAttendScore()); //考勤
if(attendScore.compareTo(BigDecimal.ZERO)< 0){
attendScore = BigDecimal.ZERO;
}
BigDecimal otherScore = staffPerformSummaryEntity.getOtherScore(); //其他绩效加分项
BigDecimal goworkScore = weightPdu.goworkWeight().add(staffPerformSummaryEntity.getGoworkScore()); //办件
if(goworkScore.compareTo(BigDecimal.ZERO)< 0){
goworkScore = BigDecimal.ZERO;
}
BigDecimal effectScore = weightPdu.effectWeight().add(staffPerformSummaryEntity.getEffectScore()); //效能
if(effectScore.compareTo(BigDecimal.ZERO)< 0){
effectScore = BigDecimal.ZERO;
}
BigDecimal complainScore = staffPerformSummaryEntity.getComplainScore(); //自评不用加100
if(complainScore.compareTo(BigDecimal.ZERO)==0){
complainScore = SCORE100;
}
complainScore = complainScore.multiply(weightPdu.selfWeight());
BigDecimal summary = new BigDecimal(0);
summary = summary.add(reviewScore);
summary = summary.add(attendScore);
summary = summary.add(effectScore);
summary = summary.add(goworkScore);
summary = summary.add(complainScore);
summary = summary.add(otherScore);
staffPerformSummaryEntity.setTotalScore(summary);
if(staffPerformSummaryEntity.getAddTotalScore()!=null){
staffPerformSummaryEntity.setSumScore(staffPerformSummaryEntity.getTotalScore().add(staffPerformSummaryEntity.getAddTotalScore()));
}
}
}
package com.mortals.xhx.daemon.applicationservice;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.springcloud.service.IApplicationStartedService;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.common.code.CheckTypeEnum;
import com.mortals.xhx.common.utils.StaffPerformUtil;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.check.service.*;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryEditService;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.QueryTimeoutException;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import static com.mortals.xhx.common.key.RedisKey.KEY_CHECK_SUMMARY_CACHE;
import static com.mortals.xhx.common.key.RedisKey.STAFF_PERFORM_SUMMARY;
/***
* 绩效汇总任务执行
*/
@Component
@Slf4j
public class StaffCheckSummaryService implements IApplicationStartedService {
protected Boolean stopped = false;
@Autowired
private ICacheService cacheService;
@Autowired
private CheckAttendRecordService checkAttendRecordService;
@Autowired
private CheckEffectRecordService checkEffectRecordService;
@Autowired
private CheckGoworkRecordService checkGoworkRecordService;
@Autowired
private CheckReviewRecordService checkReviewRecordService;
@Autowired
private CheckComplainRecordService checkComplainRecordService;
@Autowired
private CheckWindowWorkmanPerformService checkWindowWorkmanPerformService;
@Autowired
private CheckOtherRecordService checkOtherRecordService;
@Autowired
private StaffPerformSummaryService staffPerformSummaryService;
@Autowired
private StaffPerformSummaryEditService staffPerformSummaryEditService;
@Override
public void start() {
Thread sendThread = new Thread(new Runnable() {
@Override
public void run() {
int waitTime = 50;
while (!stopped) {
try {
StaffCheckSummaryQuery query = cacheService.brpop(KEY_CHECK_SUMMARY_CACHE,60, StaffCheckSummaryQuery.class);
if(!ObjectUtils.isEmpty(query)){
log.info("绩效分数汇总开始:" + JSONObject.toJSONString(query));
if(StringUtils.isNotEmpty(query.getCheckTimeStart())){
Date date = DateUtil.parse(query.getCheckTimeStart(),"yyyy-MM-dd");
query.setCheckTimeStart(DateUtil.beginOfMonth(date).toDateStr());
query.setCheckTimeEnd(DateUtil.endOfMonth(date).toDateStr());
query.setYear(DateUtil.year(date));
int checkMonth = DateUtil.month(date)+1;
query.setMonth(checkMonth);
Date now = new Date();
int nowMonth = DateUtil.month(now)+1;
if(checkMonth==nowMonth){
//汇总当月绩效
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH,-1);
query.setCheckTimeEnd(DateUtils.getStrDate(calendar.getTime()));
query.setCheckTimeStart(DateUtil.beginOfMonth(calendar.getTime()).toDateStr());
}
}
//汇总前初始化绩效避免之前有扣分但被全部撤销的情况
Date date = DateUtils.StrToDateTime(query.getCheckTimeStart());
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH) + 1;
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity.setReviewScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setOtherScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setGoworkScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setEffectScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setComplainScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setAttendScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setTotalScore(StaffPerformUtil.SCORE100);
//staffPerformSummaryEntity.setAddTotalScore(BigDecimal.ZERO);
staffPerformSummaryEntity.setErrorScore(BigDecimal.ZERO);
//staffPerformSummaryEntity.setSumScore(StaffPerformUtil.SCORE100);
staffPerformSummaryEntity.setUpdateTime(new Date());
Map<String,Object> condition = new HashMap<>();
condition.put("year",year);
condition.put("month",month);
if(query.getStaffId()!=null){
condition.put("staffId",query.getStaffId());
}
//staffPerformSummaryService.getDao().update(staffPerformSummaryEntity,condition);
staffPerformSummaryService.getDao().updateSumScore(condition);
if(query.getCheckType() == CheckTypeEnum.考勤绩效.getValue()){
checkAttendRecordService.summaryCheck(query);
}
if(query.getCheckType() == CheckTypeEnum.效能绩效.getValue()){
checkEffectRecordService.summaryCheck(query);
}
if(query.getCheckType() == CheckTypeEnum.办件绩效.getValue()){
checkGoworkRecordService.summaryCheck(query);
}
if(query.getCheckType() == CheckTypeEnum.评价绩效.getValue()){
checkReviewRecordService.summaryCheck(query);
checkComplainRecordService.summaryCheck(query);
}
if(query.getCheckType() == CheckTypeEnum.自评绩效.getValue()){
checkWindowWorkmanPerformService.summaryCheck(query);
}
if(query.getCheckType() == CheckTypeEnum.其它绩效.getValue()){
checkOtherRecordService.summaryCheck(query);
}
if(query.getCheckType()==null){
checkAttendRecordService.summaryCheck(query);
checkEffectRecordService.summaryCheck(query);
checkGoworkRecordService.summaryCheck(query);
checkReviewRecordService.summaryCheck(query);
checkComplainRecordService.summaryCheck(query);
checkWindowWorkmanPerformService.summaryCheck(query);
checkOtherRecordService.summaryCheck(query);
log.info("绩效分数汇总完成");
cacheService.set(STAFF_PERFORM_SUMMARY, DateUtils.getCurrStrDateTime());
}
//同步绩效汇总数据
staffPerformSummaryEditService.syncStaffPerformSummary(year,month,query.getStaffId());
}
try {
Thread.sleep(waitTime);
} catch (InterruptedException e2) {
}
} catch (QueryTimeoutException e) {
} catch (Exception e) {
log.error("绩效分数汇总异常", e);
try {
Thread.sleep(waitTime);
} catch (InterruptedException e2) {
}
}
}
}
});
sendThread.start();
}
@Override
public void stop() {
log.info("停止服务..");
this.stopped = true;
}
@Override
public int getOrder() {
return 30;
}
}
...@@ -6,13 +6,9 @@ import com.mortals.framework.service.ICacheService; ...@@ -6,13 +6,9 @@ import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.ITask; import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService; import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.framework.util.DateUtils; import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.common.code.CheckTypeEnum;
import com.mortals.xhx.module.attendance.model.AttendanceRecordErrorQuery; import com.mortals.xhx.module.attendance.model.AttendanceRecordErrorQuery;
import com.mortals.xhx.module.attendance.model.vo.AttendanceSummaryQuery; import com.mortals.xhx.module.attendance.model.vo.AttendanceSummaryQuery;
import com.mortals.xhx.module.attendance.service.AttendanceRecordErrorService; import com.mortals.xhx.module.attendance.service.AttendanceRecordErrorService;
import com.mortals.xhx.module.attendance.service.AttendanceStatService;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
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.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -21,7 +17,6 @@ import java.util.Calendar; ...@@ -21,7 +17,6 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
import static com.mortals.xhx.common.key.RedisKey.KEY_ATTENDANCE_STAT_CACHE; import static com.mortals.xhx.common.key.RedisKey.KEY_ATTENDANCE_STAT_CACHE;
import static com.mortals.xhx.common.key.RedisKey.KEY_CHECK_SUMMARY_CACHE;
/** /**
* 考勤汇总 * 考勤汇总
...@@ -53,30 +48,6 @@ public class AttendanceSummaryTaskImpl implements ITaskExcuteService { ...@@ -53,30 +48,6 @@ public class AttendanceSummaryTaskImpl implements ITaskExcuteService {
cacheService.lpush(KEY_ATTENDANCE_STAT_CACHE, query); cacheService.lpush(KEY_ATTENDANCE_STAT_CACHE, query);
//统计添加前一天考勤中绩效异常记录
log.info("统计添加前一天考勤中绩效异常记录开始");
AttendanceRecordErrorQuery errorQuery = new AttendanceRecordErrorQuery();
errorQuery.setErrorDateTimeStart(DateUtil.yesterday().toDateStr());
errorQuery.setErrorDateTimeEnd(DateUtil.yesterday().toDateStr());
attendanceRecordErrorService.doReprocess(errorQuery, null);
log.info("统计添加前一天考勤中绩效异常记录结束");
try {
log.info("汇总最近两个月绩效分数开始");
StaffCheckSummaryQuery summaryQuery = new StaffCheckSummaryQuery();
Calendar now1 = Calendar.getInstance();
now1.setTime(new Date());
now1.add(Calendar.MONTH,-1);
summaryQuery.setCheckTimeStart(DateUtils.getStrDate(now1.getTime()));
summaryQuery.setCheckTimeEnd(DateUtils.getCurrStrDate());
cacheService.lpush(KEY_CHECK_SUMMARY_CACHE, summaryQuery);
summaryQuery.setCheckTimeStart(DateUtils.getCurrStrDate());
summaryQuery.setCheckTimeEnd(DateUtils.getCurrStrDate());
cacheService.lpush(KEY_CHECK_SUMMARY_CACHE, summaryQuery);
log.info("汇总最近两个月绩效分数结束");
} catch (Exception e) {
log.error("汇总最近两个月绩效分数出错", e);
}
} }
@Override @Override
......
package com.mortals.xhx.daemon.task;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.common.code.StaffSatusEnum;
import com.mortals.xhx.module.holiday.model.HolidayEntity;
import com.mortals.xhx.module.holiday.model.HolidayQuery;
import com.mortals.xhx.module.holiday.service.HolidayService;
import com.mortals.xhx.module.staff.model.*;
import com.mortals.xhx.module.staff.service.StaffPerformStatService;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import com.mortals.xhx.module.staff.service.StaffService;
import com.mortals.xhx.module.window.model.WindowPerformSummaryEntity;
import com.mortals.xhx.module.window.model.WindowPerformSummaryQuery;
import com.mortals.xhx.module.window.service.WindowPerformSummaryService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
/**
* 员工绩效数据初始化任务
*/
@Slf4j
@Service("StaffPerformInitDataTask")
public class StaffPerformInitDataTaskImpl implements ITaskExcuteService {
@Autowired
private StaffPerformStatService staffPerformStatService;
@Autowired
private StaffPerformSummaryService staffPerformSummaryService;
@Autowired
private HolidayService holidayService;
@Autowired
private StaffService staffService;
@Autowired
private WindowPerformSummaryService windowPerformSummaryService;
@Override
public void excuteTask(ITask task) throws AppException {
boolean isReturn = false;
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH)+1;
int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
String dateStr = DateUtils.getStrDate(calendar.getTime());
//判断是否为特定节假日
HolidayQuery holidayQuery = new HolidayQuery();
holidayQuery.setStartTimeStart(dateStr);
holidayQuery.setStartTimeEnd(dateStr);
HolidayEntity holidayEntity = holidayService.selectOne(holidayQuery);
if(holidayEntity!=null){
if(holidayEntity.getWorkorholiday()==0){
//特定节假日
isReturn = true;
}
}else {
//判断是否为周末
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
if (dayOfWeek == Calendar.SATURDAY || dayOfWeek == Calendar.SUNDAY) {
isReturn = true;
}
}
BigDecimal totalScore = new BigDecimal(100);
List<StaffEntity> allStaff = staffService.getAllList();
if(!isReturn) {
//非节假日非周末才做绩效初始化
if(CollectionUtils.isNotEmpty(allStaff)) {
List<StaffPerformStatEntity> list = new ArrayList<>();
allStaff.stream().forEach(item -> {
boolean flag = true;
if(item.getStatus() == StaffSatusEnum.离职.getValue()) {
if(item.getLeaveDate()!=null){
String leaveDateStr = DateUtils.getStrDate(item.getLeaveDate());
if(DateUtils.StrToDate(leaveDateStr).compareTo(DateUtils.StrToDate(dateStr)) < 0){
//离职日期在统计日期之前不统计
flag = false;
}
}
}
//绩效考核授权4个维度不启用时不再生成绩效信息
if(item.getAttendCheck()==0 && item.getEffectCheck()==0 && item.getGoworkCheck()==0 && item.getComplainCheck()==0){
flag = false;
}
if(flag){
StaffPerformStatEntity statEntity = new StaffPerformStatEntity();
statEntity.initAttrValue();
statEntity.setStaffId(item.getId());
statEntity.setStaffName(item.getName());
statEntity.setDeptId(item.getDeptId());
statEntity.setDeptName(item.getDeptName());
statEntity.setSalaId(item.getSalaId());
statEntity.setSalaName(item.getSalaName());
statEntity.setYear(year);
statEntity.setMonth(month);
statEntity.setDay(dayOfMonth);
statEntity.setTotalScore(totalScore);
statEntity.setCreateUserId(1l);
statEntity.setCreateTime(new Date());
StaffPerformStatQuery tempQuery = new StaffPerformStatQuery();
tempQuery.setStaffId(statEntity.getStaffId());
tempQuery.setYear(statEntity.getYear());
tempQuery.setMonth(statEntity.getMonth());
tempQuery.setDay(statEntity.getDay());
StaffPerformStatEntity temp = staffPerformStatService.selectOne(tempQuery);
if (temp == null) {
list.add(statEntity);
}
}
});
staffPerformStatService.save(list);
}
}
if(dayOfMonth==1){
//月初第一天初始化绩效汇总信息
if(CollectionUtils.isNotEmpty(allStaff)) {
List<StaffPerformSummaryEntity> summaryList = new ArrayList<>();
allStaff.stream().forEach(item -> {
boolean flag = true;
if(item.getStatus() == StaffSatusEnum.离职.getValue()) {
if(item.getLeaveDate()!=null){
String leaveDateStr = DateUtils.getStrDate(item.getLeaveDate());
if(DateUtils.StrToDate(leaveDateStr).compareTo(DateUtils.StrToDate(dateStr)) < 0){
//离职日期在统计日期之前不统计
flag = false;
}
}
}
//绩效考核授权4个维度不启用时不再生成绩效信息
if(item.getAttendCheck()==0 && item.getEffectCheck()==0 && item.getGoworkCheck()==0 && item.getComplainCheck()==0){
flag = false;
}
if(flag) {
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity.initAttrValue();
staffPerformSummaryEntity.setStaffId(item.getId());
staffPerformSummaryEntity.setWorkNum(item.getWorkNum());
staffPerformSummaryEntity.setStaffName(item.getName());
staffPerformSummaryEntity.setDeptId(item.getDeptId());
staffPerformSummaryEntity.setDeptName(item.getDeptName());
staffPerformSummaryEntity.setSalaId(item.getSalaId());
staffPerformSummaryEntity.setSalaName(item.getSalaName());
staffPerformSummaryEntity.setYear(year);
staffPerformSummaryEntity.setMonth(month);
staffPerformSummaryEntity.setTotalScore(totalScore);
staffPerformSummaryEntity.setCreateUserId(1l);
staffPerformSummaryEntity.setCreateTime(new Date());
StaffPerformSummaryQuery summaryQuery = new StaffPerformSummaryQuery();
summaryQuery.setStaffId(staffPerformSummaryEntity.getStaffId());
summaryQuery.setYear(staffPerformSummaryEntity.getYear());
summaryQuery.setMonth(staffPerformSummaryEntity.getMonth());
StaffPerformSummaryEntity tempSummary = staffPerformSummaryService.selectOne(summaryQuery);
if (tempSummary == null) {
summaryList.add(staffPerformSummaryEntity);
}
}
});
staffPerformSummaryService.save(summaryList);
}
//初始化部门窗口绩效
List<WindowPerformSummaryEntity> list = windowPerformSummaryService.find(new WindowPerformSummaryQuery().year(year).month(month));
if(CollectionUtils.isEmpty(list)) {
windowPerformSummaryService.initWindowPerformSummary(year,month);
}
}
}
@Override
public void stopTask(ITask task) throws AppException {
}
}
package com.mortals.xhx.daemon.task; package com.mortals.xhx.daemon.task;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.PageUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
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.OrderCol; import com.mortals.framework.model.OrderCol;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.ITask; import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService; import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.base.system.user.model.UserEntity; import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.common.code.CheckTypeEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.attendance.model.AttendanceRecordHikEntity;
import com.mortals.xhx.module.attendance.model.AttendanceRecordHikQuery; import com.mortals.xhx.module.attendance.model.AttendanceRecordHikQuery;
import com.mortals.xhx.module.attendance.model.vo.AttendanceSummaryQuery;
import com.mortals.xhx.module.attendance.service.AttendanceRecordHikService; import com.mortals.xhx.module.attendance.service.AttendanceRecordHikService;
import com.mortals.xhx.module.attendance.service.AttendanceStatService; import com.mortals.xhx.module.attendance.service.AttendanceStatService;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.hik.door.model.req.door.DoorEventReq;
import com.mortals.xhx.module.hik.door.model.rsp.door.DoorEventDataInfo;
import com.mortals.xhx.module.hik.door.service.IHikDoorService;
import com.mortals.xhx.module.staff.model.StaffEntity;
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.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.*; import java.util.Arrays;
import java.util.stream.Collectors; import java.util.Date;
import static com.mortals.xhx.common.key.RedisKey.KEY_ATTENDANCE_STAT_CACHE;
import static com.mortals.xhx.common.key.RedisKey.KEY_CHECK_SUMMARY_CACHE;
/** /**
* 统计计算考勤 * 统计计算考勤
......
...@@ -22,10 +22,4 @@ public interface AttendanceLeaveRecordService extends ICRUDService<AttendanceLea ...@@ -22,10 +22,4 @@ public interface AttendanceLeaveRecordService extends ICRUDService<AttendanceLea
Rest<String> syncLeaveRecord(AttendanceLeaveRecordQuery query, Context context); Rest<String> syncLeaveRecord(AttendanceLeaveRecordQuery query, Context context);
/**
* 从新生成因事假bug导致缺失的绩效考勤数据
* @param id
* @param context
*/
void doCreatPerformAttend(Long id, Context context);
} }
\ No newline at end of file
...@@ -6,7 +6,6 @@ import com.mortals.xhx.module.attendance.dao.AttendanceRecordErrorDao; ...@@ -6,7 +6,6 @@ import com.mortals.xhx.module.attendance.dao.AttendanceRecordErrorDao;
import com.mortals.xhx.module.attendance.model.AttendanceRecordErrorEntity; import com.mortals.xhx.module.attendance.model.AttendanceRecordErrorEntity;
import com.mortals.xhx.module.attendance.model.AttendanceRecordErrorQuery; import com.mortals.xhx.module.attendance.model.AttendanceRecordErrorQuery;
import com.mortals.xhx.module.attendance.model.vo.ErrorSummaryVo; import com.mortals.xhx.module.attendance.model.vo.ErrorSummaryVo;
import com.mortals.xhx.module.perform.dao.PerformErrorMessageDao;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -31,19 +30,6 @@ public interface AttendanceRecordErrorService extends ICRUDService<AttendanceRec ...@@ -31,19 +30,6 @@ public interface AttendanceRecordErrorService extends ICRUDService<AttendanceRec
*/ */
boolean errorConfirm(Long errorId); boolean errorConfirm(Long errorId);
/**
* 自动处理异常考勤记录
*
* @param date
*/
void doAutoProcess(Date date);
/**
* 按时间从新生成已处理的考勤绩效核查数据
*
* @param query
*/
void doReprocess(AttendanceRecordErrorQuery query, Context context);
/** /**
* 统计每月异常次数top10 * 统计每月异常次数top10
......
package com.mortals.xhx.module.attendance.service.work; package com.mortals.xhx.module.attendance.service.work;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.util.ThreadPool;
import com.mortals.xhx.common.code.*; import com.mortals.xhx.common.code.*;
import com.mortals.xhx.module.attendance.model.*; import com.mortals.xhx.module.attendance.model.*;
import com.mortals.xhx.module.attendance.service.*; import com.mortals.xhx.module.attendance.service.AttendanceGroupFixedworkService;
import com.mortals.xhx.module.check.model.CheckAttendRecordEntity; import com.mortals.xhx.module.attendance.service.AttendanceLeaveRecordService;
import com.mortals.xhx.module.check.model.CheckAttendRecordQuery; import com.mortals.xhx.module.attendance.service.AttendanceRecordErrorService;
import com.mortals.xhx.module.check.service.CheckAttendRecordService;
import com.mortals.xhx.module.holiday.model.HolidayEntity;
import com.mortals.xhx.module.holiday.model.HolidayQuery;
import com.mortals.xhx.module.holiday.service.HolidayService;
import com.mortals.xhx.module.perform.model.PerformAttendRecordEntity;
import com.mortals.xhx.module.perform.model.PerformAttendRecordQuery;
import com.mortals.xhx.module.perform.model.PerformErrorMessageEntity;
import com.mortals.xhx.module.perform.model.PerformErrorMessageQuery;
import com.mortals.xhx.module.perform.service.PerformAttendRecordService;
import com.mortals.xhx.module.perform.service.PerformErrorMessageService;
import com.mortals.xhx.utils.SpringUtils; import com.mortals.xhx.utils.SpringUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StopWatch;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -52,20 +35,12 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract { ...@@ -52,20 +35,12 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
private CommonData commonData; private CommonData commonData;
private PerformAttendRecordService performAttendRecordService;
private CheckAttendRecordService checkAttendRecordService;
private PerformErrorMessageService performErrorMessageService;
public FixWorkOtherAttendance(int type) { public FixWorkOtherAttendance(int type) {
super(type); super(type);
this.attendanceGroupFixedworkService = SpringUtils.getBean(AttendanceGroupFixedworkService.class); this.attendanceGroupFixedworkService = SpringUtils.getBean(AttendanceGroupFixedworkService.class);
this.errorService = SpringUtils.getBean(AttendanceRecordErrorService.class); this.errorService = SpringUtils.getBean(AttendanceRecordErrorService.class);
this.attendanceLeaveRecordService = SpringUtils.getBean(AttendanceLeaveRecordService.class); this.attendanceLeaveRecordService = SpringUtils.getBean(AttendanceLeaveRecordService.class);
this.performAttendRecordService = SpringUtils.getBean(PerformAttendRecordService.class);
this.checkAttendRecordService = SpringUtils.getBean(CheckAttendRecordService.class);
this.performErrorMessageService = SpringUtils.getBean(PerformErrorMessageService.class);
} }
...@@ -520,46 +495,7 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract { ...@@ -520,46 +495,7 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
}; };
ThreadPool.getInstance().execute(runnable);*/ ThreadPool.getInstance().execute(runnable);*/
PerformAttendRecordQuery query = new PerformAttendRecordQuery();
query.setStaffId(staffId);
query.setErrorTimeStart(DateUtil.formatDate(delErrorList.get(0).getErrorDateTime()));
query.setErrorTimeEnd(DateUtil.formatDate(delErrorList.get(0).getErrorDateTime()));
query.setRuleIdNotList(Arrays.asList(9L));
List<PerformAttendRecordEntity> attendRecords = performAttendRecordService.find(query, context);
List<PerformAttendRecordEntity> delAttendRecords = attendRecords.stream().map(item -> {
Date errorTime = item.getErrorTime();
for (AttendanceRecordErrorEntity attendRecord : delErrorList) {
if (errorTime.getTime() == attendRecord.getErrorDateTime().getTime()) {
return item;
}
}
return null;
}).filter(f -> f != null).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(delAttendRecords)) {
Long[] delIds = delAttendRecords.stream().map(i -> i.getId()).toArray(Long[]::new);
performAttendRecordService.getDao().delete(delIds);
CheckAttendRecordQuery checkAttendRecordQuery = new CheckAttendRecordQuery();
checkAttendRecordQuery.setRecordIdList(Arrays.asList(delIds));
List<CheckAttendRecordEntity> checkAttendRecordEntities = checkAttendRecordService.find(checkAttendRecordQuery, context);
if (!ObjectUtils.isEmpty(checkAttendRecordEntities)) {
Long[] checkIds = checkAttendRecordEntities.stream().map(i -> i.getId()).toArray(Long[]::new);
checkAttendRecordService.getDao().delete(checkIds);
// checkAttendRecordService.remove(checkIds, context);
// log.info("删除考勤核查记录成功,size:{}",checkIds.length);
PerformErrorMessageQuery performErrorMessageQuery = new PerformErrorMessageQuery();
performErrorMessageQuery.setPerformType(PerformTypeEnum.考勤绩效.getValue());
performErrorMessageQuery.setCheckRecordIdList(Arrays.asList(checkIds));
List<PerformErrorMessageEntity> errorList = performErrorMessageService.find(performErrorMessageQuery);
if (CollectionUtils.isNotEmpty(errorList)) {
Long[] deleteIds = errorList.stream().map(i -> i.getId()).toArray(Long[]::new);
performErrorMessageService.remove(deleteIds, context);
}
}
}
// stopWatch.stop(); // stopWatch.stop();
// log.info("删除异常记录耗时:{}ms", stopWatch.getLastTaskTimeMillis()); // log.info("删除异常记录耗时:{}ms", stopWatch.getLastTaskTimeMillis());
} }
......
...@@ -157,17 +157,4 @@ public class AttendanceLeaveRecordController extends BaseCRUDJsonBodyMappingCont ...@@ -157,17 +157,4 @@ public class AttendanceLeaveRecordController extends BaseCRUDJsonBodyMappingCont
model.put("entity",entity); model.put("entity",entity);
} }
@RequestMapping(value = {"doCreatPerformAttend"},method = {RequestMethod.POST, RequestMethod.GET})
public String doCreatPerformAttend(Long id) {
String msg="操作成功";
try {
this.service.doCreatPerformAttend(id,this.getContext());
}catch (Exception e) {
msg=e.getMessage();
}
JSONObject ret = new JSONObject();
ret.put("code", 1);
ret.put("msg", msg);
return ret.toJSONString();
}
} }
\ No newline at end of file
package com.mortals.xhx.module.attendance.web; package com.mortals.xhx.module.attendance.web;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ReflectUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
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.OrderCol; import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.ICacheService; import com.mortals.framework.service.ICacheService;
...@@ -17,39 +14,30 @@ import com.mortals.framework.utils.ReflectUtils; ...@@ -17,39 +14,30 @@ import com.mortals.framework.utils.ReflectUtils;
import com.mortals.framework.utils.ServletUtils; import com.mortals.framework.utils.ServletUtils;
import com.mortals.framework.utils.poi.ExcelUtil; import com.mortals.framework.utils.poi.ExcelUtil;
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.upload.service.UploadService; import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.common.code.*; import com.mortals.xhx.common.code.GoWorkResultEnum;
import com.mortals.xhx.common.code.NormalEnum;
import com.mortals.xhx.common.code.OffWorkResultEnum;
import com.mortals.xhx.common.key.RedisKey; import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.common.keys.RedisCacheKeys; import com.mortals.xhx.common.keys.RedisCacheKeys;
import com.mortals.xhx.common.pdu.HomeStatInfo; import com.mortals.xhx.common.pdu.HomeStatInfo;
import com.mortals.xhx.module.attendance.model.*; import com.mortals.xhx.module.attendance.model.*;
import com.mortals.xhx.module.attendance.model.vo.AttendStatInfo;
import com.mortals.xhx.module.attendance.service.*; import com.mortals.xhx.module.attendance.service.*;
import com.mortals.xhx.module.dept.model.DeptEntity; import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptQuery; import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService; import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity;
import com.mortals.xhx.module.perform.model.vo.AppealInfo;
import com.mortals.xhx.module.staff.service.StaffService;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.poi.ss.formula.functions.T;
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;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
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 com.mortals.framework.model.Context;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.lang.reflect.Field;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function; import java.util.function.Function;
......
package com.mortals.xhx.module.attendance.web; package com.mortals.xhx.module.attendance.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.RepeatSubmit; import com.mortals.framework.annotation.RepeatSubmit;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
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.*; import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.service.IUser; import com.mortals.framework.service.IUser;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.utils.BeanUtil; import com.mortals.framework.utils.BeanUtil;
import com.mortals.framework.utils.ReflectUtils; import com.mortals.framework.utils.ReflectUtils;
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.busiz.h5.req.AttendSaveReq;
import com.mortals.xhx.busiz.h5.web.ApiWebPerformController;
import com.mortals.xhx.common.code.ErrorStatusEnum; import com.mortals.xhx.common.code.ErrorStatusEnum;
import com.mortals.xhx.common.code.ProcessStatusEnum; import com.mortals.xhx.module.attendance.model.AttendanceClassQuery;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.module.attendance.model.AttendanceGroupQuery;
import com.mortals.xhx.module.attendance.model.*; import com.mortals.xhx.module.attendance.model.AttendanceRecordErrorEntity;
import com.mortals.xhx.module.attendance.model.AttendanceRecordErrorQuery;
import com.mortals.xhx.module.attendance.model.vo.ErrorSummaryVo; import com.mortals.xhx.module.attendance.model.vo.ErrorSummaryVo;
import com.mortals.xhx.module.attendance.service.*; import com.mortals.xhx.module.attendance.service.AttendanceClassService;
import com.mortals.xhx.module.attendance.service.AttendanceGroupService;
import com.mortals.xhx.module.attendance.service.AttendanceRecordErrorService;
import com.mortals.xhx.module.dept.model.DeptQuery; import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService; import com.mortals.xhx.module.dept.service.DeptService;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; 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.*;
/** /**
* 考勤打卡记录异常信息 * 考勤打卡记录异常信息
* *
...@@ -191,27 +181,6 @@ public class AttendanceRecordErrorController extends BaseCRUDJsonBodyMappingCont ...@@ -191,27 +181,6 @@ public class AttendanceRecordErrorController extends BaseCRUDJsonBodyMappingCont
super.doListAfter(query, list, context); super.doListAfter(query, list, context);
} }
/**
* 从新生成已处理的绩效考勤核查数据
*
* @param query
* @return
*/
@PostMapping({"doReprocess"})
@UnAuth
public Rest<String> doReprocess(@RequestBody AttendanceRecordErrorQuery query) {
Rest<String> ret = new Rest();
Context context = this.getContext();
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
service.doReprocess(query, context);
}
});
thread.start();
return Rest.ok();
}
/** /**
* 查询当月异常考勤次数排行榜 * 查询当月异常考勤次数排行榜
......
package com.mortals.xhx.module.check.dao;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.module.check.model.CheckAllRecordQuery;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
import com.mortals.xhx.module.check.model.vo.CheckAllScoreSummaryVo;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import java.util.List;
/**
* 全部类型核查信息Dao
*/
public interface CheckAllRecordDao {
/**
* 获取全部绩效核查信息列表
* @param query
* @param pageInfo
* @return
*/
Result<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query, PageInfo pageInfo);
/**
* 绩效核查分数情况汇总
* @param query
* @return
*/
CheckAllScoreSummaryVo getScoreSummary(StaffCheckSummaryQuery query);
int getCount(CheckAllRecordQuery checkAllRecordQuery);
}
package com.mortals.xhx.module.check.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.check.model.CheckAttendRecordEntity;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo;
import com.mortals.xhx.module.dept.model.DeptPerformStatEntity;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import java.util.List;
/**
* 考勤绩效记录核查信息Dao
* 考勤绩效记录核查信息 DAO接口
*
* @author zxfei
* @date 2023-07-10
*/
public interface CheckAttendRecordDao extends ICRUDDao<CheckAttendRecordEntity,Long>{
/**
* 汇总已审核的核查记录
* @param query
* @return
*/
List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query);
/**
* 个人绩效统计
* @param query
* @return
*/
List<StaffPerformStatEntity> getStaffPerformStat(StaffCheckSummaryQuery query);
/**
* 部门绩效统计
* @param query
* @return
*/
List<DeptPerformStatEntity> getDeptPerformStat(StaffCheckSummaryQuery query);
}
package com.mortals.xhx.module.check.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.check.model.CheckComplainRecordEntity;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryVo;
import com.mortals.xhx.module.dept.model.DeptPerformStatEntity;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import java.util.List;
/**
* 评价绩效投诉核查信息Dao
* 评价绩效投诉核查信息 DAO接口
*
* @author zxfei
* @date 2023-07-11
*/
public interface CheckComplainRecordDao extends ICRUDDao<CheckComplainRecordEntity,Long>{
/**
* 汇总已审核的核查记录
* @param query
* @return
*/
List<StaffCheckSummaryVo> summaryCheck(StaffCheckSummaryQuery query);
/**
* 个人绩效统计
* @param query
* @return
*/
List<StaffPerformStatEntity> getStaffPerformStat(StaffCheckSummaryQuery query);
/**
* 部门绩效统计
* @param query
* @return
*/
List<DeptPerformStatEntity> getDeptPerformStat(StaffCheckSummaryQuery query);
}
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