|
@@ -55,7 +55,7 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
|
|
|
private final RedisService<String> redisService;
|
|
private final RedisService<String> redisService;
|
|
|
|
|
|
- private String keyPrefix = "device:history:";
|
|
|
|
|
|
+ private final String keyPrefix = "device:history:";
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@ApiOperation("对象查询")
|
|
@ApiOperation("对象查询")
|
|
@@ -182,6 +182,7 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public R<Boolean> mercDeviceAuth(DeviceInfoDto.MercDeviceAuthDto auth) {
|
|
public R<Boolean> mercDeviceAuth(DeviceInfoDto.MercDeviceAuthDto auth) {
|
|
Long mercId = auth.getMercId();
|
|
Long mercId = auth.getMercId();
|
|
|
|
+ String mercCode = auth.getMercCode();
|
|
//商户最终设备列表
|
|
//商户最终设备列表
|
|
List<Long> deviceIds = auth.getDeviceIds();
|
|
List<Long> deviceIds = auth.getDeviceIds();
|
|
List<DeviceInfo> devices = getDevicesByMercId(mercId);
|
|
List<DeviceInfo> devices = getDevicesByMercId(mercId);
|
|
@@ -196,7 +197,7 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
List<DeviceInfo> deviceInfos = this.listByIds(deviceIds);
|
|
List<DeviceInfo> deviceInfos = this.listByIds(deviceIds);
|
|
deviceInfos.forEach(deviceInfo -> {
|
|
deviceInfos.forEach(deviceInfo -> {
|
|
//绑定关系
|
|
//绑定关系
|
|
- deviceInfo.setMercId(mercId);
|
|
|
|
|
|
+ deviceInfo.setMercId(mercId).setMercCode(mercCode);
|
|
});
|
|
});
|
|
updateBatchById(deviceInfos);
|
|
updateBatchById(deviceInfos);
|
|
//原来存在的设备关系,不在最终设备列表中的移除
|
|
//原来存在的设备关系,不在最终设备列表中的移除
|
|
@@ -234,6 +235,14 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
return updateBatchById(deviceInfos);
|
|
return updateBatchById(deviceInfos);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ @ApiOperation("集合查询")
|
|
|
|
+ @Override
|
|
|
|
+ public R<List<DeviceInfoDto.Vo>> list(DeviceInfoDto.ListDto dto) {
|
|
|
|
+ List<DeviceInfo> list = list(new LambdaQueryWrapper<DeviceInfo>().in(CollUtil.isNotEmpty(dto.getDeviceIds()), DeviceInfo::getDeviceId, dto.getDeviceIds()));
|
|
|
|
+ return R.ok(copy(DeviceInfoDto.Vo.class, list));
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 获取商户设备列表
|
|
* 获取商户设备列表
|
|
*
|
|
*
|