BAOLH
2025-04-25 6ce655e8911e0b1fd54c3b73cc393154e6045dae
Merge branch 'wcd' into wcd-2411-update
1 files added
21 files modified
958 ■■■■■ changed files
eladmin-master/eladmin-common/src/main/java/me/zhengjie/annotation/Query.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/utils/QueryHelp.java 67 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/domain/AttendanceBusinessTravel.java 4 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/rest/AttendanceController.java 8 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/rest/AttendanceLeaveController.java 14 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/AttendanceLeaveService.java 11 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/AttendanceService.java 9 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/dto/AttendanceBusinessTravelDto.java 3 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/dto/AttendanceQueryCriteria.java 11 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceLeaveServiceImpl.java 130 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceServiceImpl.java 138 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/DingTalkServiceImpl.java 73 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/SysUserLevelOtherServiceImpl.java 1 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskServiceImpl.java 10 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/treatment/service/impl/UserLevelWageServiceImpl.java 25 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/api/attendance/attendanceLeave.js 8 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/assetManagement/assetUseManagement/index.vue 2 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/attendance/attendanceBusinessTravel/index.vue 50 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/attendance/attendanceLeave/index.vue 4 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/attendance/index.vue 384 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/task/taskUser/index.vue 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/annotation/Query.java
@@ -52,6 +52,8 @@
    String isOr() default "";
    //
    String orGroup() default "";
    enum Type {
        // jie 2019/6/4 相等
        EQUAL
eladmin-master/eladmin-common/src/main/java/me/zhengjie/utils/QueryHelp.java
@@ -54,6 +54,9 @@
        }
        try {
            List<Field> fields = getAllFields(query.getClass(), new ArrayList<>());
            Map<String, List<Predicate>> orGroupMap = new HashMap<String, List<Predicate>>();
            for (Field field : fields) {
                boolean accessible = field.isAccessible();
                // 设置对象的访问权限,保证对private的属性的访
@@ -135,6 +138,68 @@
                    }
                    //
                    String orGroup = q.orGroup();
                    if (ObjectUtil.isNotEmpty(orGroup)) {
                        if (orGroupMap.get(orGroup) == null) {
                            orGroupMap.put(orGroup, new ArrayList<Predicate>());
                        }
                        List<Predicate> predicates = orGroupMap.get(orGroup);
                        switch (q.type()) {
                            case EQUAL:
                                predicates.add(cb.equal(getExpression(attributeName,join,root)
                                        .as((Class<? extends Comparable>) fieldType),val));
                                break;
                            case GREATER_THAN:
                                predicates.add(cb.greaterThanOrEqualTo(getExpression(attributeName,join,root)
                                        .as((Class<? extends Comparable>) fieldType), (Comparable) val));
                                break;
                            case LESS_THAN:
                                predicates.add(cb.lessThanOrEqualTo(getExpression(attributeName,join,root)
                                        .as((Class<? extends Comparable>) fieldType), (Comparable) val));
                                break;
                            case LESS_THAN_NQ:
                                predicates.add(cb.lessThan(getExpression(attributeName,join,root)
                                        .as((Class<? extends Comparable>) fieldType), (Comparable) val));
                                break;
                            case INNER_LIKE:
                                predicates.add(cb.like(getExpression(attributeName,join,root)
                                        .as(String.class), "%" + val.toString() + "%"));
                                break;
                            case LEFT_LIKE:
                                predicates.add(cb.like(getExpression(attributeName,join,root)
                                        .as(String.class), "%" + val.toString()));
                                break;
                            case RIGHT_LIKE:
                                predicates.add(cb.like(getExpression(attributeName,join,root)
                                        .as(String.class), val.toString() + "%"));
                                break;
                            case IN:
                                if (CollUtil.isNotEmpty((Collection<Object>)val)) {
                                    predicates.add(getExpression(attributeName,join,root).in((Collection<Object>) val));
                                }
                                break;
                            case NOT_IN:
                                if (CollUtil.isNotEmpty((Collection<Object>)val)) {
                                    predicates.add(getExpression(attributeName,join,root).in((Collection<Object>) val).not());
                                }
                                break;
                            case NOT_EQUAL:
                                predicates.add(cb.notEqual(getExpression(attributeName,join,root), val));
                                break;
                            case NOT_NULL:
                                predicates.add(cb.isNotNull(getExpression(attributeName,join,root)));
                                break;
                            case IS_NULL:
                                predicates.add(cb.isNull(getExpression(attributeName,join,root)));
                                break;
                            case BETWEEN:
                                List<Object> between = new ArrayList<>((List<Object>)val);
                                predicates.add(cb.between(getExpression(attributeName, join, root).as((Class<? extends Comparable>) between.get(0).getClass()),
                                        (Comparable) between.get(0), (Comparable) between.get(1)));
                                break;
                            default: break;
                        }
                    } else {
                    switch (q.type()) {
                        case EQUAL:
                            list.add(cb.equal(getExpression(attributeName,join,root)
@@ -191,8 +256,10 @@
                        default: break;
                    }
                }
                }
                field.setAccessible(accessible);
            }
            orGroupMap.values().forEach(predicates -> list.add(cb.or(predicates.toArray(new Predicate[0]))));
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/domain/AttendanceBusinessTravel.java
@@ -89,6 +89,10 @@
    @ApiModelProperty(value = "出差类别")
    private String category;
    @Column(name = "`project_id`")
    @ApiModelProperty(value = "项目ID")
    private Long projectId;
    @Column(name = "`approval_status`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "审批状态")
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/rest/AttendanceController.java
@@ -64,6 +64,14 @@
        return new ResponseEntity<>(attendanceService.queryAll(criteria,pageable),HttpStatus.OK);
    }
    @GetMapping("/notNormal")
    @Log("查询考勤记录")
    @ApiOperation("查询考勤记录")
    @PreAuthorize("@el.check('attendance:list')")
    public ResponseEntity<Object> queryAttendanceNotNormal(AttendanceQueryCriteria criteria, Pageable pageable){
        return new ResponseEntity<>(attendanceService.queryAllNotNormal(criteria,pageable),HttpStatus.OK);
    }
    @GetMapping(value = "/all")
    @Log("查询考勤记录")
    @ApiOperation("查询考勤记录")
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/rest/AttendanceLeaveController.java
@@ -94,18 +94,20 @@
        return new ResponseEntity<>(attendanceLeaveService.calcTimeLength(resources), HttpStatus.OK);
    }
    @PostMapping(value = "/getYearTimeLength")
    @PostMapping(value = "/getYearTimeLength/{userId}")
    @Log("获取年假时长")
    @ApiOperation("获取年假时长")
    public ResponseEntity<Object> getYearTimeLength(@RequestBody Long userId) throws ParseException {
        return new ResponseEntity<>(attendanceLeaveService.getYearTimeLength(userId), HttpStatus.OK);
    public ResponseEntity<Object> getYearTimeLength(@PathVariable Long userId, @RequestBody String year) throws ParseException {
        return new ResponseEntity<>(attendanceLeaveService.getYearTimeLength(userId, year), HttpStatus.OK);
    }
    @PostMapping(value = "/getOverTimeLength")
    @PostMapping(value = "/getOverTimeLength/{userId}")
    @Log("获取调休假时长")
    @ApiOperation("获取调休假时长")
    public ResponseEntity<Object> getOverTimeLength(@RequestBody Long userId) throws ParseException {
        return new ResponseEntity<>(attendanceLeaveService.getOverTimeLength(userId), HttpStatus.OK);
    public ResponseEntity<Object> getOverTimeLength(@PathVariable Long userId, @RequestBody String yearMonth) throws ParseException {
        Double overTimeLength = attendanceLeaveService.getOverTimeLength(userId, yearMonth);
        Double overTimeCloseLength = attendanceLeaveService.getOverTimeCloseLength(userId, yearMonth);
        return new ResponseEntity<>(overTimeLength + overTimeCloseLength, HttpStatus.OK);
    }
    @PutMapping(value = "/approve")
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/AttendanceLeaveService.java
@@ -86,14 +86,25 @@
    Double getYearTimeLength(Long userId) throws ParseException;
    /**
     *获取剩余年假
     * @return
     * @throws ParseException
     */
    Double getYearTimeLength(Long userId, String year) throws ParseException;
    /**
     *获取剩余调休假
     * @return
     * @throws ParseException
     */
    Double getOverTimeLength(Long userId) throws ParseException;
    Double getOverTimeLength(Long userId, String yearMonth) throws ParseException;
    Double getOverTimeCloseLength(Long userId);
    Double getOverTimeCloseLength(Long userId, String yearMonth);
    /**
     * 审核功能
     * @param resources /
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/AttendanceService.java
@@ -44,6 +44,14 @@
    Map<String,Object> queryAll(AttendanceQueryCriteria criteria, Pageable pageable);
    /**
     * 查询数据分页
     * @param criteria 条件
     * @param pageable 分页参数
     * @return Map<String,Object>
     */
    Map<String,Object> queryAllNotNormal(AttendanceQueryCriteria criteria, Pageable pageable);
    /**
    * 查询所有数据不分页
    * @param criteria 条件参数
    * @return List<AttendanceDto>
@@ -125,4 +133,5 @@
     */
    void addAttendanceInfo(Attendance attendance) throws Exception;
    void generateAttendance(Long id, String startDate, String endDate);
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/dto/AttendanceBusinessTravelDto.java
@@ -64,6 +64,9 @@
    /** 出差类别 */
    private String category;
    /** 项目ID */
    private Long projectId;
    /** 审批状态 */
    private String approvalStatus;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/dto/AttendanceQueryCriteria.java
@@ -52,9 +52,20 @@
    @Query(type = Query.Type.EQUAL, propName = "endClockResults")
    private String endClockResults;
    /* 开始打卡模糊查询 */
    @Query(orGroup = "NotNormal", type = Query.Type.IN, propName = "startClockResults")
    private List<String> startClockResultsList;
    /* 结束打卡模糊查询 */
    @Query(orGroup = "NotNormal", type = Query.Type.IN, propName = "endClockResults")
    private List<String> endClockResultsList;
    /* 模糊 */
    @Query(propName = "attendanceDate", type = Query.Type.INNER_LIKE)
    private String attendanceDateLike;
    @Query(propName = "userId", type = Query.Type.IN)
    private List<Long> userIds;
    private String targetYearMonth;
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceLeaveServiceImpl.java
@@ -491,26 +491,86 @@
    }
    /**
     * 获取用户年假剩余时长
     */
    @Override
    public Double getYearTimeLength(Long userId, String year) {
        //获取年假剩余(新)
        Double surplusYearTime = new Double(0.00);
        // 根据用户查询
        List<SysUserLevelOther> sysUserLevelOtherList = sysUserLevelOtherRepository.findByUserId(userId);
        if (sysUserLevelOtherList.size() > 0) {
            for (SysUserLevelOther sysUserLevelOther : sysUserLevelOtherList) {
                if (!sysUserLevelOther.getYearMonth().isEmpty() && sysUserLevelOther.getYearMonth().substring(0,4).equals(String.valueOf(year))) {
                    //年假总时长
                    Double yearTime = Double.valueOf(sysUserLevelOther.getAnnualLeaveDays() == null ? 0 : sysUserLevelOther.getAnnualLeaveDays() * 8);
                    String startTime = year + "-01-01 00:00:00";
                    String endTime = year + "-12-31 23:59:59";
                    Double usedYearTime = attendanceLeaveRepository.getSurplusYearTime(sysUserLevelOther.getUserId(), startTime, endTime);
                    surplusYearTime = yearTime - (usedYearTime == null ? 0.0 : usedYearTime);
                }
            }
        }
        return surplusYearTime;
    }
    /**
     * 获取用户调休假剩余时长
     */
    @Override
    public Double getOverTimeLength(Long userId) {
        //获取调休假剩余时长
        Double surplusYearTime = new Double(0.00);
        LocalDate localDateStart = LocalDate.of(2024, 1, 1);
        LocalDate localDateMiddle = LocalDate.now().withDayOfMonth(1).minusMonths(3);
        Double overTimeLast = attendanceOvertimeRepository.findByUserIdAndYearMonth(userId, localDateStart.atStartOfDay(), localDateMiddle.atStartOfDay()); // TODO
        if (overTimeLast == null) {
            overTimeLast = 0.0;
        }
        LocalDate localDateEnd = LocalDate.now().plusMonths(1).withDayOfMonth(1);
        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 surplusYearTime = attendanceOvertimeRepository.findByUserIdAndYearMonth(userId, localDateMiddle.atStartOfDay(), localDateEnd.atStartOfDay());
        if (surplusYearTime == null) {
            surplusYearTime = 0.0;
        }
            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 (usedTime == null) {
            usedTime = 0.0;
            }
        if (overTimeLast > usedTime) {
            return surplusYearTime;
        }
        surplusYearTime = surplusYearTime + overTimeLast - usedTime;
        if (surplusYearTime <= 0.0) {
            return 0.0;
        }
        return BigDecimal.valueOf(surplusYearTime).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
    }
    @Override
    public Double getOverTimeLength(Long userId, String yearMonth) {
        LocalDate localDateStart = LocalDate.of(2024, 1, 1);
        LocalDate localDateMiddle = LocalDate.parse(yearMonth + "-01").minusMonths(3);
        Double overTimeLast = attendanceOvertimeRepository.findByUserIdAndYearMonth(userId, localDateStart.atStartOfDay(), localDateMiddle.atStartOfDay()); // TODO
        if (overTimeLast == null) {
            overTimeLast = 0.0;
        }
        LocalDate localDateEnd = LocalDate.parse(yearMonth + "-01").plusMonths(1).withDayOfMonth(1);
        Double surplusYearTime = attendanceOvertimeRepository.findByUserIdAndYearMonth(userId, localDateMiddle.atStartOfDay(), localDateEnd.atStartOfDay());
        if (surplusYearTime == null) {
            surplusYearTime = 0.0;
        }
        Double usedTime = attendanceLeaveRepository.findByUserIdAndDateAndLeaveType(userId, localDateStart.atStartOfDay(), localDateEnd.atStartOfDay(), Constant.LEAVE_TYPE_REPLACE).stream().mapToDouble(AttendanceLeave::getLeaveDuration).sum();
        if (usedTime == null) {
            usedTime = 0.0;
        }
        if (overTimeLast > usedTime) {
            return surplusYearTime;
        }
        surplusYearTime = surplusYearTime + overTimeLast - usedTime;
        if (surplusYearTime <= 0.0) {
            return 0.0;
        }
@@ -522,25 +582,41 @@
     */
    @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);
        LocalDate localDateStart = LocalDate.of(2024, 1, 1);
        LocalDate localDateMiddle = LocalDate.now().withDayOfMonth(1).minusMonths(3);
        Double surplusYearTime = attendanceOvertimeRepository.findByUserIdAndYearMonth(userId, localDateStart.atStartOfDay(), localDateMiddle.atStartOfDay()); // TODO
        if (surplusYearTime == null) {
            surplusYearTime = 0.0;
        }
        LocalDate localDateEnd = LocalDate.now().plusMonths(1).withDayOfMonth(1);
            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 (usedTime == null) {
            usedTime = 0.0;
            }
        }
        if (surplusYearTime <= 0.0) {
        if (surplusYearTime <= usedTime) {
            return 0.0;
        }
        surplusYearTime = surplusYearTime - usedTime;
        return BigDecimal.valueOf(surplusYearTime).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
    }
    @Override
    public Double getOverTimeCloseLength(Long userId, String yearMonth) {
        LocalDate localDateStart = LocalDate.of(2024, 1, 1);
        LocalDate localDateMiddle = LocalDate.parse(yearMonth + "-01").minusMonths(3);
        Double surplusYearTime = attendanceOvertimeRepository.findByUserIdAndYearMonth(userId, localDateStart.atStartOfDay(), localDateMiddle.atStartOfDay()); // TODO
        if (surplusYearTime == null) {
            surplusYearTime = 0.0;
        }
        LocalDate localDateEnd = LocalDate.parse(yearMonth + "-01").plusMonths(1).withDayOfMonth(1);
        Double usedTime = attendanceLeaveRepository.findByUserIdAndDateAndLeaveType(userId, localDateStart.atStartOfDay(), localDateEnd.atStartOfDay(), Constant.LEAVE_TYPE_REPLACE).stream().mapToDouble(AttendanceLeave::getLeaveDuration).sum();
        if (usedTime == null) {
            usedTime = 0.0;
        }
        if (surplusYearTime <= usedTime) {
            return 0.0;
        }
        surplusYearTime = surplusYearTime - usedTime;
        return BigDecimal.valueOf(surplusYearTime).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
    }
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceServiceImpl.java
@@ -24,16 +24,12 @@
import me.zhengjie.modules.attendance.service.mapstruct.AttendanceMapper;
import me.zhengjie.modules.constant.Constant;
import me.zhengjie.modules.quartz.service.impl.WeComServiceImpl;
import me.zhengjie.modules.system.domain.Role;
import me.zhengjie.modules.system.domain.SysConfigHoliday;
import me.zhengjie.modules.system.domain.SysRostering;
import me.zhengjie.modules.system.domain.User;
import me.zhengjie.modules.system.repository.DictDetailRepository;
import me.zhengjie.modules.system.repository.SysConfigHolidayRepository;
import me.zhengjie.modules.system.repository.UserRepository;
import me.zhengjie.modules.system.domain.*;
import me.zhengjie.modules.system.repository.*;
import me.zhengjie.modules.system.service.dto.SysConfigHolidayQueryCriteria;
import me.zhengjie.utils.*;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
@@ -89,6 +85,29 @@
                attendanceDto.setUserName(user.getNickName());
                return attendanceDto;
            }
        };
        return PageUtil.toPage(page.map(func));
    }
    @Override
    public Map<String,Object> queryAllNotNormal(AttendanceQueryCriteria criteria, Pageable pageable) {
        if (criteria.getUserId() == null) {
            List<String> wecomExcludeList = dictDetailRepository.findByDictName("wecom_exclude_list").stream().map(DictDetail::getValue).collect(Collectors.toList());
            criteria.setUserIds(userRepository.findAllByEnabled(true).stream().filter(user ->!wecomExcludeList.contains(user.getWeComId())).map(User::getId).collect(Collectors.toList()));
        }
        criteria.setStartClockResultsList(Arrays.asList(Constant.ATTENDANCE_START_EARLY, Constant.ATTENDANCE_START_LATE, Constant.ATTENDANCE_STATE_WAITFOR, Constant.ATTENDANCE_STATE_NOTSIGNED, Constant.ATTENDANCE_STATE_LACK_OF_TIME));
        criteria.setEndClockResultsList(Arrays.asList(Constant.ATTENDANCE_START_EARLY, Constant.ATTENDANCE_START_LATE, Constant.ATTENDANCE_STATE_WAITFOR, Constant.ATTENDANCE_STATE_NOTSIGNED, Constant.ATTENDANCE_STATE_LACK_OF_TIME));
        Page<Attendance> page = attendanceRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
        //将实体转换为Dto(重写)
        Function<Attendance, AttendanceDto> func = attendance -> {
            // 将实体类转换成DTO
            AttendanceDto attendanceDto = attendanceMapper.toDto(attendance);
            //查询用户信息
            User user = userRepository.findById(attendanceDto.getUserId()).orElseGet(User::new);
            attendanceDto.setUserName(user.getNickName());
            return attendanceDto;
        };
        return PageUtil.toPage(page.map(func));
    }
@@ -287,6 +306,74 @@
        weComService.getWeComAttendanceList(attendance.getAttendanceDate(), userList);
        // 选择日期和员工更新员工的考勤信息,未选择员工则更新所有人
        weComService.getWeComAttendanceListOfNoonOrNight(attendanceDate, userList);
    }
    @Autowired
    private SysRosteringRepository sysRosteringRepository;
    @Override
    public void generateAttendance(Long id, String startDate, String endDate) {
        Stream.iterate(LocalDate.parse(startDate), date -> date.plusDays(1))
            .limit(ChronoUnit.DAYS.between(LocalDate.parse(startDate), LocalDate.parse(endDate)) + 1).forEach(date -> {
                    User user = userRepository.findById(id).get();
                    // 用户排班
                    SysRostering sysRostering = sysRosteringRepository.findByRosId(user.getSysRostering().getId());
                    // 考勤记录
                    Attendance attendance = new Attendance();
                    SysConfigHoliday sysConfigHoliday = sysConfigHolidayRepository.findByHolidayDate(date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
                    // 时间格式化
                    DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("HH:mm:ss");
                    // 考勤记录
                    attendance.setUserId(user.getId());
                    attendance.setAttendanceDate(Timestamp.valueOf(date.atStartOfDay()));
                    // 考勤日期类是否是周末、节假日、工作日
                    if (sysConfigHoliday == null && (date.getDayOfWeek() == DayOfWeek.SATURDAY || date.getDayOfWeek() == DayOfWeek.SUNDAY)) {
                        attendance.setStartLocationResults(Constant.LOCATION_RESULTS_REST);
                        attendance.setEndLocationResults(Constant.LOCATION_RESULTS_REST);
                        attendance.setStartClockResults(Constant.ATTENDANCE_STATE_REST);
                        attendance.setEndClockResults(Constant.ATTENDANCE_STATE_REST);
                        // 考勤记录:日期类型-双休
                        attendance.setDateType(Constant.DATE_TYPE_WEEKEND);
                    } else if (sysConfigHoliday != null && sysConfigHoliday.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS)) {
                        attendance.setStartLocationResults(Constant.LOCATION_RESULTS_REST);
                        attendance.setEndLocationResults(Constant.LOCATION_RESULTS_REST);
                        attendance.setStartClockResults(Constant.ATTENDANCE_STATE_REST);
                        attendance.setEndClockResults(Constant.ATTENDANCE_STATE_REST);
                        // 考勤记录:日期类型-节假日
                        attendance.setDateType(Constant.DATE_TYPE_LEGAL_HOLIDAYS);
                    } else if (sysConfigHoliday != null && sysConfigHoliday.getDateType().equals(Constant.DATE_TYPE_HOLIDAYS)) {
                        attendance.setStartLocationResults(Constant.LOCATION_RESULTS_REST);
                        attendance.setEndLocationResults(Constant.LOCATION_RESULTS_REST);
                        attendance.setStartClockResults(Constant.ATTENDANCE_STATE_REST);
                        attendance.setEndClockResults(Constant.ATTENDANCE_STATE_REST);
                        // 考勤记录:日期类型-法定节假日
                        attendance.setDateType(Constant.DATE_TYPE_HOLIDAYS);
                    } else {
                        attendance.setStartLocationResults(Constant.LOCATION_RESULTS_NORMAL);
                        attendance.setEndLocationResults(Constant.LOCATION_RESULTS_NORMAL);
                        attendance.setStartClockResults(Constant.ATTENDANCE_STATE_NORMAL);
                        attendance.setEndClockResults(Constant.ATTENDANCE_STATE_NORMAL);
                        attendance.setActualWorkStartTime(Timestamp.valueOf(date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + " " + dateTimeFormatter.format(sysRostering.getWorkStartTime())));
                        attendance.setActualWorkEndTime(Timestamp.valueOf(date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + " " + dateTimeFormatter.format(sysRostering.getWorkEndTime())));
                        // 考勤记录:日期类型-工作日
                        attendance.setDateType(Constant.DATE_TYPE_WEEKDAY);
                    }
                    // 考勤记
                    attendance.setRosteringWorkStartTime(Timestamp.valueOf(date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + " " + dateTimeFormatter.format(sysRostering.getWorkStartTime())));
                    attendance.setRosteringWorkEndTime(Timestamp.valueOf(date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + " " + dateTimeFormatter.format(sysRostering.getWorkEndTime())));
                    attendance.setRosteringLunchStartTime(Timestamp.valueOf(date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + " " + dateTimeFormatter.format(sysRostering.getLunchStartTime())));
                    attendance.setRosteringLunchEndTime(Timestamp.valueOf(date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + " " + dateTimeFormatter.format(sysRostering.getLunchEndTime())));
                    // 保存
                    attendanceRepository.save(attendance);
        });
    }
    @Override
@@ -617,6 +704,38 @@
            List<Calculate> breakParts = new ArrayList<>();
            breakParts.add(new Calculate(rosteringLunchStartTime, rosteringLunchEndTime));
            // 请假信息
            List<AttendanceLeave> attendanceLeaveList = attendanceLeaveRepository.findByUserIdAndDate(criteria.getUserId(), startOfDate, endOfDate);
            breakParts.addAll(
                    attendanceLeaveList.stream().map(attendanceLeave -> {
                        LocalDateTime attendanceLeaveStart = attendanceLeave.getLeaveStartTime().toLocalDateTime();
                        LocalDateTime attendanceLeaveEnd = attendanceLeave.getLeaveEndTime().toLocalDateTime();
                        if (attendanceLeaveStart.isBefore(rosteringWorkStartTime)) {
                            attendanceLeaveStart = rosteringWorkStartTime;
                        }
                        if (attendanceLeaveEnd.isAfter(rosteringWorkEndTime)) {
                            attendanceLeaveEnd = rosteringWorkEndTime;
                        }
                        return new Calculate(attendanceLeaveStart, attendanceLeaveEnd);
                    }
                    ).filter(calculate -> calculate.getStart().isBefore(calculate.getEnd())).collect(Collectors.toList())
            );
            // 合并请假时间
            List<Calculate> finalBreakParts = breakParts.stream().sorted().reduce(new Stack<>(), (result, current) -> {
                // 删除重复时间,合并相连的时间段
                if (result.empty()) {
                    result.push(current);
                    return result;
                }
                Calculate last = result.peek();
                if (last.getEnd().isBefore(current.getStart())) {
                    result.push(current);
                } else if (last.getEnd().isBefore(current.getEnd())) {
                    last.setEnd(current.getEnd());
                }
                return result;
            }, (o1, o2) -> null);
            // 外出信息
            List<AttendanceGoOut> attendanceGoOutList = attendanceGoOutRepository.findByUserAndDate(criteria.getUserId(), startOfDate, endOfDate);
            attendanceParts.addAll(
@@ -650,7 +769,7 @@
                return result;
            }, (o1, o2) -> null).forEach(calculate -> {
                // 去除休息时间:午休等
                for (Calculate breakPart : breakParts) {
                for (Calculate breakPart : finalBreakParts) {
                    if ((calculate.getStart().isBefore(breakPart.getStart()) && calculate.getEnd().isAfter(breakPart.getStart()))
                            || (calculate.getStart().isBefore(breakPart.getEnd()) && calculate.getEnd().isAfter(breakPart.getEnd()))) {
                        Calculate calculate1 = new Calculate(calculate.getStart(), breakPart.getStart());
@@ -674,9 +793,6 @@
                            (total, current) -> total.add(BigDecimal.valueOf(current)),
                            (o1, o2) -> null).divide(BigDecimal.valueOf(3600), 2, RoundingMode.HALF_UP
                    );
            // 请假信息
            List<AttendanceLeave> attendanceLeaveList = attendanceLeaveRepository.findByUserIdAndDate(criteria.getUserId(), startOfDate, endOfDate);
            // 年假不扣工时
            BigDecimal annualLeaveHours = attendanceLeaveList.stream()
                    .filter(attendanceLeave -> Constant.LEAVE_TYPE_ANNUAL_LEAVE.equals(attendanceLeave.getLeaveType())
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/DingTalkServiceImpl.java
@@ -193,13 +193,13 @@
                    // 如果是周六或者周日或节假日,打卡状态为等待的话,就改状态为休息(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))) {
                        // 开始打卡结果
                        if(attendance.getStartClockResults().equals(Constant.ATTENDANCE_STATE_WAITFOR)){
                        if(attendance.getStartClockResults().equals(Constant.ATTENDANCE_STATE_WAITFOR) || attendance.getStartClockResults().equals(Constant.ATTENDANCE_STATE_LACK_OF_TIME)){
                            attendance.setStartClockResults(Constant.ATTENDANCE_STATE_REST);
                            attendance.setStartLocationResults(Constant.LOCATION_RESULTS_REST);
                            attendance.setActualWorkStartTime(null);
                        }
                        // 结束打卡结果
                        if(attendance.getEndClockResults().equals(Constant.ATTENDANCE_STATE_WAITFOR)){
                        if(attendance.getEndClockResults().equals(Constant.ATTENDANCE_STATE_WAITFOR) || attendance.getEndClockResults().equals(Constant.ATTENDANCE_STATE_LACK_OF_TIME)){
                            attendance.setEndClockResults(Constant.ATTENDANCE_STATE_REST);
                            attendance.setEndLocationResults(Constant.LOCATION_RESULTS_REST);
                            attendance.setActualWorkEndTime(null);
@@ -247,7 +247,8 @@
                    }
                    // 修改考勤打卡状态
                    if (ObjectUtils.isNotEmpty(attendance)) {
                        attendance = updateRecord(user, attendance, true, attendDate);
                        getMornOrNoon(user,attendance,attendDate,attendance.getRosteringWorkStartTime(),attendance.getRosteringWorkEndTime(), true);
//                        attendance = updateRecord(user, attendance, true, attendDate);
                        attendanceRepository.save(attendance);
                    }
                }
@@ -360,7 +361,8 @@
                    }
                    // 修改考勤打卡状态
                    if (ObjectUtils.isNotEmpty(attendance)) {
                        attendance = updateRecord(user, attendance, false, attendDate);
                        getMornOrNoon(user,attendance,attendDate,attendance.getRosteringWorkStartTime(),attendance.getRosteringWorkEndTime(), false);
//                        attendance = updateRecord(user, attendance, false, attendDate);
                        attendanceRepository.save(attendance);
                    }
                }
@@ -442,20 +444,35 @@
                Double outDuration = new Double(0.00);
                Double outStartDuration = new Double(0.00);// 考勤按钮的时长
                Double outEndDuration = new Double(0.00);// 考勤按钮的时长
                for(AttendanceGoOut attendanceGoOut : attendanceGoOutList){
                    // attendDate不等于null 说明是考勤信息按钮
                    if(ObjectUtils.isNotEmpty(attendDate)){
                    for(AttendanceGoOut attendanceGoOut : attendanceGoOutList) {
                        // 上午时长、下午时长
                        outStartDuration += getStartDuration(attendanceGoOut.getOutStartTime(),attendanceGoOut.getOutEndTime(),attendance);
                        outEndDuration += getEndDuration(attendanceGoOut.getOutStartTime(),attendanceGoOut.getOutEndTime(),attendance);
                    }
                        //调用方法修改考勤打卡状态
                        updateAttendanceRecord(null,attendance,Constant.ATTENDANCE_STATE_GOOUT,day,outStartDuration,outEndDuration);
                    }else{
                    for(AttendanceGoOut attendanceGoOut : attendanceGoOutList) {
                        // 上午or下午总时长
                        outDuration += getDuration(attendanceGoOut.getOutStartTime(),attendanceGoOut.getOutEndTime(),attendance,day);
                    }
                        updateAttendanceRecord(outDuration,attendance,Constant.ATTENDANCE_STATE_GOOUT, day,null,null);
                    }
                }
//                for(AttendanceGoOut attendanceGoOut : attendanceGoOutList){
//                    // attendDate不等于null 说明是考勤信息按钮
//                    if(ObjectUtils.isNotEmpty(attendDate)){
//                        // 上午时长、下午时长
//                        outStartDuration += getStartDuration(attendanceGoOut.getOutStartTime(),attendanceGoOut.getOutEndTime(),attendance);
//                        outEndDuration += getEndDuration(attendanceGoOut.getOutStartTime(),attendanceGoOut.getOutEndTime(),attendance);
//                        //调用方法修改考勤打卡状态
//                        updateAttendanceRecord(null,attendance,Constant.ATTENDANCE_STATE_GOOUT,day,outStartDuration,outEndDuration);
//                    }else{
//                        // 上午or下午总时长
//                        outDuration += getDuration(attendanceGoOut.getOutStartTime(),attendanceGoOut.getOutEndTime(),attendance,day);
//                        updateAttendanceRecord(outDuration,attendance,Constant.ATTENDANCE_STATE_GOOUT, day,null,null);
//                    }
//                }
            }else{
                if(ObjectUtils.isNotEmpty(attendanceBusinessTravel)){
                    // attendDate不等于null 说明是考勤信息按钮
@@ -475,32 +492,58 @@
        }else{
            // 查询考勤外出表
            List<AttendanceGoOut> attendanceGoOutList = attendanceGoOutRepository.findByUserAndDate(user.getId(),attendance.getRosteringWorkStartTime().toLocalDateTime(),attendance.getRosteringWorkEndTime().toLocalDateTime());
            for(AttendanceGoOut attendanceGoOut : attendanceGoOutList){
                // attendDate不等于null 说明是考勤信息按钮
                if(ObjectUtils.isNotEmpty(attendDate)){
                for(AttendanceGoOut attendanceGoOut : attendanceGoOutList) {
                    // 上午时长、下午时长
                    leaveStartDuration += getStartDuration(attendanceGoOut.getOutStartTime(),attendanceGoOut.getOutEndTime(),attendance);
                    leaveEndDuration += getEndDuration(attendanceGoOut.getOutStartTime(),attendanceGoOut.getOutEndTime(),attendance);
                }else{
                    // 上午or下午总时长
                    leaveDuration += getDuration(attendanceGoOut.getOutStartTime(),attendanceGoOut.getOutEndTime(),attendance,day);
                }
            }
            for(AttendanceLeave attendanceLeave : attendanceLeaveList){
                // attendDate不等于null 说明是考勤信息按钮
                if(ObjectUtils.isNotEmpty(attendDate)){
                    // 上午总时长、下午总时长
                    leaveStartDuration += getStartDuration(attendanceLeave.getLeaveStartTime(),attendanceLeave.getLeaveEndTime(),attendance);
                    leaveEndDuration += getEndDuration(attendanceLeave.getLeaveStartTime(),attendanceLeave.getLeaveEndTime(),attendance);
                }
                    //调用方法修改考勤打卡状态
                    updateAttendanceRecord(null,attendance,Constant.ATTENDANCE_STATE_LEAVE,day,leaveStartDuration,leaveEndDuration);
                }else{
                for(AttendanceGoOut attendanceGoOut : attendanceGoOutList) {
                    // 上午or下午总时长
                    leaveDuration += getDuration(attendanceGoOut.getOutStartTime(),attendanceGoOut.getOutEndTime(),attendance,day);
                }
                for(AttendanceLeave attendanceLeave : attendanceLeaveList){
                    // 上午or下午总时长
                    leaveDuration += getDuration(attendanceLeave.getLeaveStartTime(),attendanceLeave.getLeaveEndTime(),attendance,day);
                }
                    //调用方法修改考勤打卡状态
                    updateAttendanceRecord(leaveDuration,attendance,Constant.ATTENDANCE_STATE_LEAVE,day,null,null);
                }
            }
//            for(AttendanceGoOut attendanceGoOut : attendanceGoOutList){
//                // attendDate不等于null 说明是考勤信息按钮
//                if(ObjectUtils.isNotEmpty(attendDate)){
//                    // 上午时长、下午时长
//                    leaveStartDuration += getStartDuration(attendanceGoOut.getOutStartTime(),attendanceGoOut.getOutEndTime(),attendance);
//                    leaveEndDuration += getEndDuration(attendanceGoOut.getOutStartTime(),attendanceGoOut.getOutEndTime(),attendance);
//                }else{
//                    // 上午or下午总时长
//                    leaveDuration += getDuration(attendanceGoOut.getOutStartTime(),attendanceGoOut.getOutEndTime(),attendance,day);
//                }
//            }
//            for(AttendanceLeave attendanceLeave : attendanceLeaveList){
//                // attendDate不等于null 说明是考勤信息按钮
//                if(ObjectUtils.isNotEmpty(attendDate)){
//                    // 上午总时长、下午总时长
//                    leaveStartDuration += getStartDuration(attendanceLeave.getLeaveStartTime(),attendanceLeave.getLeaveEndTime(),attendance);
//                    leaveEndDuration += getEndDuration(attendanceLeave.getLeaveStartTime(),attendanceLeave.getLeaveEndTime(),attendance);
//                    //调用方法修改考勤打卡状态
//                    updateAttendanceRecord(null,attendance,Constant.ATTENDANCE_STATE_LEAVE,day,leaveStartDuration,leaveEndDuration);
//                }else{
//                    // 上午or下午总时长
//                    leaveDuration += getDuration(attendanceLeave.getLeaveStartTime(),attendanceLeave.getLeaveEndTime(),attendance,day);
//                    //调用方法修改考勤打卡状态
//                    updateAttendanceRecord(leaveDuration,attendance,Constant.ATTENDANCE_STATE_LEAVE,day,null,null);
//                }
//            }
        }
    }
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/SysUserLevelOtherServiceImpl.java
@@ -153,6 +153,7 @@
//            }
//        }
        // 保存
        resources.setStartDate(new Timestamp(new SimpleDateFormat("yyyy-MM-dd").parse(resources.getYearMonth() + "-01").getTime()));
        return sysUserLevelOtherMapper.toDto(sysUserLevelOtherRepository.save(resources));
    }
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java
@@ -810,7 +810,7 @@
        }
        returnData.put("onDutyDays", numDay);
        // 剩余年假
        Double yearTimes = attendanceLeaveService.getYearTimeLength(userId);
        Double yearTimes = attendanceLeaveService.getYearTimeLength(userId, sdfDate.substring(0, 4));
        returnData.put("annualLeave", yearTimes);
        // 查询当月的补卡记录的条数
        Integer count = attendanceCardreplacementRepository.count(userId, sdfDate.substring(0, 7));
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskServiceImpl.java
@@ -16,6 +16,7 @@
package me.zhengjie.modules.task.service.impl;
import lombok.RequiredArgsConstructor;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.modules.constant.Constant;
import me.zhengjie.modules.project.domain.Project;
import me.zhengjie.modules.project.repository.ProjectRepository;
@@ -946,6 +947,10 @@
    @CacheEvict(cacheNames = "ChildrenTask", allEntries = true)
    public TaskMongo create(Long userId, TaskMongo resources) {
        resources.setTaskStatus(Constant.TASK_STATUS_NOT_STARTED);
        boolean existed = mongoTemplate.exists(Query.query(Criteria.where("name").is(resources.getName()).and("projectId").is(resources.getProjectId())), TaskMongo.class);
        if (existed) {
            throw new BadRequestException("任务名称重复");
        }
        synchronized (lock) {
            // 查询最大的old_id值
            Query query = new Query();
@@ -972,7 +977,10 @@
//
//        containUserList.addAll(userIdList.stream().filter(o -> !containUserList.contains(o)).collect(Collectors.toList()));
        boolean existed = mongoTemplate.exists(Query.query(Criteria.where("name").is(resources.getName()).and("projectId").is(resources.getProjectId()).and("id").ne(resources.getId())), TaskMongo.class);
        if (existed) {
            throw new BadRequestException("任务名称重复");
        }
        return mongoTemplate.save(resources);
    }
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/treatment/service/impl/UserLevelWageServiceImpl.java
@@ -176,18 +176,29 @@
        Map<String, Double> attendanceBusinessTravelMap = attendanceBusinessTravelList.stream().collect(Collectors.groupingBy(AttendanceBusinessTravel::getCategory, Collectors.summingDouble(AttendanceBusinessTravel::getTravelDuration)));
        BigDecimal travelSubsidy = new BigDecimal(0.0);
        // 出差补助金
        attendanceBusinessTravelMap.forEach((key, value) -> {
            if (key.equals(Constant.ATTENDANCE_BUSINESS_TRAVEL_CATEGORY_TRAVEL)) {
        for (Map.Entry<String, Double> entry : attendanceBusinessTravelMap.entrySet()) {
            if (entry.getKey().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)) {
                travelSubsidy = travelSubsidy.add(BigDecimal.valueOf(entry.getValue() * sysConfigProportion.getProportion()));
            } else if (entry.getKey().equals(Constant.ATTENDANCE_BUSINESS_TRAVEL_CATEGORY_SAME_PLACE)) {
                // 客户现场补助金
//                SysConfigProportion sysConfigProportion = sysConfigProportionRepository.findByTitle("客户现场补助金额");
                travelSubsidy.add(BigDecimal.valueOf(value * 30)); // 按30元/天计算 TODO 待调整
                travelSubsidy = travelSubsidy.add(BigDecimal.valueOf(entry.getValue() * 30)); // 按30元/天计算 TODO 待调整
            }
        });
        }
//        // 出差补助金
//        attendanceBusinessTravelMap.forEach((key, value) -> {
//            if (key.equals(Constant.ATTENDANCE_BUSINESS_TRAVEL_CATEGORY_TRAVEL)) {
//                // 出差补助金
//                SysConfigProportion sysConfigProportion = sysConfigProportionRepository.findByTitle("出差补助金额");
//                travelSubsidy = travelSubsidy.add(BigDecimal.valueOf(value * sysConfigProportion.getProportion()));
//            } else if (key.equals(Constant.ATTENDANCE_BUSINESS_TRAVEL_CATEGORY_SAME_PLACE)) {
//                // 客户现场补助金
////                SysConfigProportion sysConfigProportion = sysConfigProportionRepository.findByTitle("客户现场补助金额");
//                travelSubsidy = travelSubsidy.add(BigDecimal.valueOf(value * 30)); // 按30元/天计算 TODO 待调整
//            }
//        });
        return travelSubsidy.doubleValue();
    }
eladmin-web-master/src/api/attendance/attendanceLeave.js
@@ -40,17 +40,17 @@
  })
}
export function getYearTimeLength(data) {
export function getYearTimeLength(userId, data) {
  return request({
    url: 'api/attendanceLeave/getYearTimeLength',
    url: 'api/attendanceLeave/getYearTimeLength/' + userId,
    method: 'post',
    data
  })
}
export function getOverTimeLength(data) {
export function getOverTimeLength(userId, data) {
  return request({
    url: 'api/attendanceLeave/getOverTimeLength',
    url: 'api/attendanceLeave/getOverTimeLength/' + userId,
    method: 'post',
    data
  })
eladmin-web-master/src/views/assetManagement/assetUseManagement/index.vue
@@ -210,7 +210,7 @@
      crudUser.getAll().then(res => {
        this.users = res
      })
      // 资产
      // 资产 response.data
      crudAssetManagement.getAll().then(res => {
        this.assetManagements = res
      })
eladmin-web-master/src/views/attendance/attendanceBusinessTravel/index.vue
@@ -269,6 +269,26 @@
              "
            />
          </el-form-item>
          <el-form-item label="关联项目" prop="projectId">
            <el-select
              v-model="form.projectId"
              filterable
              clearable
              placeholder="请选择"
              style="width: 340px;"
              :disabled="
                form.approvalStatus == dictGoOutAgree ||
                  form.approvalStatus == dictGoOutReturn
              "
            >
              <el-option
                v-for="item in projects"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="出差分类" prop="category">
            <el-select
              v-model="form.category"
@@ -494,6 +514,16 @@
          show-overflow-tooltip
        />
        <el-table-column
          prop="category"
          label="出差分类"
          width="80"
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            {{ dict.label[dictBusinessTravelCategory][scope.row.category] }}
          </template>
        </el-table-column>
        <el-table-column
          prop="approvalStatus"
          label="审批状态"
          width="80"
@@ -617,6 +647,7 @@
<script>
import crudAttendanceBusinessTravel from '@/api/attendance/attendanceBusinessTravel'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import crudProject from '@/api/project/project'
import rrOperation from '@crud/RR.operation'
import crudUser from '@/api/system/user'
import { mapGetters } from 'vuex'
@@ -638,6 +669,7 @@
  departureCity: null,
  arrivalCity: null,
  category: null,
  projectId: null,
  approvalStatus: null,
  approvalDescription: null,
  remarks: null,
@@ -700,10 +732,15 @@
        ],
        approvalStatus: [
          { required: true, message: '审批状态不能为空', trigger: 'change' }
        ],
        projectId: [
          { required: true, message: '请选择项目', trigger: 'change' }
        ]
      },
      users: [],
      approvalUsers: [],
      // 项目列表
      projects: [],
      dictBussinessStatus: constant.BUSSINESS_APPROVE_STATUS,
      dictGoOutAppRev: constant.BUSSINESS_APPROVE_STATUS_REVIEWED,
      dictGoOutAgree: constant.BUSSINESS_APPROVE_STATUS_AGREE,
@@ -745,6 +782,8 @@
      const userRolesLevel = this.user.roles.map(({ level }) => level)
      // 用户最大角色级别
      this.userRolesLevelMin = Math.min(...userRolesLevel)
      // 获取项目列表
      this.getProjects()
      return true
    },
    // 钩子:新建 - 之前
@@ -769,6 +808,17 @@
        return true
      }
    },
    // 获取项目列表
    getProjects() {
      // 获取项目列表
      crudProject.getRelevant({
        'projectStatusIn': ['project_status_not_started', 'project_status_under_way'],
        'approve_status': 'approve_status_acknowledged'
      }).then(res => {
        // 项目列表
        this.projects = res
      })
    },
    // 查询员工
    getUsers() {
      crudUser.getAll().then(res => {
eladmin-web-master/src/views/attendance/attendanceLeave/index.vue
@@ -485,11 +485,11 @@
        return
      }
      // 获取年假剩余时长
      crudAttendanceLeave.getYearTimeLength((this.form.userId == null ? 1 : this.form.userId)).then(res => {
      crudAttendanceLeave.getYearTimeLength((this.form.userId == null ? 1 : this.form.userId), this.form.leaveStartTime.substring(0, 4)).then(res => {
        this.yearTimeLenght = res
      })
      // 获取调休假剩余时长
      crudAttendanceLeave.getOverTimeLength((this.form.userId == null ? 1 : this.form.userId)).then(res => {
      crudAttendanceLeave.getOverTimeLength((this.form.userId == null ? 1 : this.form.userId), this.form.leaveStartTime.substring(0, 7)).then(res => {
        this.OverTimeLenght = res
      })
      // 通过后台计算时长
eladmin-web-master/src/views/attendance/index.vue
New file
@@ -0,0 +1,384 @@
<template>
  <div class="app-container">
    <el-row :gutter="40" class="panel-group">
      <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
        <div class="card-panel">
          <div class="card-panel-icon-wrapper icon-people">
            <svg-icon icon-class="visits" class-name="card-panel-icon" />
          </div>
          <div class="card-panel-description">
            <div class="card-panel-text">
              补卡未承认
            </div>
            <count-to
              :start-val="0"
              :end-val="100"
              :duration="1"
              class="card-panel-num"
            />
          </div>
        </div>
      </el-col>
      <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
        <div class="card-panel">
          <div class="card-panel-icon-wrapper icon-permission">
            <svg-icon icon-class="people" class-name="card-panel-icon" />
          </div>
          <div class="card-panel-description">
            <div class="card-panel-text">
              请假未承认
            </div>
            <count-to
              :start-val="0"
              :end-val="100"
              :duration="3000"
              :decimals="2"
              class="card-panel-num"
            />
          </div>
        </div>
      </el-col>
      <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
        <div class="card-panel">
          <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="100"
              :duration="3600"
              class="card-panel-num"
            />
          </div>
        </div>
      </el-col>
      <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
        <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="100"
              :decimals="2"
              :duration="3600"
              class="card-panel-num"
            />
            <span class="card-panel-texts">/</span>
            <count-to
              :start-val="0"
              :end-val="100"
              :duration="3600"
              class="card-panel-num"
            />
          </div>
        </div>
      </el-col>
    </el-row>
    <!--工具栏-->
    <div class="head-container">
      <div>
        <el-select v-model="query.userId" filterable clearable placeholder="所属员工" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery">
          <el-option
            v-for="item in users"
            :key="item.id"
            :label="item.nickName"
            :value="item.id"
          />
        </el-select>
        <el-date-picker
          v-model="query.attendanceDate"
          type="daterange"
          clearable
          class="filter-item"
          value-format="yyyy-MM-dd"
          placeholder="请选择考勤日期"
          range-separator=" ~ "
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          style="width: 285px;"
        />
        <rrOperation />
      </div>
      <!--表格渲染-->
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" row-key="id" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
        <el-table-column type="selection" width="55" />
        <el-table-column prop="userName" label="所属员工" fixed="left" width="100" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-tag>{{ scope.row.userName }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="attendanceDate" label="考勤日期" fixed="left" width="100" show-overflow-tooltip>
          <template slot-scope="scope">
            {{ crud.toDate(scope.row.attendanceDate) }}
          </template>
        </el-table-column>
        <el-table-column prop="rosteringWorkStartTime" min-width="140" label="排班工作开始时间" show-overflow-tooltip />
        <el-table-column prop="actualWorkStartTime" min-width="140" label="实际工作开始时间" show-overflow-tooltip />
        <el-table-column prop="startLocationResults" min-width="100" label="开始位置结果" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-tag v-if="scope.row.startLocationResults === dictlocationResultsNormal" type="success">{{ dict.label[lacationResules][scope.row.startLocationResults] }}</el-tag>
            <el-tag v-if="scope.row.startLocationResults === dictlocationResultsOutside" type="warning">{{ dict.label[lacationResules][scope.row.startLocationResults] }}</el-tag>
            <el-tag v-if="scope.row.startLocationResults === dictlocationResultsNotSigned" type="danger">{{ dict.label[lacationResules][scope.row.startLocationResults] }}</el-tag>
            <el-tag v-if="scope.row.startLocationResults === dictlocationResultsRest" type="warning">{{ dict.label[lacationResules][scope.row.startLocationResults] }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="startClockResults" min-width="100" label="开始打卡结果" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-tag v-if="scope.row.startClockResults === dictAttendanceStateWaitFor" type="warning">{{ dict.label[attendanceState][scope.row.startClockResults] }}</el-tag>
            <el-tag v-if="scope.row.startClockResults === dictAttendanceStateNormal" type="success">{{ dict.label[attendanceState][scope.row.startClockResults] }}</el-tag>
            <el-tag v-if="scope.row.startClockResults === dictAttendanceStateNotSigned" type="danger">{{ dict.label[attendanceState][scope.row.startClockResults] }}</el-tag>
            <el-tag v-if="scope.row.startClockResults === dictAttendanceStateGoOut" type="success">{{ dict.label[attendanceState][scope.row.startClockResults] }}</el-tag>
            <el-tag v-if="scope.row.startClockResults === dictAttendanceStateBusiness" type="success">{{ dict.label[attendanceState][scope.row.startClockResults] }}</el-tag>
            <el-tag v-if="scope.row.startClockResults === dictAttendanceStateLeave" type="success">{{ dict.label[attendanceState][scope.row.startClockResults] }}</el-tag>
            <el-tag v-if="scope.row.startClockResults === dictAttendanceStateRest" type="warning">{{ dict.label[attendanceState][scope.row.startClockResults] }}</el-tag>
            <el-tag v-if="scope.row.startClockResults === dictEndanceStateLackOfTime" type="danger">{{ dict.label[attendanceState][scope.row.startClockResults] }}</el-tag>
            <el-tag v-if="scope.row.startClockResults === dictStartLate" type="warning">{{ dict.label[attendanceState][scope.row.startClockResults] }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="rosteringWorkEndTime" min-width="140" label="排班工作结束时间" show-overflow-tooltip />
        <el-table-column prop="actualWorkEndTime" min-width="140" label="实际工作结束时间" show-overflow-tooltip />
        <el-table-column prop="endLocationResults" min-width="100" label="结束位置结果" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-tag v-if="scope.row.endLocationResults === dictlocationResultsNormal" type="success">{{ dict.label[lacationResules][scope.row.endLocationResults] }}</el-tag>
            <el-tag v-if="scope.row.endLocationResults === dictlocationResultsOutside" type="warning">{{ dict.label[lacationResules][scope.row.endLocationResults] }}</el-tag>
            <el-tag v-if="scope.row.endLocationResults === dictlocationResultsNotSigned" type="danger">{{ dict.label[lacationResules][scope.row.endLocationResults] }}</el-tag>
            <el-tag v-if="scope.row.endLocationResults === dictlocationResultsRest" type="warning">{{ dict.label[lacationResules][scope.row.endLocationResults] }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="endClockResults" min-width="100" label="结束打卡结果" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-tag v-if="scope.row.endClockResults === dictAttendanceStateWaitFor" type="warning">{{ dict.label[attendanceState][scope.row.endClockResults] }}</el-tag>
            <el-tag v-if="scope.row.endClockResults === dictAttendanceStateNormal" type="success">{{ dict.label[attendanceState][scope.row.endClockResults] }}</el-tag>
            <el-tag v-if="scope.row.endClockResults === dictAttendanceStateNotSigned" type="danger">{{ dict.label[attendanceState][scope.row.endClockResults] }}</el-tag>
            <el-tag v-if="scope.row.endClockResults === dictAttendanceStateGoOut" type="success">{{ dict.label[attendanceState][scope.row.endClockResults] }}</el-tag>
            <el-tag v-if="scope.row.endClockResults === dictAttendanceStateBusiness" type="success">{{ dict.label[attendanceState][scope.row.endClockResults] }}</el-tag>
            <el-tag v-if="scope.row.endClockResults === dictAttendanceStateLeave" type="success">{{ dict.label[attendanceState][scope.row.endClockResults] }}</el-tag>
            <el-tag v-if="scope.row.endClockResults === dictAttendanceStateRest" type="warning">{{ dict.label[attendanceState][scope.row.endClockResults] }}</el-tag>
            <el-tag v-if="scope.row.endClockResults === dictEndanceStateLackOfTime" type="danger">{{ dict.label[attendanceState][scope.row.endClockResults] }}</el-tag>
            <el-tag v-if="scope.row.endClockResults === dictStartEarly" type="warning">{{ dict.label[attendanceState][scope.row.endClockResults] }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="dateType" min-width="80" label="日期类型" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-tag>{{ dict.label[dateType][scope.row.dateType] }}</el-tag>
          </template>
        </el-table-column>
      </el-table>
      <!--分页组件-->
      <pagination />
    </div>
  </div>
</template>
<script>
import crudAttendance from '@/api/attendance/attendance'
import crudAttendanceCardreplacement from '@/api/attendance/attendanceCardreplacement'
import crudAttendanceGoOut from '@/api/attendance/attendanceGoOut'
import crudAttendanceBusinessTravel from '@/api/attendance/attendanceBusinessTravel'
import crudUser from '@/api/system/user'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import constant from '@/utils/constant'
const defaultForm = { id: null, userId: null, attendanceDate: null, rosteringWorkStartTime: null, actualWorkStartTime: null, startLocationResults: null, startClockResults: null, rosteringWorkEndTime: null, actualWorkEndTime: null, endLocationResults: null, endClockResults: null, dateType: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null }
export default {
  name: 'AttendanceTotal',
  components: { pagination, rrOperation },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  cruds() {
    return CRUD({ title: '考勤记录', url: 'api/attendance/notNormal', idField: 'id', sort: 'attendanceDate,desc', crudMethod: { ...crudAttendance }})
  },
  // 数据字典
  dicts: [constant.ATTENDANCE_STATE, constant.DATE_TYPE, constant.LOCATION_RESULTS, constant.CARD_REPLACEMENT_DIFFERENTIATION, constant.CARD_APPROVE_STATUS, constant.LEAVE_TIME_TYPE, constant.GO_OUT_TYPE],
  data() {
    return {
      permission: {
        add: ['admin', 'attendance:add'],
        edit: ['admin', 'attendance:edit'],
        del: ['admin', 'attendance:del'],
        download: ['admin', 'attendance:download'],
        addAttendanceInfo: ['admin', 'attendance:addAttendanceInfo']
      },
      attendanceState: constant.ATTENDANCE_STATE,
      lacationResules: constant.LOCATION_RESULTS,
      dateType: constant.DATE_TYPE,
      dictlocationResultsNormal: constant.LOCATION_RESULTS_NORMAL,
      dictlocationResultsOutside: constant.LOCATION_RESULTS_OUTSIDE,
      dictlocationResultsNotSigned: constant.LOCATION_RESULTS_NOTSIGNED,
      dictlocationResultsRest: constant.LOCATION_RESULTS_REST,
      dictAttendanceStateWaitFor: constant.ATTENDANCE_STATE_WAITFOR,
      dictAttendanceStateNormal: constant.ATTENDANCE_STATE_NORMAL,
      dictAttendanceStateNotSigned: constant.ATTENDANCE_STATE_NOTSIGNED,
      dictAttendanceStateGoOut: constant.ATTENDANCE_STATE_GOOUT,
      dictAttendanceStateBusiness: constant.ATTENDANCE_STATE_BUSINESS,
      dictAttendanceStateLeave: constant.ATTENDANCE_STATE_LEAVE,
      dictAttendanceStateRest: constant.ATTENDANCE_STATE_REST,
      dictEndanceStateLackOfTime: constant.ATTENDANCE_STATE_LACK_OF_TIME,
      dictStartEarly: constant.ATTENDANCE_STATE_EARLY,
      dictStartLate: constant.ATTENDANCE_STATE_LATE,
      users: [],
      users1: [],
      approvalUsers: [],
      goOutVisible: false,
      goSuccessLoading: false,
      dictLeaveTimeType: constant.LEAVE_TIME_TYPE,
      dictGoOutTypr: constant.GO_OUT_TYPE,
      dictLeaveTimeTypeHour: constant.LEAVE_TIME_TYPE_HOUR,
      dictLeaveTimeTypeDay: constant.LEAVE_TIME_TYPE_DAY,
    }
  },
  methods: {
    // 钩子:在获取表格数据之前执行,false 则代表不获取数据
    [CRUD.HOOK.beforeRefresh]() {
      this.getUsers()
      this.getUsers1()
      this.getApprovalUsers()
      return true
    },
    // 查询员工
    getUsers() {
      crudUser.getAll().then(res => {
        this.users = res
      })
    },
    // 查询员工
    getUsers1() {
      crudUser.getUserInfose().then(res => {
        this.users1 = res
      })
    },
    // 查询审核人
    getApprovalUsers() {
      crudUser.getApprovalUsers().then(res => {
        this.approvalUsers = res
      })
    },
  }
}
</script>
<style scoped>
.attCss {
  font-size: 12px;
  text-align: center;
}
.panel-group {
  margin-top: 18px;
  .card-panel-col {
    margin-bottom: 32px;
  }
  .card-panel {
    height: 108px;
    cursor: pointer;
    font-size: 12px;
    position: relative;
    overflow: hidden;
    color: #666;
    background: #fff;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.05);
    &:hover {
      .card-panel-icon-wrapper {
        color: #fff;
      }
      .icon-people {
        background: #40c9c6;
      }
      .icon-message {
        background: #36a3f7;
      }
      .icon-permission {
        background: #34bfa3;
      }
      .icon-timings {
        background: #f4516c;
      }
    }
    .icon-people {
      color: #40c9c6;
    }
    .icon-message {
      color: #36a3f7;
    }
    .icon-permission {
      color: #34bfa3;
    }
    .card-panel-icon-wrapper {
      float: left;
      margin: 14px 0 0 14px;
      padding: 16px;
      transition: all 0.38s ease-out;
      border-radius: 6px;
    }
    .card-panel-icon {
      float: left;
      font-size: 48px;
    }
    .card-panel-description {
      float: right;
      font-weight: bold;
      margin: 26px;
      margin-left: 0px;
      .card-panel-text {
        line-height: 18px;
        color: rgba(0, 0, 0, 0.45);
        font-size: 16px;
        margin-bottom: 12px;
      }
      .card-panel-texts {
        font-size: 20px;
      }
      .card-panel-num {
        font-size: 20px;
      }
    }
  }
}
@media (max-width: 550px) {
  .card-panel-description {
    display: none;
  }
  .card-panel-icon-wrapper {
    float: none !important;
    width: 100%;
    height: 100%;
    margin: 0 !important;
    .svg-icon {
      display: block;
      margin: 14px auto !important;
      float: none !important;
    }
  }
}
</style>
eladmin-web-master/src/views/task/taskUser/index.vue
@@ -326,7 +326,7 @@
              当前任务:<i> {{ selectedTaskName }} </i>
              <span
                v-if="taskTotal.performanceType"
                style="magin: right 10px;"
                style="margin: right 10px;"
              ><i>
                (绩效类型:
                {{