liusheng
2023-09-09 f0f6c3b39dddf5cfdf145425687e9339453b5ba1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonateorganController.java
@@ -41,11 +41,9 @@
@Api("捐献器官管理")
@RestController
@RequestMapping("/project/donateorgan")
public class ServiceDonateorganController extends BaseController
{
public class ServiceDonateorganController extends BaseController {
    @Autowired
    private IServiceDonateorganService serviceDonateorganService;
    /**
@@ -54,16 +52,14 @@
    @ApiOperation("捐献器官列表")
    //@PreAuthorize("@ss.hasPermi('project:donateorgan:list')")
    @GetMapping("/list")
    public TableDataInfo list(ServiceDonateorgan serviceDonateorgan)
    {
    public TableDataInfo list(ServiceDonateorgan serviceDonateorgan) {
        startPage();
        List<ServiceDonateorgan> list = serviceDonateorganService.queryList(serviceDonateorgan);
        return getDataTable(list);
    }
    @GetMapping("/listnew")
    public TableDataInfo listnew (DonateOrganVO donateOrganVO)
    {
    public TableDataInfo listnew(DonateOrganVO donateOrganVO) {
        startPage();
        List<DonateOrganVO> list = serviceDonateorganService.selectVOList(donateOrganVO);
        return getDataTable(list);
@@ -77,8 +73,7 @@
    //@PreAuthorize("@ss.hasPermi('project:donateorgan:export')")
    @Log(title = "捐献器官管理", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(ServiceDonateorgan serviceDonateorgan)
    {
    public AjaxResult export(ServiceDonateorgan serviceDonateorgan) {
        List<ServiceDonateorgan> list = serviceDonateorganService.queryList(serviceDonateorgan);
        ExcelUtil<ServiceDonateorgan> util = new ExcelUtil<ServiceDonateorgan>(ServiceDonateorgan.class);
        return util.exportExcel(list, "捐献器官管理数据");
@@ -90,8 +85,7 @@
    @ApiOperation("通过id获得捐献器官信息")
    //@PreAuthorize("@ss.hasPermi('project:donateorgan:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return AjaxResult.success(serviceDonateorganService.getById(id));
    }
@@ -103,20 +97,15 @@
    @Log(title = "捐献器官管理", businessType = BusinessType.INSERT)
    @PostMapping
    @RepeatSubmit
    public AjaxResult add(@RequestBody ServiceDonateorgan serviceDonateorgan)
    {
    public AjaxResult add(@RequestBody ServiceDonateorgan serviceDonateorgan) {
        String organNumber = serviceDonateorgan.getDonorno() + "." + serviceDonateorgan.getOrganno();
        if (organNumber == "")
        {
        if (organNumber == "") {
            return AjaxResult.error("新增时生成的编号为空,创建失败!");
        }
        else
        {
        } else {
            ServiceDonateorgan serviceDonateorgan1 = new ServiceDonateorgan();
            serviceDonateorgan1.setOrgannumber(organNumber);
            List<ServiceDonateorgan> listrecord = serviceDonateorganService.queryList(serviceDonateorgan);
            if (listrecord.size()>0)
            {
            if (listrecord.size() > 0) {
                return AjaxResult.error("新增时生成的编号"+ organNumber +"已存在,无法保存!");
            }
        }
@@ -130,10 +119,9 @@
    @ApiOperation("修改捐献器官信息")
    //@PreAuthorize("@ss.hasPermi('project:donateorgan:edit')")
    @Log(title = "捐献器官管理", businessType = BusinessType.UPDATE)
    @PutMapping
    @PostMapping("/edit")
    @RepeatSubmit    
    public AjaxResult edit(@RequestBody ServiceDonateorgan serviceDonateorgan)
    {
    public AjaxResult edit(@RequestBody ServiceDonateorgan serviceDonateorgan) {
        return toAjax(serviceDonateorganService.updateById(serviceDonateorgan));
    }
@@ -143,9 +131,8 @@
    @ApiOperation("删除捐献器官信息")
    //@PreAuthorize("@ss.hasPermi('project:donateorgan: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(serviceDonateorganService.removeByIds(Arrays.asList(ids)));
    }
@@ -258,7 +245,6 @@
    public AjaxResult getOrganCount(TimeVO timeVO){
        return AjaxResult.success(serviceDonateorganService.getOrganCount(timeVO));
    }
}