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