yaozc
2023-01-31 aa102c7ba6977ff40f3e02eba32a00a168fb3564
Merge branch 'master' of http://192.168.1.110:5678/r/pms-upgrade into yaozc

# Conflicts:
# eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/service/impl/ProjectServiceImpl.java
# eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/DingTalkServiceImpl.java
# eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskDaliyServiceImpl.java
# eladmin-web-master/src/api/system/user.js
# eladmin-web-master/src/views/home.vue
12 files added
39 files modified
2384 ■■■■■ changed files
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/repository/AttendanceBusinessTravelRepository.java 4 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/repository/AttendanceRepository.java 4 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/rest/AttendanceCardreplacementController.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/repository/ProjectRepository.java 8 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/rest/ProjectController.java 8 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/service/ProjectService.java 7 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/service/impl/ProjectServiceImpl.java 27 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/DingTalkServiceImpl.java 20 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/DateTimeUtil.java 723 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/SystemSetting.java 60 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/CalendarVo.java 16 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/SystemSettingRepository.java 28 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/SystemSettingController.java 96 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java 21 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/SystemSettingService.java 83 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/UserService.java 17 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/SystemSettingDto.java 42 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/SystemSettingQueryCriteria.java 32 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/SystemSettingServiceImpl.java 106 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java 283 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/SystemSettingMapper.java 32 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskDaliyRepository.java 19 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/dto/TaskDaliyQueryCriteria.java 4 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/dto/TaskQueryCriteria.java 4 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/dto/TaskUserQueryCriteria.java 4 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskDaliyServiceImpl.java 112 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskServiceImpl.java 18 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskUserServiceImpl.java 29 ●●●●● patch | view | raw | blame | history
eladmin-web-master/package.json 6 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/api/project/project.js 10 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/api/system/systemSetting.js 35 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/api/system/user.js 16 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/attendance/attendanceBusinessTravel/index.vue 2 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/attendance/attendanceCardReplacement/index.vue 20 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/attendance/attendanceGoOut/index.vue 24 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/attendance/attendanceLeave/index.vue 24 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/cost/cost/index.vue 2 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/dashboard/PanelGroup.vue 74 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/home.vue 172 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/project/projectCost/index.vue 2 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/project/projectPerformance/index.vue 2 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/project/projectPerformanceDetail/index.vue 2 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/salary/salary/index.vue 7 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/system/company/index.vue 104 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/system/configIndividualIncomeTax/index.vue 2 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/system/userLevelInsurance/index.vue 2 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/system/userLevelOther/index.vue 2 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/system/userLevelWage/index.vue 2 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/task/task/index.vue 2 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/task/taskDaliy/index.vue 59 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/task/taskUser/index.vue 4 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/repository/AttendanceBusinessTravelRepository.java
@@ -46,4 +46,8 @@
    // 查询出差记录
    @Query(value = "SELECT * from attendance_business_travel where user_id = ?1 and travel_start_time <= ?3 and travel_end_time >= ?2 and approval_status in ('business_approve_status_agree')", nativeQuery = true)
    AttendanceBusinessTravel findByUserAndDate(Long userId, LocalDateTime startDate, LocalDateTime endDate);
    // 查询出差记录
    @Query(value = "SELECT * from attendance_business_travel where user_id = ?1 and travel_start_time <= ?3 and travel_end_time >= ?2 and approval_status in ('business_approve_status_agree')", nativeQuery = true)
    List<AttendanceBusinessTravel> findByUserAndSEDate(Long userId, LocalDateTime startDate, LocalDateTime endDate);
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/repository/AttendanceRepository.java
@@ -37,4 +37,8 @@
    /** 根据员工姓名模糊查询 */
    @Query(value = "SELECT * from attendance WHERE  " , nativeQuery = true)
    List<AttendanceDto> findByUserNameLike(String userName);
    /** 根据时间范围查询考勤记录 **/
    @Query(value = "SELECT * from attendance where user_id = ?1 and attendance_date <= ?3 and attendance_date >= ?2", nativeQuery = true)
    List<Attendance> findAllByUserAndDate(Long userId, String startDate, String endDate);
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/rest/AttendanceCardreplacementController.java
@@ -105,7 +105,7 @@
    @PutMapping(value = "/revoke")
    @Log("补卡撤销")
    @ApiOperation("补卡撤销")
    @PreAuthorize("@el.check('attendanceCardreplacement:revoke')")
    @PreAuthorize("@el.check('attendanceCardreplacement:approve')")
    public ResponseEntity<Object> checkInApplicationPass(@Validated @RequestBody AttendanceCardreplacement resources){
        attendanceCardreplacementService.cardRevoke(resources);
        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/repository/ProjectRepository.java
@@ -42,4 +42,12 @@
    List<Project> findByProjectStatus(String projectStatus);
    List<Project> findByProjectStatusAndIdIn(String projectStatus, Long[] ids);
    /**
     * 根据用户ID查询负责项目ID
     * @param liableUserId
     * @return
     */
    @Query(value = "SELECT id FROM project WHERE liable_user_id = ?1", nativeQuery = true)
    List<Long> findIdByLiableUserId(Long liableUserId);
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/rest/ProjectController.java
@@ -68,6 +68,14 @@
        return new ResponseEntity<>(projectService.queryAll(criteria),HttpStatus.OK);
    }
    @GetMapping(value = "/relevant")
    @Log("查询相关项目")
    @ApiOperation("查询相关项目")
    @PreAuthorize("@el.check('project:list')")
    public ResponseEntity<Object> queryProjectRelevant(ProjectQueryCriteria criteria){
        return new ResponseEntity<>(projectService.queryRelevant(criteria),HttpStatus.OK);
    }
    @PostMapping
    @Log("新增项目")
    @ApiOperation("新增项目")
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/service/ProjectService.java
@@ -48,6 +48,13 @@
    List<ProjectDto> queryAll(ProjectQueryCriteria criteria);
    /**
     * 查询所有数据不分页
     * @param criteria 条件参数
     * @return List<ProjectDto>
     */
    List<ProjectDto> queryRelevant(ProjectQueryCriteria criteria);
    /**
     * 根据ID查询
     * @param id ID
     * @return ProjectDto
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/service/impl/ProjectServiceImpl.java
@@ -17,11 +17,14 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.servlet.http.HttpServletResponse;
@@ -51,15 +54,16 @@
import me.zhengjie.modules.system.service.RoleService;
import me.zhengjie.modules.system.service.dto.RoleSmallDto;
import me.zhengjie.modules.task.domain.Task;
import me.zhengjie.modules.task.repository.TaskDaliyRepository;
import me.zhengjie.modules.task.repository.TaskRepository;
import me.zhengjie.modules.task.repository.TaskUserRepository;
import me.zhengjie.modules.task.service.TaskService;
import me.zhengjie.utils.FileUtil;
import me.zhengjie.utils.PageUtil;
import me.zhengjie.utils.QueryHelp;
import me.zhengjie.utils.SecurityUtils;
import me.zhengjie.utils.ValidationUtil;
import me.zhengjie.utils.enums.DataScopeEnum;
/**
* @website https://eladmin.vip
@@ -81,6 +85,7 @@
    private final TaskUserRepository taskUserRepository;
    private final ProjectCostRepository projectCostRepository;
    private final TaskRepository taskRepository;
    private final TaskDaliyRepository taskDaliyRepository;
    @Override
    public Map<String,Object> queryAll(ProjectQueryCriteria criteria, Pageable pageable) {
@@ -145,6 +150,24 @@
    }
    @Override
    public List<ProjectDto> queryRelevant(ProjectQueryCriteria criteria){
        // 获取登录用户角色等级
        List<Integer> levels = roleService.findByUsersId(SecurityUtils.getCurrentUserId()).stream().map(RoleSmallDto::getLevel).collect(Collectors.toList());
        // 登录用户最大角色等级
        int min = Collections.min(levels);
        // 判断角色等级
        if (min == Constant.ROLE_LEVEL_MANAGER || min == Constant.ROLE_LEVEL_LEADER || min == Constant.ROLE_LEVEL_ORDINARY) {
            // 根据用户ID查询参与的项目ID
            List<Long> taskUserProjectIdList = taskDaliyRepository.findProjectIdByUserId(SecurityUtils.getCurrentUserId());
            // 根据用户ID查询负责的项目ID
            List<Long> projectIdList = projectRepository.findIdByLiableUserId(SecurityUtils.getCurrentUserId());
            // 检索条件
            criteria.setIdInList(Stream.of(taskUserProjectIdList, projectIdList).flatMap(Collection::stream).distinct().collect(Collectors.toList()));
        }
        return projectMapper.toDto(projectRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
    }
    @Override
    @Transactional
    public ProjectDto findById(Long id) {
        Project project = projectRepository.findById(id).orElseGet(Project::new);
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/DingTalkServiceImpl.java
@@ -65,9 +65,16 @@
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        // 获取当前日期
        String strTodayDate = df.format(new Date());
        // 获取当前日期类
        Calendar calTodayDay = Calendar.getInstance();
        calTodayDay.setTime(Timestamp.valueOf(strTodayDate + " 00:00:00"));
        // 获取考勤日期类
        Calendar calAttendDay = Calendar.getInstance();
        // 参数日期为null(定时任务)
        if (ObjectUtils.isEmpty(attendDate)) {
            // 考勤日期类
            calAttendDay.setTime(Timestamp.valueOf(strTodayDate + " 00:00:00"));
        } else {
            // 考勤日期类
            calAttendDay.setTime(attendDate);
        }
        // 参数日期为null(定时任务) 或者 参数日期小于等于今天在创建(考勤按钮调用)
        if (ObjectUtils.isEmpty(attendDate) || attendDate.compareTo(Timestamp.valueOf(strTodayDate + " 00:00:00")) <= 0) {
            // 用户列表
@@ -94,9 +101,6 @@
                // 节假日列表
                sysConfigHoliday = sysConfigHolidayRepository.findByHolidayDate(strTodayDate);
            }
            // 获取当前日期类
            Calendar calAttendanceDate = Calendar.getInstance();
            calAttendanceDate.setTime(Timestamp.valueOf(ObjectUtils.isEmpty(attendDate) ? strTodayDate + " 00:00:00" : strAttendDate + " 00:00:00"));
            // 遍历用户列表
            for (User user : userList) {
                // 用户钉钉号不为null
@@ -115,8 +119,8 @@
                    attendance.setAttendanceDate(Timestamp.valueOf(ObjectUtils.isEmpty(attendDate) ? strTodayDate + " 00:00:00" : strAttendDate + " 00:00:00"));
                    attendance.setStartClockResults(Constant.ATTENDANCE_STATE_WAITFOR);
                    attendance.setEndClockResults(Constant.ATTENDANCE_STATE_WAITFOR);
                    // 当前日期类是否是周末、节假日、工作日
                    if (sysConfigHoliday == null && (calAttendanceDate.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || calAttendanceDate.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY)) {
                    // 考勤日期类是否是周末、节假日、工作日
                    if (sysConfigHoliday == null && (calAttendDay.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || calAttendDay.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY)) {
                        // 考勤记录:日期类型-双休
                        attendance.setDateType(Constant.DATE_TYPE_WEEKEND);
                    } else if (sysConfigHoliday != null && sysConfigHoliday.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS)) {
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/DateTimeUtil.java
New file
@@ -0,0 +1,723 @@
package me.zhengjie.modules.quartz.utils;
import me.zhengjie.utils.StringUtils;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
public class DateTimeUtil {
    public static final String DIVIDE_LINE = "-";
    public static final String DIVIDE_COLON = ":";
    public static final long SECOND = 1000;
    public static final long MINUTE = 60 * SECOND;
    public static final long HOUR = 60 * MINUTE;
    public static final long DAY = 24 * HOUR;
    public static final long WEEK = 7 * DAY;
    public static final String YEARFORMAT = "yyyy";
    public static final String MONTHFORMAT = "yyyy-MM";
    public static final String SHORTFORMAT = "yyyy-MM-dd";
    public static final String SHORTFORMATNOSPIT = "yyyyMMdd";
    public static final String LONGFORMATNOSPIT = "yyyyMMddHHmmss";
    public static final String LONGFORMAT = "yyyy-MM-dd HH:mm:ss";
    public static final String SUPERLONGFORMAT = "yyyy-MM-dd HH:mm:ss sss";
    private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    public static final int FIELD_YEAR = Calendar.YEAR;
    public static final int FIELD_MONTH = Calendar.MONTH;
    public static final int FIELD_DATE = Calendar.DATE;
    /**
     * 时间戳格式化 yyyy-MM-dd HH:mm:ss
     */
    public static String getTimestampString(Date date) {
        return sdf.format(date).toString();
    }
    /**
     * 系统当前时间戳
     */
    public static Timestamp getTimestamp(){
        SimpleDateFormat myFormat = new SimpleDateFormat(LONGFORMAT);
        long stamp = System.currentTimeMillis();
        String timestamp = myFormat.format(stamp);
        return Timestamp.valueOf(timestamp);
    }
    /**
     * 日期转时间戳
     */
    public static Timestamp getTimestamp(Date date) {
        return Timestamp.valueOf(getTimestampString(date));
    }
    /**
     * 字符串转时间戳
     */
    public static Timestamp getTimestamp(String timestamp) {
        if(StringUtils.isEmpty(timestamp)){
            return null;
        }
        return Timestamp.valueOf(timestamp);
    }
    /**
     * 时间格式化 yyyy-MM-dd
     */
    public static String getDate() {
        SimpleDateFormat myFormat = new SimpleDateFormat(SHORTFORMAT);
        return myFormat.format(System.currentTimeMillis());
    }
    /**
     * 时间格式化 yyyy-MM-dd
     */
    public static String getDate(Date date) {
        return getDate(date, SHORTFORMAT);
    }
    /**
     * 时间格式化 yyyy-MM-dd
     */
    public static String getDate(Date date, String format) {
        String result = null;
        try {
            SimpleDateFormat myFormat = new SimpleDateFormat(format);
            result = myFormat.format(date);
        } catch (Exception e) {
            return null;
        }
        return result;
    }
    /**
     * 时间格式化 yyyy-MM-dd HH:mm:ss
     * */
    public static String getDateTime() {
        return getDateTime(new Date());
    }
    /**
     * 时间格式化 yyyy-MM-dd HH:mm:ss
     * */
    public static String getDateTime(Date date) {
        SimpleDateFormat d = new SimpleDateFormat(LONGFORMAT);
        return d.format(date);
    }
    /**
     * 时间格式化 yyyy-MM-dd
     * */
    public static String getShortDate(Date date){
        if(date==null)
            date = new Date();
        return getDate(date, SHORTFORMAT);
    }
    /**
     * 时间格式化 yyyy-MM-dd HH:mm:ss
     * */
    public static String getLongDate(Date date){
        if(date==null)
            date = new Date();
        return getDateTime(date);
    }
    /**
     * 时间格式化 yyyy-MM-dd HH:mm:ss
     * */
    public static String getTimestampStr(){
        SimpleDateFormat myFormat = new SimpleDateFormat(LONGFORMAT);
        return myFormat.format(System.currentTimeMillis());
    }
    /**
     * 时间格式化 yyyyMMddHHmmss
     * */
    public static String getLongTime(){
        SimpleDateFormat myFormat = new SimpleDateFormat(LONGFORMATNOSPIT);
        return myFormat.format(System.currentTimeMillis());
    }
    /**
     * 时间格式化 yyyyMMddHHmmss
     * */
    public static String getLongTime(long ts){
        SimpleDateFormat myFormat = new SimpleDateFormat(LONGFORMATNOSPIT);
        return myFormat.format(ts);
    }
    /**
     * 时间戳TS
     */
    public static String getTS(){
        long ts = System.currentTimeMillis();
        return Long.toString(ts);
    }
    /**
     * N年后
     * */
    public static Date addYear(Date date, int amount) {
        return add(date, Calendar.YEAR, amount);
    }
    /**
     * N个月后
     * */
    public static Date addMonth(Date date, int amount) {
        return add(date, Calendar.MONTH, amount);
    }
    /**
     * 得到某一天的该星期的第一日 00:00:00
     *
     * @param date
     * @param firstDayOfWeek
     *            一个星期的第一天为星期几
     *
     * @return
     */
    public static Date getFirstDayOfWeek(Date date, int firstDayOfWeek) {
        Calendar cal = Calendar.getInstance();
        if (date != null)
            cal.setTime(date);
        cal.setFirstDayOfWeek(firstDayOfWeek);//设置一星期的第一天是哪一天
        cal.set(Calendar.DAY_OF_WEEK, firstDayOfWeek);//指示一个星期中的某天
        cal.set(Calendar.HOUR_OF_DAY, 0);//指示一天中的小时。HOUR_OF_DAY 用于 24 小时制时钟。例如,在 10:04:15.250 PM 这一时刻,HOUR_OF_DAY 为 22。
        cal.set(Calendar.MINUTE, 0);//指示一小时中的分钟。例如,在 10:04:15.250 PM 这一时刻,MINUTE 为 4。
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);
        return cal.getTime();
    }
    /**
     * N天后
     * */
    public static Date addDay(Date date, int amount) {
        return add(date, Calendar.DATE, amount);
    }
    /**
     * N(年、月、天)后
     * */
    public static Date add(Date date, int field, int amount) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.add(field, amount);
        return calendar.getTime();
    }
    /**
     * N(年、月、天)后
     * */
    public static Date add(String datestr, int field, int amount) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(formatDate(datestr));
        calendar.add(field, amount);
        return calendar.getTime();
    }
    /**
     * N(年、月、天)后(字符串形式)
     * */
    public static String add(String datestr, int field, int amount, String format) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(formatDate(datestr,format));
        calendar.add(field, amount);
        return getDate(calendar.getTime(), format);
    }
    /***
     * 获取当前时间,不含日期
     * @return
     */
    public static String getCurrentTime(){
        SimpleDateFormat sdf = new SimpleDateFormat("kk:mm:ss");
        String time = sdf.format(Calendar.getInstance().getTime());
        return time;
    }
    /**
     * 将字符串转为为日期
     */
    public static Date formatDate(String datestr) {
        if(19==datestr.length()){
            return formatDate(datestr, LONGFORMAT);
        }else{
            return formatDate(datestr, SHORTFORMAT);
        }
    }
    /**
     * 将字符串转为为日期
     */
    public static Date formatDate(String datestr, String format) {
        try {
            if(StringUtils.isEmpty(datestr)){
                return null;
            }
            SimpleDateFormat myFormat = new SimpleDateFormat(format);
            Date date = myFormat.parse(datestr);
            return date;
        } catch (Exception e) {
            return null;
        }
    }
    /***
     * 月份的开始结束日期
     * @param year
     * @param month
     * @param keys
     * @return
     */
    public static Map<String, String> getMonthStartDateAndEndDate(int year, int month,
                                                                  String... keys) {
        SimpleDateFormat d = new SimpleDateFormat(LONGFORMAT);
        Map<String, String> date = new HashMap<String, String>();
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.YEAR, year);
        calendar.set(Calendar.MONTH, month - 1);
        calendar.set(Calendar.DAY_OF_MONTH, 1);
        date.put(keys[0], d.format(calendar.getTime()));
        calendar.add(Calendar.MONTH, 1);
        calendar.add(Calendar.DAY_OF_MONTH, -1);
        date.put(keys[1], d.format(calendar.getTime()));
        return date;
    }
    /**
     * 时间格式化
     */
    public static String getTimeString(String time) {
        String[] ti = time.split(":");
        if (ti[1].length() == 1) {
            time = ti[0] + "0" + ti[1];
        } else {
            time = ti[0] + ti[1];
        }
        return time;
    }
    /**
     * <br>描 述: 获取计费模式的年月  2017-06-26 至 2017-07-25 为 2017年07月 以此类推
     * <br>作 者: shizhenwei
     * <br>历 史: (版本) 作者 时间 注释
     * @return
     */
    public static String getSicdtYearMonth(String datestr){
        String[] fileds = datestr.split(DIVIDE_LINE);
        if(Integer.valueOf(fileds[2])>25){
            Date date = add(datestr, FIELD_MONTH, 1);
            return getDate(date, MONTHFORMAT);
        }
        return datestr.substring(0, 7);
    }
    public static String getSicdtYearMonth(){
        return getSicdtYearMonth(getDate());
    }
    @SuppressWarnings("deprecation")
    public static String timeString() {
        Date date = new Date();
        return getTimeString(date.getHours() + ":" + date.getMinutes());
    }
    /**
     * 月-天数
     * */
    public static int getDayNum(int year, int month) {
        if (month == 2) {
            return year % 400 != 0 && (year % 4 != 0 || year % 100 == 0) ? 28
                    : 29;
        }
        String SmallMonth = ",4,6,9,11,";
        return SmallMonth.indexOf(String.valueOf(String
                .valueOf((new StringBuffer(",")).append(String.valueOf(month))
                        .append(",")))) < 0 ? 31 : 30;
    }
    /***
     * 两个日期之间的天数
     * @param date1
     * @param date2
     * @return
     */
    public static int DateDiff(Date date1, Date date2) {
        int i = (int) ((date1.getTime() - date2.getTime()) / 3600 / 24 / 1000);
        return i;
    }
    /**
     * 日期拆分,取年或月或日    Y-年  M-月  D-日
     * @param strDate
     * @param style
     * @return
     */
    public static int getYearMonthDate(String strDate, String style) {
        int year;
        int month;
        int day;
        int firstDash;
        int secondDash;
        if (strDate == null) {
            return 0;
        }
        firstDash = strDate.indexOf('-');
        secondDash = strDate.indexOf('-', firstDash + 1);
        if ((firstDash > 0) & (secondDash > 0)
                & (secondDash < strDate.length() - 1)) {
            year = Integer.parseInt(strDate.substring(0, firstDash));
            month = Integer.parseInt(strDate.substring(firstDash + 1,
                    secondDash));
            day = Integer.parseInt(strDate.substring(secondDash + 1));
        } else {
            return 0;
        }
        if (style.equalsIgnoreCase("Y")) {
            return year;
        } else if (style.equalsIgnoreCase("M")) {
            return month;
        } else if (style.equalsIgnoreCase("D")) {
            return day;
        } else {
            return 0;
        }
    }
    /***
     * 是否是年份的第一天
     * @param date
     * @return
     */
    public static boolean isYearFirstDay(java.sql.Date date) {
        boolean i = false;
        if ((DateTimeUtil.getYearMonthDate(date.toString(), "M") == 1)
                && (DateTimeUtil.getYearMonthDate(date.toString(), "D") == 1)) {
            i = true;
        }
        return i;
    }
    /**
     * 是否是半年的第一天
     * @param date
     * @return
     */
    public static boolean isHalfYearFirstDay(java.sql.Date date) {
        boolean i = false;
        if (((DateTimeUtil.getYearMonthDate(date.toString(), "M") == 1) && (DateTimeUtil
                .getYearMonthDate(date.toString(), "D") == 1))
                || ((DateTimeUtil.getYearMonthDate(date.toString(), "M") == 7) && (DateTimeUtil
                .getYearMonthDate(date.toString(), "D") == 1))) {
            i = true;
        }
        return i;
    }
    /**
     * 取半年的第一天
     * @param date
     * @return
     */
    public static String getHalfYearFirstDay(java.sql.Date date) {
        String month = "01";
        if (DateTimeUtil.getYearMonthDate(date.toString(), "M") >= 7) {
            month = "07";
        }
        String day = Integer.toString(DateTimeUtil.getYearMonthDate(
                date.toString(), "Y")) + "-" + month + "-01";
        return day;
    }
    /**
     * 是否是半年最后一天
     * */
    public static boolean isHalfYearLastDay(java.sql.Date date) {
        boolean i = false;
        if (((DateTimeUtil.getYearMonthDate(date.toString(), "M") == 12) && (DateTimeUtil
                .getYearMonthDate(date.toString(), "D") == 31))
                || ((DateTimeUtil.getYearMonthDate(date.toString(), "M") == 6) && (DateTimeUtil
                .getYearMonthDate(date.toString(), "D") == 30))) {
            i = true;
        }
        return i;
    }
    /***
     * 取半年最后一天
     * @param date
     * @return
     */
    public static String getHalfYearLastDay(java.sql.Date date) {
        String month = "-06-30";
        if (DateTimeUtil.getYearMonthDate(date.toString(), "M") >= 7) {
            month = "-12-31";
        }
        String day = Integer.toString(getYearMonthDate(date.toString(), "Y"))
                + "-" + month;
        return day;
    }
    /***
     *是否是年度最后一天
     * @param date
     * @return
     */
    public static boolean isYearLastDay(java.sql.Date date) {
        boolean i = false;
        if ((DateTimeUtil.getYearMonthDate(date.toString(), "M") == 12)
                && (DateTimeUtil.getYearMonthDate(date.toString(), "D") == 31)) {
            i = true;
        }
        return i;
    }
    /**
     * 是否季度第一天
     * */
    public static boolean isQuarterFirstDay(java.sql.Date date) {
        boolean i = false;
        if (((DateTimeUtil.getYearMonthDate(date.toString(), "M") == 1)
                || (DateTimeUtil.getYearMonthDate(date.toString(), "M") == 4)
                || (DateTimeUtil.getYearMonthDate(date.toString(), "M") == 7) || (DateTimeUtil
                .getYearMonthDate(date.toString(), "M") == 10))
                && (DateTimeUtil.getYearMonthDate(date.toString(), "D") == 1)) {
            i = true;
        }
        return i;
    }
    /***
     * 季度第一天
     * @param date
     * @return
     */
    public static String getQuarterFirstDay(java.sql.Date date) {
        String month = "01";
        if (DateTimeUtil.getYearMonthDate(date.toString(), "M") >= 10) {
            month = "10";
        } else if (DateTimeUtil.getYearMonthDate(date.toString(), "M") >= 7) {
            month = "07";
        } else if (DateTimeUtil.getYearMonthDate(date.toString(), "M") >= 4) {
            month = "04";
        } else if (DateTimeUtil.getYearMonthDate(date.toString(), "M") >= 1) {
            month = "01";
        }
        String day = Integer.toString(DateTimeUtil.getYearMonthDate(
                date.toString(), "Y")) + "-" + month + "-01";
        return day;
    }
    /**
     * 是否季度最后一天
     * @param date
     * @return
     */
    public static boolean isQuarterLastDay(java.sql.Date date) {
        boolean i = false;
        if ((DateTimeUtil.getYearMonthDate(date.toString(), "M") == 3)
                && (DateTimeUtil.getYearMonthDate(date.toString(), "D") == 31)) {
            i = true;
        }
        if ((DateTimeUtil.getYearMonthDate(date.toString(), "M") == 6)
                && (DateTimeUtil.getYearMonthDate(date.toString(), "D") == 30)) {
            i = true;
        }
        if ((DateTimeUtil.getYearMonthDate(date.toString(), "M") == 9)
                && (DateTimeUtil.getYearMonthDate(date.toString(), "D") == 30)) {
            i = true;
        }
        if ((DateTimeUtil.getYearMonthDate(date.toString(), "M") == 12)
                && (DateTimeUtil.getYearMonthDate(date.toString(), "D") == 31)) {
            i = true;
        }
        return i;
    }
    /**
     * 季度最后一天
     * @param date
     * @return
     */
    public static String getQuarterLastDay(java.sql.Date date) {
        String month = "-03-31";
        if (DateTimeUtil.getYearMonthDate(date.toString(), "M") >= 10) {
            month = "-12-31";
        } else if (DateTimeUtil.getYearMonthDate(date.toString(), "M") >= 7) {
            month = "-09-30";
        } else if (DateTimeUtil.getYearMonthDate(date.toString(), "M") >= 4) {
            month = "-06-30";
        }
        String day = Integer.toString(DateTimeUtil.getYearMonthDate(
                date.toString(), "Y")) + "-" + month;
        return day;
    }
    /***
     * 是否月份最后一天
     * @param date
     * @return
     */
    public static boolean isMonthLastDay(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        return calendar.getActualMaximum(Calendar.DAY_OF_MONTH) == calendar.get(Calendar.DAY_OF_MONTH);
    }
    /**
     * 是否月份第一天
     * @param date
     * @return
     */
    public static boolean isMonthFisrtDay(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        return calendar.getActualMinimum(Calendar.DAY_OF_MONTH) == calendar.get(Calendar.DAY_OF_MONTH);
    }
    /**
     * 月份第一天日期
     * @param date
     * @return
     */
    public static Date getMonthFisrtDay(Date date){
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMinimum(Calendar.DAY_OF_MONTH));
        return calendar.getTime();
    }
    /**
     * 星期的第几天
     * @param strDate  yy-mm-dd
     * @return
     */
    public static int getDateInWeek(String strDate) {
        DateFormat df = DateFormat.getDateInstance();
        try {
            df.parse(strDate);
            Calendar c = df.getCalendar();
            int day = c.get(Calendar.DAY_OF_WEEK) - Calendar.SUNDAY;
            return day;
        } catch (ParseException e) {
            return -1;
        }
    }
    public static java.sql.Date getSqlDate(Date date) {
        java.sql.Date result = null;
        try {
            SimpleDateFormat myFormat = new SimpleDateFormat(LONGFORMAT);
            String mystrdate = myFormat.format(date);
            result = java.sql.Date.valueOf(mystrdate);
        } catch (Exception e) {
            return null;
        }
        return result;
    }
    /**
     * 获取当前月的月初到今天的日期
     */
//    public static List<String> getDayofMouth() {
//        List<String> data = new ArrayList<>();
//
//    }
    /**
     * 获取当月所有日期
     * @return
     */
    public static List<String> getDayByMonth(){
        List<String> data = new ArrayList<>();
     try {
        Calendar c = Calendar.getInstance();
        // 获取当前的年份
        int year = c.get(Calendar.YEAR);
        // 获取当前的月份(需要加1才是现在的月份)
        int month = c.get(Calendar.MONTH) + 1;
        // 获取本月的总天数
        int dayCount = c.getActualMaximum(Calendar.DAY_OF_MONTH);
        // 定义时间格式
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        // 开始日期为当前年月拼接1号
        Date startDate = sdf.parse(year + "-" + month + "-01");
        // 结束日期为当前年月拼接该月最大天数
        Date endDate = sdf.parse(year + "-" + month + "-" + dayCount);
        // 设置calendar的开始日期
        c.setTime(startDate);
        // 当前时间小于等于设定的结束时间
        while(c.getTime().compareTo(endDate) <= 0){
            String time = sdf.format(c.getTime());
            data.add(time);
            // 当前日期加1
            c.add(Calendar.DATE, 1);
        }
    } catch (ParseException e) {
        e.printStackTrace();
    }
        return data;
}
    /**
     * 上个月
     * @param dt
     * @return
     */
    @SuppressWarnings("deprecation")
    public static String getUpMDate(Date dt) {
        dt.setDate(1);
        dt.setDate(dt.getDate() - 1);
        return dt.toLocaleString();
    }
    public static String getShortDate(String dt) {
        if (dt != null) {
            SimpleDateFormat myFormat = new SimpleDateFormat(SHORTFORMAT);
            try {
                Date date = myFormat.parse(dt);
                return getDate(date, SHORTFORMATNOSPIT);
            } catch (ParseException e) {
                return dt;
            }
        } else
            return dt;
    }
    public static String getLongDate(String dt) {
        if (dt != null) {
            SimpleDateFormat myFormat = new SimpleDateFormat(SHORTFORMAT);
            try {
                Date date = myFormat.parse(dt);
                return getDate(date, SHORTFORMAT);
            } catch (ParseException e) {
                return dt;
            }
        } else
            return dt;
    }
    public static boolean isSameYearMonth(String date) {
        try {
            String currdate = getDate();
            currdate = getShortDate(currdate).substring(0, 6);
            String lastdate = getShortDate(date).substring(0, 6);
            if (lastdate.equals(currdate)) {
                return true;
            } else {
                return false;
            }
        } catch (NumberFormatException e) {
            return false;
        }
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/SystemSetting.java
New file
@@ -0,0 +1,60 @@
/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import me.zhengjie.base.BaseEntity;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
/**
* @website https://eladmin.vip
* @description /
* @author wcd
* @date 2023-01-30
**/
@Entity
@Data
@Table(name="system_setting")
public class SystemSetting extends BaseEntity implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    @ApiModelProperty(value = "id")
    private Long id;
    @Column(name = "`description`")
    @ApiModelProperty(value = "描述")
    private String description;
    @Column(name = "`label`")
    @ApiModelProperty(value = "标签")
    private String label;
    @Column(name = "`value`")
    @ApiModelProperty(value = "值")
    private String value;
    public void copy(SystemSetting source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/CalendarVo.java
New file
@@ -0,0 +1,16 @@
package me.zhengjie.modules.system.domain.vo;
import lombok.Data;
@Data
public class CalendarVo {
    private String Date;
    private String Title;
    private Boolean isOk;
    private Integer type;
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/SystemSettingRepository.java
New file
@@ -0,0 +1,28 @@
/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.repository;
import me.zhengjie.modules.system.domain.SystemSetting;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* @website https://eladmin.vip
* @author wcd
* @date 2023-01-30
**/
public interface SystemSettingRepository extends JpaRepository<SystemSetting, Long>, JpaSpecificationExecutor<SystemSetting> {
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/SystemSettingController.java
New file
@@ -0,0 +1,96 @@
/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.rest;
import me.zhengjie.annotation.Log;
import me.zhengjie.modules.system.domain.SystemSetting;
import me.zhengjie.modules.system.service.SystemSettingService;
import me.zhengjie.modules.system.service.dto.SysRosteringQueryCriteria;
import me.zhengjie.modules.system.service.dto.SystemSettingQueryCriteria;
import org.springframework.data.domain.Pageable;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
/**
* @website https://eladmin.vip
* @author wcd
* @date 2023-01-30
**/
@RestController
@RequiredArgsConstructor
@Api(tags = "公司管理管理")
@RequestMapping("/api/systemSetting")
public class SystemSettingController {
    private final SystemSettingService systemSettingService;
    @Log("导出数据")
    @ApiOperation("导出数据")
    @GetMapping(value = "/download")
    @PreAuthorize("@el.check('systemSetting:list')")
    public void exportSystemSetting(HttpServletResponse response, SystemSettingQueryCriteria criteria) throws IOException {
        systemSettingService.download(systemSettingService.queryAll(criteria), response);
    }
    @GetMapping
    @Log("查询公司管理")
    @ApiOperation("查询公司管理")
    @PreAuthorize("@el.check('systemSetting:list')")
    public ResponseEntity<Object> querySystemSetting(SystemSettingQueryCriteria criteria, Pageable pageable){
        return new ResponseEntity<>(systemSettingService.queryAll(criteria,pageable),HttpStatus.OK);
    }
    @GetMapping(value = "/all")
    @Log("查询公司管理")
    @ApiOperation("查询公司管理")
    @PreAuthorize("@el.check('systemSetting:list')")
    public ResponseEntity<Object> querySystemSetting(SystemSettingQueryCriteria criteria){
        return new ResponseEntity<>(systemSettingService.queryAll(criteria),HttpStatus.OK);
    }
    @PostMapping
    @Log("新增公司管理")
    @ApiOperation("新增公司管理")
    @PreAuthorize("@el.check('systemSetting:add')")
    public ResponseEntity<Object> createSystemSetting(@Validated @RequestBody SystemSetting resources){
        return new ResponseEntity<>(systemSettingService.create(resources),HttpStatus.CREATED);
    }
    @PutMapping
    @Log("修改公司管理")
    @ApiOperation("修改公司管理")
    @PreAuthorize("@el.check('systemSetting:edit')")
    public ResponseEntity<Object> updateSystemSetting(@Validated @RequestBody SystemSetting resources){
        systemSettingService.update(resources);
        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
    }
    @DeleteMapping
    @Log("删除公司管理")
    @ApiOperation("删除公司管理")
    @PreAuthorize("@el.check('systemSetting:del')")
    public ResponseEntity<Object> deleteSystemSetting(@RequestBody Long[] ids) {
        systemSettingService.deleteAll(ids);
        return new ResponseEntity<>(HttpStatus.OK);
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java
@@ -48,6 +48,7 @@
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.ParseException;
import java.util.*;
import java.util.stream.Collectors;
@@ -239,4 +240,24 @@
            throw new BadRequestException("角色权限不足");
        }
    }
    /**
     * 获取用户日历信息
     * @param month
     * @return
     * @throws Exception
     */
    @GetMapping(value = "/getUserCalendarInfo/{month}")
    @Log("获取用户日历信息")
    @ApiOperation("获取用户日历信息")
    public ResponseEntity<Object> getUserCalendarInfo(@PathVariable String month) throws Exception {
        return new ResponseEntity<>(userService.getUserCalendarInfo(month), HttpStatus.OK);
    }
    @GetMapping(value = "/getUserBaseInfo")
    @Log("获取用户基础信息")
    @ApiOperation("获取用户日历信息")
    public ResponseEntity<Object> getUserBaseInfo() throws ParseException {
        return new ResponseEntity<>(userService.getUserBaseInfo(), HttpStatus.OK);
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/SystemSettingService.java
New file
@@ -0,0 +1,83 @@
/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.service;
import me.zhengjie.modules.system.domain.SystemSetting;
import me.zhengjie.modules.system.service.dto.SystemSettingDto;
import me.zhengjie.modules.system.service.dto.SystemSettingQueryCriteria;
import org.springframework.data.domain.Pageable;
import java.util.Map;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
/**
* @website https://eladmin.vip
* @description 服务接口
* @author wcd
* @date 2023-01-30
**/
public interface SystemSettingService {
    /**
    * 查询数据分页
    * @param criteria 条件
    * @param pageable 分页参数
    * @return Map<String,Object>
    */
    Map<String,Object> queryAll(SystemSettingQueryCriteria criteria, Pageable pageable);
    /**
    * 查询所有数据不分页
    * @param criteria 条件参数
    * @return List<SystemSettingDto>
    */
    List<SystemSettingDto> queryAll(SystemSettingQueryCriteria criteria);
    /**
     * 根据ID查询
     * @param id ID
     * @return SystemSettingDto
     */
    SystemSettingDto findById(Long id);
    /**
    * 创建
    * @param resources /
    * @return SystemSettingDto
    */
    SystemSettingDto create(SystemSetting resources);
    /**
    * 编辑
    * @param resources /
    */
    void update(SystemSetting resources);
    /**
    * 多选删除
    * @param ids /
    */
    void deleteAll(Long[] ids);
    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    void download(List<SystemSettingDto> all, HttpServletResponse response) throws IOException;
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/UserService.java
@@ -16,6 +16,7 @@
package me.zhengjie.modules.system.service;
import me.zhengjie.modules.system.domain.User;
import me.zhengjie.modules.system.domain.vo.CalendarVo;
import me.zhengjie.modules.system.service.dto.UserDto;
import me.zhengjie.modules.system.service.dto.UserLoginDto;
import me.zhengjie.modules.system.service.dto.UserQueryCriteria;
@@ -23,6 +24,7 @@
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -123,4 +125,19 @@
     */
    void updateCenter(User resources);
    /**
     * 获取日历信息
     * @param month
     * @return
     * @throws Exception
     */
    List<CalendarVo> getUserCalendarInfo(String month) throws Exception;
    /**
     * 获取用户基本信息
     * @return
     * @throws ParseException
     */
    Map getUserBaseInfo() throws ParseException;
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/SystemSettingDto.java
New file
@@ -0,0 +1,42 @@
/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.service.dto;
import lombok.Data;
import me.zhengjie.base.BaseDTO;
import java.io.Serializable;
/**
* @website https://eladmin.vip
* @description /
* @author wcd
* @date 2023-01-30
**/
@Data
public class SystemSettingDto extends BaseDTO implements Serializable {
    private Long id;
    /** 描述 */
    private String description;
    /** 标签 */
    private String label;
    /** 值 */
    private String value;
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/SystemSettingQueryCriteria.java
New file
@@ -0,0 +1,32 @@
/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.service.dto;
import lombok.Data;
import java.util.List;
import me.zhengjie.annotation.Query;
/**
* @website https://eladmin.vip
* @author wcd
* @date 2023-01-30
**/
@Data
public class SystemSettingQueryCriteria{
    @Query(type = Query.Type.INNER_LIKE)
    private String label;
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/SystemSettingServiceImpl.java
New file
@@ -0,0 +1,106 @@
/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.service.impl;
import me.zhengjie.modules.system.domain.SystemSetting;
import me.zhengjie.utils.ValidationUtil;
import me.zhengjie.utils.FileUtil;
import lombok.RequiredArgsConstructor;
import me.zhengjie.modules.system.repository.SystemSettingRepository;
import me.zhengjie.modules.system.service.SystemSettingService;
import me.zhengjie.modules.system.service.dto.SystemSettingDto;
import me.zhengjie.modules.system.service.dto.SystemSettingQueryCriteria;
import me.zhengjie.modules.system.service.mapstruct.SystemSettingMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import me.zhengjie.utils.PageUtil;
import me.zhengjie.utils.QueryHelp;
import java.util.List;
import java.util.Map;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.LinkedHashMap;
/**
* @website https://eladmin.vip
* @description 服务实现
* @author wcd
* @date 2023-01-30
**/
@Service
@RequiredArgsConstructor
public class SystemSettingServiceImpl implements SystemSettingService {
    private final SystemSettingRepository systemSettingRepository;
    private final SystemSettingMapper systemSettingMapper;
    @Override
    public Map<String,Object> queryAll(SystemSettingQueryCriteria criteria, Pageable pageable){
        Page<SystemSetting> page = systemSettingRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
        return PageUtil.toPage(page.map(systemSettingMapper::toDto));
    }
    @Override
    public List<SystemSettingDto> queryAll(SystemSettingQueryCriteria criteria){
        return systemSettingMapper.toDto(systemSettingRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
    }
    @Override
    @Transactional
    public SystemSettingDto findById(Long id) {
        SystemSetting systemSetting = systemSettingRepository.findById(id).orElseGet(SystemSetting::new);
        ValidationUtil.isNull(systemSetting.getId(),"SystemSetting","id",id);
        return systemSettingMapper.toDto(systemSetting);
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public SystemSettingDto create(SystemSetting resources) {
        return systemSettingMapper.toDto(systemSettingRepository.save(resources));
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void update(SystemSetting resources) {
        SystemSetting systemSetting = systemSettingRepository.findById(resources.getId()).orElseGet(SystemSetting::new);
        ValidationUtil.isNull( systemSetting.getId(),"SystemSetting","id",resources.getId());
        systemSetting.copy(resources);
        systemSettingRepository.save(systemSetting);
    }
    @Override
    public void deleteAll(Long[] ids) {
        for (Long id : ids) {
            systemSettingRepository.deleteById(id);
        }
    }
    @Override
    public void download(List<SystemSettingDto> all, HttpServletResponse response) throws IOException {
        List<Map<String, Object>> list = new ArrayList<>();
        for (SystemSettingDto systemSetting : all) {
            Map<String,Object> map = new LinkedHashMap<>();
            map.put("标签", systemSetting.getLabel());
            map.put("值", systemSetting.getValue());
            map.put("描述", systemSetting.getDescription());
            list.add(map);
        }
        FileUtil.downloadExcel(list, response);
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java
@@ -18,18 +18,32 @@
import lombok.RequiredArgsConstructor;
import me.zhengjie.config.FileProperties;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.modules.attendance.domain.Attendance;
import me.zhengjie.modules.attendance.domain.AttendanceBusinessTravel;
import me.zhengjie.modules.attendance.domain.AttendanceGoOut;
import me.zhengjie.modules.attendance.repository.AttendanceBusinessTravelRepository;
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.impl.AttendanceLeaveServiceImpl;
import me.zhengjie.modules.constant.Constant;
import me.zhengjie.modules.quartz.utils.DateTimeUtil;
import me.zhengjie.modules.security.service.OnlineUserService;
import me.zhengjie.modules.security.service.UserCacheManager;
import me.zhengjie.modules.system.domain.*;
import me.zhengjie.exception.EntityExistException;
import me.zhengjie.exception.EntityNotFoundException;
import me.zhengjie.modules.system.domain.vo.CalendarVo;
import me.zhengjie.modules.system.repository.*;
import me.zhengjie.modules.system.service.UserService;
import me.zhengjie.modules.system.service.dto.*;
import me.zhengjie.modules.system.service.mapstruct.SysUserLevelWageMapper;
import me.zhengjie.modules.system.service.mapstruct.UserLoginMapper;
import me.zhengjie.modules.system.service.mapstruct.UserMapper;
import me.zhengjie.modules.task.domain.TaskDaliy;
import me.zhengjie.modules.task.repository.TaskDaliyRepository;
import me.zhengjie.utils.*;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;
@@ -41,7 +55,15 @@
import javax.validation.constraints.NotBlank;
import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
import java.util.stream.Collectors;
@@ -65,6 +87,14 @@
    private final SysUserLevelWageRepository sysUserLevelWageRepository;
    private final SysUserLevelInsuranceRepository sysUserLevelInsuranceRepository;
    private final SysUserLevelOtherRepository sysUserLevelOtherRepository;
    private final AttendanceRepository attendanceRepository;
    private final TaskDaliyRepository taskDaliyRepository;
    private final AttendanceLeaveServiceImpl attendanceLeaveService;
    private final AttendanceCardreplacementRepository attendanceCardreplacementRepository;
    private final SysConfigProportionRepository sysConfigProportionRepository;
    private final SysConfigHolidayRepository sysConfigHolidayRepository;
    private final AttendanceGoOutRepository attendanceGoOutRepository;
    private final AttendanceBusinessTravelRepository attendanceBusinessTravelRepository;
    @Override
    public Object queryAll(UserQueryCriteria criteria, Pageable pageable) {
@@ -176,6 +206,259 @@
        delCaches(user.getId(), user.getUsername());
    }
    /**
     * 获取日历信息
     * @param month
     * @return
     * @throws Exception
     */
    @Override
    public List<CalendarVo> getUserCalendarInfo(String month) throws Exception {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        List<CalendarVo> calendarInfo = new ArrayList<>();
        List<String> dateList = new ArrayList<>();
        //月份第一天,最后一天
        LocalDate startDate = LocalDate.parse(month).with(TemporalAdjusters.firstDayOfMonth());
        LocalDate endDate = LocalDate.parse(month).with(TemporalAdjusters.lastDayOfMonth());
        //当前登录人
        Long userId = SecurityUtils.getCurrentUserId();
        //查询这个范围的考勤记录
        List<Attendance> attendanceList = attendanceRepository.findAllByUserAndDate(userId,startDate.toString(),endDate.toString());
        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.getRosteringWorkStartTime().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.getRosteringWorkEndTime().toString() : "下班:" + formateResult(attendance.getEndClockResults()).get("msg"));
            offDuty.setIsOk((Boolean) formateResult(attendance.getEndClockResults()).get("status"));
            offDuty.setType(1);
            calendarInfo.add(onDuty);
            calendarInfo.add(offDuty);
            dateList.add(attendance.getAttendanceDate().toString());
        }
        //获取应工作时长
        User user = userRepository.getById(userId);
        Long duration = (Duration.between(user.getSysRostering().getWorkStartTime(), user.getSysRostering().getWorkEndTime())).toHours();
        //查询日志表
        List<TaskDaliy> taskDaliyList = taskDaliyRepository.findAllByUserAndDate(userId,startDate,endDate);
        for (TaskDaliy taskDaliy : taskDaliyList) {
            CalendarVo daily = new CalendarVo();
            daily.setDate(taskDaliy.getFillDate().toString());
            if (dateList.contains(taskDaliy.getFillDate().toString())) {
                dateList.remove(taskDaliy.getFillDate().toString());
            }
            daily.setIsOk(taskDaliy.getConsumedHours().compareTo(new Double(duration - 1)) >= 0 ? true : false);
            daily.setTitle(taskDaliy.getConsumedHours().compareTo(new Double(duration - 1)) >= 0 ? "工时: " + taskDaliy.getConsumedHours().toString() : "已填工时:" + taskDaliy.getConsumedHours().toString() + " 不满8小时,请补充日报");
            daily.setType(2);
            calendarInfo.add(daily);
        }
        for (String date : dateList) {
            String type1 = "";
            String type2 = "";
            CalendarVo dailyVo = new CalendarVo();
            dailyVo.setDate(date);
            for (Attendance attendanceRecord : attendanceList) {
                type1 = attendanceRecord.getStartClockResults();
                type2 = attendanceRecord.getEndClockResults();
                date = date.substring(0,10);
                if(date.equals(df.format(attendanceRecord.getAttendanceDate())) && type1.equals(Constant.ATTENDANCE_STATE_LEAVE) && type2.equals(Constant.ATTENDANCE_STATE_LEAVE)){
                    dailyVo.setTitle("请假");
                    dailyVo.setIsOk(true);
                }else if(date.equals(df.format(attendanceRecord.getAttendanceDate())) && type1.equals(Constant.ATTENDANCE_STATE_BUSINESS) && type2.equals(Constant.ATTENDANCE_STATE_BUSINESS)){
                    dailyVo.setTitle("出差");
                    dailyVo.setIsOk(true);
                }else if(date.equals(df.format(attendanceRecord.getAttendanceDate())) && type1.equals(Constant.ATTENDANCE_STATE_REST) && type2.equals(Constant.ATTENDANCE_STATE_REST)){
                    dailyVo.setTitle("休息");
                    dailyVo.setIsOk(true);
                }else if(date.equals(df.format(attendanceRecord.getAttendanceDate()))){
                    dailyVo.setTitle("日报未填写,请补充日报");
                    dailyVo.setIsOk(false);
                }
            }
            dailyVo.setType(2);
            calendarInfo.add(dailyVo);
        }
        return calendarInfo;
    }
    /**
     * 判断状态
     * @param result
     * @return
     */
    public Map formateResult(String result) {
        Map returnData = new HashMap();
        switch (result) {
            case Constant.ATTENDANCE_STATE_NOTSIGNED:
                returnData.put("msg", "缺卡");
                returnData.put("status", false);
                break;
            case Constant.ATTENDANCE_START_EARLY:
                returnData.put("msg", "早退");
                returnData.put("status", false);
                break;
            case Constant.ATTENDANCE_START_LATE:
                returnData.put("msg", "迟到");
                returnData.put("status", false);
                break;
            case Constant.ATTENDANCE_STATE_LACK_OF_TIME:
                returnData.put("msg", "缺时");
                returnData.put("status", false);
                break;
            case Constant.ATTENDANCE_STATE_LEAVE:
                returnData.put("msg", "请假");
                returnData.put("status", true);
                break;
            case Constant.ATTENDANCE_STATE_GOOUT:
                returnData.put("msg", "外出");
                returnData.put("status", true);
                break;
            case Constant.ATTENDANCE_STATE_BUSINESS:
                returnData.put("msg", "出差");
                returnData.put("status", true);
                break;
            case Constant.ATTENDANCE_STATE_WAITFOR:
                returnData.put("msg", "等待");
                returnData.put("status", true);
                break;
            case Constant.ATTENDANCE_STATE_REST:
                returnData.put("msg", "休息");
                returnData.put("status", true);
                break;
            default:
                returnData.put("msg", result);
                returnData.put("status", true);
        }
        return returnData;
    }
    /**
     *获取用户基础信息
     * @return
     * @throws ParseException
     */
    @Override
    public Map getUserBaseInfo() throws ParseException {
        Long userId = SecurityUtils.getCurrentUserId();
        Map returnData = new HashMap();
        LocalDate startDate = LocalDate.now().with(TemporalAdjusters.firstDayOfMonth());
        LocalDate endDate = LocalDate.now().with(TemporalAdjusters.lastDayOfMonth());
        List<Attendance> attendanceRecordList = attendanceRepository.findAllByUserAndDate(userId, startDate.toString(), endDate.toString());
        // 出勤天数
        returnData.put("onDutyDays", attendanceRecordList.size());
        // 剩余年假
        Double yearTimes = attendanceLeaveService.getYearTimeLength(userId);
        returnData.put("annualLeave", yearTimes);
        // 剩余补卡
        Calendar calendar = Calendar.getInstance();
        // 获取当前年
        int year = calendar.get(Calendar.YEAR);
        // 获取当前月
        int month = calendar.get(Calendar.MONTH) + 1;
        String mouths = "";
        if(month < 10){
            mouths = "0" + month;
        }
        String baseDate = year + "-" + mouths;
        // 查询当月的补卡记录的条数
        Integer count = attendanceCardreplacementRepository.count(userId, baseDate);
        // 查询配置表的每月补卡次数
        SysConfigProportion sysConfigProportion = sysConfigProportionRepository.findByTitle("每月可补卡次数");
        if(count >= sysConfigProportion.getProportion()){
            returnData.put("cardLeft", 0);
        }else{
            returnData.put("cardLeft", (sysConfigProportion.getProportion() - count));
        }
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        // 法定节假日
        List<String> holiday = new ArrayList<>();
        // 天数
        int shouldWordDays = 0;
        List<SysConfigHoliday> holidayConfigurationList = sysConfigHolidayRepository.findAll();
        for (SysConfigHoliday holidayConfiguration : holidayConfigurationList) {
            if (holidayConfiguration.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS)) {
                holiday.add(df.format(holidayConfiguration.getHolidayDate()));
            }
        }
        // 获取当月所有日期
        List<String> dateList = DateTimeUtil.getDayByMonth();
        Date date1 = new Date();
        String todayDay = df.format(date1);
        // 工作日的天数
        for(String date : dateList){
            Date isWeekEnd = df.parse(date);
            calendar.setTime(isWeekEnd);
            if(isWeekEnd.compareTo(df.parse(todayDay)) <= 0){
                if(!holiday.contains(date) && calendar.get(Calendar.DAY_OF_WEEK) != Calendar.SATURDAY && calendar.get(Calendar.DAY_OF_WEEK) != Calendar.SUNDAY){
                    shouldWordDays += 1;
                }
            }
        }
        int num = shouldWordDays * 8;
        // 月初到今天应工作时长
        returnData.put("Time", num);
        DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        User user = userRepository.getById(userId);
        // 考勤上午时间
        Double attCheckOnDuration = 0.0;
        // 考勤下午时间
        Double attCheckOffDuration = 0.0;
        for(Attendance attendance : attendanceRecordList){
            // 上班打卡时间不为空并且打卡状态不为出差外出的考勤记录
            if(ObjectUtils.isNotEmpty(attendance.getActualWorkStartTime()) && !attendance.getStartClockResults().equals(Constant.ATTENDANCE_STATE_GOOUT) && !attendance.getStartClockResults().equals(Constant.ATTENDANCE_STATE_BUSINESS)){
                LocalDateTime attCheckOnTime = attendance.getActualWorkStartTime().toLocalDateTime();
                LocalDateTime scheduleStartTime = LocalDateTime.parse(attendance.getAttendanceDate().toString().substring(0,10) +" " + user.getSysRostering().getLunchStartTime().toString() + ":00",formatter2);
                if(attCheckOnTime.compareTo(scheduleStartTime) <= 0){
                    // 获得两个时间之间的相差值
                    Duration duration = Duration.between(attCheckOnTime, scheduleStartTime);
                    Long minutes = duration.toMinutes();
                    Double hour = Double.valueOf(String.valueOf(new BigDecimal(Double.valueOf(minutes) / 60).setScale(2, BigDecimal.ROUND_HALF_UP)));
                    attCheckOnDuration = attCheckOnDuration + hour;
                }
            }
            // 下班打卡时间不为空并且打卡状态不为出差外出的考勤记录
            if(ObjectUtils.isNotEmpty(attendance.getActualWorkEndTime()) && !attendance.getEndClockResults().equals(Constant.ATTENDANCE_STATE_GOOUT) && !attendance.getEndClockResults().equals(Constant.ATTENDANCE_STATE_BUSINESS)){
                LocalDateTime attCheckOffTime = attendance.getActualWorkEndTime().toLocalDateTime();
                LocalDateTime scheduleEndTime = LocalDateTime.parse(attendance.getAttendanceDate().toString().substring(0,10) +" " + user.getSysRostering().getLunchEndTime().toString() + ":00",formatter2);
                if(attCheckOffTime.compareTo(scheduleEndTime) > 0){
                    // 获得两个时间之间的相差值
                    Duration duration = Duration.between(scheduleEndTime, attCheckOffTime);
                    Long minutes = duration.toMinutes();
                    Double hour = Double.valueOf(String.valueOf(new BigDecimal(Double.valueOf(minutes) / 60 ).setScale(2, BigDecimal.ROUND_HALF_UP)));
                    attCheckOffDuration = attCheckOffDuration + hour;
                }
            }
        }
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("HH:mm:ss");
        String startTime = startDate + " " + dateTimeFormatter.format(user.getSysRostering().getWorkStartTime());
        String endTime = df.format(new Date()) + " " + dateTimeFormatter.format(user.getSysRostering().getWorkEndTime());
        // 外出时长
        Double goOutTimes = 0.0;
        // 查询外出表
        List<AttendanceGoOut> attendanceGoOutList = attendanceGoOutRepository.findByUserAndDate(userId,Timestamp.valueOf(startTime).toLocalDateTime(),Timestamp.valueOf(endTime).toLocalDateTime());
        for(AttendanceGoOut attendanceGoOut : attendanceGoOutList){
            goOutTimes = goOutTimes + attendanceGoOut.getOutDuration();
        }
        // 出差时长
        Double bussTimes = 0.0;
        // 查询出差表
        List<AttendanceBusinessTravel> attendanceBusinessTravelList = attendanceBusinessTravelRepository.findByUserAndSEDate(userId,Timestamp.valueOf(startDate + " " + "00:00:00").toLocalDateTime(),Timestamp.valueOf(df.format(new Date()) + " " + "00:00:00").toLocalDateTime());
        for(AttendanceBusinessTravel attendanceBusinessTravel : attendanceBusinessTravelList){
            bussTimes = bussTimes + attendanceBusinessTravel.getTravelDuration();
        }
        returnData.put("Times", attCheckOnDuration + attCheckOffDuration + goOutTimes + (bussTimes * 8));
        return returnData;
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void delete(Set<Long> ids) {
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/SystemSettingMapper.java
New file
@@ -0,0 +1,32 @@
/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.service.mapstruct;
import me.zhengjie.base.BaseMapper;
import me.zhengjie.modules.system.domain.SystemSetting;
import me.zhengjie.modules.system.service.dto.SystemSettingDto;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
/**
* @website https://eladmin.vip
* @author wcd
* @date 2023-01-30
**/
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface SystemSettingMapper extends BaseMapper<SystemSettingDto, SystemSetting> {
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/repository/TaskDaliyRepository.java
@@ -23,6 +23,7 @@
import org.springframework.data.jpa.repository.Query;
import java.sql.Timestamp;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -132,4 +133,22 @@
     */
    @Query(value = "SELECT COALESCE(SUM(consumed_hours), 0) AS consumedHours, COALESCE(SUM(consumed_workload), 0) AS consumedWorkload, COALESCE(MAX(task_progress), 0) AS taskProgress FROM task_daliy WHERE project_id = ?1 AND task_id = ?2 AND user_id = ?3", nativeQuery = true)
    TaskDailyInterface findSumConsumedHoursAndSumConsumedWorkloadAndMaxTaskProgressByProjectIdAndTaskIdAndUserId(Long projectId, Long taskId, Long userId);
    /**
     * 根据userId,开始时间结束时间范围查询日志表
     * @param userId
     * @param startDate
     * @param endDate
     * @return
     */
    @Query(value = "SELECT * from task_daliy where user_id = ?1 and fill_date <= ?3 and fill_date >= ?2 group by fill_date", nativeQuery = true)
    List<TaskDaliy> findAllByUserAndDate(Long userId, LocalDate startDate, LocalDate endDate);
    /**
     * 根据用户ID查询参与的项目ID
     * @param userId
     * @return
     */
    @Query(value = "SELECT DISTINCT(project_id) FROM task_user WHERE user_id = ?1", nativeQuery = true)
    List<Long> findProjectIdByUserId(Long userId);
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/dto/TaskDaliyQueryCriteria.java
@@ -50,4 +50,8 @@
    private String fillDateLike;
    private String targetYearMonth;
    /** 包含 */
    @Query(propName = "projectId", type = Query.Type.IN)
    private List<Long> projectIdInList;
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/dto/TaskQueryCriteria.java
@@ -60,4 +60,8 @@
    private String taskStatus;
    private Long taskUserId;
    /** 包含 */
    @Query(propName = "projectId", type = Query.Type.IN)
    private List<Long> projectIdInList;
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/dto/TaskUserQueryCriteria.java
@@ -42,4 +42,8 @@
    /** 精确 */
    @Query
    private String taskStatus;
    /** 包含 */
    @Query(propName = "projectId", type = Query.Type.IN)
    private List<Long> projectIdInList;
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskDaliyServiceImpl.java
@@ -25,6 +25,8 @@
import me.zhengjie.modules.system.domain.User;
import me.zhengjie.modules.system.repository.DictDetailRepository;
import me.zhengjie.modules.system.repository.UserRepository;
import me.zhengjie.modules.system.service.RoleService;
import me.zhengjie.modules.system.service.dto.RoleSmallDto;
import me.zhengjie.modules.task.domain.Task;
import me.zhengjie.modules.task.domain.TaskDaliy;
import me.zhengjie.modules.task.domain.TaskUser;
@@ -48,6 +50,7 @@
import javax.servlet.http.HttpServletResponse;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @website https://eladmin.vip
@@ -66,9 +69,24 @@
    private final UserRepository userRepository;
    private final DictDetailRepository dictDetailRepository;
    private final TaskUserRepository taskUserRepository;
    private final ProjectProgressRepository projectProgressRepository;
    private final RoleService roleService;
    @Override
    public Map<String,Object> queryAll(TaskDaliyQueryCriteria criteria, Pageable pageable){
        // 获取登录用户角色等级
        List<Integer> levels = roleService.findByUsersId(SecurityUtils.getCurrentUserId()).stream().map(RoleSmallDto::getLevel).collect(Collectors.toList());
        // 登录用户最大角色等级
        int min = Collections.min(levels);
        // 判断角色等级
        if (min == Constant.ROLE_LEVEL_MANAGER || min == Constant.ROLE_LEVEL_LEADER || min == Constant.ROLE_LEVEL_ORDINARY) {
            // 根据用户ID查询参与的项目ID
            List<Long> taskUserProjectIdList = taskDaliyRepository.findProjectIdByUserId(SecurityUtils.getCurrentUserId());
            // 根据用户ID查询负责的项目ID
            List<Long> projectIdList = projectRepository.findIdByLiableUserId(SecurityUtils.getCurrentUserId());
            // 检索条件
            criteria.setProjectIdInList(Stream.of(taskUserProjectIdList, projectIdList).flatMap(Collection::stream).distinct().collect(Collectors.toList()));
        }
        Page<TaskDaliy> page = taskDaliyRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
        // 将实体类转换为DTO(重写)
        Function<TaskDaliy, TaskDaliyDto> func = new Function<TaskDaliy, TaskDaliyDto>(){
@@ -223,9 +241,9 @@
        // 判断是否有本月任务日报
        if (taskDaliyMonthList.size() != 0) {
            // 获取本月任务日报中所有任务ID
            List<Long> taskIds = taskDaliyMonthList.stream().map(item -> item.getTaskId()).distinct().collect(Collectors.toList());
            List<Long> taskIds = taskDaliyMonthList.stream().map(item -> item.getTaskId()).collect(Collectors.toList());
            // 获取本月任务分配列表
            List<TaskUser> taskUserMonthList = taskUserRepository.findByUserIdAndTaskIdIn(criteria.getUserId(), taskIds);
            List<TaskUser> taskUserMonthList = taskUserRepository.findByTaskIdIn(taskIds);
            // 日历类
            Calendar cal = setUpCalendar(targetYearMonth);
            // 获取本月最大天数
@@ -278,6 +296,96 @@
        return completedWork;
    }
    @Override
    public Double queryComplianceWork(TaskDaliyQueryCriteria criteria){
        // 已达标工时
        Double complianceWork = 0D;
        // 国际时间转中国时间
        String targetYearMonth = DateUtil.internationalTimeToChinaTime(criteria.getTargetYearMonth());
        // 任务日报检索类
        criteria.setFillDateLike(targetYearMonth.substring(0,7));
        // 获取本月任务日报列表
        List<TaskDaliy> taskDaliyMonthList = taskDaliyRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder));
        // 判断是否有本月任务日报
        if (taskDaliyMonthList.size() != 0) {
            // 获取本月任务日报中所有任务ID
            List<Long> taskIds = taskDaliyMonthList.stream().map(item -> item.getTaskId()).collect(Collectors.toList());
            // 获取本月任务日报中所有项目ID
            List<Long> projectIds = taskDaliyMonthList.stream().map(item -> item.getProjectId()).collect(Collectors.toList());
            // 获取本月任务分配列表
            List<TaskUser> taskUserMonthList = taskUserRepository.findByTaskIdIn(taskIds);
            // 日历类
            Calendar cal = setUpCalendar(targetYearMonth);
            // 获取本月最大天数
            int lastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
            // 设置本月最大天数
            cal.set(Calendar.DAY_OF_MONTH, lastDay);
            // 获取本月最大周数
            int lastWeek = cal.get(Calendar.WEEK_OF_YEAR);
            // 获取本月最大任务进度列表
            List<ProjectProgress> projectProgressLastList = projectProgressRepository.findByBelongYearAndBelongWeekAndProjectIdIn(Integer.valueOf(targetYearMonth.substring(0,4)), lastWeek, projectIds);
            // 循环本月最大天数
            for (int i = 1; i <= lastDay; i ++) {
                // 设置天数
                cal.set(Calendar.DAY_OF_MONTH, i);
                // 获取本日任务日报列表
                List<TaskDaliy> taskDaliyDayList = taskDaliyMonthList.stream().filter(item -> item.getFillDate().getTime() == cal.getTime().getTime()).collect(Collectors.toList());
                // 循环本日任务日报列表
                for (int j = 0; j < taskDaliyDayList.size(); j ++) {
                    // 本日任务日报
                    TaskDaliy taskDaliyDay = taskDaliyDayList.get(j);
                    // 本日任务分配列表
                    List<TaskUser> taskUserDayList = taskUserMonthList.stream().filter(item -> item.getTaskId() == taskDaliyDay.getTaskId() && item.getUserId() == taskDaliyDay.getUserId()).collect(Collectors.toList());
                    // 判断本日任务分配列表数量
                    if (taskUserDayList.size() > 1) {
                        throw new BadRequestException("任务存在多次分配同一人情况!");
                    } else if (taskUserDayList.size() == 0) {
                        throw new BadRequestException("未找到任务分配记录!");
                    }
                    // 本日任务分配
                    TaskUser taskUserDay = taskUserDayList.get(0);
                    // 本日最大任务进度列表
                    List<ProjectProgress> projectProgressLastDayList = projectProgressLastList.stream().filter(item -> item.getProject().getId() == taskDaliyDay.getProjectId()).collect(Collectors.toList());
                    // 判断本日最大任务进度列表
                    if (projectProgressLastDayList.size() > 1) {
                        throw new BadRequestException("任务进度存在多条同年同周情况!");
                    } else if (projectProgressLastDayList.size() == 0) {
                        throw new BadRequestException("未找到任务进度记录!");
                    }
                    // 本日最大任务进度
                    ProjectProgress projectProgressLastDay = projectProgressLastDayList.get(0);
                    // 判断本日最大任务进度是否未承认
                    if (Constant.APPROVE_STATUS_UNRECOGNIZED.equals(projectProgressLastDay.getApproveStatus())) {
                        throw new BadRequestException("任务进度未承认!");
                    }
                    // 判断本日最大任务进度是否达标
                    if (projectProgressLastDay.getProjectProgress() < projectProgressLastDay.getEstimatedProgress()) {
                        // 跳过当前循环
                        continue;
                    }
                    // 根据项目ID、任务ID、用户ID查询填报日期前最近的任务日报信息
                    TaskDaliy taskDaliyHistory = taskDaliyRepository.findPreviousByProjectIdAndTaskIdAndAndUserId(taskDaliyDay.getProjectId(), taskDaliyDay.getTaskId(), taskDaliyDay.getUserId(), taskDaliyDay.getFillDate());
                    // 本日任务日报进度
                    Double taskDaliyDayProgress = taskDaliyDay.getTaskProgress();
                    // 判断最近的任务日报是否为空
                    if (taskDaliyHistory != null) {
                        // 本日任务日报相关历史进度
                        Double taskDaliyHistoryProgress = taskDaliyHistory.getTaskProgress();
                        // 判断进度是否正常
                        if (taskDaliyDayProgress - taskDaliyHistoryProgress <= 0) {
                            throw new BadRequestException("任务日报进度计算存在异常!");
                        }
                        // 本日任务日报进度
                        taskDaliyDayProgress = taskDaliyDayProgress - taskDaliyHistoryProgress;
                    }
                    // 已达标工时
                    complianceWork += taskUserDay.getTaskHours() * (taskDaliyDayProgress / 100);
                }
            }
        }
        // 已达标工时
        return complianceWork;
    }
    /**
     * 设置日历类
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskServiceImpl.java
@@ -20,6 +20,8 @@
import me.zhengjie.modules.project.domain.Project;
import me.zhengjie.modules.project.repository.ProjectRepository;
import me.zhengjie.modules.system.repository.DictDetailRepository;
import me.zhengjie.modules.system.service.RoleService;
import me.zhengjie.modules.system.service.dto.RoleSmallDto;
import me.zhengjie.modules.task.domain.Task;
import me.zhengjie.modules.task.domain.TaskDaliy;
import me.zhengjie.modules.task.domain.TaskUser;
@@ -43,6 +45,8 @@
import javax.servlet.http.HttpServletResponse;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @website https://eladmin.vip
@@ -60,9 +64,23 @@
    private final DictDetailRepository dictDetailRepository;
    private final TaskUserRepository taskUserRepository;
    private final TaskDaliyRepository taskDaliyRepository;
    private final RoleService roleService;
    @Override
    public Map<String,Object> queryAll(TaskQueryCriteria criteria, Pageable pageable){
        // 获取登录用户角色等级
        List<Integer> levels = roleService.findByUsersId(SecurityUtils.getCurrentUserId()).stream().map(RoleSmallDto::getLevel).collect(Collectors.toList());
        // 登录用户最大角色等级
        int min = Collections.min(levels);
        // 判断角色等级
        if (min == Constant.ROLE_LEVEL_MANAGER || min == Constant.ROLE_LEVEL_LEADER || min == Constant.ROLE_LEVEL_ORDINARY) {
            // 根据用户ID查询参与的项目ID
            List<Long> taskUserProjectIdList = taskDaliyRepository.findProjectIdByUserId(SecurityUtils.getCurrentUserId());
            // 根据用户ID查询负责的项目ID
            List<Long> projectIdList = projectRepository.findIdByLiableUserId(SecurityUtils.getCurrentUserId());
            // 检索条件
            criteria.setProjectIdInList(Stream.of(taskUserProjectIdList, projectIdList).flatMap(Collection::stream).distinct().collect(Collectors.toList()));
        }
        // 判断检索条件
        if (criteria.getName() == null) {
            // 检索条件
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskUserServiceImpl.java
@@ -22,14 +22,15 @@
import me.zhengjie.modules.system.domain.User;
import me.zhengjie.modules.system.repository.DictDetailRepository;
import me.zhengjie.modules.system.repository.UserRepository;
import me.zhengjie.modules.system.service.RoleService;
import me.zhengjie.modules.system.service.dto.RoleSmallDto;
import me.zhengjie.modules.task.domain.Task;
import me.zhengjie.modules.task.domain.TaskDailyInterface;
import me.zhengjie.modules.task.domain.TaskDaliy;
import me.zhengjie.modules.task.domain.TaskUser;
import me.zhengjie.modules.task.repository.TaskDaliyRepository;
import me.zhengjie.modules.task.repository.TaskRepository;
import me.zhengjie.utils.ValidationUtil;
import me.zhengjie.utils.FileUtil;
import me.zhengjie.utils.*;
import lombok.RequiredArgsConstructor;
import me.zhengjie.modules.task.repository.TaskUserRepository;
import me.zhengjie.modules.task.service.TaskUserService;
@@ -40,15 +41,13 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import me.zhengjie.utils.PageUtil;
import me.zhengjie.utils.QueryHelp;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @website https://eladmin.vip
@@ -67,9 +66,23 @@
    private final UserRepository userRepository;
    private final DictDetailRepository dictDetailRepository;
    private final TaskDaliyRepository taskDaliyRepository;
    private final RoleService roleService;
    @Override
    public Map<String,Object> queryAll(TaskUserQueryCriteria criteria, Pageable pageable){
        // 获取登录用户角色等级
        List<Integer> levels = roleService.findByUsersId(SecurityUtils.getCurrentUserId()).stream().map(RoleSmallDto::getLevel).collect(Collectors.toList());
        // 登录用户最大角色等级
        int min = Collections.min(levels);
        // 判断角色等级
        if (min == Constant.ROLE_LEVEL_MANAGER || min == Constant.ROLE_LEVEL_LEADER || min == Constant.ROLE_LEVEL_ORDINARY) {
            // 根据用户ID查询参与的项目ID
            List<Long> taskUserProjectIdList = taskDaliyRepository.findProjectIdByUserId(SecurityUtils.getCurrentUserId());
            // 根据用户ID查询负责的项目ID
            List<Long> projectIdList = projectRepository.findIdByLiableUserId(SecurityUtils.getCurrentUserId());
            // 检索条件
            criteria.setProjectIdInList(Stream.of(taskUserProjectIdList, projectIdList).flatMap(Collection::stream).distinct().collect(Collectors.toList()));
        }
        Page<TaskUser> page = taskUserRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
        // 将实体类转换为DTO(重写)
        Function<TaskUser, TaskUserDto> func = new Function<TaskUser, TaskUserDto>(){
eladmin-web-master/package.json
@@ -33,6 +33,11 @@
    "url": "https://github.com/elunez/eladmin/issues"
  },
  "dependencies": {
    "@fullcalendar/core": "^5.11.0",
    "@fullcalendar/daygrid": "^5.11.0",
    "@fullcalendar/interaction": "^5.11.0",
    "@fullcalendar/timegrid": "^5.11.0",
    "@fullcalendar/vue": "^5.11.0",
    "@riophae/vue-treeselect": "^0.4.0",
    "axios": "^0.21.1",
    "clipboard": "2.0.4",
@@ -48,6 +53,7 @@
    "jsencrypt": "^3.0.0-rc.1",
    "jszip": "^3.7.1",
    "mavon-editor": "^2.9.1",
    "moment": "^2.29.4",
    "normalize.css": "7.0.0",
    "nprogress": "0.2.0",
    "path-to-regexp": "2.4.0",
eladmin-web-master/src/api/project/project.js
@@ -48,4 +48,12 @@
  })
}
export default { getAll, add, edit, del, editAdmit, getPartake }
export function getRelevant(params) {
  return request({
    url: 'api/project/relevant',
    method: 'get',
    params
  })
}
export default { getAll, add, edit, del, editAdmit, getPartake, getRelevant }
eladmin-web-master/src/api/system/systemSetting.js
New file
@@ -0,0 +1,35 @@
import request from '@/utils/request'
export function getAll(params) {
  return request({
    url: 'api/systemSetting/all',
    method: 'get',
    params
  })
}
export function add(data) {
  return request({
    url: 'api/systemSetting',
    method: 'post',
    data
  })
}
export function del(ids) {
  return request({
    url: 'api/systemSetting/',
    method: 'delete',
    data: ids
  })
}
export function edit(data) {
  return request({
    url: 'api/systemSetting',
    method: 'put',
    data
  })
}
export default { add, edit, del, getAll }
eladmin-web-master/src/api/system/user.js
@@ -81,4 +81,18 @@
  })
}
export default { getAll, add, edit, del, get, getApprovalUsers }
export function getUserCalendarInfo(month) {
  return request({
    url: 'api/users/getUserCalendarInfo/' + month,
    method: 'get'
  })
}
export function getUserBaseInfo() {
  return request({
    url: 'api/users/getUserBaseInfo',
    method: 'get'
  })
}
export default { getAll, add, edit, del, get, getApprovalUsers, getUserCalendarInfo, getUserBaseInfo }
eladmin-web-master/src/views/attendance/attendanceBusinessTravel/index.vue
@@ -276,7 +276,7 @@
  components: { pagination, crudOperation, rrOperation, udOperation },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  cruds() {
    return CRUD({ title: '出差记录', url: 'api/attendanceBusinessTravel', idField: 'id', sort: 'id,desc', crudMethod: { ...crudAttendanceBusinessTravel }})
    return CRUD({ title: '出差记录', url: 'api/attendanceBusinessTravel', idField: 'id', sort: 'travelStartTime,desc', crudMethod: { ...crudAttendanceBusinessTravel }})
  },
  // 数据字典constant
  dicts: [constant.BUSSINESS_APPROVE_STATUS, constant.LEAVE_TIME_TYPE],
eladmin-web-master/src/views/attendance/attendanceCardReplacement/index.vue
@@ -144,33 +144,33 @@
      <!--表格渲染-->
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
        <el-table-column type="selection" width="55" />
        <el-table-column prop="userName" label="申请人" width="100" show-overflow-tooltip fixed="left">
        <el-table-column prop="userName" label="申请人" min-width="100" show-overflow-tooltip fixed="left">
          <template slot-scope="scope">
            <el-tag>{{ scope.row.userName }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="appUserName" label="审批者" width="100" show-overflow-tooltip fixed="left">
        <el-table-column prop="appUserName" label="审批者" min-width="100" show-overflow-tooltip fixed="left">
          <template slot-scope="scope">
            <el-tag>{{ scope.row.appUserName }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="cardReplacementTime" label="补卡时间" width="140" show-overflow-tooltip />
        <el-table-column prop="cardReplacementReason" label="补卡原因" width="140" show-overflow-tooltip />
        <el-table-column prop="approvalStatus" label="审批状态" width="80" show-overflow-tooltip>
        <el-table-column prop="cardReplacementTime" label="补卡时间" min-width="140" show-overflow-tooltip />
        <el-table-column prop="cardReplacementReason" label="补卡原因" min-width="140" show-overflow-tooltip />
        <el-table-column prop="approvalStatus" label="审批状态" min-width="80" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-tag v-if="scope.row.approvalStatus === dictCardApproveStatusReviewed" type="warning">{{ dict.label[dictCardApproveStatus][scope.row.approvalStatus] }}</el-tag>
            <el-tag v-if="scope.row.approvalStatus === dictCardApproveStatusAgree" type="success">{{ dict.label[dictCardApproveStatus][scope.row.approvalStatus] }}</el-tag>
            <el-tag v-if="scope.row.approvalStatus === dictCardApproveStatusRefuse" type="danger">{{ dict.label[dictCardApproveStatus][scope.row.approvalStatus] }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="approvalDescription" label="审批说明" width="140" show-overflow-tooltip />
        <el-table-column prop="cardReplacementDistinguish" label="补卡区分" width="80" show-overflow-tooltip>
        <el-table-column prop="approvalDescription" label="审批说明" min-width="140" show-overflow-tooltip />
        <el-table-column prop="cardReplacementDistinguish" label="补卡区分" min-width="80" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-tag>{{ dict.label[dictCardReplacement][scope.row.cardReplacementDistinguish] }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="remarks" label="备注" width="140" show-overflow-tooltip />
        <el-table-column prop="createTime" label="创建时间" width="140" show-overflow-tooltip />
        <el-table-column prop="remarks" label="备注" min-width="140" show-overflow-tooltip />
        <el-table-column prop="createTime" label="创建时间" min-width="140" show-overflow-tooltip />
        <el-table-column v-if="checkPer(['admin','attendanceCardreplacement:approve'])" label="审核操作" width="180px" align="center" fixed="right">
          <template slot-scope="scope">
            <el-button
@@ -240,7 +240,7 @@
  // 数据字典
  dicts: [constant.CARD_REPLACEMENT_DIFFERENTIATION, constant.CARD_APPROVE_STATUS],
  cruds() {
    return CRUD({ title: '补卡记录', url: 'api/attendanceCardreplacement', idField: 'id', sort: 'id,desc', crudMethod: { ...crudAttendanceCardreplacement }})
    return CRUD({ title: '补卡记录', url: 'api/attendanceCardreplacement', idField: 'id', sort: 'cardReplacementTime,desc', crudMethod: { ...crudAttendanceCardreplacement }})
  },
  data() {
    return {
eladmin-web-master/src/views/attendance/attendanceGoOut/index.vue
@@ -186,39 +186,39 @@
      <!--表格渲染-->
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
        <el-table-column type="selection" width="55" />
        <el-table-column prop="userName" label="申请人" width="100" fixed="left" show-overflow-tooltip>
        <el-table-column prop="userName" label="申请人" min-width="100" fixed="left" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-tag>{{ scope.row.userName }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="appUserName" label="审批者" width="100" fixed="left" show-overflow-tooltip>
        <el-table-column prop="appUserName" label="审批者" min-width="100" fixed="left" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-tag>{{ scope.row.appUserName }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="outStartTime" label="外出开始时间" width="140" show-overflow-tooltip />
        <el-table-column prop="outEndTime" label="外出结束时间" width="140" show-overflow-tooltip />
        <el-table-column prop="outDuration" label="外出时长" width="80" show-overflow-tooltip>
        <el-table-column prop="outStartTime" label="外出开始时间" min-width="140" show-overflow-tooltip />
        <el-table-column prop="outEndTime" label="外出结束时间" min-width="140" show-overflow-tooltip />
        <el-table-column prop="outDuration" label="外出时长" min-width="80" show-overflow-tooltip>
          <template slot-scope="scope">
            {{ scope.row.outDuration + '(' + dict.label[dictLeaveTimeType][scope.row.durationUnit] + ')' }}
          </template>
        </el-table-column>
        <el-table-column prop="outOfOfficeType" label="外出类型" width="80" show-overflow-tooltip>
        <el-table-column prop="outOfOfficeType" label="外出类型" min-width="80" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-tag>{{ dict.label[dictGoOutTypr][scope.row.outOfOfficeType] }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="outReason" label="外出原因" width="140" show-overflow-tooltip />
        <el-table-column prop="approvalStatus" label="审批状态" width="80" show-overflow-tooltip>
        <el-table-column prop="outReason" label="外出原因" min-width="140" show-overflow-tooltip />
        <el-table-column prop="approvalStatus" label="审批状态" min-width="80" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-tag v-if="scope.row.approvalStatus === dictGoOutAppRev" type="warning">{{ dict.label[dictApprovalStart][scope.row.approvalStatus] }}</el-tag>
            <el-tag v-if="scope.row.approvalStatus === dictGoOutAgree" type="success">{{ dict.label[dictApprovalStart][scope.row.approvalStatus] }}</el-tag>
            <el-tag v-if="scope.row.approvalStatus === dictGoOutReturn" type="danger">{{ dict.label[dictApprovalStart][scope.row.approvalStatus] }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="approvalDescription" label="审批说明" width="140" show-overflow-tooltip />
        <el-table-column prop="remarks" label="备注" width="140" show-overflow-tooltip />
        <el-table-column prop="createTime" label="创建时间" width="140" show-overflow-tooltip />
        <el-table-column prop="approvalDescription" label="审批说明" min-width="140" show-overflow-tooltip />
        <el-table-column prop="remarks" label="备注" min-width="140" show-overflow-tooltip />
        <el-table-column prop="createTime" label="创建时间" min-width="140" show-overflow-tooltip />
        <el-table-column v-if="checkPer(['admin','attendanceGoOut:approve'])" label="审核操作" width="180px" align="center" fixed="right">
          <template slot-scope="scope">
            <el-button
@@ -286,7 +286,7 @@
  components: { pagination, crudOperation, rrOperation, udOperation },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  cruds() {
    return CRUD({ title: '外出记录', url: 'api/attendanceGoOut', idField: 'id', sort: 'id,desc', crudMethod: { ...crudAttendanceGoOut }})
    return CRUD({ title: '外出记录', url: 'api/attendanceGoOut', idField: 'id', sort: 'outStartTime,desc', crudMethod: { ...crudAttendanceGoOut }})
  },
  // 数据字典
  dicts: [constant.LEAVE_TIME_TYPE, constant.GO_OUT_TYPE, constant.GO_OUT_APPROVE_STATUS],
eladmin-web-master/src/views/attendance/attendanceLeave/index.vue
@@ -186,47 +186,47 @@
      <!--表格渲染-->
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
        <el-table-column type="selection" width="55" />
        <el-table-column prop="userName" label="申请人" width="100" fixed="left" show-overflow-tooltip>
        <el-table-column prop="userName" label="申请人" min-width="100" fixed="left" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-tag>{{ scope.row.userName }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="appUserName" label="审批者" width="100" fixed="left" show-overflow-tooltip>
        <el-table-column prop="appUserName" label="审批者" min-width="100" fixed="left" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-tag>{{ scope.row.appUserName }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="leaveType" label="请假类型" width="80" show-overflow-tooltip>
        <el-table-column prop="leaveType" label="请假类型" min-width="80" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-tag>{{ dict.label[dictLeaveType][scope.row.leaveType] }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="leaveStartTime" width="140" label="请假开始时间" show-overflow-tooltip>
        <el-table-column prop="leaveStartTime" min-width="140" label="请假开始时间" show-overflow-tooltip>
          <template slot-scope="scope">
            {{ scope.row.leaveDurationUnit === dictLeaveTimeTypeHour ? scope.row.leaveStartTime : crud.toDate(scope.row.leaveStartTime) }}
          </template>
        </el-table-column>
        <el-table-column prop="leaveEndTime" width="140" label="请假结束时间" show-overflow-tooltip>
        <el-table-column prop="leaveEndTime" min-width="140" label="请假结束时间" show-overflow-tooltip>
          <template slot-scope="scope">
            {{ scope.row.leaveDurationUnit === dictLeaveTimeTypeHour ? scope.row.leaveEndTime : crud.toDate(scope.row.leaveEndTime) }}
          </template>
        </el-table-column>
        <el-table-column prop="leaveDuration" label="请假时长" width="80" show-overflow-tooltip>
        <el-table-column prop="leaveDuration" label="请假时长" min-width="80" show-overflow-tooltip>
          <template slot-scope="scope">
            {{ scope.row.leaveDuration + '(' + dict.label[dictLeaveTimeType][scope.row.leaveDurationUnit] + ')' }}
          </template>
        </el-table-column>
        <el-table-column prop="leaveReason" label="请假原因" width="140" show-overflow-tooltip />
        <el-table-column prop="approvalStatus" label="审批状态" width="80" show-overflow-tooltip>
        <el-table-column prop="leaveReason" label="请假原因" min-width="140" show-overflow-tooltip />
        <el-table-column prop="approvalStatus" label="审批状态" min-width="80" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-tag v-if="scope.row.approvalStatus === dictAppRovalStatusUnderAppover" type="warning">{{ dict.label[dictApprovalStart][scope.row.approvalStatus] }}</el-tag>
            <el-tag v-if="scope.row.approvalStatus === dictAppRovalStatusPassed" type="success">{{ dict.label[dictApprovalStart][scope.row.approvalStatus] }}</el-tag>
            <el-tag v-if="scope.row.approvalStatus === dictAppRovalStatusReturn" type="danger">{{ dict.label[dictApprovalStart][scope.row.approvalStatus] }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="approvalDescription" label="审批说明" width="140" show-overflow-tooltip />
        <el-table-column prop="remarks" label="备注" width="140" show-overflow-tooltip />
        <el-table-column prop="createTime" width="140" label="创建时间" show-overflow-tooltip />
        <el-table-column prop="approvalDescription" label="审批说明" min-width="140" show-overflow-tooltip />
        <el-table-column prop="remarks" label="备注" min-width="140" show-overflow-tooltip />
        <el-table-column prop="createTime" min-width="140" label="创建时间" show-overflow-tooltip />
        <el-table-column v-if="checkPer(['admin','attendanceLeave:approve'])" label="审核操作" width="180px" align="center" fixed="right">
          <template slot-scope="scope">
            <el-button
@@ -294,7 +294,7 @@
  components: { pagination, crudOperation, rrOperation, udOperation },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  cruds() {
    return CRUD({ title: '请假记录', url: 'api/attendanceLeave', idField: 'id', sort: 'id,desc', crudMethod: { ...crudAttendanceLeave }})
    return CRUD({ title: '请假记录', url: 'api/attendanceLeave', idField: 'id', sort: 'leaveStartTime,desc', crudMethod: { ...crudAttendanceLeave }})
  },
  // 数据字典
  dicts: [constant.LEAVE_TYPE, constant.APPROVAL_STATUS, constant.LEAVE_TIME_TYPE],
eladmin-web-master/src/views/cost/cost/index.vue
@@ -121,7 +121,7 @@
  components: { pagination, crudOperation, rrOperation, udOperation, moneyInput },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  cruds() {
    return CRUD({ title: '成本', url: 'api/cost', idField: 'id', sort: 'id,desc', crudMethod: { ...crudCost }})
    return CRUD({ title: '成本', url: 'api/cost', idField: 'id', sort: 'enterProjectTime,desc', crudMethod: { ...crudCost }})
  },
  data() {
    // 工资(千万内)验证
eladmin-web-master/src/views/dashboard/PanelGroup.vue
@@ -3,52 +3,54 @@
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
      <div class="card-panel" @click="handleSetLineChartData('newVisitis')">
        <div class="card-panel-icon-wrapper icon-people">
          <svg-icon icon-class="peoples" class-name="card-panel-icon" />
          <svg-icon icon-class="visits" class-name="card-panel-icon" />
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text">
            New Visits
            出勤天数
          </div>
          <count-to :start-val="0" :end-val="102400" :duration="2600" class="card-panel-num" />
          <count-to :start-val="0" :end-val="userInfo.onDutyDays" :duration="2600" class="card-panel-num" />
        </div>
      </div>
    </el-col>
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
      <div class="card-panel" @click="handleSetLineChartData('messages')">
        <div class="card-panel-icon-wrapper icon-message">
          <svg-icon icon-class="message" class-name="card-panel-icon" />
        <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">
            Messages
            剩余年假(小时)
          </div>
          <count-to :start-val="0" :end-val="81212" :duration="3000" class="card-panel-num" />
        </div>
      </div>
    </el-col>
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
      <div class="card-panel" @click="handleSetLineChartData('purchases')">
        <div class="card-panel-icon-wrapper icon-money">
          <svg-icon icon-class="money" class-name="card-panel-icon" />
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text">
            Purchases
          </div>
          <count-to :start-val="0" :end-val="9280" :duration="3200" class="card-panel-num" />
          <count-to :start-val="0" :end-val="userInfo.annualLeave" :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" @click="handleSetLineChartData('shoppings')">
        <div class="card-panel-icon-wrapper icon-shopping">
          <svg-icon icon-class="shopping" class-name="card-panel-icon" />
        <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">
            Shoppings
            剩余补卡次数
          </div>
          <count-to :start-val="0" :end-val="13600" :duration="3600" class="card-panel-num" />
          <count-to :start-val="0" :end-val="userInfo.cardLeft" :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="userInfo.Times" :decimals="2" :duration="3600" class="card-panel-num" />
          <span class="card-panel-texts">/</span>
          <count-to :start-val="0" :end-val="userInfo.Time" :duration="3600" class="card-panel-num" />
        </div>
      </div>
    </el-col>
@@ -61,6 +63,12 @@
export default {
  components: {
    CountTo
  },
  props: {
    userInfo: {
      type: Object,
      required: true
    }
  },
  methods: {
    handleSetLineChartData(type) {
@@ -102,12 +110,12 @@
        background: #36a3f7;
      }
      .icon-money {
        background: #f4516c;
      .icon-permission {
        background: #34bfa3
      }
      .icon-shopping {
        background: #34bfa3
      .icon-timings{
        background:#f4516c
      }
    }
@@ -119,11 +127,7 @@
      color: #36a3f7;
    }
    .icon-money {
      color: #f4516c;
    }
    .icon-shopping {
    .icon-permission {
      color: #34bfa3
    }
@@ -153,6 +157,10 @@
        margin-bottom: 12px;
      }
      .card-panel-texts{
         font-size: 20px;
      }
      .card-panel-num {
        font-size: 20px;
      }
eladmin-web-master/src/views/home.vue
@@ -1,37 +1,23 @@
<template>
  <div class="dashboard-container">
    <div class="dashboard-editor-container">
      <panel-group @handleSetLineChartData="handleSetLineChartData" />
      <panel-group :user-info="userInfo" @handleSetLineChartData="handleSetLineChartData" />
      <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
        <line-chart :chart-data="lineChartData" />
      </el-row>
      <el-row :gutter="32">
        <el-col :xs="24" :sm="24" :lg="8">
          <div class="chart-wrapper">
            <radar-chart />
          </div>
        </el-col>
        <el-col :xs="24" :sm="24" :lg="8">
          <div class="chart-wrapper">
            <pie-chart />
          </div>
        </el-col>
        <el-col :xs="24" :sm="24" :lg="8">
          <div class="chart-wrapper">
            <bar-chart />
          </div>
        </el-col>
        <FullCalendar ref="fullCalendar" :options="calendarOptions" class="eventDeal-wrap" />
      </el-row>
    </div>
  </div>
</template>
<script>
import crudUser from '@/api/system/user'
import PanelGroup from './dashboard/PanelGroup'
import LineChart from './dashboard/LineChart'
import RadarChart from '@/components/Echarts/RadarChart'
import PieChart from '@/components/Echarts/PieChart'
import BarChart from '@/components/Echarts/BarChart'
import '@fullcalendar/core/vdom'
import FullCalendar from '@fullcalendar/vue'
import dayGridPlugin from '@fullcalendar/daygrid'
import interactionPlugin from '@fullcalendar/interaction'
import timeGridPlugin from '@fullcalendar/timegrid'
import moment from 'moment'
const lineChartData = {
  newVisitis: {
@@ -56,19 +42,149 @@
  name: 'Dashboard',
  components: {
    PanelGroup,
    LineChart,
    RadarChart,
    PieChart,
    BarChart
    FullCalendar
  },
  data() {
    return {
      lineChartData: lineChartData.newVisitis
      lineChartData: lineChartData.newVisitis,
      calendarOptions: {
        // 引入的插件
        plugins: [dayGridPlugin, timeGridPlugin, interactionPlugin],
        // 日历头部按钮位置
        headerToolbar: {
          left: '',
          center: 'title',
          right: 'prev,today,next'
        },
        // 日历头部按钮中文转换
        buttonText: {
          today: '今天',
          month: '月',
          week: '周',
          day: '天'
        },
        initialView: 'dayGridMonth',
        locale: 'zh-ch',
        firstDay: '1',
        weekNumberCalculation: 'ISO',
        eventCOlor: '#3d8eec',
        timeGridEventMinHeight: '20',
        aspectRatio: '1.5',
        displayEventTime: false,
        allDaySlot: false,
        eventLimit: true,
        fixedWeekCount: false,
        eventTimeFormat: {
          hour: 'numeric',
          minute: '2-digit',
          hour12: false
        },
        slotLabelFormat: {
          hour: '2-digit',
          minute: '2-digit',
          meridiem: false,
          hour12: false
        },
        businessHours: {
          dow: [1, 2, 3, 4, 5],
          start: '9:00',
          end: '18:00'
        },
        events: [],
        // 事件
        editable: false,
        eventStartEditable: false,
        eventDurationEditable: false,
        selectable: false,
        selectMirror: true,
        selectMinDistance: 0,
        weekends: true,
        navLinks: true,
        selectHelper: false,
        selectEventOverlap: false,
        dayMaxEvents: true,
        dateClick: this.handleDateClick, // 点击日期触发
        eventsSet: this.handleEvents,
        eventClick: this.handleEventClick, // 点击日程触发
        eventDrop: this.handleEventDrop,
        eventResize: this.eventResize,
        height: 'auto',
        customButtons: {
          prev: {
            click: () => {
              this.monthClick('prev')
    }
          },
          today: {
            text: '今天',
            click: () => {
              this.monthClick('')
            }
          },
          next: {
            click: () => {
              this.monthClick('next')
            }
          }
        }
      },
      userInfo: {}
    }
  },
  mounted() {
    this.monthClick('')
    this.getUserBaseInfo()
  },
  methods: {
    handleSetLineChartData(type) {
      this.lineChartData = lineChartData[type]
    },
    // 箭头点击事件
    monthClick(type) {
      const calendarApi = this.$refs['fullCalendar'].getApi()
      if (type === 'prev') {
        calendarApi.prev()
      } else if (type === 'next') {
        calendarApi.next()
      } else {
        calendarApi.today()
      }
      // this.calendarOptions.events = [{title: '上班打卡时间', color: 'red',start: '2023-01-28',date: '2023-01-28'}]
      this.getUserCalendarInfo(moment(calendarApi.view.currentStart).format('YYYY-MM-DD').toString())
    },
    // 获取打卡信息
    getUserCalendarInfo(month) {
      crudUser.getUserCalendarInfo(month).then(res => {
        this.calendarOptions.events = res.map(function(obj) {
          obj.start = obj.date
          obj.color = obj.isOk ? 'green' : 'red'
          obj.date1 = obj.date
          return obj
        })
      }).catch(() => {
        this.calendarOptions.events = []
      })
    },
    // 日期点击
    handleDateClick(selectInfo) {
      console.log('handleDateClick.info:', selectInfo)
    },
    // 日程点击信息展示
    handleEventClick(info) {
      if (info.event._def.extendedProps.type === 1) {
        this.$router.push({
          path: '/attendance/attendance',
          query: { date: info.event._def.extendedProps.date1 }
        })
      } else {
        this.$router.push({ path: '/task/taskDaliy', query: { date: info.event._def.extendedProps.date1 }})
      }
    },
    // 获取用户信息
    getUserBaseInfo() {
      crudUser.getUserBaseInfo().then(res => {
        this.userInfo = res
      })
    }
  }
}
eladmin-web-master/src/views/project/projectCost/index.vue
@@ -121,7 +121,7 @@
  components: { pagination, crudOperation, rrOperation, udOperation, moneyInput },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  cruds() {
    return CRUD({ title: '项目成本', url: 'api/projectCost', idField: 'id', sort: 'id,desc', crudMethod: { ...crudProjectCost }})
    return CRUD({ title: '项目成本', url: 'api/projectCost', idField: 'id', sort: 'enterProjectTime,desc', crudMethod: { ...crudProjectCost }})
  },
  data() {
    // 指针重指向
eladmin-web-master/src/views/project/projectPerformance/index.vue
@@ -100,7 +100,7 @@
  components: { pagination, crudOperation, rrOperation, udOperation },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  cruds() {
    return CRUD({ title: '项目绩效', url: 'api/projectPerformance', idField: 'id', sort: 'id,desc', crudMethod: { ...crudProjectPerformance }})
    return CRUD({ title: '项目绩效', url: 'api/projectPerformance', idField: 'id', sort: 'startDate,desc', crudMethod: { ...crudProjectPerformance }})
  },
  data() {
    return {
eladmin-web-master/src/views/project/projectPerformanceDetail/index.vue
@@ -116,7 +116,7 @@
  components: { pagination, crudOperation, rrOperation, udOperation },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  cruds() {
    return CRUD({ title: '项目绩效详细', url: 'api/projectPerformanceDetail', idField: 'id', sort: 'id,desc', crudMethod: { ...crudProjectPerformanceDetail }})
    return CRUD({ title: '项目绩效详细', url: 'api/projectPerformanceDetail', idField: 'id', sort: 'yearMonth,desc', crudMethod: { ...crudProjectPerformanceDetail }})
  },
  data() {
    // 时长(千内)验证
eladmin-web-master/src/views/salary/salary/index.vue
@@ -4,7 +4,7 @@
    <div class="head-container">
      <div v-if="crud.props.searchToggle">
        <!-- 搜索 -->
        <el-select v-model="query.userId" filterable clearable placeholder="所属员工" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery">
        <el-select v-model="query.userId" v-permission="permission.queryUserId" filterable clearable placeholder="所属员工" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery">
          <el-option
            v-for="item in users"
            :key="item.id"
@@ -715,7 +715,7 @@
  mixins: [presenter(), header(), form(defaultForm), crud()],
  dicts: [constant.PUBLICITY_STATUS, constant.APPROVE_STATUS],
  cruds() {
    return CRUD({ title: '工资记录', url: 'api/salary', idField: 'id', sort: 'id,desc', crudMethod: { ...crudSalary }})
    return CRUD({ title: '工资记录', url: 'api/salary', idField: 'id', sort: 'salaryYearMonth,desc', crudMethod: { ...crudSalary }})
  },
  data() {
    // 工资(千万内)验证
@@ -752,7 +752,8 @@
        download: ['admin', 'salary:download'],
        publicity: ['admin', 'salary:publicity'],
        approve: ['admin', 'salary:approve'],
        generate: ['admin', 'salary:generate']
        generate: ['admin', 'salary:generate'],
        queryUserId: ['admin', 'salary:queryUserId']
      },
      rules: {
        userId: [
eladmin-web-master/src/views/system/company/index.vue
New file
@@ -0,0 +1,104 @@
<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">
      <div v-if="crud.props.searchToggle">
        <!-- 搜索 -->
        <el-input v-model="query.label" clearable size="small" placeholder="输入标题搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
        <rrOperation />
      </div>
      <!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
      <crudOperation :permission="permission" />
      <!--表单组件-->
      <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
        <el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
          <el-form-item label="标签" prop="label">
            <el-input v-model="form.label" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="值" prop="value">
            <el-input v-model="form.value" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="描述">
            <el-input v-model="form.description" style="width: 370px;" />
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button type="text" @click="crud.cancelCU">取消</el-button>
          <el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
        </div>
      </el-dialog>
      <!--表格渲染-->
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
        <el-table-column type="selection" width="55" />
        <el-table-column prop="label" label="标签">
          <template slot-scope="scope">
            {{ scope.row.label }}
          </template>
        </el-table-column>
        <el-table-column prop="value" label="值">
          <template slot-scope="scope">
            {{ scope.row.value }}
          </template>
        </el-table-column>
        <el-table-column prop="description" label="描述" />
        <el-table-column prop="createTime" label="创建日期" />
        <el-table-column v-if="checkPer(['admin','systemSetting:edit','systemSetting:del'])" label="操作" width="150px" align="center">
          <template slot-scope="scope">
            <udOperation
              :data="scope.row"
              :permission="permission"
            />
          </template>
        </el-table-column>
      </el-table>
      <!--分页组件-->
      <pagination />
    </div>
  </div>
</template>
<script>
import crudSystemSetting from '@/api/system/systemSetting'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
const defaultForm = { id: null, name: null, description: null, label: null, value: null, createBy: null, updateBy: null, createTime: null, updateTime: null }
export default {
  name: 'SystemSetting',
  components: { pagination, crudOperation, rrOperation, udOperation },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  cruds() {
    return CRUD({ title: '公司管理', url: 'api/systemSetting', idField: 'id', sort: 'id,desc', crudMethod: { ...crudSystemSetting }})
  },
  data() {
    return {
      permission: {
        add: ['admin', 'systemSetting:add'],
        edit: ['admin', 'systemSetting:edit'],
        del: ['admin', 'systemSetting:del'],
        download: ['admin', 'systemSetting:download']
      },
      rules: {
        label: [
          { required: true, message: '标签不能为空', trigger: 'blur' }
        ],
        value: [
          { required: true, message: '值不能为空', trigger: 'blur' }
        ]
      }}
  },
  methods: {
    // 钩子:在获取表格数据之前执行,false 则代表不获取数据
    [CRUD.HOOK.beforeRefresh]() {
      return true
    }
  }
}
</script>
<style scoped>
</style>
eladmin-web-master/src/views/system/configIndividualIncomeTax/index.vue
@@ -96,7 +96,7 @@
  components: { pagination, crudOperation, rrOperation, udOperation, moneyInput },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  cruds() {
    return CRUD({ title: '个人所得税', url: 'api/sysConfigIndividualIncomeTax', idField: 'id', sort: 'id,desc', crudMethod: { ...crudSysConfigIndividualIncomeTax }})
    return CRUD({ title: '个人所得税', url: 'api/sysConfigIndividualIncomeTax', idField: 'id', sort: 'gearAmountStart,desc', crudMethod: { ...crudSysConfigIndividualIncomeTax }})
  },
  data() {
    // 工资(千万内)验证
eladmin-web-master/src/views/system/userLevelInsurance/index.vue
@@ -306,7 +306,7 @@
  components: { pagination, crudOperation, rrOperation, udOperation, moneyInput },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  cruds() {
    return CRUD({ title: '用户级别保险', url: 'api/sysUserLevelInsurance', idField: 'id', sort: 'id,desc', crudMethod: { ...crudSysUserLevelInsurance }})
    return CRUD({ title: '用户级别保险', url: 'api/sysUserLevelInsurance', idField: 'id', sort: 'startDate,desc', crudMethod: { ...crudSysUserLevelInsurance }})
  },
  data() {
    // 指针重指向
eladmin-web-master/src/views/system/userLevelOther/index.vue
@@ -139,7 +139,7 @@
  components: { pagination, crudOperation, rrOperation, udOperation },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  cruds() {
    return CRUD({ title: '用户级别其他', url: 'api/sysUserLevelOther', idField: 'id', sort: 'id,desc', crudMethod: { ...crudSysUserLevelOther }})
    return CRUD({ title: '用户级别其他', url: 'api/sysUserLevelOther', idField: 'id', sort: 'startDate,desc', crudMethod: { ...crudSysUserLevelOther }})
  },
  data() {
    // 指针重指向
eladmin-web-master/src/views/system/userLevelWage/index.vue
@@ -171,7 +171,7 @@
  components: { pagination, crudOperation, rrOperation, udOperation, moneyInput },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  cruds() {
    return CRUD({ title: '用户级别工资', url: 'api/sysUserLevelWage', idField: 'id', sort: 'id,desc', crudMethod: { ...crudSysUserLevelWage }})
    return CRUD({ title: '用户级别工资', url: 'api/sysUserLevelWage', idField: 'id', sort: 'startDate,desc', crudMethod: { ...crudSysUserLevelWage }})
  },
  data() {
    // 指针重指向
eladmin-web-master/src/views/task/task/index.vue
@@ -445,7 +445,7 @@
    // 获取项目
    getProject() {
      // 获取项目
      crudProject.getAll({ approveStatus: constant.APPROVE_STATUS_ACKNOWLEDGED }).then(res => {
      crudProject.getRelevant().then(res => {
        // 项目列表
        this.projects = res
      })
eladmin-web-master/src/views/task/taskDaliy/index.vue
@@ -36,10 +36,10 @@
      <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
        <el-form ref="form" :model="form" :rules="rules" size="small" label-width="110px">
          <el-form-item label="填写日期" prop="fillDate">
            <el-date-picker v-model="form.fillDate" type="date" style="width: 340px;" />
            <el-date-picker v-model="form.fillDate" type="date" style="width: 340px;" :disabled="disabledFlagBySettlement" />
          </el-form-item>
          <el-form-item label="所属员工" prop="userId">
            <el-select v-model="form.userId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="userRolesLevelMin == roleLevelOrdinary" @change="formUserChange">
            <el-select v-model="form.userId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="disabledFlagBySettlement || userRolesLevelMin == roleLevelOrdinary" @change="formUserChange">
              <el-option
                v-for="item in users"
                :key="item.id"
@@ -50,7 +50,7 @@
            </el-select>
          </el-form-item>
          <el-form-item label="所属项目" prop="projectId">
            <el-select v-model="form.projectId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="crud.status.edit == crudStatusPrepared" @change="formProjectChange">
            <el-select v-model="form.projectId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="disabledFlagBySettlement || crud.status.edit == crudStatusPrepared" @change="formProjectChange">
              <el-option
                v-for="item in formProjects"
                :key="item.id"
@@ -60,7 +60,7 @@
            </el-select>
          </el-form-item>
          <el-form-item label="所属任务" prop="taskId">
            <el-select v-model="form.taskId" filterable clearable placeholder="请选择" style="width: 340px;" @change="formTaskChange">
            <el-select v-model="form.taskId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="disabledFlagBySettlement" @change="formTaskChange">
              <el-option
                v-for="item in formTasks"
                :key="item.id"
@@ -70,23 +70,23 @@
            </el-select>
          </el-form-item>
          <el-form-item label="消耗工时" prop="consumedHours">
            <el-input v-model="form.consumedHours" style="width: 340px;">
            <el-input v-model="form.consumedHours" style="width: 340px;" :disabled="disabledFlagBySettlement">
              <template slot="append">小时</template>
            </el-input>
          </el-form-item>
          <el-form-item label="消耗工作量" prop="consumedWorkload">
            <el-input v-model="form.consumedWorkload" style="width: 340px;" />
            <el-input v-model="form.consumedWorkload" style="width: 340px;" :disabled="disabledFlagBySettlement" />
          </el-form-item>
          <el-form-item label="消耗工作量单位" prop="consumedWorkloadUnit">
            {{ dict.label[standardWorkloadUnit][form.consumedWorkloadUnit] }}
          </el-form-item>
          <el-form-item label="任务进度" prop="taskProgress">
            <el-input v-model="form.taskProgress" style="width: 340px;">
            <el-input v-model="form.taskProgress" style="width: 340px;" :disabled="disabledFlagBySettlement">
              <template slot="append">%</template>
            </el-input>
          </el-form-item>
          <el-form-item v-if="userRolesLevelMin != roleLevelOrdinary && crud.status.edit == crudStatusPrepared" label="结算状态" prop="settlementStatus">
            <el-select v-model="form.settlementStatus" filterable placeholder="请选择" style="width: 340px;">
            <el-select v-model="form.settlementStatus" filterable placeholder="请选择" style="width: 340px;" :disabled="disabledFlagBySettlement">
              <el-option
                v-for="item in dict[settlementStatus]"
                :key="item.id"
@@ -96,7 +96,7 @@
            </el-select>
          </el-form-item>
          <el-form-item label="备注">
            <el-input v-model="form.remarks" :rows="3" type="textarea" style="width: 340px;" />
            <el-input v-model="form.remarks" :rows="3" type="textarea" style="width: 340px;" :disabled="disabledFlagBySettlement" />
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
@@ -107,45 +107,45 @@
      <!--表格渲染-->
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
        <el-table-column type="selection" width="55" />
        <el-table-column :show-overflow-tooltip="true" prop="fillDate" label="填写日期" fixed="left" width="100px">
        <el-table-column :show-overflow-tooltip="true" prop="fillDate" label="填写日期" fixed="left" min-width="100px">
          <template slot-scope="scope">
            {{ crud.toDate(scope.row.fillDate) }}
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="userNickName" label="所属员工" fixed="left" width="120px">
        <el-table-column :show-overflow-tooltip="true" prop="userNickName" label="所属员工" fixed="left" min-width="100px">
          <template slot-scope="scope">
            <el-tag>{{ scope.row.userNickName }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="projectName" label="所属项目" width="180px">
        <el-table-column :show-overflow-tooltip="true" prop="projectName" label="所属项目" min-width="140px">
          <template slot-scope="scope">
            <el-tag>{{ scope.row.projectName }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="taskName" label="所属任务" width="180px">
        <el-table-column :show-overflow-tooltip="true" prop="taskName" label="所属任务" min-width="180px">
          <template slot-scope="scope">
            <el-tag>{{ scope.row.taskName }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="consumedHours" label="消耗工时" width="80px" />
        <el-table-column :show-overflow-tooltip="true" prop="consumedWorkload" label="消耗工作量" width="80px" />
        <el-table-column :show-overflow-tooltip="true" prop="taskWorkloadUnit" label="消耗工作量单位" width="110px">
        <el-table-column :show-overflow-tooltip="true" prop="consumedHours" label="消耗工时" min-width="80px" />
        <el-table-column :show-overflow-tooltip="true" prop="consumedWorkload" label="消耗工作量" min-width="80px" />
        <el-table-column :show-overflow-tooltip="true" prop="taskWorkloadUnit" label="消耗工作量单位" min-width="110px">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.taskWorkloadUnit != null && scope.row.taskWorkloadUnit != ''">{{ dict.label[standardWorkloadUnit][scope.row.taskWorkloadUnit] }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="taskProgress" label="任务进度" width="80px">
        <el-table-column :show-overflow-tooltip="true" prop="taskProgress" label="任务进度" min-width="80px">
          <template slot-scope="scope">
            {{ scope.row.taskProgress }}%
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="settlementStatus" width="80px" label="结算状态">
        <el-table-column :show-overflow-tooltip="true" prop="settlementStatus" min-width="80px" label="结算状态">
          <template slot-scope="scope">
            <el-tag>{{ dict.label[settlementStatus][scope.row.settlementStatus] }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="remarks" label="备注" width="280px" />
        <el-table-column prop="createTime" label="创建时间" />
        <el-table-column prop="remarks" label="备注" min-width="140px" />
        <el-table-column prop="createTime" label="创建时间" min-width="140px" />
        <el-table-column v-if="checkPer(['admin','taskDaliy:edit','taskDaliy:del'])" label="操作" width="150px" align="center" fixed="right">
          <template slot-scope="scope">
            <udOperation
@@ -262,7 +262,9 @@
      // 表单项目列表
      formProjects: [],
      // 表单任务列表
      formTasks: []
      formTasks: [],
      // 表单禁用标记(结算状态)
      disabledFlagBySettlement: false
    }
  },
  computed: {
@@ -309,7 +311,7 @@
    // 获取检索项目
    getQueryProject() {
      // 获取项目
      crudProject.getAll({ approveStatus: constant.APPROVE_STATUS_ACKNOWLEDGED }).then(res => {
      crudProject.getRelevant().then(res => {
        // 检索项目列表
        this.queryProjects = res
      })
@@ -330,6 +332,19 @@
        })
      }
    },
    // 新增与编辑前做的操作
    [CRUD.HOOK.afterToCU](crud, form) {
      // 判断表单结算状态
      if (this.form.settlementStatus === constant.SETTLEMENT_STATUS_SETTLED) {
        // 表单禁用标记(结算状态)
        this.disabledFlagBySettlement = true
      } else {
        // 表单禁用标记(结算状态)
        this.disabledFlagBySettlement = false
      }
      // 随机数
      this.random = Math.random()
    },
    // 钩子:新建 - 之前
    [CRUD.HOOK.beforeToAdd]() {
      // 表单赋值
eladmin-web-master/src/views/task/taskUser/index.vue
@@ -192,7 +192,7 @@
  mixins: [presenter(), header(), form(defaultForm), crud()],
  dicts: [constant.TASK_STATUS, constant.STANDARD_WORKLOAD_UNIT],
  cruds() {
    return CRUD({ title: '任务分配', url: 'api/taskUser', idField: 'id', sort: 'id,desc', crudMethod: { ...crudTaskUser }})
    return CRUD({ title: '任务分配', url: 'api/taskUser', idField: 'id', sort: 'taskStartDate,desc', crudMethod: { ...crudTaskUser }})
  },
  data() {
    // 指针重指向
@@ -316,7 +316,7 @@
    // 获取项目
    getProject() {
      // 获取项目
      crudProject.getAll({ approveStatus: constant.APPROVE_STATUS_ACKNOWLEDGED }).then(res => {
      crudProject.getRelevant().then(res => {
        // 项目列表
        this.projects = res
      })