| | |
| | | import com.ruoyi.approve.mapper.WorkingHoursSettingMapper; |
| | | import com.ruoyi.approve.pojo.*; |
| | | import com.ruoyi.approve.service.HolidaySettingsService; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getList") |
| | | @Log(title = "获取假期设置列表", businessType = BusinessType.OTHER) |
| | | public AjaxResult getList(@RequestParam(defaultValue = "1") long current, |
| | | @RequestParam(defaultValue = "50") long size, HolidaySettings holidaySettings) { |
| | | Page page = new Page(current, size); |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | @Log(title = "添假期设置", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody HolidaySettings holidaySettings){ |
| | | return AjaxResult.success(holidaySettingsService.save(holidaySettings)); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | @Log(title = "更新假期设置", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody HolidaySettings holidaySettings){ |
| | | return AjaxResult.success(holidaySettingsService.updateById(holidaySettings)); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | @Log(title = "删除假期设置", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID"); |
| | | return AjaxResult.success(holidaySettingsService.removeByIds(ids)); |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getAnnualLeaveSettingList") |
| | | @Log(title = "获取年假规则列表", businessType = BusinessType.OTHER) |
| | | public AjaxResult getAnnualLeaveSettingList(@RequestParam(defaultValue = "1") long current, |
| | | @RequestParam(defaultValue = "50") long size, AnnualLeaveSetting annualLeaveSetting) { |
| | | Page page = new Page(current, size); |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/addAnnualLeaveSetting") |
| | | @Log(title = "添年假规则", businessType = BusinessType.INSERT) |
| | | public AjaxResult addAnnualLeaveSetting(@RequestBody AnnualLeaveSetting annualLeaveSetting){ |
| | | return AjaxResult.success(annualLeaveSettingMapper.insert(annualLeaveSetting)); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateAnnualLeaveSetting") |
| | | @Log(title = "更新年假规则", businessType = BusinessType.UPDATE) |
| | | public AjaxResult updateAnnualLeaveSetting(@RequestBody AnnualLeaveSetting annualLeaveSetting){ |
| | | return AjaxResult.success(annualLeaveSettingMapper.updateById(annualLeaveSetting)); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/deleteAnnualLeaveSetting") |
| | | @Log(title = "删除年假规则", businessType = BusinessType.DELETE) |
| | | public AjaxResult deleteAnnualLeaveSetting(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID"); |
| | | return AjaxResult.success(annualLeaveSettingMapper.deleteBatchIds(ids)); |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getOvertimeSettingList") |
| | | @Log(title = "获取加班规则列表", businessType = BusinessType.OTHER) |
| | | public AjaxResult getOvertimeSettingList(@RequestParam(defaultValue = "1") long current, |
| | | @RequestParam(defaultValue = "50") long size, OvertimeSetting overtimeSetting) { |
| | | Page page = new Page(current, size); |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/addOvertimeSetting") |
| | | @Log(title = "添加班规则", businessType = BusinessType.INSERT) |
| | | public AjaxResult addOvertimeSetting(@RequestBody OvertimeSetting overtimeSetting){ |
| | | return AjaxResult.success(overtimeSettingMapper.insert(overtimeSetting)); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateOvertimeSetting") |
| | | @Log(title = "更新加班规则", businessType = BusinessType.UPDATE) |
| | | public AjaxResult updateOvertimeSetting(@RequestBody OvertimeSetting overtimeSetting){ |
| | | return AjaxResult.success(overtimeSettingMapper.updateById(overtimeSetting)); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/deleteOvertimeSetting") |
| | | @Log(title = "删除加班规则", businessType = BusinessType.DELETE) |
| | | public AjaxResult deleteOvertimeSetting(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID"); |
| | | return AjaxResult.success(overtimeSettingMapper.deleteBatchIds(ids)); |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getWorkingHoursSettingList") |
| | | @Log(title = "获取上班时间设置-班制规则列表", businessType = BusinessType.OTHER) |
| | | public AjaxResult getWorkingHoursSettingList(@RequestParam(defaultValue = "1") long current, |
| | | @RequestParam(defaultValue = "50") long size, WorkingHoursSetting workingHoursSetting) { |
| | | Page page = new Page(current, size); |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/addWorkingHoursSetting") |
| | | @Log(title = "添班制规则", businessType = BusinessType.INSERT) |
| | | public AjaxResult addWorkingHoursSetting(@RequestBody WorkingHoursSetting workingHoursSetting){ |
| | | return AjaxResult.success(workingHoursSettingMapper.insert(workingHoursSetting)); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateWorkingHoursSetting") |
| | | @Log(title = "更新班制规则", businessType = BusinessType.UPDATE) |
| | | public AjaxResult updateWorkingHoursSetting(@RequestBody WorkingHoursSetting workingHoursSetting){ |
| | | return AjaxResult.success(workingHoursSettingMapper.updateById(workingHoursSetting)); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/deleteWorkingHoursSetting") |
| | | @Log(title = "删除班制规则", businessType = BusinessType.DELETE) |
| | | public AjaxResult deleteWorkingHoursSetting(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID"); |
| | | return AjaxResult.success(workingHoursSettingMapper.deleteBatchIds(ids)); |