package com.ruoyi.web.controller.project; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.NotRepeatCommit; import com.ruoyi.common.annotation.RepeatSubmit; 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.enums.BusinessType; import com.ruoyi.common.utils.bean.DtoConversionUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.project.domain.ServiceOrganallocation; import com.ruoyi.project.service.IServiceOrganallocationService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.Arrays; import java.util.List; /** * 器官分配Controller * * @author ruoyi * @date 2021-11-10 */ @Api("器官分配管理") @RestController @RequestMapping("/project/organallocation") public class ServiceOrganallocationController extends BaseController { @Autowired private IServiceOrganallocationService serviceOrganallocationService; /** * 查询器官分配列表 */ @ApiOperation("器官分配信息列表") //@PreAuthorize("@ss.hasPermi('project:organallocation:list')") @GetMapping("/list") public TableDataInfo list(ServiceOrganallocation serviceOrganallocation) { startPage(); //List list = serviceOrganallocationService.queryList(serviceOrganallocation); List list = serviceOrganallocationService.selectServiceOrganallocationList(serviceOrganallocation); return getDataTable(list); } /** * 导出器官分配列表 */ @ApiOperation("导出器官分配信息列表") //@PreAuthorize("@ss.hasPermi('project:organallocation:export')") @Log(title = "器官分配", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(ServiceOrganallocation serviceOrganallocation) { List list = serviceOrganallocationService.queryList(serviceOrganallocation); ExcelUtil util = new ExcelUtil(ServiceOrganallocation.class); return util.exportExcel(list, "器官分配数据"); } /** * 获取器官分配详细信息 */ @ApiOperation("通过id获取器官分配信息") //@PreAuthorize("@ss.hasPermi('project:organallocation:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(serviceOrganallocationService.getById(id)); } /** * 新增器官分配 */ @ApiOperation("新增器官分配信息") //@PreAuthorize("@ss.hasPermi('project:organallocation:add')") @Log(title = "器官分配", businessType = BusinessType.INSERT) @PostMapping @NotRepeatCommit(key = "param:arg[1]", value = 30000) public AjaxResult add(@RequestBody ServiceOrganallocation serviceOrganallocation) { return toAjax(serviceOrganallocationService.save(serviceOrganallocation)); } /** * 新增器官分配 */ @ApiOperation("新增器官分配集合信息") @Log(title = "器官分配集合", businessType = BusinessType.INSERT) @PostMapping("/add") @RepeatSubmit public AjaxResult addArrayData(@RequestBody List serviceOrganallocations) { return AjaxResult.success(serviceOrganallocationService.saveDate(serviceOrganallocations)); } /** * 修改器官分配 */ @ApiOperation("修改器官分配信息") //@PreAuthorize("@ss.hasPermi('project:organallocation:edit')") @Log(title = "器官分配", businessType = BusinessType.UPDATE) @PostMapping("/edit") @RepeatSubmit public AjaxResult edit(@RequestBody ServiceOrganallocation serviceOrganallocation) { return toAjax(serviceOrganallocationService.updateById(serviceOrganallocation)); } /** * 修改器官分配 */ @ApiOperation("修改器官分配信息") //@PreAuthorize("@ss.hasPermi('project:organallocation:edit')") @Log(title = "器官分配", businessType = BusinessType.UPDATE) @PostMapping("/editarraydata") @RepeatSubmit public AjaxResult editArrayData(@RequestBody List serviceOrganallocations) { return AjaxResult.success(serviceOrganallocationService.editArrayData(serviceOrganallocations)); } /** * 删除器官分配 */ @ApiOperation("删除器官分配信息") //@PreAuthorize("@ss.hasPermi('project:organallocation:remove')") @Log(title = "器官分配", businessType = BusinessType.DELETE) @GetMapping("/remove/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(serviceOrganallocationService.removeByIds(Arrays.asList(ids))); } }