| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | |
| | | |
| | | private final IAttendanceService attendanceService; |
| | | |
| | | // private final IEnclosureService iEnclosureService; |
| | | |
| | | private final IDictBizService iDictBizService; |
| | | |
| | | private final IUserService userService; |
| | |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入attendance") |
| | | public R<IPage<AttendanceVO>> page(AttendanceVO attendance, Query query, Long department) { |
| | | IPage<Attendance> pages = attendanceService.selectAttendancePage(Condition.getPage(query), department, attendance); |
| | | return R.data(AttendanceWrapper.build().pageVO(pages)); |
| | | public R<IPage<AttendanceVO>> page(AttendanceVO attendance, Query query) { |
| | | IPage<AttendanceVO> pages = attendanceService.selectAttendancePage(Condition.getPage(query), attendance); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | // /** |
| | | // * 保安位置比对 |
| | | // */ |
| | | // @GetMapping("/positionThan") |
| | | // public R positionThan(@Valid Attendance attendance, HttpServletResponse response) { |
| | | // response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | // response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | // response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | | // Enclosure enclosure = new Enclosure(); |
| | | // enclosure.setAnumber(attendance.getNumber()); |
| | | // //查询当前处警人员的电子围栏信息 |
| | | // Boolean onArea = iEnclosureService.isOnArea(attendance.getJd(),attendance.getWd(),enclosure); |
| | | // if (onArea){ |
| | | // return R.data(true); |
| | | // } |
| | | // return R.data(false); |
| | | // } |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 导出用户 |
| | | * 导出考勤数据 |
| | | * @param response |
| | | * @param attendance |
| | | */ |
| | | @GetMapping("/export-Attendance") |
| | | public void exportAttendane(String name, String beginTime, String endTime, String attendancetype, HttpServletResponse response) { |
| | | String beginTimes = null; |
| | | String endTimes = null; |
| | | String attendancetypes = null; |
| | | if (beginTime.equals("undefined ") && endTime.equals("undefined")) { |
| | | beginTimes=null; |
| | | endTimes=null; |
| | | attendancetypes=attendancetype; |
| | | } |
| | | else if (attendancetype.equals("undefined")){ |
| | | attendancetypes=null; |
| | | } |
| | | else { |
| | | beginTimes=beginTime; |
| | | endTimes=endTime; |
| | | attendancetypes=attendancetype; |
| | | } |
| | | |
| | | List<AttendanceExcel> list = attendanceService.exportAttendane(name, beginTimes, endTimes, attendancetypes); |
| | | public void exportAttendane(AttendanceVO attendance, HttpServletResponse response) { |
| | | List<AttendanceExcel> list = attendanceService.exportAttendane(attendance); |
| | | ExcelUtil.export(response, "考勤数据" + DateUtil.time(), "考勤数据表", list, AttendanceExcel.class); |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | } |