| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.lavorissue.dto.StatisticsLaborIssue; |
| | | import com.ruoyi.lavorissue.mapper.LavorIssueMapper; |
| | | import com.ruoyi.lavorissue.pojo.LaborIssue; |
| | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "劳保发放-分页查询", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "劳保发放-分页查询") |
| | | public AjaxResult listPage(Page page, LaborIssue laborIssue){ |
| | | public R<?> listPage(Page page, LaborIssue laborIssue){ |
| | | IPage<LaborIssue> listPage = laborIssueService.listPage(page, laborIssue); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @GetMapping("/statisticsList") |
| | | @Log(title = "劳保发放-统计查询", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "劳保发放-统计查询") |
| | | public AjaxResult statisticsList(LaborIssue laborIssue){ |
| | | public R<?> statisticsList(LaborIssue laborIssue){ |
| | | List<Map<String, Object>> listPage = laborIssueService.statisticsList(laborIssue); |
| | | return AjaxResult.success(listPage); |
| | | return R.ok(listPage); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Log(title = "劳保发放-添加", businessType = BusinessType.INSERT) |
| | | @Operation(summary = "劳保发放-添加") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody LaborIssue laborIssue){ |
| | | public R<?> add(@RequestBody LaborIssue laborIssue){ |
| | | String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); |
| | | StartAndEndDateDto dateTime = DailyRedisCounter.getDateTime(); |
| | | Long approveId = lavorIssueMapper.selectCount(new LambdaQueryWrapper<LaborIssue>() |
| | |
| | | laborIssue.setOrderNo(String.format("%03d", l + 1)); |
| | | } |
| | | boolean save = laborIssueService.save(laborIssue); |
| | | return save ? AjaxResult.success() : AjaxResult.error(); |
| | | return save ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Log(title = "劳保发放-修改", businessType = BusinessType.UPDATE) |
| | | @Operation(summary = "劳保发放-修改") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody LaborIssue laborIssue){ |
| | | public R<?> update(@RequestBody LaborIssue laborIssue){ |
| | | boolean update = laborIssueService.updateById(laborIssue); |
| | | return update ? AjaxResult.success() : AjaxResult.error(); |
| | | return update ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Log(title = "劳保发放-删除", businessType = BusinessType.DELETE) |
| | | @Operation(summary = "劳保发放-删除") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | public R<?> delete(@RequestBody List<Long> ids){ |
| | | boolean delete = laborIssueService.removeBatchByIds(ids); |
| | | return delete ? AjaxResult.success() : AjaxResult.error(); |
| | | return delete ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @GetMapping("/statistics") |
| | | @Operation(summary = "劳保发放-统计") |
| | | public AjaxResult statistics(StatisticsLaborIssue req) throws Exception { |
| | | public R<?> statistics(StatisticsLaborIssue req) throws Exception { |
| | | StatisticsLaborIssue statisticsLaborIssue = laborIssueService.statistics(req); |
| | | return AjaxResult.success(statisticsLaborIssue); |
| | | return R.ok(statisticsLaborIssue); |
| | | } |
| | | |
| | | |