¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.Instrument; |
| | | import com.yuanchu.limslaboratory.pojo.MeteringPlan; |
| | | import com.yuanchu.limslaboratory.service.MeteringPlanService; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | | 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.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | | * å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-27 |
| | | */ |
| | | @Api(tags = "å®éªå®¤-->2ã计é管ç") |
| | | @RestController |
| | | @RequestMapping("/metering-plan") |
| | | public class MeteringPlanController { |
| | | |
| | | @Autowired |
| | | private MeteringPlanService meteringPlanService; |
| | | |
| | | @ApiOperation("æ·»å 计é计å") |
| | | @PostMapping("/add") |
| | | public Result<?> addMeteringPlanInformation(@RequestBody MeteringPlan meteringPlan) { |
| | | Integer isInsertSuccess = meteringPlanService.addMeteringPlanInformation(meteringPlan); |
| | | if (isInsertSuccess == 1){ |
| | | return Result.success("æ·»å 计é计åæå!"); |
| | | } |
| | | return Result.fail("æ·»å 计é计å失败! "); |
| | | } |
| | | |
| | | @ApiOperation("计é计åå页æ¥è¯¢") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageNo", value = "èµ·å§é¡µ", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯ä¸é¡µæ°é", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "measureCodeOrNameOrUnit", value = "æ¯ä¸é¡µæ°é", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/plan_page_list") |
| | | public Result<?> pagingQueryOfMeteringPlan(Integer pageNo, Integer pageSize, String measureCodeOrNameOrUnit) { |
| | | IPage<Map<String, Object>> page = meteringPlanService.pagingQueryOfMeteringPlan(measureCodeOrNameOrUnit, new Page<Objects>(pageNo, pageSize)); |
| | | return Result.success(page); |
| | | } |
| | | |
| | | @ApiOperation("计éå°è´¦å页æ¥è¯¢") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageNo", value = "èµ·å§é¡µ", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯ä¸é¡µæ°é", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/standing_page_list") |
| | | public Result<?> pagingQueryOfMeasurementLedger(Integer pageNo, Integer pageSize) { |
| | | IPage<Map<String, Object>> page = meteringPlanService.pagingQueryOfMeasurementLedger(new Page<Objects>(pageNo, pageSize)); |
| | | return Result.success(page); |
| | | } |
| | | } |