Merge branch 'wcd' into wcd-2411-update
1 files added
18 files modified
| | |
| | | @ApiModelProperty(value = "到达城市") |
| | | private String arrivalCity; |
| | | |
| | | @Column(name = "`category`")
|
| | | @ApiModelProperty(value = "出差类别")
|
| | | private String category;
|
| | |
|
| | | @Column(name = "`approval_status`",nullable = false) |
| | | @NotBlank |
| | | @ApiModelProperty(value = "审批状态") |
| | |
| | | List<AttendanceBusinessTravel> findByUserAndSEDate(Long userId, LocalDateTime startDate, LocalDateTime endDate); |
| | | |
| | | // 查询出差天数 |
| | | @Query(value = "SELECT SUM(travel_duration) from attendance_business_travel where user_id = ?1 and travel_start_time >= ?2 and travel_end_time < ?3 and approval_status in ('business_approve_status_agree')", nativeQuery = true) |
| | | Integer findByUserIdAndYearMonth(Long userId, LocalDateTime startDate, LocalDateTime endDate); |
| | | @Query(value = "SELECT * from attendance_business_travel where user_id = ?1 and travel_start_time >= ?2 and travel_end_time < ?3 and approval_status in ('business_approve_status_agree')", nativeQuery = true)
|
| | | List<AttendanceBusinessTravel> findByUserIdAndYearMonth(Long userId, LocalDateTime startDate, LocalDateTime endDate);
|
| | | } |
| | |
| | | public interface AttendanceLeaveRepository extends JpaRepository<AttendanceLeave, Long>, JpaSpecificationExecutor<AttendanceLeave> { |
| | | |
| | | //添加时查询请假时间是否冲突 |
| | | @Query(value = "SELECT * FROM attendance_leave WHERE user_id = ?3 AND approval_status IN ('approval_status_under_approval', 'approval_status_passed') AND ((leave_start_time >= ?1 and leave_start_time <= ?2) OR \n" + |
| | | "(leave_start_time <= ?1 and leave_end_time >= ?2) OR (leave_end_time >= ?1 and leave_end_time <= ?2) OR (leave_start_time >= ?1 and leave_end_time <= ?2))", nativeQuery = true) |
| | | @Query(value = "SELECT * FROM attendance_leave WHERE user_id = ?3 AND approval_status IN ('approval_status_under_approval', 'approval_status_passed') AND ((leave_start_time > ?1 and leave_start_time < ?2) OR \n" +
|
| | | "(leave_start_time < ?1 and leave_end_time > ?2) OR (leave_end_time > ?1 and leave_end_time < ?2) OR (leave_start_time > ?1 and leave_end_time < ?2))", nativeQuery = true)
|
| | | List<AttendanceLeave> checkCreateLeaveTime(String startTime, String endTime, Long userId); |
| | | |
| | | //修改时查询请假时间是否冲突 |
| | | @Query(value = "SELECT * FROM attendance_leave WHERE user_id = ?3 AND approval_status IN ('approval_status_under_approval', 'approval_status_passed') AND id NOT IN ?4 AND ((leave_start_time >= ?1 and leave_start_time <= ?2) OR \n" + |
| | | "(leave_start_time <= ?1 and leave_end_time >= ?2) OR (leave_end_time >= ?1 and leave_end_time <= ?2) OR (leave_start_time >= ?1 and leave_end_time <= ?2))", nativeQuery = true) |
| | | @Query(value = "SELECT * FROM attendance_leave WHERE user_id = ?3 AND approval_status IN ('approval_status_under_approval', 'approval_status_passed') AND id NOT IN ?4 AND ((leave_start_time > ?1 and leave_start_time < ?2) OR \n" +
|
| | | "(leave_start_time < ?1 and leave_end_time > ?2) OR (leave_end_time > ?1 and leave_end_time < ?2) OR (leave_start_time > ?1 and leave_end_time < ?2))", nativeQuery = true)
|
| | | List<AttendanceLeave> checkUpdateForLeaveTime(String startTime, String endTime, Long userId, Set<Long> ids); |
| | | |
| | | //查询今年已使用的年假时长 |
| | |
| | | */ |
| | | Double getOverTimeLength(Long userId) throws ParseException; |
| | | |
| | | Double getOverTimeCloseLength(Long userId);
|
| | |
|
| | | /** |
| | | * 审核功能 |
| | | * @param resources / |
| | |
| | | /** 到达城市 */ |
| | | private String arrivalCity; |
| | | |
| | | /** 出差类别 */
|
| | | private String category;
|
| | |
|
| | | /** 审批状态 */ |
| | | private String approvalStatus; |
| | | |
| | |
| | | */
|
| | | @Override
|
| | | public Double getOverTimeLength(Long userId) {
|
| | | //获取年假剩余(新)
|
| | | //获取调休假剩余时长
|
| | | Double surplusYearTime = new Double(0.00);
|
| | |
|
| | | List<AttendanceOvertime> attendanceOvertimeList = attendanceOvertimeRepository.findByUserIdAndApprovalStatus(userId, Constant.OVERTIME_PASS);
|
| | | if (attendanceOvertimeList.size() > 0) {
|
| | | LocalDate localDateStart = LocalDate.now().withDayOfMonth(1).minusMonths(3);
|
| | | LocalDate localDateEnd = LocalDate.now().plusDays(1);
|
| | |
|
| | | List<AttendanceOvertime> attendanceOvertimeList = attendanceOvertimeRepository.findByUserIdAndDate(userId, localDateStart.atStartOfDay(), localDateEnd.atStartOfDay());
|
| | | if (!attendanceOvertimeList.isEmpty()) {
|
| | | surplusYearTime = attendanceOvertimeList.stream()
|
| | | .filter(attendanceOvertime -> !attendanceOvertime.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS))
|
| | | .map(attendanceOvertime -> attendanceOvertime.getOvertimeDuration()).reduce(0.0, (o1, o2) -> o1 + o2);
|
| | | Double usedTime = attendanceLeaveRepository.sumLeaveDurationByUserIdAndLeaveType(userId, Constant.LEAVE_TYPE_REPLACE);
|
| | | if (usedTime != null) {
|
| | | Double usedTime = attendanceLeaveRepository.findByUserIdAndDateAndLeaveType(userId, localDateStart.atStartOfDay(), localDateEnd.atStartOfDay(), Constant.LEAVE_TYPE_REPLACE).stream().mapToDouble(AttendanceLeave::getLeaveDuration).sum();
|
| | | if (usedTime > 0) {
|
| | | surplusYearTime = surplusYearTime - usedTime;
|
| | | }
|
| | | }
|
| | | return surplusYearTime;
|
| | | if (surplusYearTime <= 0.0) {
|
| | | return 0.0;
|
| | | }
|
| | | return BigDecimal.valueOf(surplusYearTime).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取用户调休假结算时长
|
| | | */
|
| | | @Override
|
| | | public Double getOverTimeCloseLength(Long userId) {
|
| | | //获取年假剩余(新)
|
| | | Double surplusYearTime = new Double(0.00);
|
| | |
|
| | | LocalDate localDateStart = LocalDate.now().withDayOfMonth(1).minusMonths(4);
|
| | | LocalDate localDateEnd = LocalDate.now().plusDays(1);
|
| | |
|
| | |
|
| | | List<AttendanceOvertime> attendanceOvertimeList = attendanceOvertimeRepository.findByUserIdAndDate(userId, localDateStart.atStartOfDay(), localDateStart.plusMonths(1).withDayOfMonth(1).atStartOfDay());
|
| | | if (!attendanceOvertimeList.isEmpty()) {
|
| | | surplusYearTime = attendanceOvertimeList.stream()
|
| | | .filter(attendanceOvertime -> !attendanceOvertime.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS))
|
| | | .map(attendanceOvertime -> attendanceOvertime.getOvertimeDuration()).reduce(0.0, (o1, o2) -> o1 + o2);
|
| | | Double usedTime = attendanceLeaveRepository.findByUserIdAndDateAndLeaveType(userId, localDateStart.atStartOfDay(), localDateEnd.atStartOfDay(), Constant.LEAVE_TYPE_REPLACE).stream().mapToDouble(AttendanceLeave::getLeaveDuration).sum();
|
| | | if (usedTime > 0) {
|
| | | surplusYearTime = surplusYearTime - usedTime;
|
| | | }
|
| | | }
|
| | | if (surplusYearTime <= 0.0) {
|
| | | return 0.0;
|
| | | }
|
| | | return BigDecimal.valueOf(surplusYearTime).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | User user = userRepository.findById(attendanceLeave.getUserId()).orElseGet(User::new);
|
| | | userList.add(user);
|
| | | }
|
| | | if (attendanceLeave.getLeaveStartTime().before(new Date())) {
|
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
| | | String attendanceDate = df.format(attendanceLeave.getLeaveStartTime());
|
| | | dingTalkService.getDingTalkAttendanceListOfNoonOrNight(attendanceDate,userList);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void deleteAll(Long[] ids) {
|
| | |
| | | Long result = resultParts.stream()
|
| | | .mapToLong(calculate -> ChronoUnit.MINUTES.between(calculate.getStart(), calculate.getEnd()))
|
| | | .sum();
|
| | | // .reduce(new BigDecimal(0),
|
| | | // (total, current) -> total.add(BigDecimal.valueOf(current)),
|
| | | // (o1, o2) -> null).divide(BigDecimal.valueOf(3600), 2, RoundingMode.HALF_UP
|
| | | // )
|
| | | // result = result.setScale(1, RoundingMode.FLOOR);
|
| | | // if (result < 30) {
|
| | | // System.out.println("localDate : " + localDate + " hours : " + 0);
|
| | | // return BigDecimal.valueOf(0.0);
|
| | | // } else {
|
| | | // result = result - 30;
|
| | | // }
|
| | | System.out.println("localDate : " + localDate + " hours : " + result);
|
| | | return BigDecimal.valueOf(result).divide(BigDecimal.valueOf(60), 1, RoundingMode.HALF_DOWN);
|
| | | long halfHour = result / 30;
|
| | | return BigDecimal.valueOf(halfHour).multiply(BigDecimal.valueOf(0.5));
|
| | | }).reduce(BigDecimal::add).get().doubleValue();
|
| | | }
|
| | |
|
| | |
| | | // 费用类型:客户关系 |
| | | public static final String EXPENSE_TYPE_CUSTOMER_RELATIONSHIP = "expense_type_customer_relationship"; |
| | | |
| | | public static final String ATTENDANCE_BUSINESS_TRAVEL_CATEGORY = "attendance_business_travel_category";
|
| | | public static final String ATTENDANCE_BUSINESS_TRAVEL_CATEGORY_TRAVEL = "attendance_business_travel_category_travel";
|
| | | public static final String ATTENDANCE_BUSINESS_TRAVEL_CATEGORY_SAME_PLACE = "attendance_business_travel_category_same_place";
|
| | |
|
| | | // 钱款缴纳状态 |
| | | public static final String RECOVERY_STATUS = "recovery_status"; |
| | | // 钱款缴纳状态:普通 |
| | |
| | | /** |
| | | * 月报set |
| | | */ |
| | | public void getMonthlyInfo() throws ParseException { |
| | | public void getMonthlyInfo() {
|
| | | //节假日,工作日 |
| | | List<Timestamp> holiday = new ArrayList<>(), isWork = new ArrayList<>(); |
| | | // 查询节假日 |
| | |
| | | if (ObjectUtils.isNotEmpty(user.getDingding())) {
|
| | | // 考勤记录:根据用户和日期查询
|
| | | Attendance attendance = attendanceRepository.findAllByUserIdAndAttendanceDate(user.getId(), strAttendDate);
|
| | | Boolean isHoliday = false;
|
| | | if (calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_HOLIDAYS)) {
|
| | | isHoliday = true;
|
| | | }
|
| | | // 如果是周六或者周日或节假日,打卡状态为等待的话,就改状态为休息(oapiDingTalkRecordResultList为空的情况下)
|
| | | if (ObjectUtils.isNotEmpty(attendance) && (calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_HOLIDAYS))) {
|
| | | // 开始打卡结果
|
| | |
| | | // 调用验证状态方法
|
| | | Boolean flag = getCardSupplement(attendance.getUserId(),attendance.getStartClockResults(),attendance.getActualWorkStartTime());
|
| | | // 考勤记录
|
| | | if (!isHoliday) {
|
| | | attendance.setStartClockResults(flag == true ? attendance.getStartClockResults() : (ObjectUtil.isEmpty(oapiDingTalkRecordResult.getUserCheckTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), oapiDingTalkRecordResult.getUserCheckTime(), 1)));
|
| | | } else {
|
| | | attendance.setStartClockResults(Constant.ATTENDANCE_STATE_NORMAL);
|
| | | }
|
| | | attendance.setStartLocationResults(flag == true ? attendance.getStartLocationResults() : setLocationResults(oapiDingTalkRecordResult.getLocationResult()));
|
| | | attendance.setActualWorkStartTime(flag == true ? attendance.getActualWorkStartTime() : oapiDingTalkRecordResult.getUserCheckTime());
|
| | | }
|
| | |
| | | // 调用验证状态方法
|
| | | Boolean flag = getCardSupplement(attendance.getUserId(),attendance.getEndClockResults(),attendance.getActualWorkEndTime());
|
| | | // 考勤记录
|
| | | if (!isHoliday) {
|
| | | attendance.setEndClockResults(flag == true ? attendance.getEndClockResults() : (ObjectUtil.isEmpty(oapiDingTalkRecordResult.getUserCheckTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), oapiDingTalkRecordResult.getUserCheckTime(), 2)));
|
| | | } else {
|
| | | attendance.setEndClockResults(Constant.ATTENDANCE_STATE_NORMAL);
|
| | | }
|
| | | attendance.setEndLocationResults(flag == true ? attendance.getEndLocationResults() : setLocationResults(oapiDingTalkRecordResult.getLocationResult()));
|
| | | attendance.setActualWorkEndTime(flag == true ? attendance.getActualWorkEndTime() : oapiDingTalkRecordResult.getUserCheckTime());
|
| | | }
|
| | |
| | | if (ObjectUtils.isNotEmpty(user.getDingding())) {
|
| | | // 考勤记录:根据用户和日期查询
|
| | | Attendance attendance = attendanceRepository.findAllByUserIdAndAttendanceDate(user.getId(), strAttendDate);
|
| | | Boolean isHoliday = false;
|
| | | if (calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_HOLIDAYS)) {
|
| | | isHoliday = true;
|
| | | }
|
| | | // 如果是周六或者周日或节假日,打卡状态为等待的话,就改状态为休息(oapiDingTalkRecordResultList为空的情况下)
|
| | | if (ObjectUtils.isNotEmpty(attendance) && (calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_HOLIDAYS))) {
|
| | | // 开始打卡结果
|
| | |
| | | // 调用验证状态方法
|
| | | Boolean flag = getCardSupplement(attendance.getUserId(),attendance.getStartClockResults(),attendance.getActualWorkStartTime());
|
| | | // 考勤记录
|
| | | if (!isHoliday) {
|
| | | attendance.setStartClockResults(flag == true ? attendance.getStartClockResults() : (ObjectUtil.isEmpty(oapiDingTalkRecordResult.getUserCheckTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), oapiDingTalkRecordResult.getUserCheckTime(), 1)));
|
| | | } else {
|
| | | attendance.setStartClockResults(Constant.ATTENDANCE_STATE_NORMAL);
|
| | | }
|
| | | attendance.setStartLocationResults(flag == true ? attendance.getStartLocationResults() : setLocationResults(oapiDingTalkRecordResult.getLocationResult()));
|
| | | attendance.setActualWorkStartTime(flag == true ? attendance.getActualWorkStartTime() : oapiDingTalkRecordResult.getUserCheckTime());
|
| | | }
|
| | |
| | | // 调用验证状态方法
|
| | | Boolean flag = getCardSupplement(attendance.getUserId(),attendance.getEndClockResults(),attendance.getActualWorkEndTime());
|
| | | // 考勤记录
|
| | | if (!isHoliday) {
|
| | | attendance.setEndClockResults(flag == true ? attendance.getEndClockResults() : (ObjectUtil.isEmpty(oapiDingTalkRecordResult.getUserCheckTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), oapiDingTalkRecordResult.getUserCheckTime(), 2)));
|
| | | } else {
|
| | | attendance.setEndClockResults(Constant.ATTENDANCE_STATE_NORMAL);
|
| | | }
|
| | | attendance.setEndLocationResults(flag == true ? attendance.getEndLocationResults() : setLocationResults(oapiDingTalkRecordResult.getLocationResult()));
|
| | | attendance.setActualWorkEndTime(flag == true ? attendance.getActualWorkEndTime() : oapiDingTalkRecordResult.getUserCheckTime());
|
| | | }
|
| | |
| | |
|
| | | import lombok.RequiredArgsConstructor;
|
| | | import me.zhengjie.exception.BadRequestException;
|
| | | import me.zhengjie.modules.attendance.domain.AttendanceLeave;
|
| | | import me.zhengjie.modules.attendance.repository.AttendanceLeaveRepository;
|
| | | import me.zhengjie.modules.attendance.repository.AttendanceOvertimeRepository;
|
| | | import me.zhengjie.modules.attendance.service.AttendanceService;
|
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceQueryCriteria;
|
| | | import me.zhengjie.modules.constant.Constant;
|
| | |
| | | private final SysConfigHolidayRepository sysConfigHolidayRepository;
|
| | | private final RoleService roleService;
|
| | | private final DictDetailRepository dictDetailRepository;
|
| | | private final AttendanceOvertimeRepository attendanceOvertimeRepository;
|
| | | private final AttendanceLeaveRepository attendanceLeaveRepository;
|
| | | // ==================== 以下为定时生成工资记录主要依赖 ====================
|
| | | private final UserService userService;
|
| | | private final UserLevelWageService userLevelWageService;
|
| | |
| | | criteria.setUserId(userId);
|
| | | criteria.setTargetYearMonth(targetYearMonth);
|
| | | UserLevelWageDto userLevelWageDto = userLevelWageService.queryTargetYearMonth(criteria);
|
| | |
|
| | | // 换休转补助
|
| | | LocalDateTime startLocalDateTime = LocalDateTime.parse(targetYearMonth + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
| | | LocalDateTime startLocalDateTime3MonthsPrevious = startLocalDateTime.minusMonths(3).withDayOfMonth(1);
|
| | | LocalDateTime endLocalDateTime3MonthsPrevious = startLocalDateTime3MonthsPrevious.plusMonths(1).withDayOfMonth(1);
|
| | | LocalDateTime endLocalDateTime = startLocalDateTime.plusMonths(1).withDayOfMonth(1);
|
| | |
|
| | | Double approvedTime = attendanceOvertimeRepository.findByUserIdAndYearMonth(userId, startLocalDateTime3MonthsPrevious, endLocalDateTime3MonthsPrevious);
|
| | | Double leaveTime = attendanceLeaveRepository.findByUserIdAndDateAndLeaveType(
|
| | | userId, startLocalDateTime3MonthsPrevious, endLocalDateTime, Constant.LEAVE_TYPE_REPLACE).stream()
|
| | | .map(AttendanceLeave::getLeaveDuration).mapToDouble(Double::doubleValue).sum();
|
| | | if (approvedTime != null && approvedTime.compareTo(leaveTime) > 0) {
|
| | | attendanceHours = attendanceHours + approvedTime - leaveTime;
|
| | | System.out.println("换休转补助:" + (approvedTime - leaveTime));
|
| | | }
|
| | |
|
| | | // 平日加班费
|
| | | if (userLevelWageDto.getOverTimeWage() != null) {
|
| | | // System.out.println("用户" + userId + "的级别工资中平日加班时间" + attendanceHours + "小时,配置加班费用为:" + userLevelWageDto.getOverTimeWage() + "元/小时!");
|
| | |
| | | import me.zhengjie.modules.attendance.repository.AttendanceCardreplacementRepository;
|
| | | import me.zhengjie.modules.attendance.repository.AttendanceGoOutRepository;
|
| | | import me.zhengjie.modules.attendance.repository.AttendanceRepository;
|
| | | import me.zhengjie.modules.attendance.service.AttendanceService;
|
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceLeaveDto;
|
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceLeaveQueryCriteria;
|
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceQueryCriteria;
|
| | | import me.zhengjie.modules.attendance.service.impl.AttendanceLeaveServiceImpl;
|
| | | import me.zhengjie.modules.constant.Constant;
|
| | | import me.zhengjie.modules.project.repository.ProjectRepository;
|
| | |
| | | private final MongoTemplate mongoTemplate;
|
| | | private final UserLevelWageRepository userLevelWageRepository;
|
| | | private final UserInsuranceRepository userInsuranceRepository;
|
| | |
|
| | | private final AttendanceService attendanceService;
|
| | |
|
| | | @Autowired
|
| | | private CacheManager cacheManager;
|
| | |
| | | for (Attendance attendance : attendanceList) {
|
| | | CalendarVo onDuty = new CalendarVo();
|
| | | onDuty.setDate(df.format(attendance.getAttendanceDate()));
|
| | | onDuty.setTitle(Constant.ATTENDANCE_STATE_NORMAL.equals(formateResult(attendance.getStartClockResults()).get("msg")) ? "上班打卡时间:" + attendance.getActualWorkStartTime().toString() : "上班:" + formateResult(attendance.getStartClockResults()).get("msg"));
|
| | | onDuty.setTitle(Constant.ATTENDANCE_STATE_NORMAL.equals(formateResult(attendance.getStartClockResults()).get("msg")) ? "上班打卡时间:" + (attendance.getActualWorkStartTime() == null ? "" : attendance.getActualWorkStartTime().toString()) : "上班:" + formateResult(attendance.getStartClockResults()).get("msg"));
|
| | | onDuty.setIsOk((Boolean) formateResult(attendance.getStartClockResults()).get("status"));
|
| | | onDuty.setType(1);
|
| | | CalendarVo offDuty = new CalendarVo();
|
| | | offDuty.setDate(df.format(attendance.getAttendanceDate()));
|
| | | offDuty.setTitle(Constant.ATTENDANCE_STATE_NORMAL.equals(formateResult(attendance.getEndClockResults()).get("msg")) ? "下班打卡时间:" + attendance.getActualWorkEndTime().toString() : "下班:" + formateResult(attendance.getEndClockResults()).get("msg"));
|
| | | offDuty.setTitle(Constant.ATTENDANCE_STATE_NORMAL.equals(formateResult(attendance.getEndClockResults()).get("msg")) ? "下班打卡时间:" + (attendance.getActualWorkEndTime() == null ? "" : attendance.getActualWorkEndTime().toString()) : "下班:" + formateResult(attendance.getEndClockResults()).get("msg"));
|
| | | offDuty.setIsOk((Boolean) formateResult(attendance.getEndClockResults()).get("status"));
|
| | | offDuty.setType(1);
|
| | | calendarInfo.add(onDuty);
|
| | |
| | | }
|
| | | }
|
| | | return taskDaliyMongo;
|
| | | })
|
| | | // .collect(
|
| | | // Collectors.groupingBy(
|
| | | // (TaskDaliyMongo taskDaliyMongo) -> taskDaliyMongo.getTaskUserMongo().getTask().getId(),
|
| | | // Collectors.reducing(
|
| | | // null,
|
| | | // (TaskDaliyMongo prev, TaskDaliyMongo cur) -> {
|
| | | // if (prev == null) {
|
| | | // return cur;
|
| | | // }
|
| | | // prev.setConsumedHours(prev.getConsumedHours() + cur.getConsumedHours());
|
| | | // return prev;
|
| | | // }
|
| | | // )
|
| | | // )
|
| | | // ).values().stream()
|
| | | .map(taskDaliyMongo -> {
|
| | | }).map(taskDaliyMongo -> {
|
| | | TaskDaliyMongoDto dto = new TaskDaliyMongoDto();
|
| | | dto.setId(taskDaliyMongo.getId());
|
| | | dto.setFillDate(taskDaliyMongo.getFillDate());
|
| | |
| | | // 绩效详细
|
| | | returnData.put("achievementsList", resultList);
|
| | |
|
| | | // 换休时长
|
| | | // 加班时长
|
| | | AttendanceQueryCriteria attendanceQueryCriteria = new AttendanceQueryCriteria();
|
| | | attendanceQueryCriteria.setUserId(userId);
|
| | | attendanceQueryCriteria.setTargetYearMonth(sdfDate.substring(0, 7) + "-01");
|
| | | Double attendanceOverTimeHours = attendanceService.queryAttendanceOverTimeHours(attendanceQueryCriteria);
|
| | | returnData.put("attendanceOverTimeHours", attendanceOverTimeHours);
|
| | |
|
| | | // 请假时长
|
| | | AttendanceLeaveQueryCriteria attendanceLeaveQueryCriteria = new AttendanceLeaveQueryCriteria();
|
| | | attendanceLeaveQueryCriteria.setUserId(userId);
|
| | | attendanceLeaveQueryCriteria.setLeaveStartTimeLike(sdfDate.substring(0, 7) + "%");
|
| | | List<AttendanceLeaveDto> attendanceLeaveDtos = attendanceLeaveService.queryAll(attendanceLeaveQueryCriteria);
|
| | | double leaveTimeHours = attendanceLeaveDtos.stream().mapToDouble(AttendanceLeaveDto::getLeaveDuration).sum();
|
| | | returnData.put("leaveTimeHours", BigDecimal.valueOf(leaveTimeHours).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
| | |
|
| | | // 换休剩余时长
|
| | | Double overTime = attendanceLeaveService.getOverTimeLength(userId);
|
| | | returnData.put("overTime", overTime);
|
| | |
|
| | | // 待结算换休时长
|
| | | Double overTimeClose = attendanceLeaveService.getOverTimeCloseLength(userId);
|
| | | returnData.put("overTimeClose", overTimeClose);
|
| | |
|
| | | // 出差天数
|
| | | returnData.put("businessDays", attendanceBusinessTravelList.stream().filter(attendanceBusinessTravel -> attendanceBusinessTravel.getCategory().equals(Constant.ATTENDANCE_BUSINESS_TRAVEL_CATEGORY_TRAVEL)).count());
|
| | | returnData.put("localDays", attendanceBusinessTravelList.stream().filter(attendanceBusinessTravel -> attendanceBusinessTravel.getCategory().equals(Constant.ATTENDANCE_BUSINESS_TRAVEL_CATEGORY_SAME_PLACE)).count());
|
| | |
|
| | | return returnData;
|
| | | }
|
| | |
|
| | |
| | | import me.zhengjie.modules.attendance.domain.AttendanceOvertime;
|
| | | import me.zhengjie.modules.attendance.repository.AttendanceBusinessTravelRepository;
|
| | | import me.zhengjie.modules.attendance.repository.AttendanceOvertimeRepository;
|
| | | import me.zhengjie.modules.constant.Constant;
|
| | | import me.zhengjie.modules.system.domain.SysConfigProportion;
|
| | | import me.zhengjie.modules.system.domain.User;
|
| | | import me.zhengjie.modules.system.repository.SysConfigProportionRepository;
|
| | |
| | | import java.time.format.DateTimeFormatter;
|
| | | import java.util.*;
|
| | | import java.util.function.Function;
|
| | | import java.util.stream.Collectors;
|
| | |
|
| | | /**
|
| | | * @author 姚增春
|
| | |
| | | LocalDateTime firstDayOfNextMonth = firstDayOfMonth.plusMonths(1);
|
| | |
|
| | | // 查询出差表的记录
|
| | | Integer bussSameMonthDays = attendanceBusinessTravelRepository.findByUserIdAndYearMonth(criteria.getUserId(), firstDayOfMonth, firstDayOfNextMonth);
|
| | | // 查询配置表
|
| | | SysConfigProportion sysConfigProportion = sysConfigProportionRepository.findByTitle("出差补助金额");
|
| | | List<AttendanceBusinessTravel> attendanceBusinessTravelList = attendanceBusinessTravelRepository.findByUserIdAndYearMonth(criteria.getUserId(), firstDayOfMonth, firstDayOfNextMonth);
|
| | | Map<String, Double> attendanceBusinessTravelMap = attendanceBusinessTravelList.stream().collect(Collectors.groupingBy(AttendanceBusinessTravel::getCategory, Collectors.summingDouble(AttendanceBusinessTravel::getTravelDuration)));
|
| | |
|
| | | BigDecimal travelSubsidy = new BigDecimal(0.0);
|
| | | // 出差补助金
|
| | | Double travelSubsidy = (bussSameMonthDays == null ? 0 : bussSameMonthDays) * sysConfigProportion.getProportion();
|
| | |
|
| | | return travelSubsidy;
|
| | | attendanceBusinessTravelMap.forEach((key, value) -> {
|
| | | if (key.equals(Constant.ATTENDANCE_BUSINESS_TRAVEL_CATEGORY_TRAVEL)) {
|
| | | // 出差补助金
|
| | | SysConfigProportion sysConfigProportion = sysConfigProportionRepository.findByTitle("出差补助金额");
|
| | | travelSubsidy.add(BigDecimal.valueOf(value * sysConfigProportion.getProportion()));
|
| | | } else if (key.equals(Constant.ATTENDANCE_BUSINESS_TRAVEL_CATEGORY_SAME_PLACE)) {
|
| | | // 客户现场补助金
|
| | | // SysConfigProportion sysConfigProportion = sysConfigProportionRepository.findByTitle("客户现场补助金额");
|
| | | travelSubsidy.add(BigDecimal.valueOf(value * 30)); // 按30元/天计算 TODO 待调整
|
| | | }
|
| | | });
|
| | | return travelSubsidy.doubleValue();
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | List<Map<String, Object>> list = new ArrayList<>();
|
| | | for (UserLevelWageDto userLevelWage : all) {
|
| | | // 将实体类转换成DTO
|
| | | User user = userRepository.findById(userLevelWage.getUserId()).orElseGet(User::new);;
|
| | | User user = userRepository.findById(userLevelWage.getUserId()).orElseGet(User::new);
|
| | |
|
| | | Map<String, Object> map = new LinkedHashMap<>();
|
| | | map.put("员工姓名", user.getNickName());
|
| | |
| | | unique-opened |
| | | mode="vertical" |
| | | > |
| | | <sidebar-item v-for="route in sidebarRouters" :key="route.path" :item="route" :base-path="route.path" /> |
| | | <sidebar-item |
| | | v-for="route in sidebarRouters" |
| | | :key="route.path" |
| | | :item="route" |
| | | :base-path="route.path" |
| | | /> |
| | | </el-menu> |
| | | </el-scrollbar> |
| | | </div> |
| | |
| | | isCollapse() { |
| | | return !this.sidebar.opened |
| | | } |
| | | }, |
| | | methods: { |
| | | } |
| | | } |
| | | </script> |
| | |
| | | hidden: true |
| | | }, |
| | | { |
| | | path: '/yhkj', |
| | | name: 'IframePage', |
| | | meta: { |
| | | title: '以恒官网', |
| | | icon: 'user', |
| | | isNewWindow: true, |
| | | }, |
| | | component: () => import('@/views/ifamepage.vue'), |
| | | hidden: true |
| | | |
| | | }, |
| | | { |
| | | path: '/404', |
| | | component: (resolve) => require(['@/views/features/404'], resolve), |
| | | hidden: true |
| | |
| | | } |
| | | ] |
| | | }, |
| | | |
| | | ] |
| | | |
| | | export default new Router({ |
| | |
| | | // 加班审批状态:已退回 |
| | | export const OVERTIME_RETURN = 'overtime_return' |
| | | |
| | | export const BUSINESS_TRAVEL_CATEGORY = 'business_travel_category' |
| | | // 钱款缴纳状态 |
| | | export const RECOVERY_STATUS = 'recovery_status' |
| | | |
| | |
| | | OVERTIME_APPROVAL, |
| | | OVERTIME_PASS, |
| | | OVERTIME_RETURN, |
| | | BUSINESS_TRAVEL_CATEGORY, |
| | | RECOVERY_STATUS |
| | | } |
| | |
| | | " |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="出差分类" prop="category"> |
| | | <el-select |
| | | v-model="form.category" |
| | | filterable |
| | | clearable |
| | | placeholder="请选择" |
| | | style="width: 340px;" |
| | | :disabled=" |
| | | form.approvalStatus == dictGoOutAgree || |
| | | form.approvalStatus == dictGoOutReturn |
| | | " |
| | | > |
| | | <el-option |
| | | v-for="item in dict[dictBusinessTravelCategory]" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="审批说明"> |
| | | <el-input |
| | | v-model="form.approvalDescription" |
| | |
| | | import udOperation from '@crud/UD.operation' |
| | | import pagination from '@crud/Pagination' |
| | | import constant from '../../../utils/constant' |
| | | import { relativeTimeThreshold } from 'moment/moment' |
| | | |
| | | const defaultForm = { |
| | | id: null, |
| | |
| | | travelReason: null, |
| | | departureCity: null, |
| | | arrivalCity: null, |
| | | category: null, |
| | | approvalStatus: null, |
| | | approvalDescription: null, |
| | | remarks: null, |
| | |
| | | }) |
| | | }, |
| | | // 数据字典constant |
| | | dicts: [constant.BUSSINESS_APPROVE_STATUS, constant.LEAVE_TIME_TYPE], |
| | | dicts: [constant.BUSSINESS_APPROVE_STATUS, constant.LEAVE_TIME_TYPE, constant.BUSINESS_TRAVEL_CATEGORY], |
| | | data() { |
| | | return { |
| | | permission: { |
| | |
| | | dictGoOutReturn: constant.BUSSINESS_APPROVE_STATUS_REFUSE, |
| | | dictLeaveTimeTypeDay: constant.LEAVE_TIME_TYPE_DAY, |
| | | dictLeaveTimeType: constant.LEAVE_TIME_TYPE, |
| | | dictBusinessTravelCategory: constant.BUSINESS_TRAVEL_CATEGORY, |
| | | makeUpCardVisible: false, |
| | | successLoading: false, |
| | | userRolesLevelMin: null, |
| | |
| | | this.form.travelEndTime = data.travelEndTime |
| | | this.form.departureCity = data.departureCity |
| | | this.form.arrivalCity = data.arrivalCity |
| | | this.form.cagtegory = data.category |
| | | this.form.travelDuration = data.travelDuration |
| | | this.form.durationUnit = data.durationUnit |
| | | this.form.approvalStatus = data.approvalStatus |
| | |
| | | </div> |
| | | </el-col> |
| | | <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col"> |
| | | <!-- <el-tooltip class="item" effect="dark" placement="top" :open-delay="3000" style="cursor:pointer"> --> |
| | | <div class="card-panel"> |
| | | <div class="card-panel-icon-wrapper icon-timings"> |
| | | <svg-icon icon-class="timing" class-name="card-panel-icon" /> |
| | | </div> |
| | | <div class="card-panel-description"> |
| | | <div class="card-panel-text"> |
| | | 当月绩效时长 |
| | | </div> |
| | | <count-to |
| | | :start-val="0" |
| | | :end-val="userInfo.achievementsTime" |
| | | :decimals="2" |
| | | :duration="3600" |
| | | class="card-panel-num" |
| | | /> |
| | | </div> |
| | | <el-button |
| | | type="success" |
| | | style="position: absolute;bottom: 4%;right: 1%;width: 60px;height: 27px;display: flex;background-color: #40c9c6;border-color: #40c9c6;align-items: center;justify-content: center;" |
| | | round |
| | | @click="changeVisible" |
| | | >详细绩效</el-button> |
| | | </div> |
| | | <!-- </el-tooltip> --> |
| | | </el-col> |
| | | <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col"> |
| | | <div class="card-panel" @click="handleSetLineChartData('shoppings')"> |
| | | <div class="card-panel-icon-wrapper icon-message"> |
| | | <svg-icon icon-class="message" class-name="card-panel-icon" /> |
| | |
| | | :start-val="0" |
| | | :end-val="userInfo.overTime" |
| | | :duration="3600" |
| | | :decimals="2" |
| | | class="card-panel-num" |
| | | /> |
| | | </div> |
| | | <div class="card-panel-description"> |
| | | <div class="card-panel-text"> |
| | | 请假时间 |
| | | </div> |
| | | <count-to |
| | | :start-val="0" |
| | | :end-val="userInfo.leaveTimeHours" |
| | | :duration="3600" |
| | | :decimals="2" |
| | | class="card-panel-num" |
| | | /> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-dialog |
| | | title="详细绩效" |
| | | :visible.sync="centerDialogVisible" |
| | | width="50%" |
| | | center |
| | | @open="showPerformanceDetail" |
| | | > |
| | | <div style="overflow:auto;height:600px"> |
| | | <div style="display: flex;justify-content: center"> |
| | | <span>本月绩效组成图</span> |
| | | <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col"> |
| | | <div class="card-panel" @click="handleSetLineChartData('shoppings')"> |
| | | <div class="card-panel-icon-wrapper icon-message"> |
| | | <svg-icon icon-class="message" class-name="card-panel-icon" /> |
| | | </div> |
| | | <div id="container" style="height:580px" /> |
| | | <div class="card-panel-description"> |
| | | <div class="card-panel-text"> |
| | | 待结算调休 |
| | | </div> |
| | | </el-dialog> |
| | | <el-col :xs="12" :sm="12" :lg="30" class="card-panel-col"> |
| | | <div class="card-panel" style="display: flex;justify-content: right"> |
| | | <div style="width: 100%;padding-top: 30px;"> |
| | | <el-statistic |
| | | v-if="meritWageList[0] !== undefined" |
| | | :value="meritWageList[1]" |
| | | :title="'⏳' + meritWageList[0]" |
| | | suffix="工时" |
| | | <count-to |
| | | :start-val="0" |
| | | :end-val="userInfo.overTimeClose" |
| | | :duration="3600" |
| | | :decimals="2" |
| | | class="card-panel-num" |
| | | /> |
| | | <br> |
| | | <div style="display: flex;justify-content: center"> |
| | | <span |
| | | v-if="meritWageList[0] !== undefined" |
| | | >完成可获得{{ meritWageList[3] }}💰</span> |
| | | </div> |
| | | <div class="card-panel-description"> |
| | | <div class="card-panel-text"> |
| | | 平日加班 |
| | | </div> |
| | | <count-to |
| | | :start-val="0" |
| | | :end-val="userInfo.attendanceOverTimeHours" |
| | | :duration="3600" |
| | | :decimals="2" |
| | | class="card-panel-num" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div style="width: 100%;padding-top: 30px;"> |
| | | <el-statistic |
| | | v-if="meritWageList[2]" |
| | | format="DD天HH小时mm分钟" |
| | | :value="meritWageList[2]" |
| | | time-indices |
| | | title="🚩距离本月结束还有:" |
| | | </el-col> |
| | | <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col"> |
| | | <div class="card-panel" @click="handleSetLineChartData('shoppings')"> |
| | | <div class="card-panel-icon-wrapper icon-message"> |
| | | <svg-icon icon-class="message" class-name="card-panel-icon" /> |
| | | </div> |
| | | <div class="card-panel-description"> |
| | | <div class="card-panel-text"> |
| | | 出差天数 |
| | | </div> |
| | | <count-to |
| | | :start-val="0" |
| | | :end-val="userInfo.businessDays" |
| | | :duration="3600" |
| | | class="card-panel-num" |
| | | /> |
| | | </div> |
| | | <div class="card-panel-description"> |
| | | <div class="card-panel-text"> |
| | | 客户现场 |
| | | </div> |
| | | <count-to |
| | | :start-val="0" |
| | | :end-val="userInfo.localDays" |
| | | :duration="3600" |
| | | class="card-panel-num" |
| | | /> |
| | | </div> |
| | | </div> |
| | |
| | | required: true |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | centerDialogVisible: false |
| | | } |
| | | }, |
| | | methods: { |
| | | handleSetLineChartData(type) { |
| | | this.$emit('handleSetLineChartData', type) |
| | | }, |
| | | changeVisible() { |
| | | this.centerDialogVisible = true |
| | | }, |
| | | showPerformanceDetail() { |
| | | if (this.meritWageList[2] == undefined) { |
| New file |
| | |
| | | <template> |
| | | <div class="iframe-container"> |
| | | <iframe :src="iframeSrc" class="iframe-content"></iframe> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | // iframeSrc: 'https://www.baidu.com/index.htm' |
| | | iframeSrc: 'http://114.116.101.63:30800/' |
| | | }; |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .iframe-container { |
| | | width: 100%; |
| | | height: 100%; |
| | | overflow: hidden; /* 隐藏外部容器的滚动条 */ |
| | | } |
| | | |
| | | .iframe-content { |
| | | width: 100%; |
| | | height: 100%; |
| | | border: none; |
| | | overflow: auto; /* 保留 iframe 的滚动条 */ |
| | | } |
| | | </style> |