Blame view

src/main/java/com/pashanhoo/replenish/controller/DgArchivesReplenishController.java 2.87 KB
1 2
package com.pashanhoo.replenish.controller;

3
import com.baomidou.mybatisplus.core.metadata.IPage;
4 5
import com.pashanhoo.common.Result;
import com.pashanhoo.replenish.entity.vo.AddDgArchivesReplenishRequest;
6
import com.pashanhoo.replenish.entity.vo.DgArchivesReplenishListVO;
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
import com.pashanhoo.replenish.entity.vo.DgArchivesReplenishSearchRequest;
import com.pashanhoo.replenish.service.DgArchivesReplenishService;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * <p>
 * 档案补录信息 前端控制器
 * </p>
 *
 * @author
 * @since 2021-11-05
 */
@RestController
@RequestMapping("/system/dgArchivesReplenish/")
@Api(tags = "档案补录信息接口")
public class DgArchivesReplenishController {
    @Autowired
    private DgArchivesReplenishService dgarchivesreplenishService;

    @PostMapping("insertDgArchivesReplenish")
    @ApiOperation("新增档案补录信息")
    public Result insertDgArchivesReplenish(@RequestBody AddDgArchivesReplenishRequest request){
        if(dgarchivesreplenishService.insertDgArchivesReplenish(request)){
            return Result.ok();
        }
        return Result.error("新增失败");
    }

    @DeleteMapping("deleteDgArchivesReplenishByIds")
    @ApiOperation(value = "批量删除档案补录信息")
44 45 46 47 48 49 50
    public Result deleteDgArchivesReplenishByIds(@ApiParam("档案标识码") @RequestParam(value = "bsmArchives") List<String> bsmArchives) {
        try {
            if(dgarchivesreplenishService.delete(bsmArchives)) {
                return Result.ok("删除成功");
            }
        } catch (Exception e) {
            return Result.exception(e.getMessage());
51
        }
52
        return Result.ok("删除失败");
53 54 55 56 57 58 59 60 61 62
    }

    @GetMapping("getDgArchivesReplenishDetailById")
    @ApiOperation(value = "读取明细")
    public Result getDgArchivesReplenishDetailById(@ApiParam("档案补录信息ID") @RequestParam String id){
        return Result.ok(dgarchivesreplenishService.getDgArchivesReplenishDetailById(id));
    }

    @PostMapping("search")
    @ApiOperation(value = "根据条件进行列表查询")
63
    public Result<IPage<DgArchivesReplenishListVO>> searchDgArchivesReplenishList(@RequestBody DgArchivesReplenishSearchRequest request) {
64

65
        return Result.ok(dgarchivesreplenishService.searchDgArchivesReplenishList(request));
66
    }
67 68 69

    @GetMapping("doReplenishArchive")
    @ApiOperation(value = "归档")
70
    public Result doReplenishArchive(@ApiParam("档案补录标识码") @RequestParam String bsmModify,@ApiParam("档案标识码") @RequestParam String bsmArchive){
71 72
        return Result.ok(dgarchivesreplenishService.doReplenishArchive(bsmModify,bsmArchive));
    }
73
}