liusheng
2024-05-16 c678e5fe694f06b023369ca0fc5d2f1cf50f6599
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceOrganallocationController.java
@@ -1,11 +1,13 @@
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;
@@ -20,15 +22,14 @@
/**
 * 器官分配Controller
 *
 *
 * @author ruoyi
 * @date 2021-11-10
 */
@Api("器官分配管理")
@RestController
@RequestMapping("/project/organallocation")
public class ServiceOrganallocationController extends BaseController
{
public class ServiceOrganallocationController extends BaseController {
    @Autowired
    private IServiceOrganallocationService serviceOrganallocationService;
@@ -36,10 +37,9 @@
     * 查询器官分配列表
     */
    @ApiOperation("器官分配信息列表")
    //@PreAuthorize("@ss.hasPermi('project:organallocation:list')")
    //// @PreAuthorize("@ss.hasPermi('project:organallocation:list')")
    @GetMapping("/list")
    public TableDataInfo list(ServiceOrganallocation serviceOrganallocation)
    {
    public TableDataInfo list(ServiceOrganallocation serviceOrganallocation) {
        startPage();
        //List<ServiceOrganallocation> list = serviceOrganallocationService.queryList(serviceOrganallocation);
        List<ServiceOrganallocation> list = serviceOrganallocationService.selectServiceOrganallocationList(serviceOrganallocation);
@@ -50,11 +50,10 @@
     * 导出器官分配列表
     */
    @ApiOperation("导出器官分配信息列表")
    //@PreAuthorize("@ss.hasPermi('project:organallocation:export')")
    //// @PreAuthorize("@ss.hasPermi('project:organallocation:export')")
    @Log(title = "器官分配", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(ServiceOrganallocation serviceOrganallocation)
    {
    public AjaxResult export(ServiceOrganallocation serviceOrganallocation) {
        List<ServiceOrganallocation> list = serviceOrganallocationService.queryList(serviceOrganallocation);
        ExcelUtil<ServiceOrganallocation> util = new ExcelUtil<ServiceOrganallocation>(ServiceOrganallocation.class);
        return util.exportExcel(list, "器官分配数据");
@@ -64,10 +63,9 @@
     * 获取器官分配详细信息
     */
    @ApiOperation("通过id获取器官分配信息")
    //@PreAuthorize("@ss.hasPermi('project:organallocation:query')")
    //// @PreAuthorize("@ss.hasPermi('project:organallocation:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return AjaxResult.success(serviceOrganallocationService.getById(id));
    }
@@ -75,37 +73,58 @@
     * 新增器官分配
     */
    @ApiOperation("新增器官分配信息")
    //@PreAuthorize("@ss.hasPermi('project:organallocation:add')")
    //// @PreAuthorize("@ss.hasPermi('project:organallocation:add')")
    @Log(title = "器官分配", businessType = BusinessType.INSERT)
    @PostMapping
    @RepeatSubmit
    public AjaxResult add(@RequestBody ServiceOrganallocation serviceOrganallocation)
    {
    @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<ServiceOrganallocation> serviceOrganallocations) {
        return AjaxResult.success(serviceOrganallocationService.saveDate(serviceOrganallocations));
    }
    /**
     * 修改器官分配
     */
    @ApiOperation("修改器官分配信息")
    //@PreAuthorize("@ss.hasPermi('project:organallocation:edit')")
    //// @PreAuthorize("@ss.hasPermi('project:organallocation:edit')")
    @Log(title = "器官分配", businessType = BusinessType.UPDATE)
    @PutMapping
    @RepeatSubmit
    public AjaxResult edit(@RequestBody ServiceOrganallocation serviceOrganallocation)
    {
    @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<ServiceOrganallocation> serviceOrganallocations) {
        return AjaxResult.success(serviceOrganallocationService.editArrayData(serviceOrganallocations));
    }
    /**
     * 删除器官分配
     */
    @ApiOperation("删除器官分配信息")
    //@PreAuthorize("@ss.hasPermi('project:organallocation:remove')")
    //// @PreAuthorize("@ss.hasPermi('project:organallocation:remove')")
    @Log(title = "器官分配", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
    @GetMapping("/remove/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(serviceOrganallocationService.removeByIds(Arrays.asList(ids)));
    }
}