| | |
| | | package org.jeecg.modules.dry.service.impl; |
| | | |
| | | import org.jeecg.common.util.RedisUtil; |
| | | import org.jeecg.modules.dry.common.CacheConstants; |
| | | import org.jeecg.modules.dry.entity.DryEquipment; |
| | | import org.jeecg.modules.dry.mapper.DryEquipmentMapper; |
| | | import org.jeecg.modules.dry.service.IDryEquipmentService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 干燥机 |
| | |
| | | @Service |
| | | public class DryEquipmentServiceImpl extends ServiceImpl<DryEquipmentMapper, DryEquipment> implements IDryEquipmentService { |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | @Override |
| | | public DryEquipment selectByTenantIdEquipmentId(String tenantId, String equipmentId) { |
| | | DryEquipment dryEquipment = (DryEquipment) redisUtil.hget(CacheConstants.RedisKeyEnum.EQP_MAP.getCode(), tenantId + equipmentId); |
| | | if (dryEquipment == null) { |
| | | List<DryEquipment> list = this.list(); |
| | | for (DryEquipment equipment : list) { |
| | | redisUtil.hset(CacheConstants.RedisKeyEnum.EQP_MAP.getCode(),equipment.getTenantId()+equipment.getCode(),equipment); |
| | | if ((equipment.getTenantId()+equipment.getCode()).equals(tenantId + equipmentId)) { |
| | | dryEquipment = equipment; |
| | | } |
| | | } |
| | | } |
| | | return dryEquipment; |
| | | } |
| | | } |