“zhuo”
2023-08-10 805248000274ad1bd010ec4a7ed6b2821be87d23
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
52
53
54
55
56
57
58
59
60
61
62
63
64
package com.yuanchu.limslaboratory.controller;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.CnasAnnualPlan;
import com.yuanchu.limslaboratory.pojo.vo.CnasAnnualPlanVo;
import com.yuanchu.limslaboratory.service.CnasAnnualPlanService;
import com.yuanchu.limslaboratory.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;
 
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
 
/**
 * <p>
 * 审核年度计划表 前端控制器
 * </p>
 *
 * @author 江苏鵷雏网络科技有限公司
 * @since 2023-08-10 11:50:11
 */
@Api(tags = "CNAS管理-->审核年度计划")
@RestController
@RequestMapping("/cnasAnnualPlan")
public class CnasAnnualPlanController {
 
    @Resource
    private CnasAnnualPlanService cnasAnnualPlanService;
 
    @ApiOperation(value = "查询审查计划")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "page", value = "初始页", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "pageSize", value = "每一页数量", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "beginTime", value = "检验开始时间", dataTypeClass = Date.class),
            @ApiImplicitParam(name = "endTime", value = "检验结束时间", dataTypeClass = Date.class),
    })
    @GetMapping("/selectAllList")
    public Result selectAllList(Integer page, Integer pageSize, @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
        IPage<CnasAnnualPlanVo> reportPage = cnasAnnualPlanService.selectAllList(new Page(page, pageSize), beginTime, endTime);
        Map<String, Object> map = new HashMap<>();
        map.put("total", reportPage.getTotal());
        map.put("row", reportPage.getRecords());
        return Result.success(map);
    }
 
    @ApiOperation(value = "新增审查计划")
    @PostMapping("/addCnasAnnualPlan")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "CnasAnnualPlan", value = "审查对象", dataTypeClass = Integer.class, required = true)
    })
    public Result addCnasAnnualPlan(@RequestBody CnasAnnualPlan cnasAnnualPlan) {
        cnasAnnualPlanService.save(cnasAnnualPlan);
        return Result.success();
    }
 
}