From 44f24790744222734ce29cbbebd6bc71005ed41a 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: Mon, 25 Mar 2024 16:46:21 +0800 Subject: [PATCH] bug --- .../fuint/business/member/entity/LJStaff.java | 3 +++ .../service/impl/LJStaffServiceImpl.java | 26 ++++++++++++++++++- .../tag/controller/OilTagController.java | 12 ++++++++- .../tag/controller/TagCodeController.java | 9 ++++++- .../controller/TagCodeRecordController.java | 10 ++++--- .../tag/mapper/xml/TagCodeRecordMapper.xml | 1 + .../impl/TagCodeRecordServiceImpl.java | 1 + 7 files changed, 56 insertions(+), 6 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/entity/LJStaff.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/entity/LJStaff.java index d79055e17..ac0a7603d 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/entity/LJStaff.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/entity/LJStaff.java @@ -128,4 +128,7 @@ public class LJStaff extends BaseEntity implements Serializable { */ @TableField(exist = false) private String dutyName; + //码牌绑定状态 0:未绑定 1:已绑定 + @TableField(exist = false) + private String tagStatus; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java index c41f22532..13337f1d4 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java @@ -1,8 +1,11 @@ package com.fuint.business.member.service.impl; import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fuint.business.member.entity.LJStaff; @@ -11,6 +14,8 @@ import com.fuint.business.member.service.ILJStaffService; import com.fuint.business.member.utils.QrCodeUtils; import com.fuint.business.storeInformation.entity.LJStore; import com.fuint.business.storeInformation.service.ILJStoreService; +import com.fuint.business.tag.entity.TagCodeRecord; +import com.fuint.business.tag.service.TagCodeRecordService; import com.fuint.common.dto.AccountInfo; import com.fuint.common.service.AccountService; import com.fuint.common.service.SettingService; @@ -25,6 +30,7 @@ import com.fuint.utils.Digests; import com.fuint.utils.Encodes; import jdk.nashorn.internal.parser.Token; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.core.env.Environment; import org.springframework.mock.web.MockMultipartFile; import org.springframework.stereotype.Service; @@ -51,6 +57,10 @@ public class LJStaffServiceImpl extends ServiceImpl impl @Resource private DutyService tDutyService; + @Lazy + @Resource + private TagCodeRecordService tagCodeRecordService; + /** * 根据条件分页查询员工信息 * @param page @@ -65,7 +75,21 @@ public class LJStaffServiceImpl extends ServiceImpl impl storeId = staff.getStoreId(); } staff.setStoreId(storeId); - return baseMapper.selectLJStaffList(page,staff); + IPage ljStaffIPage = baseMapper.selectLJStaffList(page, staff); + List records = ljStaffIPage.getRecords(); + if (CollectionUtils.isNotEmpty(records)){ + for (LJStaff record : records) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(TagCodeRecord::getStaffId,record.getId()); + List list = tagCodeRecordService.list(queryWrapper); + if (ObjectUtils.isNotEmpty(list)){ + record.setTagStatus("1"); + }else { + record.setTagStatus("0"); + } + } + } + return ljStaffIPage; } /** 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 108d2e75b..a06479cb4 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 @@ -2,7 +2,9 @@ package com.fuint.business.tag.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.service.OilTagService; @@ -42,7 +44,15 @@ public class OilTagController extends BaseController { @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, @Param("cardFuelDiesel") OilTag oilTag) { Page page = new Page(pageNo, pageSize); - return getSuccessResult(this.oilTagService.page(page, new QueryWrapper<>(oilTag))); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + if (ObjectUtils.isNotEmpty(oilTag.getTagCodeSn())){ + queryWrapper.eq(OilTag::getTagCodeSn,oilTag.getTagCodeSn()); + } + if (ObjectUtils.isNotEmpty(oilTag.getSnCode())){ + queryWrapper.eq(OilTag::getSnCode,oilTag.getSnCode()); + } + queryWrapper.orderByDesc(OilTag::getCreateTime); + return getSuccessResult(this.oilTagService.page(page, queryWrapper)); } /** diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/tag/controller/TagCodeController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/tag/controller/TagCodeController.java index 215b12e8d..13e852861 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/tag/controller/TagCodeController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/tag/controller/TagCodeController.java @@ -2,7 +2,9 @@ package com.fuint.business.tag.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.dto.TagCodeDTO; import com.fuint.business.tag.entity.TagCode; @@ -57,7 +59,12 @@ public class TagCodeController extends BaseController { @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, @Param("cardFuelDiesel") TagCode tagCode) { Page page = new Page(pageNo, pageSize); - return getSuccessResult(this.tagCodeService.page(page, new QueryWrapper<>(tagCode))); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + if (ObjectUtils.isNotEmpty(tagCode.getTagCodeSn())){ + queryWrapper.eq(TagCode::getTagCodeSn,tagCode.getTagCodeSn()); + } + queryWrapper.orderByDesc(TagCode::getCreateTime); + return getSuccessResult(this.tagCodeService.page(page, queryWrapper)); } /** diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/tag/controller/TagCodeRecordController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/tag/controller/TagCodeRecordController.java index 97e9051ec..252163683 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/tag/controller/TagCodeRecordController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/tag/controller/TagCodeRecordController.java @@ -127,14 +127,18 @@ public class TagCodeRecordController extends BaseController { } /** - * 删除数据 + * 码牌与油站解绑 * * @param id 主键结合 * @return 删除结果 */ - @DeleteMapping("id") + /* @DeleteMapping("id") public ResponseObject delete(@PathVariable Long id) { + TagCodeRecord tagCodeRecord = this.tagCodeRecordService.getById(id); + if () + //码牌id + Integer oilTagId = tagCodeRecord.getOilTagId(); return getSuccessResult(this.tagCodeRecordService.removeById(id)); - } + }*/ } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/tag/mapper/xml/TagCodeRecordMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/tag/mapper/xml/TagCodeRecordMapper.xml index 9b350e7b5..17aeb7022 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/tag/mapper/xml/TagCodeRecordMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/tag/mapper/xml/TagCodeRecordMapper.xml @@ -17,6 +17,7 @@