| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.service.LinkBasicInformationService; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | 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.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-08-03 |
| | | */ |
| | | @Api(tags = "æ¥æ£ç®¡ç-->å§ææ£éª") |
| | | @RestController |
| | | @RequestMapping("/link-basic-table") |
| | | public class LinkBasicInformationController { |
| | | |
| | | @Autowired |
| | | private LinkBasicInformationService linkBasicInformationService; |
| | | |
| | | @ApiOperation("龿¥-->è·å龿¥") |
| | | @GetMapping("/link") |
| | | public Result<?> getLink() { |
| | | Object link1 = null; |
| | | try { |
| | | link1 = RedisUtil.get("link"); |
| | | } catch (Exception e) { |
| | | String uuid = IdWorker.get32UUID(); |
| | | RedisUtil.set("link", uuid, 60 * 24); |
| | | return Result.success("success", uuid); |
| | | } |
| | | return Result.success(link1); |
| | | } |
| | | |
| | | @ApiOperation(value = "åé¡µè¡¨æ ¼") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageNo", value = "èµ·å§é¡µ", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯ä¸é¡µæ°é", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "entrustCoding", value = "å§æç¼å·", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "sampleName", value = "æ ·ååç§°", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "entrusted", value = "å§æåä½", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "inspectionStatus", value = "æ£éªç¶æ", dataTypeClass = Integer.class) |
| | | }) |
| | | @GetMapping("/page") |
| | | public Result<?> getLinkBasicPage(Integer pageNo, Integer pageSize, String entrustCoding, String sampleName, String entrusted, Integer inspectionStatus) { |
| | | IPage<Map<String, Object>> linkBasicPage = linkBasicInformationService.getLinkBasicPage(new Page<Object>(pageNo, pageSize), entrustCoding, sampleName, entrusted, inspectionStatus); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("total", linkBasicPage.getTotal()); |
| | | map.put("row", linkBasicPage.getRecords()); |
| | | return Result.success(map); |
| | | } |
| | | } |