Blame view

src/main/java/com/pashanhoo/receive/controller/DgReceiveController.java 1.88 KB
1 2 3 4 5 6 7 8 9 10
package com.pashanhoo.receive.controller;

import com.pashanhoo.common.Result;
import com.pashanhoo.receive.entity.vo.AddDgReceiveRequest;
import com.pashanhoo.receive.entity.vo.DgReceiveSearchRequest;
import com.pashanhoo.receive.service.DgReceiveService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
11
import org.springframework.validation.BindingResult;
12 13
import org.springframework.web.bind.annotation.*;

14
import javax.validation.Valid;
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
import java.util.List;

/**
 * <p>
 * 档案接收记录 前端控制器
 * </p>
 *
 * @author
 * @since 2021-11-05
 */
@RestController
@RequestMapping("/system/dgReceive/")
@Api(tags = "档案接收记录接口")
public class DgReceiveController {
    @Autowired
    private DgReceiveService dgreceiveService;

    @PostMapping("insertDgReceive")
33
    @ApiOperation("新增接收记录接口")
34 35 36 37 38 39 40 41 42 43
    public Result insertDgReceive(@Valid @RequestBody AddDgReceiveRequest request, BindingResult bindingResult) {
        if (bindingResult.hasErrors()){
            return Result.checkError(bindingResult.getAllErrors().get(0).getDefaultMessage());
        }
        try {
            dgreceiveService.insertDgReceive(request);
        }catch (Exception ex){
            return Result.error(ex.getMessage());
        }
       return Result.ok();
44 45 46 47
    }
    @PostMapping("search")
    @ApiOperation(value = "根据条件进行列表查询")
    public Result searchDgReceiveList(@RequestBody DgReceiveSearchRequest request) {
48
        return dgreceiveService.searchDgReceiveList(request);
49
    }
50 51 52 53 54 55 56 57 58 59
    @PostMapping("addBatchArchies")
    @ApiOperation("批量归档")
    public Result addBatchArchies(@ApiParam("接收记录ID列表") @RequestParam(value = "idList") List<String> idList){
        return dgreceiveService.addBatchArchies(idList);
    }





60
}