liusheng
2023-11-17 054cfdd53b732d2f60627fc9ac7cf92233d3c200
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonateflowchartController.java
@@ -7,6 +7,7 @@
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
@@ -27,15 +28,14 @@
/**
 * 捐献流程Controller
 *
 *
 * @author ruoyi
 * @date 2021-11-15
 */
@Api("捐献流程管理")
@RestController
@RequestMapping("/project/donateflowchart")
public class ServiceDonateflowchartController extends BaseController
{
public class ServiceDonateflowchartController extends BaseController {
    @Autowired
    private IServiceDonateflowchartService serviceDonateflowchartService;
@@ -45,8 +45,7 @@
    @ApiOperation("查询捐献流程")
    //@PreAuthorize("@ss.hasPermi('system:donateflowchart:list')")
    @GetMapping("/list")
    public TableDataInfo list(ServiceDonateflowchart serviceDonateflowchart)
    {
    public TableDataInfo list(ServiceDonateflowchart serviceDonateflowchart) {
        startPage();
        List<ServiceDonateflowchart> list = serviceDonateflowchartService.queryList(serviceDonateflowchart);
@@ -60,8 +59,7 @@
    //@PreAuthorize("@ss.hasPermi('system:donateflowchart:export')")
    @Log(title = "捐献流程", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(ServiceDonateflowchart serviceDonateflowchart)
    {
    public AjaxResult export(ServiceDonateflowchart serviceDonateflowchart) {
        List<ServiceDonateflowchart> list = serviceDonateflowchartService.queryList(serviceDonateflowchart);
        ExcelUtil<ServiceDonateflowchart> util = new ExcelUtil<ServiceDonateflowchart>(ServiceDonateflowchart.class);
        return util.exportExcel(list, "捐献流程数据");
@@ -73,8 +71,7 @@
    @ApiOperation("通过id获取捐献流程")
    //@PreAuthorize("@ss.hasPermi('system:donateflowchart:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return AjaxResult.success(serviceDonateflowchartService.getById(id));
    }
@@ -86,8 +83,7 @@
    @Log(title = "捐献流程", businessType = BusinessType.INSERT)
    @PostMapping
    @RepeatSubmit
    public AjaxResult add(@RequestBody ServiceDonateflowchart serviceDonateflowchart)
    {
    public AjaxResult add(@RequestBody ServiceDonateflowchart serviceDonateflowchart) {
        return toAjax(serviceDonateflowchartService.save(serviceDonateflowchart));
    }
@@ -98,9 +94,15 @@
    //@PreAuthorize("@ss.hasPermi('system:donateflowchart:edit')")
    @Log(title = "捐献流程", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    @RepeatSubmit
    public AjaxResult edit(@RequestBody ServiceDonateflowchart serviceDonateflowchart)
    {
    @RepeatSubmit
    public AjaxResult edit(@RequestBody ServiceDonateflowchart serviceDonateflowchart) {
        ServiceDonateflowchart serviceDonateflowchart1 = new ServiceDonateflowchart();
        serviceDonateflowchart1.setInfoid(serviceDonateflowchart.getInfoid());
        List<ServiceDonateflowchart> list = serviceDonateflowchartService.queryList(serviceDonateflowchart1);
        if (CollectionUtils.isEmpty(list)) {
            return error("伦理审查修改数据不存在,请检查后再次修改");
        }
        serviceDonateflowchart.setId(list.get(0).getId());
        return toAjax(serviceDonateflowchartService.updateById(serviceDonateflowchart));
    }
@@ -111,8 +113,7 @@
    //@PreAuthorize("@ss.hasPermi('system:donateflowchart:remove')")
    @Log(title = "捐献流程", businessType = BusinessType.DELETE)
    @GetMapping("/remove/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(serviceDonateflowchartService.removeByIds(Arrays.asList(ids)));
    }
}