| | |
| | | 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; |
| | |
| | | |
| | | /** |
| | | * 捐献流程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; |
| | | |
| | |
| | | @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); |
| | | |
| | |
| | | //@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, "捐献流程数据"); |
| | |
| | | @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)); |
| | | } |
| | | |
| | |
| | | @ApiOperation("新增捐献流程") |
| | | //@PreAuthorize("@ss.hasPermi('system:donateflowchart:add')") |
| | | @Log(title = "捐献流程", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | @PostMapping("/add") |
| | | @RepeatSubmit |
| | | public AjaxResult add(@RequestBody ServiceDonateflowchart serviceDonateflowchart) |
| | | { |
| | | return toAjax(serviceDonateflowchartService.save(serviceDonateflowchart)); |
| | | public AjaxResult add(@RequestBody ServiceDonateflowchart serviceDonateflowchart) { |
| | | boolean save = serviceDonateflowchartService.save(serviceDonateflowchart); |
| | | return AjaxResult.success(serviceDonateflowchart); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation("修改捐献流程") |
| | | //@PreAuthorize("@ss.hasPermi('system:donateflowchart:edit')") |
| | | @Log(title = "捐献流程", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | @RepeatSubmit |
| | | public AjaxResult edit(@RequestBody ServiceDonateflowchart serviceDonateflowchart) |
| | | { |
| | | @PostMapping("/edit") |
| | | @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)); |
| | | } |
| | | |
| | |
| | | @ApiOperation("删除捐献流程") |
| | | //@PreAuthorize("@ss.hasPermi('system:donateflowchart: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(serviceDonateflowchartService.removeByIds(Arrays.asList(ids))); |
| | | } |
| | | } |