|
@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.github.yitter.idgen.YitIdHelper;
|
|
|
+import com.xy.annotation.LogOperate;
|
|
|
import com.xy.collections.list.JArrayList;
|
|
|
import com.xy.collections.list.JList;
|
|
|
import com.xy.collections.map.JHashMap;
|
|
@@ -37,6 +38,7 @@ import com.xy.dto.mini.MiniDeviceInfoDto;
|
|
|
import com.xy.dto.nfc.ActiveDeviceDTO;
|
|
|
import com.xy.entity.*;
|
|
|
import com.xy.enums.FileExportType;
|
|
|
+import com.xy.enums.LogEnum;
|
|
|
import com.xy.error.CommRuntimeException;
|
|
|
import com.xy.mapper.DeviceInfoMapper;
|
|
|
import com.xy.mapper.entity.DeviceInfoQueryPage;
|
|
@@ -834,6 +836,7 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
return R.ok(queryPage(page));
|
|
|
}
|
|
|
|
|
|
+ @LogOperate(logType = LogEnum.LogType.V2, optType = LogEnum.OptType.V2, logContent = "商户设备授权")
|
|
|
@ApiOperation(value = "商户设备授权", hidden = true)
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -1008,7 +1011,8 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
deviceStatusService.updateBatchById(deviceStatuses);
|
|
|
}
|
|
|
deviceAnnualFee.run(deviceInfos);
|
|
|
- return R.ok(Boolean.TRUE);
|
|
|
+ String log = String.format("商户设备授权:授权商户:%s,授权设备:%s", auth.getMercId() + "," + auth.getMercName(), deviceIds.size() == 0 ? "取消所有设备授权" : CollUtil.join(deviceIds, ","));
|
|
|
+ return R.ok(Boolean.TRUE).setLogMsg(log);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1018,9 +1022,22 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
+ @LogOperate(logType = LogEnum.LogType.V2, optType = LogEnum.OptType.V2, logContent = "解绑商户")
|
|
|
public R<Boolean> unBindMercDevice(DeviceInfoDto.MercDeviceUnBindDto dto) {
|
|
|
List<DeviceInfo> deviceInfos = this.listByIds(dto.getDeviceIds());
|
|
|
- return R.ok(removeMerRefDevicesToTopMerc(deviceInfos));
|
|
|
+ List<MercDto.Vo> mercs = mercService.list(new MercDto.SelectList()
|
|
|
+ .setMercIds(new JArrayList<>(deviceInfos).getProperty(DeviceInfo::getMercId).comparing())
|
|
|
+ ).getData();
|
|
|
+ StringJoiner mercIds = new StringJoiner(",");
|
|
|
+ StringJoiner mercNames = new StringJoiner(",");
|
|
|
+ JMap<Long, MercDto.Vo> mercMaps = new JArrayList<>(mercs).toMap(MercDto.Vo::getId).cover();
|
|
|
+ for (DeviceInfo deviceInfo : deviceInfos) {
|
|
|
+ MercDto.Vo vo = mercMaps.get(deviceInfo.getMercId());
|
|
|
+ mercIds.add(String.valueOf(deviceInfo.getMercId()));
|
|
|
+ mercNames.add(vo.getName());
|
|
|
+ }
|
|
|
+ String log = String.format("解绑商户:被解绑商户:%s,解绑设备:%s", mercIds + "," + mercNames, CollUtil.isEmpty(dto.getDeviceIds()) ? "" : CollUtil.join(dto.getDeviceIds(), ","));
|
|
|
+ return R.ok(removeMerRefDevicesToTopMerc(deviceInfos)).setLogMsg(log);
|
|
|
}
|
|
|
|
|
|
/**
|