|
|
|
@ -1,27 +1,18 @@
|
|
|
|
|
package com.ruoyi.web.controller.common;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
|
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
|
|
|
|
import com.ruoyi.common.bo.AnnexQueryBo;
|
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
|
import com.ruoyi.common.domain.Annex;
|
|
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
|
|
import com.ruoyi.common.service.IAnnexService;
|
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
import javax.validation.constraints.NotEmpty;
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import static com.ruoyi.common.constant.Constants.WGZ;
|
|
|
|
@ -43,72 +34,72 @@ public class AnnexController extends BaseController {
|
|
|
|
|
/**
|
|
|
|
|
* 查询附件列表
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation("查询附件列表")
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('common:annex:list')")
|
|
|
|
|
@GetMapping("/list")
|
|
|
|
|
public TableDataInfo<Annex> list(@Validated AnnexQueryBo bo) {
|
|
|
|
|
return iAnnexService.queryPageList(bo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 导出附件列表
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation("导出附件列表")
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('common:annex:export')")
|
|
|
|
|
@Log(title = "附件", businessType = BusinessType.EXPORT)
|
|
|
|
|
@GetMapping("/export")
|
|
|
|
|
public AjaxResult<Annex> export(@Validated AnnexQueryBo bo) {
|
|
|
|
|
List<Annex> list = iAnnexService.queryList(bo);
|
|
|
|
|
ExcelUtil<Annex> util = new ExcelUtil<Annex>(Annex.class);
|
|
|
|
|
return util.exportExcel(list, "附件");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取附件详细信息
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation("获取附件详细信息")
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('common:annex:query')")
|
|
|
|
|
@GetMapping("/{id}")
|
|
|
|
|
public AjaxResult<Annex> getInfo(@NotNull(message = "主键不能为空")
|
|
|
|
|
@PathVariable("id") String id) {
|
|
|
|
|
return AjaxResult.success(iAnnexService.queryById(id));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 新增附件
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation("新增附件")
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('common:annex:add')")
|
|
|
|
|
@Log(title = "附件", businessType = BusinessType.INSERT)
|
|
|
|
|
@RepeatSubmit
|
|
|
|
|
@PostMapping()
|
|
|
|
|
public AjaxResult<Void> add(@Validated @RequestBody Annex bo) {
|
|
|
|
|
return toAjax(iAnnexService.insert(bo) ? 1 : 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改附件
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation("修改附件")
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('common:annex:edit')")
|
|
|
|
|
@Log(title = "附件", businessType = BusinessType.UPDATE)
|
|
|
|
|
@RepeatSubmit
|
|
|
|
|
@PutMapping()
|
|
|
|
|
public AjaxResult<Void> edit(@Validated @RequestBody Annex bo) {
|
|
|
|
|
return toAjax(iAnnexService.update(bo) ? 1 : 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 删除附件
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation("删除附件")
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('common:annex:remove')")
|
|
|
|
|
@Log(title = "附件" , businessType = BusinessType.DELETE)
|
|
|
|
|
@DeleteMapping("/{ids}")
|
|
|
|
|
public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
|
|
|
@PathVariable String[] ids) {
|
|
|
|
|
return toAjax(iAnnexService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
|
|
|
|
|
}
|
|
|
|
|
// @ApiOperation("查询附件列表")
|
|
|
|
|
// @PreAuthorize("@ss.hasPermi('common:annex:list')")
|
|
|
|
|
// @GetMapping("/list")
|
|
|
|
|
// public TableDataInfo<Annex> list(@Validated AnnexQueryBo bo) {
|
|
|
|
|
// return iAnnexService.queryPageList(bo);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// /**
|
|
|
|
|
// * 导出附件列表
|
|
|
|
|
// */
|
|
|
|
|
// @ApiOperation("导出附件列表")
|
|
|
|
|
// @PreAuthorize("@ss.hasPermi('common:annex:export')")
|
|
|
|
|
// @Log(title = "附件", businessType = BusinessType.EXPORT)
|
|
|
|
|
// @GetMapping("/export")
|
|
|
|
|
// public AjaxResult<Annex> export(@Validated AnnexQueryBo bo) {
|
|
|
|
|
// List<Annex> list = iAnnexService.queryList(bo);
|
|
|
|
|
// ExcelUtil<Annex> util = new ExcelUtil<Annex>(Annex.class);
|
|
|
|
|
// return util.exportExcel(list, "附件");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// /**
|
|
|
|
|
// * 获取附件详细信息
|
|
|
|
|
// */
|
|
|
|
|
// @ApiOperation("获取附件详细信息")
|
|
|
|
|
// @PreAuthorize("@ss.hasPermi('common:annex:query')")
|
|
|
|
|
// @GetMapping("/{id}")
|
|
|
|
|
// public AjaxResult<Annex> getInfo(@NotNull(message = "主键不能为空")
|
|
|
|
|
// @PathVariable("id") String id) {
|
|
|
|
|
// return AjaxResult.success(iAnnexService.queryById(id));
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// /**
|
|
|
|
|
// * 新增附件
|
|
|
|
|
// */
|
|
|
|
|
// @ApiOperation("新增附件")
|
|
|
|
|
// @PreAuthorize("@ss.hasPermi('common:annex:add')")
|
|
|
|
|
// @Log(title = "附件", businessType = BusinessType.INSERT)
|
|
|
|
|
// @RepeatSubmit
|
|
|
|
|
// @PostMapping()
|
|
|
|
|
// public AjaxResult<Void> add(@Validated @RequestBody Annex bo) {
|
|
|
|
|
// return toAjax(iAnnexService.insert(bo) ? 1 : 0);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// /**
|
|
|
|
|
// * 修改附件
|
|
|
|
|
// */
|
|
|
|
|
// @ApiOperation("修改附件")
|
|
|
|
|
// @PreAuthorize("@ss.hasPermi('common:annex:edit')")
|
|
|
|
|
// @Log(title = "附件", businessType = BusinessType.UPDATE)
|
|
|
|
|
// @RepeatSubmit
|
|
|
|
|
// @PutMapping()
|
|
|
|
|
// public AjaxResult<Void> edit(@Validated @RequestBody Annex bo) {
|
|
|
|
|
// return toAjax(iAnnexService.update(bo) ? 1 : 0);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// /**
|
|
|
|
|
// * 删除附件
|
|
|
|
|
// */
|
|
|
|
|
// @ApiOperation("删除附件")
|
|
|
|
|
// @PreAuthorize("@ss.hasPermi('common:annex:remove')")
|
|
|
|
|
// @Log(title = "附件" , businessType = BusinessType.DELETE)
|
|
|
|
|
// @DeleteMapping("/{ids}")
|
|
|
|
|
// public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
|
|
|
// @PathVariable String[] ids) {
|
|
|
|
|
// return toAjax(iAnnexService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("包工头获取务工者附件")
|
|
|
|
|