From b9eadb12e6e35eae51a04c223bad1ec2a6692a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BD=90=E5=A4=A9=E5=A4=A7=E5=9C=A3?= <17615834396@163.com> Date: Wed, 27 Mar 2024 14:48:43 +0800 Subject: [PATCH] bug --- .../tag/controller/OilTagController.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/tag/controller/OilTagController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/tag/controller/OilTagController.java index a06479cb4..50014e5f6 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/tag/controller/OilTagController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/tag/controller/OilTagController.java @@ -7,7 +7,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.tag.entity.OilTag; +import com.fuint.business.tag.entity.TagCodeRecord; import com.fuint.business.tag.service.OilTagService; +import com.fuint.business.tag.service.TagCodeRecordService; import com.fuint.business.tag.util.TagUtils; import com.fuint.framework.web.BaseController; import com.fuint.framework.web.ResponseObject; @@ -33,6 +35,9 @@ public class OilTagController extends BaseController { @Resource private OilTagService oilTagService; + @Resource + private TagCodeRecordService tagCodeRecordService; + @Resource private TagUtils tagUtils; /** @@ -100,5 +105,19 @@ public class OilTagController extends BaseController { public ResponseObject delete(@PathVariable("id") Long id) { return getSuccessResult(this.oilTagService.removeById(id)); } + + + //通过二维码sn查油站id + @GetMapping("/getSn/{sn}") + public ResponseObject selectOne(@PathVariable String sn) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(OilTag::getTagCodeSn, sn); + OilTag one = this.oilTagService.getOne(queryWrapper); + Integer oilTagId = one.getId(); + LambdaQueryWrapper queryWrapper1 = new LambdaQueryWrapper<>(); + queryWrapper1.eq(TagCodeRecord::getOilTagId,oilTagId); + TagCodeRecord one1 = tagCodeRecordService.getOne(queryWrapper1); + return getSuccessResult(one1); + } }