buhuazhen
2 天以前 d562551c7efd2c19fd037ab4fb1b7a355ff80f42
1
2
3
4
5
6
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
44
45
46
47
48
49
50
51
package com.ruoyi.consumables.controller;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.consumables.dto.ConsumablesInRecordDto;
import com.ruoyi.consumables.service.ConsumablesInRecordService;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
 
import javax.servlet.http.HttpServletResponse;
import java.util.List;
 
@RestController
@Api(tags = "耗材入库")
@RequestMapping("/consumablesInRecord")
public class ConsumablesInRecordController {
    @Autowired
    private ConsumablesInRecordService consumablesInRecordService;
 
    @GetMapping("/listPage")
    @Log(title = "生产入库-入库管理-列表", businessType = BusinessType.OTHER)
    @ApiOperation(value = "入库管理列表")
    public AjaxResult listPage(Page page, ConsumablesInRecordDto ConsumablesInRecordDto) {
        IPage<ConsumablesInRecordDto> result = consumablesInRecordService.listPage(page, ConsumablesInRecordDto);
        return AjaxResult.success(result);
    }
 
 
 
    @DeleteMapping("")
    @Log(title = "入库管理-删除入库", businessType = BusinessType.DELETE)
    public AjaxResult delete(@RequestBody List<Long> ids) {
        if(CollectionUtils.isEmpty(ids)){
            return AjaxResult.error("请选择至少一条数据");
        }
        return AjaxResult.success(consumablesInRecordService.batchDelete(ids));
    }
 
    @PostMapping("/exportConsumablesInRecord")
    @ApiOperation("导出入库记录")
    public void exportConsumablesInRecord(HttpServletResponse response, ConsumablesInRecordDto ConsumablesInRecordDto) {
        consumablesInRecordService.exportConsumablesInRecord(response,ConsumablesInRecordDto);
    }
 
}