|
@@ -156,23 +156,23 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
|
|
|
@Override
|
|
|
@ApiOperation("更新商户线路")
|
|
|
- public R updateLine(@RequestBody @Validated DeviceInfoDto.UpdateLine updateLine){
|
|
|
- LambdaUpdateWrapper<DeviceInfo> luw = new LambdaUpdateWrapper<DeviceInfo>().eq(DeviceInfo::getMercId,updateLine.getMercId());
|
|
|
+ public R updateLine(@RequestBody @Validated DeviceInfoDto.UpdateLine updateLine) {
|
|
|
+ LambdaUpdateWrapper<DeviceInfo> luw = new LambdaUpdateWrapper<DeviceInfo>().eq(DeviceInfo::getMercId, updateLine.getMercId());
|
|
|
//绑定线路,更换线路
|
|
|
- if(DeviceInfoDto.UPDATE.equals(updateLine.getType())){
|
|
|
+ if (DeviceInfoDto.UPDATE.equals(updateLine.getType())) {
|
|
|
DeviceInfo deviceInfo = new DeviceInfo();
|
|
|
deviceInfo.setPlaceLineId(updateLine.getPlaceLineId());
|
|
|
- luw.in(DeviceInfo::getDeviceId,updateLine.getDeviceIds());
|
|
|
- baseMapper.update(deviceInfo,luw);
|
|
|
+ luw.in(DeviceInfo::getDeviceId, updateLine.getDeviceIds());
|
|
|
+ baseMapper.update(deviceInfo, luw);
|
|
|
}
|
|
|
//删除线路
|
|
|
- if(DeviceInfoDto.DEL.equals(updateLine.getType())) {
|
|
|
+ if (DeviceInfoDto.DEL.equals(updateLine.getType())) {
|
|
|
luw.eq(DeviceInfo::getPlaceLineId, updateLine.getWherePlaceLineId());
|
|
|
luw.set(DeviceInfo::getPlaceLineId, null);
|
|
|
baseMapper.update(null, luw);
|
|
|
}
|
|
|
//解绑线路 设置线路ID为null
|
|
|
- if(DeviceInfoDto.CLEAR.equals(updateLine.getType())) {
|
|
|
+ if (DeviceInfoDto.CLEAR.equals(updateLine.getType())) {
|
|
|
luw.in(DeviceInfo::getDeviceId, updateLine.getDeviceIds());
|
|
|
luw.set(DeviceInfo::getPlaceLineId, null);
|
|
|
baseMapper.update(null, luw);
|
|
@@ -183,23 +183,23 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
|
|
|
@Override
|
|
|
@ApiOperation("更新商户点位")
|
|
|
- public R updatePlace(@RequestBody @Validated DeviceInfoDto.UpdatePlace updatePlace){
|
|
|
- LambdaUpdateWrapper<DeviceInfo> luw = new LambdaUpdateWrapper<DeviceInfo>().eq(DeviceInfo::getMercId,updatePlace.getMercId());
|
|
|
+ public R updatePlace(@RequestBody @Validated DeviceInfoDto.UpdatePlace updatePlace) {
|
|
|
+ LambdaUpdateWrapper<DeviceInfo> luw = new LambdaUpdateWrapper<DeviceInfo>().eq(DeviceInfo::getMercId, updatePlace.getMercId());
|
|
|
//绑定点位,更换点位
|
|
|
- if(DeviceInfoDto.UPDATE.equals(updatePlace.getType())){
|
|
|
+ if (DeviceInfoDto.UPDATE.equals(updatePlace.getType())) {
|
|
|
DeviceInfo deviceInfo = new DeviceInfo();
|
|
|
deviceInfo.setPlaceId(updatePlace.getPlaceId());
|
|
|
- luw.in(DeviceInfo::getDeviceId,updatePlace.getDeviceIds());
|
|
|
- baseMapper.update(deviceInfo,luw);
|
|
|
+ luw.in(DeviceInfo::getDeviceId, updatePlace.getDeviceIds());
|
|
|
+ baseMapper.update(deviceInfo, luw);
|
|
|
}
|
|
|
//删除点位
|
|
|
- if(DeviceInfoDto.DEL.equals(updatePlace.getType())) {
|
|
|
+ if (DeviceInfoDto.DEL.equals(updatePlace.getType())) {
|
|
|
luw.eq(DeviceInfo::getPlaceId, updatePlace.getWherePlaceId());
|
|
|
luw.set(DeviceInfo::getPlaceId, null);
|
|
|
baseMapper.update(null, luw);
|
|
|
}
|
|
|
//解绑点位 设置点位ID为null
|
|
|
- if(DeviceInfoDto.CLEAR.equals(updatePlace.getType())) {
|
|
|
+ if (DeviceInfoDto.CLEAR.equals(updatePlace.getType())) {
|
|
|
luw.in(DeviceInfo::getDeviceId, updatePlace.getDeviceIds());
|
|
|
luw.set(DeviceInfo::getPlaceId, null);
|
|
|
baseMapper.update(null, luw);
|
|
@@ -297,6 +297,16 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
return R.ok(copy(DeviceInfoDto.Vo.class, list));
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public R<List<DeviceInfoDto.Vo>> listCommon(DeviceInfoDto.ListCommon dto) {
|
|
|
+ LambdaQueryWrapper<DeviceInfo> lambdaQueryWrapper = new MybatisPlusQuery().eqWrapper(dto.getVo(), DeviceInfo.class).build();
|
|
|
+ List<Long> placeLineIds = dto.getPlaceLineIds();
|
|
|
+ if (CollUtil.isNotEmpty(placeLineIds)) {
|
|
|
+ lambdaQueryWrapper.eq(DeviceInfo::getPlaceId, placeLineIds);
|
|
|
+ }
|
|
|
+ return R.ok(copy(DeviceInfoDto.Vo.class, list(lambdaQueryWrapper)));
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取商户设备列表
|
|
|
*
|