| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.dto.CleanerDTO; |
| | | import com.ruoyi.system.dto.ProjectDeptDTO; |
| | | import com.ruoyi.system.model.TCleaner; |
| | | import com.ruoyi.system.model.TProjectDept; |
| | | import com.ruoyi.system.query.CleanerListQuery; |
| | | import com.ruoyi.system.query.ProjectDeptListQuery; |
| | | import com.ruoyi.system.service.TCleanerService; |
| | | import com.ruoyi.system.service.TProjectDeptService; |
| | | import com.ruoyi.system.vo.system.CleanerListVO; |
| | | import com.ruoyi.system.vo.system.ProjectDeptListVO; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/t-cleaner") |
| | | public class TCleanerController { |
| | | @Resource |
| | | private TCleanerService cleanerService; |
| | | |
| | | |
| | | @ApiOperation(value = "保洁员分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<CleanerListVO>> pageList(@RequestBody CleanerListQuery query) { |
| | | return R.ok(cleanerService.pageList(query)); |
| | | } |
| | | @Log(title = "新增保洁员", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "新增保洁员") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@RequestBody CleanerDTO dto) { |
| | | cleanerService.save(dto); |
| | | return R.ok(); |
| | | } |
| | | @Log(title = "编辑保洁员", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "编辑保洁员") |
| | | @PostMapping(value = "/edit") |
| | | public R<Boolean> edit(@RequestBody CleanerDTO dto) { |
| | | cleanerService.updateById(dto); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "详情保洁员") |
| | | @PostMapping(value = "/detail") |
| | | public R<TCleaner> detail(@RequestParam String id) { |
| | | return R.ok(cleanerService.getById(id)); |
| | | } |
| | | @Log(title = "批量删除保洁员", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除保洁员") |
| | | @DeleteMapping(value = "/delete") |
| | | public R<Boolean> edit(@RequestParam String ids) { |
| | | String[] split = ids.split(","); |
| | | cleanerService.removeBatchByIds(Arrays.asList(split)); |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |