Commit e7b92ac0 authored by 赵啸非's avatar 赵啸非

添加设备导入导出功能

parent 595f6442
......@@ -184,7 +184,7 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
deviceReq.setPlatformCode(platformEntity.getPlatformSn());
if (!ObjectUtils.isEmpty(platformEntity.getSendUrl())
&& platformEntity.getSendSwitch() == SendSwitchEnum.启用.getValue()
&&entity.getSwitchSend()) {
&& entity.getSwitchSend()) {
if (PatternPool.URL_HTTP.matcher(platformEntity.getSendUrl()).find()) {
ApiResp<String> resp = messageService.sendThirdParty(platformEntity.getSendUrl(), deviceReq);
} else {
......@@ -223,4 +223,16 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
super.removeBefore(ids, context);
}
@Override
protected void exportAfter(DeviceEntity params, Context context, List<DeviceEntity> list) throws AppException {
list.stream().forEach(deviceEntity -> {
PlatformEntity platformEntity = platformService.get(deviceEntity.getPlatformId());
ProductEntity productEntity = productService.get(deviceEntity.getProductId());
if (!ObjectUtils.isEmpty(platformEntity) && !ObjectUtils.isEmpty(productEntity)) {
deviceEntity.setProductCode(productEntity.getProductCode());
deviceEntity.setPlatformCode(platformEntity.getPlatformSn());
}
});
super.exportAfter(params, context, list);
}
}
\ No newline at end of file
......@@ -214,4 +214,12 @@ public class DeviceController extends BaseCRUDJsonMappingController<DeviceServic
return jsonObject.toJSONString();
}
@Override
public void doExportAfter(Context context, List<DeviceEntity> list) throws AppException {
list.stream().forEach(item->{
});
super.doExportAfter(context, list);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment