Commit e791136c authored by 姬鋆屾's avatar 姬鋆屾
parents 5da84008 ebfc22fd
...@@ -14,13 +14,18 @@ import com.mortals.framework.model.Result; ...@@ -14,13 +14,18 @@ import com.mortals.framework.model.Result;
import com.mortals.xhx.busiz.h5.req.AppealReq; import com.mortals.xhx.busiz.h5.req.AppealReq;
import com.mortals.xhx.busiz.h5.req.PerformReq; import com.mortals.xhx.busiz.h5.req.PerformReq;
import com.mortals.xhx.busiz.h5.rsp.AppealStatInfo; import com.mortals.xhx.busiz.h5.rsp.AppealStatInfo;
import com.mortals.xhx.busiz.h5.rsp.PerformStatInfo;
import com.mortals.xhx.common.code.*; import com.mortals.xhx.common.code.*;
import com.mortals.xhx.common.utils.BeanUtil; import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.dao.CheckAllRecordDao;
import com.mortals.xhx.module.check.model.*; 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.model.PerformAttendAppealQuery;
import com.mortals.xhx.module.perform.service.PerformAttendAppealService; import com.mortals.xhx.module.perform.service.PerformAttendAppealService;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import com.mortals.xhx.module.staff.model.StaffPerformStatQuery;
import com.mortals.xhx.module.staff.service.StaffPerformStatService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -30,10 +35,7 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -30,10 +35,7 @@ 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 java.util.Arrays; import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import static com.mortals.framework.ap.SysConstains.*; 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;
...@@ -62,7 +64,10 @@ public class AppealApiController extends AbstractBaseController<PerformReq> { ...@@ -62,7 +64,10 @@ public class AppealApiController extends AbstractBaseController<PerformReq> {
private CheckGoworkRecordService checkGoworkRecordService; private CheckGoworkRecordService checkGoworkRecordService;
@Autowired @Autowired
private CheckOtherRecordService checkOtherRecordService; private CheckOtherRecordService checkOtherRecordService;
@Autowired
private CheckAllRecordDao checkAllRecordDao;
@Autowired
private StaffPerformStatService staffPerformStatService;
@Autowired @Autowired
private PerformAttendAppealService appealService; private PerformAttendAppealService appealService;
...@@ -89,13 +94,44 @@ public class AppealApiController extends AbstractBaseController<PerformReq> { ...@@ -89,13 +94,44 @@ public class AppealApiController extends AbstractBaseController<PerformReq> {
} }
log.info("【{}】【请求体】--> 用户:{}", busiDesc, context.getUser().getRealName()); log.info("【{}】【请求体】--> 用户:{}", busiDesc, context.getUser().getRealName());
try { try {
//todo 查询当前登录人的绩效分数
CheckAllRecordQuery checkAllRecordQuery = new CheckAllRecordQuery();
checkAllRecordQuery.setSubAddType(SubAddTypeEnum.扣除.getValue());
checkAllRecordQuery.setStaffId(context.getUser().getCustomerId());
int totalTimes = checkAllRecordDao.getCount(checkAllRecordQuery);
checkAllRecordQuery.setCheckTimeStart(DateUtil.today());
checkAllRecordQuery.setCheckTimeEnd(DateUtil.today());
int todayTimes = checkAllRecordDao.getCount(checkAllRecordQuery);
StaffPerformStatQuery staffPerformStatQuery = new StaffPerformStatQuery();
staffPerformStatQuery.setStaffId(context.getUser().getCustomerId());
staffPerformStatQuery.setYear(DateUtil.year(new Date()));
staffPerformStatQuery.setMonth(DateUtil.month(new Date()) + 1);
List<StaffPerformStatEntity> staffPerformStatEntities = staffPerformStatService.find(staffPerformStatQuery);
BigDecimal totalScore = new BigDecimal(0.0);
if (ObjectUtils.isEmpty(staffPerformStatEntities)) {
totalScore = staffPerformStatEntities.stream().map(item -> item.getTotalSubScore()).reduce(BigDecimal.ZERO, BigDecimal::add);
}
staffPerformStatQuery.setDay(DateUtil.dayOfMonth(new Date()));
//今日得分
StaffPerformStatEntity staffPerformStatEntity = staffPerformStatService.selectOne(staffPerformStatQuery);
BigDecimal todayScore = new BigDecimal(0.0);
if (!ObjectUtils.isEmpty(staffPerformStatEntity)) {
todayScore = staffPerformStatEntity.getTotalSubScore();
}
AppealStatInfo appealStatInfo = new AppealStatInfo(); AppealStatInfo appealStatInfo = new AppealStatInfo();
appealStatInfo.setTotalScore(new BigDecimal("10.52").setScale(1,BigDecimal.ROUND_HALF_UP)); appealStatInfo.setTotalScore(totalScore.setScale(1, BigDecimal.ROUND_HALF_UP));
appealStatInfo.setTotalTimes(12); appealStatInfo.setTotalTimes(totalTimes);
appealStatInfo.setTodayScore(new BigDecimal("2.5").setScale(1,BigDecimal.ROUND_HALF_UP)); appealStatInfo.setTodayScore(todayScore.setScale(1, BigDecimal.ROUND_HALF_UP));
appealStatInfo.setTodayTimes(3); appealStatInfo.setTodayTimes(todayTimes);
rest.setData(appealStatInfo); rest.setData(appealStatInfo);
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) { } catch (Exception e) {
log.error(busiDesc, e); log.error(busiDesc, e);
......
...@@ -105,6 +105,8 @@ public class InspectApiController extends AbstractBaseController<PerformReq> { ...@@ -105,6 +105,8 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
this.addDict(model, "subAddType", SubAddTypeEnum.getEnumMap()); this.addDict(model, "subAddType", SubAddTypeEnum.getEnumMap());
this.addDict(model, "checkType", CheckTypeEnum.getEnumMap()); this.addDict(model, "checkType", CheckTypeEnum.getEnumMap());
this.addDict(model, "reviewResult", ReviewResultEnum.getEnumMap()); this.addDict(model, "reviewResult", ReviewResultEnum.getEnumMap());
this.addDict(model, "irregularOtherType", IrregularOtherTypeEnum.getEnumMap());
} }
/** /**
...@@ -325,7 +327,6 @@ public class InspectApiController extends AbstractBaseController<PerformReq> { ...@@ -325,7 +327,6 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
//根据考勤组查询 上下班 //根据考勤组查询 上下班
buildGoOffWork(req, context, recordEntity); buildGoOffWork(req, context, recordEntity);
recordEntity.setCreateUserId(context.getUser().getId()); recordEntity.setCreateUserId(context.getUser().getId());
recordEntity.setCreateTime(new Date()); recordEntity.setCreateTime(new Date());
PerformAttendRecordEntity save = attendRecordService.save(recordEntity); PerformAttendRecordEntity save = attendRecordService.save(recordEntity);
...@@ -561,6 +562,7 @@ public class InspectApiController extends AbstractBaseController<PerformReq> { ...@@ -561,6 +562,7 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
StaffEntity custStaff = getStaff(context.getUser().getCustomerId().toString()); StaffEntity custStaff = getStaff(context.getUser().getCustomerId().toString());
recordEntity.setDeductPerson(custStaff==null?"系统管理员":custStaff.getName()); recordEntity.setDeductPerson(custStaff==null?"系统管理员":custStaff.getName());
recordEntity.setDeptId(staffEntity.getDeptId()); recordEntity.setDeptId(staffEntity.getDeptId());
recordEntity.setDeptName(staffEntity.getDeptName()); recordEntity.setDeptName(staffEntity.getDeptName());
recordEntity.setSubAddType(rule.getSubAddType()); recordEntity.setSubAddType(rule.getSubAddType());
......
...@@ -9,6 +9,8 @@ import com.mortals.xhx.common.code.*; ...@@ -9,6 +9,8 @@ import com.mortals.xhx.common.code.*;
import com.mortals.xhx.common.utils.BeanUtil; import com.mortals.xhx.common.utils.BeanUtil;
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.*;
import com.mortals.xhx.module.attendance.service.work.AttendanceWorkAbstract;
import com.mortals.xhx.module.attendance.service.work.CommonData;
import com.mortals.xhx.module.dept.service.DeptService; import com.mortals.xhx.module.dept.service.DeptService;
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;
...@@ -133,7 +135,7 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte ...@@ -133,7 +135,7 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte
attendanceRecordEntity.setShiftsId(attendanceClassDetailEntity == null ? 0L : attendanceClassDetailEntity.getClassId()); attendanceRecordEntity.setShiftsId(attendanceClassDetailEntity == null ? 0L : attendanceClassDetailEntity.getClassId());
attendanceRecordEntity.setShiftsName(attendanceClassDetailEntity == null ? "" : attendanceClassDetailEntity.getClassName()); attendanceRecordEntity.setShiftsName(attendanceClassDetailEntity == null ? "" : attendanceClassDetailEntity.getClassName());
} }
//生成异常记录 //生成异常记录
genErrorAttendRecord(context, dateStr, attendanceRecordEntity, detailEntityList); genErrorAttendRecord(context, dateStr, attendanceRecordEntity, detailEntityList);
if (!ObjectUtils.isEmpty(detailEntityList)) { if (!ObjectUtils.isEmpty(detailEntityList)) {
attendanceRecordEntity.setAttendanceRecordDetailList(detailEntityList); attendanceRecordEntity.setAttendanceRecordDetailList(detailEntityList);
...@@ -265,6 +267,14 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte ...@@ -265,6 +267,14 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte
attendanceRecordEntity.setAttendanceGroupId(attendanceGroupEntity == null ? 0L : attendanceGroupEntity.getId()); attendanceRecordEntity.setAttendanceGroupId(attendanceGroupEntity == null ? 0L : attendanceGroupEntity.getId());
attendanceRecordEntity.setAttendanceGroupName(attendanceGroupEntity == null ? "" : attendanceGroupEntity.getGroupName()); attendanceRecordEntity.setAttendanceGroupName(attendanceGroupEntity == null ? "" : attendanceGroupEntity.getGroupName());
//查询考勤组详细信息获取班次 todo 默认固定班次 还有自由 与排班制 //查询考勤组详细信息获取班次 todo 默认固定班次 还有自由 与排班制
AttendanceWorkAbstract workAbstract = AttendanceWorkAbstract.newType(attendanceGroupEntity.getType());
CommonData commonData = new CommonData();
commonData.setAttendanceGroupEntity(attendanceGroupEntity);
commonData.setAttendanceDate(attendanceDate);
commonData.setDetailEntityList(detailEntityList);
workAbstract.doHandleWork(commonData);
/*
AttendanceGroupFixedworkEntity attendanceGroupFixedworkEntity = attendanceGroupFixedworkService.selectOne(new AttendanceGroupFixedworkQuery() AttendanceGroupFixedworkEntity attendanceGroupFixedworkEntity = attendanceGroupFixedworkService.selectOne(new AttendanceGroupFixedworkQuery()
.groupId(attendanceGroupEntity.getId())); .groupId(attendanceGroupEntity.getId()));
//判断当前考勤日期为周几 //判断当前考勤日期为周几
...@@ -365,7 +375,7 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte ...@@ -365,7 +375,7 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte
} }
} }
} }
} }*/
} }
......
package com.mortals.xhx.module.attendance.service.work;
import cn.hutool.core.date.DateUtil;
import com.mortals.framework.exception.AppException;
import com.mortals.xhx.common.code.TypeEnum;
import com.mortals.xhx.module.attendance.model.AttendanceGroupFixedworkEntity;
import java.util.Date;
/**
* 工作排班抽象类
*
* @author:
* @date: 2023/7/31 15:09
*/
public abstract class AttendanceWorkAbstract {
private int type;
abstract int getType();
abstract void initData();
public abstract void doHandleWork(CommonData commonData);
public static AttendanceWorkAbstract newType(int type) {
if (type == TypeEnum.固定班制.getValue()) {
return new FixWorkAttendance(type);
} else if (type == TypeEnum.自由工时.getValue()) {
return new FreedomWorkAttendance(type);
}
if (type == TypeEnum.排班制.getValue()) {
return new ScheduleWorkAttendance(type);
} else {
throw new AppException(String.format("未知的类型码:%s", type));
}
}
protected String getWeek(Date date) {
// Get the day of the week (1 = Sunday, 2 = Monday, ..., 7 = Saturday)
int dayOfWeek = DateUtil.dayOfWeek(date);
// Map the numeric day of the week to its corresponding Chinese name
String[] dayOfWeekNames = new String[]{
"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"
};
// Get the Chinese name of the day of the week
String dayOfWeekName = dayOfWeekNames[dayOfWeek - 1];
return dayOfWeekName;
}
/**
* 获取通过星期获取班次id 如果返参为-1 则不在考勤
*
* @return
*/
protected Long getWeekClassId(AttendanceGroupFixedworkEntity attendanceGroupFixedworkEntity, String week) {
Long weekClassId = 0L;
switch (week) {
case "星期一":
if (attendanceGroupFixedworkEntity.getMonday() == 0) {
weekClassId = -1L;
return weekClassId;
}
weekClassId = attendanceGroupFixedworkEntity.getMondayClassId();
break;
case "星期二":
if (attendanceGroupFixedworkEntity.getTuesday() == 0) {
weekClassId = -1L;
return weekClassId;
}
weekClassId = attendanceGroupFixedworkEntity.getTuesdayClassId();
break;
case "星期三":
if (attendanceGroupFixedworkEntity.getWednesday() == 0) {
weekClassId = -1L;
return weekClassId;
}
weekClassId = attendanceGroupFixedworkEntity.getWednesdayClassId();
break;
case "星期四":
if (attendanceGroupFixedworkEntity.getThursday() == 0) {
weekClassId = -1L;
return weekClassId;
}
weekClassId = attendanceGroupFixedworkEntity.getThursdayClassId();
break;
case "星期五":
if (attendanceGroupFixedworkEntity.getFriday() == 0) {
weekClassId = -1L;
return weekClassId;
}
weekClassId = attendanceGroupFixedworkEntity.getFridayClassId();
break;
case "星期六":
if (attendanceGroupFixedworkEntity.getSaturday() == 0) {
weekClassId = -1L;
return weekClassId;
}
weekClassId = attendanceGroupFixedworkEntity.getSaturdayClassId();
break;
case "星期日":
if (attendanceGroupFixedworkEntity.getSunday() == 0) {
weekClassId = -1L;
return weekClassId;
}
weekClassId = attendanceGroupFixedworkEntity.getSundayClassId();
break;
}
return weekClassId;
}
public AttendanceWorkAbstract(int type) {
this.type = type;
}
}
package com.mortals.xhx.module.attendance.service.work;
import com.mortals.xhx.module.attendance.model.AttendanceGroupEntity;
import com.mortals.xhx.module.attendance.model.AttendanceRecordDetailEntity;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* 通用参数
*
* @author:
* @date: 2023/7/31 15:27
*/
@Data
public class CommonData {
private AttendanceGroupEntity attendanceGroupEntity;
private List<AttendanceRecordDetailEntity> detailEntityList;
private Date attendanceDate;
}
package com.mortals.xhx.module.attendance.service.work;
import cn.hutool.core.date.DateUtil;
import com.mortals.xhx.common.code.GoWorkResultEnum;
import com.mortals.xhx.common.code.TypeEnum;
import com.mortals.xhx.module.attendance.model.*;
import com.mortals.xhx.module.attendance.service.AttendanceClassService;
import com.mortals.xhx.module.attendance.service.AttendanceGroupFixedworkService;
import com.mortals.xhx.utils.SpringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.List;
/**
* 固定班
* @author:
* @date: 2023/7/31 15:15
*/
@Slf4j
public class FixWorkAttendance extends AttendanceWorkAbstract {
private AttendanceGroupFixedworkService attendanceGroupFixedworkService;
private AttendanceClassService attendanceClassService;
public FixWorkAttendance(int type) {
super(type);
this.attendanceGroupFixedworkService = SpringUtils.getBean(AttendanceGroupFixedworkService.class);
this.attendanceClassService = SpringUtils.getBean(AttendanceClassService.class);
}
@Override
int getType() {
return TypeEnum.固定班制.getValue();
}
@Override
void initData() {
}
@Override
void doHandleWork(CommonData commonData) {
AttendanceGroupFixedworkEntity attendanceGroupFixedworkEntity = attendanceGroupFixedworkService.selectOne(new AttendanceGroupFixedworkQuery()
.groupId(commonData.getAttendanceGroupEntity().getId()));
//判断当前考勤日期为周几
String week = super.getWeek(commonData.getAttendanceDate());
//log.info("week:{}", week);
//通过考勤日期的星期拿到班次id.
if (ObjectUtils.isEmpty(attendanceGroupFixedworkEntity)) {
log.info("attendanceGroupFixedworkEntity is null ! groupId:{}", commonData.getAttendanceGroupEntity().getId());
return;
}
//获取当前日期的详细班次
Long weekClassId = this.getWeekClassId(attendanceGroupFixedworkEntity, week);
//log.info("weekClassId:{}", weekClassId);
//weekClassId为-1 则不在考勤
if (weekClassId == -1L) {
//跳过本次循环
return;
}
//获取班次信息
AttendanceClassEntity attendanceClassEntity = attendanceClassService.get(weekClassId);
if (ObjectUtils.isEmpty(attendanceClassEntity)) {
log.info("attendanceClassEntity is null ,weekClassId:{}", weekClassId);
return;
}
//List<AttendanceClassDetailEntity> attendanceClassDetailEntities = attendanceClassDetailService.find(new AttendanceClassDetailQuery().classId(attendanceClassEntity.getId()));
//获取当前班的多个班次,一个班次为一个上下班时间段
List<AttendanceClassDetailEntity> attendanceClassDetailEntities = attendanceClassEntity.getAttendanceClassDetailList();
Integer orderNum = 0;
//构造数据
if (ObjectUtils.isEmpty(commonData.getDetailEntityList())) {
//遍历班次 构建详细考勤数据
for (AttendanceClassDetailEntity classDetailEntity : attendanceClassDetailEntities) {
orderNum++;
AttendanceRecordDetailEntity recordDetailEntity = new AttendanceRecordDetailEntity();
recordDetailEntity.setShiftsId(classDetailEntity.getId());
recordDetailEntity.setShiftsName(classDetailEntity.getClassName());
recordDetailEntity.setGoWorkResult(GoWorkResultEnum.缺卡.getValue());
recordDetailEntity.setOffWorkResult(GoWorkResultEnum.缺卡.getValue());
recordDetailEntity.setOrderNum(orderNum);
commonData.getDetailEntityList().add(recordDetailEntity);
}
}
for (AttendanceClassDetailEntity classDetail : attendanceClassDetailEntities) {
//计算区间范围
//上班打卡前时间
Date goWorkDateBefore = DateUtil.offsetMinute(classDetail.getGoWorkDate(), -classDetail.getGoWorkDateBefore());
//上班打卡后时间
Date goWorkDateAfter = DateUtil.offsetMinute(classDetail.getGoWorkDate(), classDetail.getGoWorkDateAfter());
// 下班打卡前时间
Date offWorkDateBefore = DateUtil.offsetMinute(classDetail.getOffWorkDate(), -classDetail.getOffWorkDateBefore());
//下班打卡后时间
Date offWorkDateAfter = DateUtil.offsetMinute(classDetail.getOffWorkDate(), classDetail.getOffWorkDateAfter());
//判断考勤时间是否在上班打卡区间内 true 在 false 不在 格式化时间
//String currDate = DateUtil.formatTime(attendanceDate);
Date curDateTime = DateUtil.parseTime(DateUtil.formatTime(commonData.getAttendanceDate())).toJdkDate();
boolean goInTime = DateUtil.isIn(curDateTime, goWorkDateBefore, goWorkDateAfter);
//判断考勤时间是否在下班打卡区间内
boolean offInTime = DateUtil.isIn(curDateTime, offWorkDateBefore, offWorkDateAfter);
if (goInTime == false && offInTime == false) {
log.info("考勤时间不在上班区间与下班区间中,不做处理!attendDate:{}", DateUtil.formatDateTime(commonData.getAttendanceDate()));
continue;
}
if (goInTime) {
//如果是上班打卡区间范围,判断是否迟到
boolean inTime = DateUtil.isIn(curDateTime, goWorkDateBefore, classDetail.getGoWorkDate());
if (inTime) {
for (AttendanceRecordDetailEntity attendanceRecordDetailEntity : commonData.getDetailEntityList()) {
if (attendanceRecordDetailEntity.getShiftsId() == classDetail.getId()) {
attendanceRecordDetailEntity.setGoWorkResult(GoWorkResultEnum.正常.getValue());
attendanceRecordDetailEntity.setGoWorkDate(commonData.getAttendanceDate());
}
}
} else {
for (AttendanceRecordDetailEntity attendanceRecordDetailEntity : commonData.getDetailEntityList()) {
if (attendanceRecordDetailEntity.getShiftsId() == classDetail.getId()) {
attendanceRecordDetailEntity.setGoWorkResult(GoWorkResultEnum.迟到.getValue());
attendanceRecordDetailEntity.setGoWorkDate(commonData.getAttendanceDate());
}
}
}
}
if (offInTime) {
boolean inTime = DateUtil.isIn(curDateTime, classDetail.getOffWorkDate(), offWorkDateAfter);
if (inTime) {
for (AttendanceRecordDetailEntity attendanceRecordDetailEntity : commonData.getDetailEntityList()) {
if (attendanceRecordDetailEntity.getShiftsId() == classDetail.getId()) {
attendanceRecordDetailEntity.setOffWorkResult(GoWorkResultEnum.正常.getValue());
attendanceRecordDetailEntity.setOffWorkDate(commonData.getAttendanceDate());
}
}
} else {
for (AttendanceRecordDetailEntity attendanceRecordDetailEntity : commonData.getDetailEntityList()) {
if (attendanceRecordDetailEntity.getShiftsId() == classDetail.getId()) {
attendanceRecordDetailEntity.setOffWorkResult(GoWorkResultEnum.早退.getValue());
attendanceRecordDetailEntity.setOffWorkDate(commonData.getAttendanceDate());
}
}
}
}
}
}
}
package com.mortals.xhx.module.attendance.service.work;
import com.mortals.xhx.common.code.TypeEnum;
import lombok.extern.slf4j.Slf4j;
/**
* 自由排班
* @author:
* @date: 2023/7/31 15:15
*/
@Slf4j
public class FreedomWorkAttendance extends AttendanceWorkAbstract {
public FreedomWorkAttendance(int type) {
super(type);
}
@Override
int getType() {
return TypeEnum.自由工时.getValue();
}
@Override
void initData() {
}
@Override
void doHandleWork(CommonData commonData) {
}
}
package com.mortals.xhx.module.attendance.service.work;
import com.mortals.xhx.common.code.TypeEnum;
import lombok.extern.slf4j.Slf4j;
/**
* 排班值
*
* @author:
* @date: 2023/7/31 15:15
*/
@Slf4j
public class ScheduleWorkAttendance extends AttendanceWorkAbstract {
public ScheduleWorkAttendance(int type) {
super(type);
}
@Override
int getType() {
return TypeEnum.自由工时.getValue();
}
@Override
void initData() {
}
@Override
void doHandleWork(CommonData commonData) {
}
}
...@@ -248,6 +248,7 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA ...@@ -248,6 +248,7 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
staffPerformSummaryEntity.setOtherScore(new BigDecimal(0)); staffPerformSummaryEntity.setOtherScore(new BigDecimal(0));
staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0)); staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0));
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore()); staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore())); staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
......
...@@ -245,6 +245,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec ...@@ -245,6 +245,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
staffPerformSummaryEntity.setOtherScore(new BigDecimal(0)); staffPerformSummaryEntity.setOtherScore(new BigDecimal(0));
staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0)); staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0));
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
staffPerformSummaryEntity.setReviewScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore()); staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore())); staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
......
...@@ -246,6 +246,7 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE ...@@ -246,6 +246,7 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
staffPerformSummaryEntity.setReviewScore(new BigDecimal(0)); staffPerformSummaryEntity.setReviewScore(new BigDecimal(0));
staffPerformSummaryEntity.setOtherScore(new BigDecimal(0)); staffPerformSummaryEntity.setOtherScore(new BigDecimal(0));
staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0)); staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0));
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore()); staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore())); staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
......
...@@ -243,6 +243,7 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG ...@@ -243,6 +243,7 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
staffPerformSummaryEntity.setReviewScore(new BigDecimal(0)); staffPerformSummaryEntity.setReviewScore(new BigDecimal(0));
staffPerformSummaryEntity.setOtherScore(new BigDecimal(0)); staffPerformSummaryEntity.setOtherScore(new BigDecimal(0));
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore()); staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore())); staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
......
...@@ -249,6 +249,7 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt ...@@ -249,6 +249,7 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
staffPerformSummaryEntity.setReviewScore(new BigDecimal(0)); staffPerformSummaryEntity.setReviewScore(new BigDecimal(0));
staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0)); staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0));
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore()); staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore())); staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
......
...@@ -248,6 +248,7 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR ...@@ -248,6 +248,7 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
staffPerformSummaryEntity.setOtherScore(new BigDecimal(0)); staffPerformSummaryEntity.setOtherScore(new BigDecimal(0));
staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0)); staffPerformSummaryEntity.setGoworkScore(new BigDecimal(0));
staffPerformSummaryEntity.setEffectScore(new BigDecimal(0)); staffPerformSummaryEntity.setEffectScore(new BigDecimal(0));
staffPerformSummaryEntity.setComplainScore(new BigDecimal(0));
staffPerformSummaryEntity.setErrorScore(vo.getSumScore()); staffPerformSummaryEntity.setErrorScore(vo.getSumScore());
BigDecimal total = new BigDecimal(100); BigDecimal total = new BigDecimal(100);
staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore())); staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
......
...@@ -86,8 +86,9 @@ public class PerformAttendRecordServiceImpl extends AbstractCRUDServiceImpl<Perf ...@@ -86,8 +86,9 @@ public class PerformAttendRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
} }
entity.setErrorResult(entity.getRuleName()); entity.setErrorResult(entity.getRuleName());
entity.setDeductTime(new Date()); entity.setDeductTime(new Date());
entity.setDeductPerson(context == null ? "" : context.getUser() == null ? "" : context.getUser().getRealName()); if(ObjectUtils.isEmpty(entity.getDeductPerson())){
entity.setDeductPerson(context == null ? "" : context.getUser() == null ? "" : context.getUser().getRealName());
}
if (!ObjectUtils.isEmpty(entity.getAttendanceGroupId())) { if (!ObjectUtils.isEmpty(entity.getAttendanceGroupId())) {
AttendanceGroupEntity attendanceGroupEntity = attendanceGroupService.get(entity.getAttendanceGroupId()); AttendanceGroupEntity attendanceGroupEntity = attendanceGroupService.get(entity.getAttendanceGroupId());
entity.setAttendanceGroupName(attendanceGroupEntity == null ? "" : attendanceGroupEntity.getGroupName()); entity.setAttendanceGroupName(attendanceGroupEntity == null ? "" : attendanceGroupEntity.getGroupName());
......
...@@ -67,8 +67,9 @@ public class PerformComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Pe ...@@ -67,8 +67,9 @@ public class PerformComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Pe
} }
entity.setDeductTime(new Date()); entity.setDeductTime(new Date());
entity.setDeductPerson(context == null ? "" : context.getUser() == null ? "" : context.getUser().getRealName()); if(ObjectUtils.isEmpty(entity.getDeductPerson())){
entity.setDeductPerson(context == null ? "" : context.getUser() == null ? "" : context.getUser().getRealName());
}
} }
@Override @Override
......
...@@ -66,8 +66,9 @@ public class PerformEffectRecordServiceImpl extends AbstractCRUDServiceImpl<Perf ...@@ -66,8 +66,9 @@ public class PerformEffectRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName()); entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
} }
entity.setDeductTime(new Date()); entity.setDeductTime(new Date());
entity.setDeductPerson(context == null ? "" : context.getUser() == null ? "" : context.getUser().getRealName()); if(ObjectUtils.isEmpty(entity.getDeductPerson())){
entity.setDeductPerson(context == null ? "" : context.getUser() == null ? "" : context.getUser().getRealName());
}
} }
@Override @Override
......
...@@ -65,8 +65,9 @@ public class PerformGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<Perf ...@@ -65,8 +65,9 @@ public class PerformGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName()); entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
} }
entity.setDeductTime(new Date()); entity.setDeductTime(new Date());
entity.setDeductPerson(context == null ? "" : context.getUser() == null ? "" : context.getUser().getRealName()); if(ObjectUtils.isEmpty(entity.getDeductPerson())){
entity.setDeductPerson(context == null ? "" : context.getUser() == null ? "" : context.getUser().getRealName());
}
} }
@Override @Override
......
...@@ -67,7 +67,10 @@ public class PerformOtherRecordServiceImpl extends AbstractCRUDServiceImpl<Perfo ...@@ -67,7 +67,10 @@ public class PerformOtherRecordServiceImpl extends AbstractCRUDServiceImpl<Perfo
} }
entity.setDeductTime(new Date()); entity.setDeductTime(new Date());
entity.setDeductPerson(context == null ? "" : context.getUser() == null ? "" : context.getUser().getRealName());
if(ObjectUtils.isEmpty(entity.getDeductPerson())){
entity.setDeductPerson(context == null ? "" : context.getUser() == null ? "" : context.getUser().getRealName());
}
} }
......
...@@ -66,8 +66,9 @@ public class PerformReviewRecordServiceImpl extends AbstractCRUDServiceImpl<Perf ...@@ -66,8 +66,9 @@ public class PerformReviewRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName()); entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
} }
entity.setDeductTime(new Date()); entity.setDeductTime(new Date());
entity.setDeductPerson(context == null ? "" : context.getUser() == null ? "" : context.getUser().getRealName()); if(ObjectUtils.isEmpty(entity.getDeductPerson())){
entity.setDeductPerson(context == null ? "" : context.getUser() == null ? "" : context.getUser().getRealName());
}
} }
@Override @Override
......
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