| | |
| | | import org.springframework.data.jpa.repository.Query; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | |
| | | package me.zhengjie.modules.attendance.rest; |
| | | |
| | | import me.zhengjie.annotation.Log; |
| | | import me.zhengjie.modules.attendance.domain.AgreeUpdateRequest; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceBusinessTravel; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceCardreplacement; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceGoOut; |
| | |
| | | attendanceBusinessTravelService.updateApprove(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @PutMapping(value = "/updateAgree") |
| | | @Log("批量审核") |
| | | @ApiOperation("批量审核") |
| | | public ResponseEntity<Object> editIsAgree(@Validated @RequestBody AgreeUpdateRequest request) throws Exception { |
| | | attendanceBusinessTravelService.updateAgree(request); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | } |
| | |
| | | package me.zhengjie.modules.attendance.rest; |
| | | |
| | | import me.zhengjie.annotation.Log; |
| | | import me.zhengjie.modules.attendance.domain.AgreeUpdateRequest; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceCardreplacement; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceMonth; |
| | | import me.zhengjie.modules.attendance.service.AttendanceCardreplacementService; |
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceCardreplacementQueryCriteria; |
| | | import org.springframework.data.domain.Pageable; |
| | |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @PutMapping(value = "/updateAgree") |
| | | @Log("批量审核") |
| | | @ApiOperation("批量审核") |
| | | public ResponseEntity<Object> editIsAgree(@Validated @RequestBody AgreeUpdateRequest request){ |
| | | attendanceCardreplacementService.updateAgree(request); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @PutMapping(value = "/revoke") |
| | | @Log("补卡撤销") |
| | | @ApiOperation("补卡撤销") |
| | |
| | | @PostMapping(value = "/addAttendanceInfo") |
| | | @Log("考勤信息补充") |
| | | @ApiOperation("考勤信息补充") |
| | | @PreAuthorize("@el.check('attendance:addAttendanceInfo')") |
| | | public ResponseEntity<Object> addAttendanceInfo(@Validated @RequestBody Attendance attendance) throws Exception { |
| | | attendanceService.addAttendanceInfo(attendance); |
| | | return new ResponseEntity<>(HttpStatus.CREATED); |
| | |
| | | package me.zhengjie.modules.attendance.rest; |
| | | |
| | | import me.zhengjie.annotation.Log; |
| | | import me.zhengjie.modules.attendance.domain.AgreeUpdateRequest; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceBusinessTravel; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceGoOut; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceLeave; |
| | |
| | | attendanceGoOutService.updateApprove(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @PutMapping(value = "/updateAgree") |
| | | @Log("批量审核") |
| | | @ApiOperation("批量审核") |
| | | public ResponseEntity<Object> editIsAgree(@Validated @RequestBody AgreeUpdateRequest request) throws Exception { |
| | | attendanceGoOutService.updateAgree(request); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | } |
| | |
| | | package me.zhengjie.modules.attendance.rest; |
| | | |
| | | import me.zhengjie.annotation.Log; |
| | | import me.zhengjie.modules.attendance.domain.AgreeUpdateRequest; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceCardreplacement; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceLeave; |
| | | import me.zhengjie.modules.attendance.service.AttendanceLeaveService; |
| | |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @PutMapping(value = "/updateAgree") |
| | | @Log("批量审核") |
| | | @ApiOperation("批量审核") |
| | | public ResponseEntity<Object> editIsAgree(@Validated @RequestBody AgreeUpdateRequest request) throws Exception { |
| | | attendanceLeaveService.updateAgree(request); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @Log("删除请假") |
| | | @ApiOperation("删除请假") |
| | |
| | | */ |
| | | package me.zhengjie.modules.attendance.service; |
| | | |
| | | import me.zhengjie.modules.attendance.domain.AgreeUpdateRequest; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceBusinessTravel; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceGoOut; |
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceBusinessTravelDto; |
| | |
| | | */ |
| | | void updateApprove(AttendanceBusinessTravel resources) throws Exception; |
| | | |
| | | /** |
| | | * 批量审核 |
| | | * @param |
| | | */ |
| | | void updateAgree(AgreeUpdateRequest request) throws Exception; |
| | | } |
| | |
| | | */ |
| | | package me.zhengjie.modules.attendance.service; |
| | | |
| | | import me.zhengjie.modules.attendance.domain.AgreeUpdateRequest; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceCardreplacement; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceMonth; |
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceCardreplacementDto; |
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceCardreplacementQueryCriteria; |
| | | import org.springframework.data.domain.Pageable; |
| | |
| | | * @param resources |
| | | */ |
| | | void cardRevoke(AttendanceCardreplacement resources); |
| | | |
| | | /** |
| | | * 批量审核 |
| | | * @param |
| | | */ |
| | | void updateAgree(AgreeUpdateRequest request); |
| | | } |
| | |
| | | */ |
| | | package me.zhengjie.modules.attendance.service; |
| | | |
| | | import me.zhengjie.modules.attendance.domain.AgreeUpdateRequest; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceGoOut; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceLeave; |
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceGoOutDto; |
| | |
| | | * @param resources / |
| | | */ |
| | | void updateApprove(AttendanceGoOut resources) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 批量审核(外出) |
| | | * @param |
| | | */ |
| | | void updateAgree(AgreeUpdateRequest request) throws Exception; |
| | | } |
| | |
| | | */ |
| | | package me.zhengjie.modules.attendance.service; |
| | | |
| | | import me.zhengjie.modules.attendance.domain.AgreeUpdateRequest; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceCardreplacement; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceLeave; |
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceLeaveDto; |
| | |
| | | * @throws IOException / |
| | | */ |
| | | void download(List<AttendanceLeaveDto> all, HttpServletResponse response) throws IOException; |
| | | |
| | | /** |
| | | * 批量审核 |
| | | * @param |
| | | */ |
| | | void updateAgree(AgreeUpdateRequest request) throws Exception; |
| | | } |
| | |
| | | */ |
| | | package me.zhengjie.modules.attendance.service; |
| | | |
| | | import me.zhengjie.modules.attendance.domain.AgreeUpdateRequest; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceMonthLeave; |
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceMonthLeaveDto; |
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceMonthLeaveQueryCriteria; |
| | |
| | | String attendanceDate = df.format(attendanceBusinessTravel.getTravelStartTime()); |
| | | dingTalkService.getDingTalkAttendanceListOfNoonOrNight(attendanceDate,userList); |
| | | } |
| | | |
| | | /** |
| | | * 批量审核(出差) |
| | | * @param request |
| | | */ |
| | | @Override |
| | | public void updateAgree(AgreeUpdateRequest request) throws Exception { |
| | | for(Long id : request.getIds()) { |
| | | AttendanceBusinessTravel attendanceBusinessTravel = attendanceBusinessTravelRepository.findById(id).orElseGet(AttendanceBusinessTravel::new); |
| | | ValidationUtil.isNull( attendanceBusinessTravel.getId(),"AttendanceBusinessTravel","id",id); |
| | | if (request.getNum().equals(Long.valueOf(1))){ |
| | | attendanceBusinessTravel.setApprovalStatus(Constant.BUSSINESS_APPROVE_STATUS_AGREE); |
| | | } else { |
| | | attendanceBusinessTravel.setApprovalStatus(Constant.BUSSINESS_APPROVE_STATUS_REFUSE); |
| | | } |
| | | attendanceBusinessTravelRepository.save(attendanceBusinessTravel); |
| | | // 调用定时任务修改考勤记录 |
| | | List<User> userList = new ArrayList<>(); |
| | | if(ObjectUtils.isNotEmpty(attendanceBusinessTravel.getUserId())){ |
| | | User user = userRepository.findById(attendanceBusinessTravel.getUserId()).orElseGet(User::new); |
| | | userList.add(user); |
| | | } |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String attendanceDate = df.format(attendanceBusinessTravel.getTravelStartTime()); |
| | | dingTalkService.getDingTalkAttendanceListOfNoonOrNight(attendanceDate,userList); |
| | | } |
| | | } |
| | | } |
| | |
| | | package me.zhengjie.modules.attendance.service.impl; |
| | | |
| | | import me.zhengjie.exception.BadRequestException; |
| | | import me.zhengjie.modules.attendance.domain.AgreeUpdateRequest; |
| | | import me.zhengjie.modules.attendance.domain.Attendance; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceCardreplacement; |
| | | import me.zhengjie.modules.attendance.domain.AttendanceMonth; |
| | | import me.zhengjie.modules.attendance.repository.AttendanceRepository; |
| | | import me.zhengjie.modules.attendance.service.dto.AttendanceDto; |
| | | import me.zhengjie.modules.constant.Constant; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 补卡批量审核 |
| | | * @param |
| | | */ |
| | | @Override |
| | | public void updateAgree(AgreeUpdateRequest request) { |
| | | // 循环ID列表 |
| | | for (Long id : request.getIds()) { |
| | | AttendanceCardreplacement AttendanceCardreplacement = attendanceCardreplacementRepository.findById(id).orElseGet(AttendanceCardreplacement::new); |
| | | ValidationUtil.isNull(AttendanceCardreplacement.getId(), "AttendanceCardreplacement", "id", id); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String attDate = sdf.format(AttendanceCardreplacement.getCardReplacementTime()); |
| | | // 根据userId和日期查询考勤记录表 |
| | | Attendance attendance = attendanceRepository.findAllByUserIdAndAttendanceDate(AttendanceCardreplacement.getUserId(), attDate.substring(0, 10)); |
| | | // 判断是上班补卡还是下班补卡 |
| | | if (AttendanceCardreplacement.getCardReplacementDistinguish().equals(Constant.CARD_REPLACEMENT_DIFFERENTIATION_GOON)) { |
| | | // 通过 |
| | | if (AttendanceCardreplacement.getApprovalStatus().equals(Constant.CARD_APPROVE_STATUS_REVIEWED) && request.getNum().equals(Long.valueOf(1))) { |
| | | // set考勤打卡时间和打卡状态 |
| | | attendance.setActualWorkStartTime(AttendanceCardreplacement.getCardReplacementTime()); |
| | | attendance.setStartClockResults(Constant.ATTENDANCE_STATE_NORMAL); |
| | | attendance.setStartLocationResults(Constant.LOCATION_RESULTS_NORMAL); |
| | | AttendanceCardreplacement.setApprovalStatus(Constant.CARD_APPROVE_STATUS_AGREE); |
| | | }else if (AttendanceCardreplacement.getApprovalStatus().equals(Constant.CARD_APPROVE_STATUS_REVIEWED) && request.getNum().equals(Long.valueOf(2))){ |
| | | attendance.setStartClockResults(Constant.ATTENDANCE_STATE_NOTSIGNED); |
| | | attendance.setStartLocationResults(Constant.LOCATION_RESULTS_NOTSIGNED); |
| | | AttendanceCardreplacement.setApprovalStatus(Constant.CARD_APPROVE_STATUS_REFUSE); |
| | | } |
| | | } else { |
| | | // 通过 |
| | | if (AttendanceCardreplacement.getApprovalStatus().equals(Constant.CARD_APPROVE_STATUS_REVIEWED) && request.getNum().equals(Long.valueOf(1))) { |
| | | // set考勤打卡时间和打卡状态 |
| | | attendance.setActualWorkEndTime(AttendanceCardreplacement.getCardReplacementTime()); |
| | | attendance.setEndClockResults(Constant.ATTENDANCE_STATE_NORMAL); |
| | | attendance.setEndLocationResults(Constant.LOCATION_RESULTS_NORMAL); |
| | | AttendanceCardreplacement.setApprovalStatus(Constant.CARD_APPROVE_STATUS_AGREE); |
| | | }else if (AttendanceCardreplacement.getApprovalStatus().equals(Constant.CARD_APPROVE_STATUS_REVIEWED) && request.getNum().equals(Long.valueOf(2))){ |
| | | attendance.setEndClockResults(Constant.ATTENDANCE_STATE_NOTSIGNED); |
| | | attendance.setEndLocationResults(Constant.LOCATION_RESULTS_NOTSIGNED); |
| | | AttendanceCardreplacement.setApprovalStatus(Constant.CARD_APPROVE_STATUS_REFUSE); |
| | | } |
| | | } |
| | | attendanceRepository.save(attendance); |
| | | attendanceCardreplacementRepository.save(AttendanceCardreplacement); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 审核功能 |
| | | * @param resources |
| | | */ |
| | |
| | | String attendanceDate = df.format(attendanceGoOut.getOutStartTime()); |
| | | dingTalkService.getDingTalkAttendanceListOfNoonOrNight(attendanceDate,userList); |
| | | } |
| | | |
| | | /** |
| | | * 批量审核(外出) |
| | | * @param request |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public void updateAgree(AgreeUpdateRequest request) throws Exception { |
| | | for (Long id : request.getIds()) { |
| | | AttendanceGoOut attendanceGoOut = attendanceGoOutRepository.findById(id).orElseGet(AttendanceGoOut::new); |
| | | ValidationUtil.isNull( attendanceGoOut.getId(),"AttendanceGoOut","id",id); |
| | | if (request.getNum().equals(Long.valueOf(1))){ |
| | | attendanceGoOut.setApprovalStatus(Constant.GOOUT_APPROVE_STATUS_AGREE); |
| | | } else { |
| | | attendanceGoOut.setApprovalStatus(Constant.GOOUT_APPROVE_STATUS_REFUSE); |
| | | } |
| | | attendanceGoOutRepository.save(attendanceGoOut); |
| | | // 调用定时任务修改考勤记录 |
| | | List<User> userList = new ArrayList<>(); |
| | | if(ObjectUtils.isNotEmpty(attendanceGoOut.getUserId())){ |
| | | User user = userRepository.findById(attendanceGoOut.getUserId()).orElseGet(User::new); |
| | | userList.add(user); |
| | | } |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String attendanceDate = df.format(attendanceGoOut.getOutStartTime()); |
| | | dingTalkService.getDingTalkAttendanceListOfNoonOrNight(attendanceDate,userList); |
| | | } |
| | | } |
| | | } |
| | |
| | | userList.add(user); |
| | | } |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String attendanceDate = df.format(attendanceLeave.getLeaveStartTime()); |
| | | String attendanceDate = df.format(attendanceLeave.getLeaveStartTime()); |
| | | dingTalkService.getDingTalkAttendanceListOfNoonOrNight(attendanceDate,userList); |
| | | } |
| | | |
| | | /** |
| | | * 批量审核 |
| | | * @param request |
| | | */ |
| | | @Override |
| | | public void updateAgree(AgreeUpdateRequest request) throws Exception { |
| | | // 循环ID列表 |
| | | for (Long id : request.getIds()) { |
| | | AttendanceLeave attendanceLeave = attendanceLeaveRepository.findById(id).orElseGet(AttendanceLeave::new); |
| | | ValidationUtil.isNull( attendanceLeave.getId(),"AttendanceLeave","id",id); |
| | | if (request.getNum().equals(Long.valueOf(1))) { |
| | | attendanceLeave.setApprovalStatus(Constant.APPROVAL_STATUS_PASSED); |
| | | } else { |
| | | attendanceLeave.setApprovalStatus(Constant.APPROVAL_STATUS_RETURNED); |
| | | } |
| | | attendanceLeaveRepository.save(attendanceLeave); |
| | | // 调用定时任务修改考勤记录 |
| | | List<User> userList = new ArrayList<>(); |
| | | if(ObjectUtils.isNotEmpty(attendanceLeave.getUserId())){ |
| | | User user = userRepository.findById(attendanceLeave.getUserId()).orElseGet(User::new); |
| | | userList.add(user); |
| | | } |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String attendanceDate = df.format(attendanceLeave.getLeaveStartTime()); |
| | | dingTalkService.getDingTalkAttendanceListOfNoonOrNight(attendanceDate,userList); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void deleteAll(Long[] ids) { |
| | | for (Long id : ids) { |
| | |
| | | noonResult1 = Double.valueOf(new BigDecimal((float) actualTime / 3600).setScale(2, BigDecimal.ROUND_HALF_UP).toString()); |
| | | } |
| | | // 没打卡的情况下,修改考勤打卡状态 |
| | | if(attendance.getStartClockResults().equals(Constant.ATTENDANCE_STATE_NOTSIGNED) && attendance.getEndClockResults().equals(Constant.ATTENDANCE_STATE_NOTSIGNED)){ |
| | | if(attendance.getStartClockResults().equals(Constant.ATTENDANCE_STATE_NOTSIGNED) && attendance.getEndClockResults().equals(Constant.ATTENDANCE_STATE_NOTSIGNED)){ |
| | | // duration为null说明是考勤信息按钮 |
| | | if(ObjectUtils.isEmpty(duration)){ |
| | | if(stDuration > 0 && enDuration == 0){ |
| | |
| | | // 判断循环是否结束 |
| | | if (i == sysConfigIndividualIncomeTaxDtoList.size() - 1) { |
| | | // 个人所得税 |
| | | salary.setIndividualIncomeTax(taxAmount); |
| | | // salary.setIndividualIncomeTax(taxAmount); |
| | | salary.setIndividualIncomeTax(new BigDecimal(0)); |
| | | // 税后金额 |
| | | salary.setAfterTaxAmount(taxableAmount.subtract(taxAmount).compareTo(new BigDecimal(0)) == -1 ? new BigDecimal(0) : taxableAmount.subtract(taxAmount)); |
| | | } |
| | |
| | | /* |
| | | * 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. |
| | | */ |
| | | * 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.salary.service.mapstruct; |
| | | |
| | | import me.zhengjie.base.BaseMapper; |
| | |
| | | import org.mapstruct.ReportingPolicy; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @author 赵士淞 |
| | | * @date 2023-01-03 |
| | | **/ |
| | | * @author 赵士淞 |
| | | * @website https://eladmin.vip |
| | | * @date 2023-01-03 |
| | | **/ |
| | | @Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) |
| | | public interface SalaryMapper extends BaseMapper<SalaryDto, Salary> { |
| | | |
| | |
| | | */ |
| | | @Query(value = "SELECT count(1) FROM sys_user WHERE level_id IN ?1", nativeQuery = true) |
| | | int countByLevels(Long[] ids); |
| | | |
| | | /** |
| | | * 查询部门 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Query(value = "SELECT u.* FROM sys_user u JOIN sys_dept d ON u.dept_id = d.dept_id WHERE d.dept_id = ?;", nativeQuery = true) |
| | | List<User> findByDeptId(Long dept_id); |
| | | |
| | | /** |
| | | * 查询用户 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Query(value = "SELECT * FROM sys_user WHERE user_id = ?;", nativeQuery = true) |
| | | List<User> findByUserId(Long user_id); |
| | | } |
| | |
| | | public ResponseEntity<Object> getUserBaseInfo(@PathVariable Date yearMonth) throws ParseException { |
| | | return new ResponseEntity<>(userService.getUserBaseInfo(yearMonth), HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping(value = "/getUserInfose") |
| | | @Log("查询用户信息") |
| | | @ApiOperation("查询用户信息") |
| | | public ResponseEntity<Object> getUserInfos() { |
| | | return new ResponseEntity<>(userService.getUserInfose(), HttpStatus.OK); |
| | | } |
| | | } |
| | |
| | | */ |
| | | Map getUserBaseInfo(Date yearMonth) throws ParseException; |
| | | |
| | | /** |
| | | * 查询用户 |
| | | */ |
| | | List<User> getUserInfose(); |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<User> getUserInfose() { |
| | | List<User> userList = new ArrayList<>(); |
| | | //获取当前登入人信息 |
| | | User user1 = userRepository.getOne(SecurityUtils.getCurrentUserId()); |
| | | Role role = user1.getRoles().iterator().next(); |
| | | //超管、总经理查看全部 |
| | | if(role.getId() == Constant.ROLE_LEVEL_SUPER || role.getId() == Constant.ROLE_LEVEL_GENERAL){ |
| | | userList = userRepository.findAllByEnabled(true); |
| | | } else { |
| | | userList = userRepository.findByUserId(user1.getId()); |
| | | } |
| | | return userList; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void delete(Set<Long> ids) { |
| | | for (Long id : ids) { |
| | |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del, getAll, getRemainingTime, approve } |
| | | export function updateAgree(data) { |
| | | return request({ |
| | | url: 'api/attendanceBusinessTravel/updateAgree', |
| | | method: 'put', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del, getAll, getRemainingTime, approve, updateAgree } |
| | |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del, getAll, revoke, approve } |
| | | export function updateAgree(data) { |
| | | return request({ |
| | | url: 'api/attendanceCardreplacement/updateAgree', |
| | | method: 'put', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del, getAll, revoke, approve, updateAgree } |
| | |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del, getAll, getRemainingTime, approve } |
| | | export function updateAgree(data) { |
| | | return request({ |
| | | url: 'api/attendanceGoOut/updateAgree', |
| | | method: 'put', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del, getAll, getRemainingTime, approve, updateAgree } |
| | |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del, getAll, calcTimeLength, getYearTimeLength, approve } |
| | | export function updateAgree(data) { |
| | | return request({ |
| | | url: 'api/attendanceLeave/updateAgree', |
| | | method: 'put', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del, getAll, calcTimeLength, getYearTimeLength, approve, updateAgree } |
| | |
| | | }) |
| | | } |
| | | |
| | | export default { getAll, add, edit, del, get, getApprovalUsers, getUserCalendarInfo, getUserBaseInfo } |
| | | export function getUserInfose() { |
| | | return request({ |
| | | url: 'api/users/getUserInfose/', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | export default { getAll, add, edit, del, get, getApprovalUsers, getUserCalendarInfo, getUserBaseInfo, getUserInfose } |
| | |
| | | </el-button> |
| | | <el-button |
| | | slot="right" |
| | | v-permission="permission.addAttendanceInfo" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | |
| | | <el-form-item label="所属员工" prop="userId"> |
| | | <el-select v-model="attform.userId" filterable clearable placeholder="请选择" style="width: 370px;"> |
| | | <el-option |
| | | v-for="item in users" |
| | | v-for="item in users1" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | |
| | | dictStartEarly: constant.ATTENDANCE_STATE_EARLY, |
| | | dictStartLate: constant.ATTENDANCE_STATE_LATE, |
| | | users: [], |
| | | users1: [], |
| | | approvalUsers: [], |
| | | makeUpCardVisible: false, |
| | | makeUpCardLoading: false, |
| | |
| | | // 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
| | | [CRUD.HOOK.beforeRefresh]() { |
| | | this.getUsers() |
| | | this.getUsers1() |
| | | this.getApprovalUsers() |
| | | return true |
| | | }, |
| | |
| | | this.users = res |
| | | }) |
| | | }, |
| | | // 查询员工 |
| | | getUsers1() { |
| | | crudUser.getUserInfose().then(res => { |
| | | this.users1 = res |
| | | }) |
| | | }, |
| | | // 查询审核人 |
| | | getApprovalUsers() { |
| | | crudUser.getApprovalUsers().then(res => { |
| | |
| | | <rrOperation /> |
| | | </div> |
| | | <!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
| | | <crudOperation :permission="permission" /> |
| | | <crudOperation :permission="permission"> |
| | | <el-button |
| | | slot="right" |
| | | v-permission="permission.seeDivide" |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-circle-check" |
| | | :disabled="crud.selections.length < 1 || !crud.selections.every(selection => selection.approvalStatus === dictGoOutAppRev)" |
| | | style="margin-left: 4px !important;" |
| | | @click="toAgree(1, crud.selections)" |
| | | > |
| | | 批量同意 |
| | | </el-button> |
| | | <el-button |
| | | slot="right" |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-error" |
| | | :disabled="crud.selections.length < 1 || !crud.selections.every(selection => selection.approvalStatus === dictGoOutAppRev)" |
| | | style="margin-left: 4px !important;" |
| | | @click="toAgree(2, crud.selections)" |
| | | > |
| | | 批量拒绝 |
| | | </el-button> |
| | | </crudOperation> |
| | | <!--表单组件--> |
| | | <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"> |
| | |
| | | this.form.travelReason = data.travelReason |
| | | this.form.remarks = data.remarks |
| | | }, |
| | | // 批量审核 |
| | | toAgree(Number, data) { |
| | | const msg = Number === 2 ? '批量拒绝' : '批量同意' |
| | | const msg1 = Number === 2 ? 'error' : 'success' |
| | | // 确认框 |
| | | this.$confirm('此操作将' + msg + '审核内容是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: msg1 |
| | | }).then(() => { |
| | | const ids = [] |
| | | // 循环数据 |
| | | for (let i = 0; i < data.length; i++) { |
| | | // ID列表 |
| | | ids.push(data[i].id) |
| | | } |
| | | crudAttendanceBusinessTravel.updateAgree({ |
| | | num: Number, |
| | | ids: ids |
| | | }).then(res => { |
| | | // 消息提示 |
| | | this.$message({ |
| | | type: 'success', |
| | | message: msg + '!' |
| | | }) |
| | | // 刷新数据 |
| | | this.crud.refresh() |
| | | }) |
| | | }) |
| | | }, |
| | | // 审核提交功能 |
| | | approveFunction(Number, data) { |
| | | this.form.userId = data.userId |
| | |
| | | <rrOperation /> |
| | | </div> |
| | | <!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
| | | <crudOperation :permission="permission" /> |
| | | <crudOperation :permission="permission"> |
| | | <el-button |
| | | slot="right" |
| | | v-permission="permission.seeDivide" |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-circle-check" |
| | | :disabled="crud.selections.length < 1 || !crud.selections.every(selection => selection.approvalStatus === dictCardApproveStatusReviewed)" |
| | | style="margin-left: 4px !important;" |
| | | @click="toAgree(1, crud.selections)" |
| | | > |
| | | 批量同意 |
| | | </el-button> |
| | | <el-button |
| | | slot="right" |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-error" |
| | | :disabled="crud.selections.length < 1 || !crud.selections.every(selection => selection.approvalStatus === dictCardApproveStatusReviewed)" |
| | | style="margin-left: 4px !important;" |
| | | @click="toAgree(2, crud.selections)" |
| | | > |
| | | 批量拒绝 |
| | | </el-button> |
| | | </crudOperation> |
| | | <!--表单组件--> |
| | | <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"> |
| | |
| | | this.form.cardReplacementReason = data.cardReplacementReason |
| | | this.form.cardReplacementDistinguish = data.cardReplacementDistinguish |
| | | }, |
| | | // 批量审核 |
| | | toAgree(Number, data) { |
| | | const msg = Number === 2 ? '批量拒绝' : '批量同意' |
| | | const msg1 = Number === 2 ? 'error' : 'success' |
| | | // 确认框 |
| | | this.$confirm('此操作将' + msg + '审核内容是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: msg1 |
| | | }).then(() => { |
| | | const ids = [] |
| | | // 循环数据 |
| | | for (let i = 0; i < data.length; i++) { |
| | | // ID列表 |
| | | ids.push(data[i].id) |
| | | } |
| | | crudAttendanceCardreplacement.updateAgree({ |
| | | num: Number, |
| | | ids: ids |
| | | }).then(res => { |
| | | // 消息提示 |
| | | this.$message({ |
| | | type: 'success', |
| | | message: msg + '!' |
| | | }) |
| | | // 刷新数据 |
| | | this.crud.refresh() |
| | | }) |
| | | }) |
| | | }, |
| | | // 审核功能 |
| | | approveFunction(Number, data) { |
| | | this.form.userId = data.userId |
| | |
| | | <rrOperation /> |
| | | </div> |
| | | <!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
| | | <crudOperation :permission="permission" /> |
| | | <crudOperation :permission="permission"> |
| | | <el-button |
| | | slot="right" |
| | | v-permission="permission.seeDivide" |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-circle-check" |
| | | :disabled="crud.selections.length < 1 || !crud.selections.every(selection => selection.approvalStatus === dictGoOutAppRev)" |
| | | style="margin-left: 4px !important;" |
| | | @click="toAgree(1, crud.selections)" |
| | | > |
| | | 批量同意 |
| | | </el-button> |
| | | <el-button |
| | | slot="right" |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-error" |
| | | :disabled="crud.selections.length < 1 || !crud.selections.every(selection => selection.approvalStatus === dictGoOutAppRev)" |
| | | style="margin-left: 4px !important;" |
| | | @click="toAgree(2, crud.selections)" |
| | | > |
| | | 批量拒绝 |
| | | </el-button> |
| | | </crudOperation> |
| | | <!--表单组件--> |
| | | <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"> |
| | |
| | | this.form.outReason = data.outReason |
| | | this.form.remarks = data.remarks |
| | | }, |
| | | // 批量审核 |
| | | toAgree(Number, data) { |
| | | const msg = Number === 2 ? '批量拒绝' : '批量同意' |
| | | const msg1 = Number === 2 ? 'error' : 'success' |
| | | // 确认框 |
| | | this.$confirm('此操作将' + msg + '审核内容是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: msg1 |
| | | }).then(() => { |
| | | const ids = [] |
| | | // 循环数据 |
| | | for (let i = 0; i < data.length; i++) { |
| | | // ID列表 |
| | | ids.push(data[i].id) |
| | | } |
| | | crudAttendanceGoOut.updateAgree({ |
| | | num: Number, |
| | | ids: ids |
| | | }).then(res => { |
| | | // 消息提示 |
| | | this.$message({ |
| | | type: 'success', |
| | | message: msg + '!' |
| | | }) |
| | | // 刷新数据 |
| | | this.crud.refresh() |
| | | }) |
| | | }) |
| | | }, |
| | | // 审核提交功能 |
| | | approveFunction(Number, data) { |
| | | this.form.userId = data.userId |
| | |
| | | <rrOperation /> |
| | | </div> |
| | | <!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
| | | <crudOperation :permission="permission" /> |
| | | <crudOperation :permission="permission"> |
| | | <el-button |
| | | slot="right" |
| | | v-permission="permission.seeDivide" |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-circle-check" |
| | | :disabled="crud.selections.length < 1 || !crud.selections.every(selection => selection.approvalStatus === dictAppRovalStatusUnderAppover)" |
| | | style="margin-left: 4px !important;" |
| | | @click="toAgree(1, crud.selections)" |
| | | > |
| | | 批量同意 |
| | | </el-button> |
| | | <el-button |
| | | slot="right" |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-error" |
| | | :disabled="crud.selections.length < 1 || !crud.selections.every(selection => selection.approvalStatus === dictAppRovalStatusUnderAppover)" |
| | | style="margin-left: 4px !important;" |
| | | @click="toAgree(2, crud.selections)" |
| | | > |
| | | 批量拒绝 |
| | | </el-button> |
| | | </crudOperation> |
| | | <!--表单组件--> |
| | | <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"> |
| | |
| | | } |
| | | }) |
| | | }, |
| | | // 查询员工剩余年假时长 |
| | | // getUserTimes() { |
| | | // crudAttendanceLeave.getYearTimeLength().then(res => { |
| | | // this.yearTimeLenght = res |
| | | // }) |
| | | // }, |
| | | // 批量审核 |
| | | toAgree(Number, data) { |
| | | const msg = Number === 2 ? '批量拒绝' : '批量同意' |
| | | const msg1 = Number === 2 ? 'error' : 'success' |
| | | // 确认框 |
| | | this.$confirm('此操作将' + msg + '审核内容是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: msg1 |
| | | }).then(() => { |
| | | const ids = [] |
| | | // 循环数据 |
| | | for (let i = 0; i < data.length; i++) { |
| | | // ID列表 |
| | | ids.push(data[i].id) |
| | | } |
| | | crudAttendanceLeave.updateAgree({ |
| | | num: Number, |
| | | ids: ids |
| | | }).then(res => { |
| | | // 消息提示 |
| | | this.$message({ |
| | | type: 'success', |
| | | message: msg + '!' |
| | | }) |
| | | // 刷新数据 |
| | | this.crud.refresh() |
| | | }) |
| | | }) |
| | | }, |
| | | // 审批页面赋值 |
| | | toApprove(data, Number) { |
| | | if (Number !== '1') { |