| | |
| | | import com.ruoyi.collaborativeApproval.pojo.SealApplicationManagement; |
| | | import com.ruoyi.collaborativeApproval.service.RulesRegulationsManagementService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | @GetMapping("/getList") |
| | | @ApiOperation("分页查询") |
| | | @Log(title = "分页查询规章制度管理", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, RulesRegulationsManagement rulesRegulationsManagement){ |
| | | return AjaxResult.success(rulesRegulationsManagementService.listPage(page, rulesRegulationsManagement)); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("新增") |
| | | @Log(title = "新增规章制度管理", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody RulesRegulationsManagement rulesRegulationsManagement){ |
| | | rulesRegulationsManagementService.save(rulesRegulationsManagement); |
| | | return AjaxResult.success(rulesRegulationsManagement.getId()); |
| | |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("修改") |
| | | @Log(title = "修改规章制度管理", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody RulesRegulationsManagement rulesRegulationsManagement){ |
| | | return AjaxResult.success(rulesRegulationsManagementService.updateById(rulesRegulationsManagement)); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("删除") |
| | | @Log(title = "删除规章制度管理", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@PathVariable("ids") List<Long> ids){ |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | throw new RuntimeException("请传入要删除的ID"); |
| | |
| | | //规则查看时新增阅读状态 |
| | | @PostMapping("/addReadingStatus") |
| | | @ApiOperation("新增阅读状态") |
| | | @Log(title = "新增规章制度管理阅读状态", businessType = BusinessType.INSERT) |
| | | public AjaxResult addReadingStatus(@RequestBody ReadingStatus readingStatus){ |
| | | return AjaxResult.success(readingStatusMapper.insert(readingStatus)); |
| | | } |
| | | @PostMapping("/updateReadingStatus") |
| | | @ApiOperation("修改阅读状态") |
| | | @Log(title = "修改规章制度管理阅读状态", businessType = BusinessType.UPDATE) |
| | | public AjaxResult updateReadingStatus(@RequestBody ReadingStatus readingStatus){ |
| | | return AjaxResult.success(readingStatusMapper.updateById(readingStatus)); |
| | | } |
| | | @GetMapping("/getReadingStatusList") |
| | | @ApiOperation("分页查询阅读状态") |
| | | @Log(title = "分页查询规章制度管理阅读状态", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, ReadingStatus readingStatus){ |
| | | return AjaxResult.success(readingStatusMapper.selectPage(page,new QueryWrapper<ReadingStatus>(readingStatus))); |
| | | } |
| | | @GetMapping("/getReadingStatusByRuleId/{ruleId}") |
| | | @ApiOperation("根据制度id查询阅读状态") |
| | | @Log(title = "根据规章制度管理id查询阅读状态", businessType = BusinessType.OTHER) |
| | | public AjaxResult getReadingStatusByRuleId(@PathVariable Long ruleId){ |
| | | return AjaxResult.success(readingStatusMapper.selectList(new QueryWrapper<ReadingStatus>().eq("rule_id", ruleId))); |
| | | } |
| | | |
| | | @ApiOperation(value = "规章制度管理导出") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response) { |
| | | @Log(title = "规章制度管理导出", businessType = BusinessType.EXPORT) |
| | | public void export(HttpServletResponse response) { |
| | | List<RulesRegulationsManagement> accountExpenses = rulesRegulationsManagementService.list(); |
| | | ExcelUtil<RulesRegulationsManagement> util = new ExcelUtil<RulesRegulationsManagement>(RulesRegulationsManagement.class); |
| | | util.exportExcel(response, accountExpenses, "规章制度管理导出"); |