123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- package com.ruoyi.web.controller.zhdd;
- import java.util.List;
- import java.util.Arrays;
- import java.util.concurrent.TimeUnit;
- import lombok.RequiredArgsConstructor;
- import javax.servlet.http.HttpServletResponse;
- import javax.validation.constraints.*;
- import org.springframework.security.access.prepost.PreAuthorize;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import org.springframework.validation.annotation.Validated;
- import com.ruoyi.common.annotation.RepeatSubmit;
- import com.ruoyi.common.annotation.Log;
- import com.ruoyi.common.core.controller.BaseController;
- import com.ruoyi.common.core.domain.AjaxResult;
- import com.ruoyi.common.core.validate.AddGroup;
- import com.ruoyi.common.core.validate.EditGroup;
- import com.ruoyi.common.core.validate.QueryGroup;
- import com.ruoyi.common.enums.BusinessType;
- import com.ruoyi.common.utils.poi.ExcelUtil;
- import com.ruoyi.zhdd.domain.vo.JgyDutyCommandContVo;
- import com.ruoyi.zhdd.domain.bo.JgyDutyCommandContBo;
- import com.ruoyi.zhdd.service.IJgyDutyCommandContService;
- import com.ruoyi.common.core.page.TableDataInfo;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- /**
- * 日常值班登记Controller
- *
- * @author ruoyi
- * @date 2021-09-22
- */
- @Validated
- @Api(value = "日常值班登记控制器", tags = {"日常值班登记管理"})
- @RequiredArgsConstructor(onConstructor_ = @Autowired)
- @RestController
- @RequestMapping("/zhdd/dutyCommandCont")
- public class JgyDutyCommandContController extends BaseController {
- private final IJgyDutyCommandContService iJgyDutyCommandContService;
- /**
- * 查询日常值班登记列表
- */
- @ApiOperation("查询日常值班登记列表")
- @PreAuthorize("@ss.hasPermi('zhdd:dutyCommandCont:list')")
- @GetMapping("/list")
- public TableDataInfo<JgyDutyCommandContVo> list(@Validated(QueryGroup.class) JgyDutyCommandContBo bo) {
- return iJgyDutyCommandContService.queryPageList(bo);
- }
- /**
- * 导出日常值班登记列表
- */
- @ApiOperation("导出日常值班登记列表")
- @PreAuthorize("@ss.hasPermi('zhdd:dutyCommandCont:export')")
- @Log(title = "日常值班登记", businessType = BusinessType.EXPORT)
- @GetMapping("/export")
- public void export(@Validated JgyDutyCommandContBo bo, HttpServletResponse response) {
- List<JgyDutyCommandContVo> list = iJgyDutyCommandContService.queryList(bo);
- ExcelUtil.exportExcel(list, "日常值班登记", JgyDutyCommandContVo.class, response);
- }
- /**
- * 获取日常值班登记详细信息
- */
- @ApiOperation("获取日常值班登记详细信息")
- @PreAuthorize("@ss.hasPermi('zhdd:dutyCommandCont:query')")
- @GetMapping("/{duId}")
- public AjaxResult<JgyDutyCommandContVo> getInfo(@NotNull(message = "主键不能为空")
- @PathVariable("duId") Long duId) {
- return AjaxResult.success(iJgyDutyCommandContService.queryById(duId));
- }
- /**
- * 新增日常值班登记
- */
- @ApiOperation("新增日常值班登记")
- @PreAuthorize("@ss.hasPermi('zhdd:dutyCommandCont:add')")
- @Log(title = "日常值班登记", businessType = BusinessType.INSERT)
- @RepeatSubmit()
- @PostMapping()
- public AjaxResult<Void> add(@Validated(AddGroup.class) @RequestBody JgyDutyCommandContBo bo) {
- return toAjax(iJgyDutyCommandContService.insertByBo(bo) ? 1 : 0);
- }
- /**
- * 修改日常值班登记
- */
- @ApiOperation("修改日常值班登记")
- @PreAuthorize("@ss.hasPermi('zhdd:dutyCommandCont:edit')")
- @Log(title = "日常值班登记", businessType = BusinessType.UPDATE)
- @RepeatSubmit()
- @PutMapping()
- public AjaxResult<Void> edit(@Validated(EditGroup.class) @RequestBody JgyDutyCommandContBo bo) {
- return toAjax(iJgyDutyCommandContService.updateByBo(bo) ? 1 : 0);
- }
- /**
- * 删除日常值班登记
- */
- @ApiOperation("删除日常值班登记")
- @PreAuthorize("@ss.hasPermi('zhdd:dutyCommandCont:remove')")
- @Log(title = "日常值班登记" , businessType = BusinessType.DELETE)
- @DeleteMapping("/{duIds}")
- public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
- @PathVariable Long[] duIds) {
- return toAjax(iJgyDutyCommandContService.deleteWithValidByIds(Arrays.asList(duIds), true) ? 1 : 0);
- }
- }
|