Merge remote-tracking branch 'origin/master'

This commit is contained in:
齐天大圣 2024-03-26 13:33:56 +08:00
commit eab8249bde
7 changed files with 56 additions and 6 deletions

View File

@ -128,4 +128,7 @@ public class LJStaff extends BaseEntity implements Serializable {
*/ */
@TableField(exist = false) @TableField(exist = false)
private String dutyName; private String dutyName;
//码牌绑定状态 0未绑定 1已绑定
@TableField(exist = false)
private String tagStatus;
} }

View File

@ -1,8 +1,11 @@
package com.fuint.business.member.service.impl; package com.fuint.business.member.service.impl;
import cn.hutool.core.util.ObjectUtil; 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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; 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.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.member.entity.LJStaff; 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.member.utils.QrCodeUtils;
import com.fuint.business.storeInformation.entity.LJStore; import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.service.ILJStoreService; 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.dto.AccountInfo;
import com.fuint.common.service.AccountService; import com.fuint.common.service.AccountService;
import com.fuint.common.service.SettingService; import com.fuint.common.service.SettingService;
@ -25,6 +30,7 @@ import com.fuint.utils.Digests;
import com.fuint.utils.Encodes; import com.fuint.utils.Encodes;
import jdk.nashorn.internal.parser.Token; import jdk.nashorn.internal.parser.Token;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.mock.web.MockMultipartFile; import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -51,6 +57,10 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
@Resource @Resource
private DutyService tDutyService; private DutyService tDutyService;
@Lazy
@Resource
private TagCodeRecordService tagCodeRecordService;
/** /**
* 根据条件分页查询员工信息 * 根据条件分页查询员工信息
* @param page * @param page
@ -65,7 +75,21 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
storeId = staff.getStoreId(); storeId = staff.getStoreId();
} }
staff.setStoreId(storeId); staff.setStoreId(storeId);
return baseMapper.selectLJStaffList(page,staff); IPage<LJStaff> ljStaffIPage = baseMapper.selectLJStaffList(page, staff);
List<LJStaff> records = ljStaffIPage.getRecords();
if (CollectionUtils.isNotEmpty(records)){
for (LJStaff record : records) {
LambdaQueryWrapper<TagCodeRecord> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TagCodeRecord::getStaffId,record.getId());
List<TagCodeRecord> list = tagCodeRecordService.list(queryWrapper);
if (ObjectUtils.isNotEmpty(list)){
record.setTagStatus("1");
}else {
record.setTagStatus("0");
}
}
}
return ljStaffIPage;
} }
/** /**

View File

@ -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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.tag.entity.OilTag; import com.fuint.business.tag.entity.OilTag;
import com.fuint.business.tag.service.OilTagService; import com.fuint.business.tag.service.OilTagService;
@ -42,7 +44,15 @@ public class OilTagController extends BaseController {
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@Param("cardFuelDiesel") OilTag oilTag) { @Param("cardFuelDiesel") OilTag oilTag) {
Page page = new Page(pageNo, pageSize); Page page = new Page(pageNo, pageSize);
return getSuccessResult(this.oilTagService.page(page, new QueryWrapper<>(oilTag))); LambdaQueryWrapper<OilTag> 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));
} }
/** /**

View File

@ -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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.tag.dto.TagCodeDTO; import com.fuint.business.tag.dto.TagCodeDTO;
import com.fuint.business.tag.entity.TagCode; import com.fuint.business.tag.entity.TagCode;
@ -57,7 +59,12 @@ public class TagCodeController extends BaseController {
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@Param("cardFuelDiesel") TagCode tagCode) { @Param("cardFuelDiesel") TagCode tagCode) {
Page page = new Page(pageNo, pageSize); Page page = new Page(pageNo, pageSize);
return getSuccessResult(this.tagCodeService.page(page, new QueryWrapper<>(tagCode))); LambdaQueryWrapper<TagCode> 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));
} }
/** /**

View File

@ -127,14 +127,18 @@ public class TagCodeRecordController extends BaseController {
} }
/** /**
* 删除数据 * 码牌与油站解绑
* *
* @param id 主键结合 * @param id 主键结合
* @return 删除结果 * @return 删除结果
*/ */
@DeleteMapping("id") /* @DeleteMapping("id")
public ResponseObject delete(@PathVariable Long 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)); return getSuccessResult(this.tagCodeRecordService.removeById(id));
} }*/
} }

View File

@ -17,6 +17,7 @@
<select id="selectTagList" resultType="com.fuint.business.tag.vo.TagCodeRecordVO"> <select id="selectTagList" resultType="com.fuint.business.tag.vo.TagCodeRecordVO">
<include refid="selectTagListsq"></include> <include refid="selectTagListsq"></include>
<where> <where>
ot.mt_status = 0
<if test="tagCodeRecord.storeId != null and tagCodeRecord.storeId != ''"> <if test="tagCodeRecord.storeId != null and tagCodeRecord.storeId != ''">
and tcr.store_id = #{tagCodeRecord.storeId} and tcr.store_id = #{tagCodeRecord.storeId}
</if> </if>

View File

@ -55,6 +55,7 @@ public class TagCodeRecordServiceImpl extends ServiceImpl<TagCodeRecordMapper, T
@Transactional @Transactional
public boolean add(TagCodeRecordDTO tagCodeRecordDTO) { public boolean add(TagCodeRecordDTO tagCodeRecordDTO) {
boolean flag = false; boolean flag = false;
//绑定之前 先去查询
TagCodeRecord tagCodeRecord = new TagCodeRecord(); TagCodeRecord tagCodeRecord = new TagCodeRecord();
if (ObjectUtils.isNotEmpty(tagCodeRecordDTO) && CollectionUtils.isNotEmpty(tagCodeRecordDTO.getOilTagList())){ if (ObjectUtils.isNotEmpty(tagCodeRecordDTO) && CollectionUtils.isNotEmpty(tagCodeRecordDTO.getOilTagList())){
for (Integer integer : tagCodeRecordDTO.getOilTagList()) { for (Integer integer : tagCodeRecordDTO.getOilTagList()) {