DgLendController.java 4.42 KB
package com.pashanhoo.lend.controller;


import com.pashanhoo.archive.entity.vo.DgArchivesSearchRequest;
import com.pashanhoo.common.Result;
import com.pashanhoo.lend.entity.vo.AddDgLendRequest;
import com.pashanhoo.lend.entity.vo.ArchiveLendSearchRequest;
import com.pashanhoo.lend.entity.vo.DgLendSearchRequest;
import com.pashanhoo.lend.entity.vo.UpdateDgLendRequest;
import com.pashanhoo.lend.service.DgLendService;
import com.pashanhoo.lendcatalog.entity.vo.AddDgLendCatalogRequest;
import com.pashanhoo.lendfile.entity.vo.AddDgLendFileRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 档案借阅 前端控制器
 * </p>
 *
 * @author
 * @since 2021-11-05
 */
@RestController
@RequestMapping("/system/dgLend/")
@Api(tags = "档案借阅接口")
public class DgLendController {
    @Autowired
    private DgLendService dglendService;

    @PostMapping("search")
    @ApiOperation(value = "根据条件进行列表查询")
    public Result searchDgLendList(@RequestBody DgLendSearchRequest request) {
        return dglendService.searchDgLendList(request);
    }
    @PostMapping("deleteDanganJyInfo")
    @ApiOperation("通过借阅标识码删除借阅记录信息")
    public Result deleteDanganJyInfo(@RequestParam String lendBsm){
        return dglendService.deleteDanganJyInfo(lendBsm);
    }
    @PostMapping("danganGh")
    @ApiOperation("档案归还")
    public Result danganGh(@RequestBody UpdateDgLendRequest ghRequest){
        return dglendService.danganGh(ghRequest);
    }
    @PostMapping("showArchivesForLend")
    @ApiOperation("展示可以选择借阅的列表")
    public Result showArchivesForLend(@RequestBody ArchiveLendSearchRequest request) {
        return  dglendService.showArchivesForLend(request);
    }
    @PostMapping("insertDgLend")
    @ApiOperation("新增档案借阅")
    public Result insertDgLend(@RequestBody AddDgLendRequest request){
        if(dglendService.insertDgLend(request)){
            return Result.ok();
        }
        return Result.error("新增失败");
    }
    @PostMapping("addLendArchivesInfo")
    @ApiOperation(value = "选择要借阅档案List")
    public Result addLendArchivesInfo(@RequestBody List<AddDgLendCatalogRequest> archivesList) {
        return dglendService.addDestructionArchivesInfo(archivesList);
    }
    @PostMapping("insertDanganJyFile")
    @ApiOperation("批量借阅文件信息")
    public Result insertDanganJyFile(@RequestBody List<AddDgLendFileRequest> request){
        return dglendService.insertDanganJyFile(request);
    }
    @PostMapping("queryArchivesInfo")
    @ApiOperation(value = "档案列表信息展示")
    public Result queryArchivesInfo(@ApiParam("档案借阅记录ID") @RequestParam(value = "bsm_lend") String bsm_lend) {
        return dglendService.queryArchivesInfo(bsm_lend);
    }
    @GetMapping("deleteArchivesInfo")
    @ApiOperation(value = "删除档案列表中的档案信息")
    public Result deleteArchivesInfo(@ApiParam("档案ID") @RequestParam(value = "bsm_lendcatalog") String bsm_lendcatalog) {
        return dglendService.deleteArchivesInfo(bsm_lendcatalog);
    }
    @GetMapping("getDgLendDetailById")
    @ApiOperation(value = "读取明细")
    public Result getDgLendDetailById(@ApiParam("档案借阅ID") @RequestParam String id){
        return Result.ok(dglendService.getDgLendDetailById(id));
    }
    @PostMapping("updateDgLend")
    @ApiOperation("修改档案借阅")
    public Result updateDgLend(@RequestBody UpdateDgLendRequest request){
        if(dglendService.updateDgLend(request)) {
            return Result.ok("修改成功");
        }
        return Result.error("修改失败");
    }
    @PostMapping("updateStateByArchives")
    @ApiOperation(value = "新增档案借阅列表中的借阅操作")
    public Result updateStateByArchives(@ApiParam("档案业务信息ID列表") @RequestParam(value = "idList") List<String> idList) {
        return dglendService.updateStateByArchives(idList);
    }
    @GetMapping("updateArchivesStateByLend")
    @ApiOperation(value = "编辑中的借阅操作")
    public Result updateArchivesStateByLend(@ApiParam("档案借阅记录ID") @RequestParam(value = "bsm_lend") String bsm_lend) {
        return dglendService.updateArchivesStateByLend(bsm_lend);
    }









}