Merge remote-tracking branch 'origin/herb' into herb
| | |
| | | String clientId = mqttUtil.getMqttClient().getClientId(); |
| | | String tenant = clientId.substring(clientId.lastIndexOf("_")+1); |
| | | if (tenantId!=null && tenantId.equals(tenant)) { |
| | | TenantContext.setTenant(tenantId); |
| | | // 根据设备编码查询设备信息 |
| | | String code = messageJson.getString("code"); |
| | | DryEquipment equipmentVo = equipmentService.selectByTenantIdEquipmentId(tenantId,code); |
| | | // 根据设备车间id查询车间信息 |
| | | DryShop shop = dryShopService.selectByTenantIdShopId(tenantId, equipmentVo.getShopId()); |
| | | DryShop shop = dryShopService.getById(equipmentVo.getShopId()); |
| | | // 根据设备类型ID查询设备类型信息 |
| | | DryEqpType eqpType = eqpTypeService.selectByTenantIdTypeId(tenantId, equipmentVo.getType()); |
| | | DryEqpType eqpType = eqpTypeService.getById(equipmentVo.getType()); |
| | | |
| | | JSONObject res = new JSONObject(); |
| | | |
| | | res.put("tenant", clientId); |
| | | res.put("tenant", tenantId); |
| | | res.put("equipment", equipmentVo); |
| | | res.put("shop", shop); |
| | | res.put("eqpType", eqpType); |
| | |
| | | */ |
| | | public interface IDryEqpTypeService extends IService<DryEqpType> { |
| | | |
| | | DryEqpType selectByTenantIdTypeId(String type, String equipmentVoType); |
| | | } |
| | |
| | | */ |
| | | public interface IDryShopService extends IService<DryShop> { |
| | | |
| | | DryShop selectByTenantIdShopId(String tenantId, String shopId); |
| | | } |
| | |
| | | @Service |
| | | public class DryEqpTypeServiceImpl extends ServiceImpl<DryEqpTypeMapper, DryEqpType> implements IDryEqpTypeService { |
| | | |
| | | @Override |
| | | public DryEqpType selectByTenantIdTypeId(String tenantId, String id) { |
| | | LambdaQueryWrapper<DryEqpType> query = new LambdaQueryWrapper<>(); |
| | | query.eq(DryEqpType::getTenantId, tenantId); |
| | | query.eq(DryEqpType::getId, id); |
| | | return this.getOne(query); |
| | | } |
| | | } |
| | |
| | | @Service |
| | | public class DryShopServiceImpl extends ServiceImpl<DryShopMapper, DryShop> implements IDryShopService { |
| | | |
| | | @Override |
| | | public DryShop selectByTenantIdShopId(String tenantId, String shopId) { |
| | | LambdaQueryWrapper<DryShop> query = new LambdaQueryWrapper<>(); |
| | | query.eq(DryShop::getTenantId, tenantId); |
| | | query.eq(DryShop::getId, shopId); |
| | | return this.getOne(query); |
| | | } |
| | | } |