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();
|
}
|
|
}
|