Commit ba925574 by 陈健智

全网搜导出调整

parent 4cd3f9da
...@@ -5,9 +5,9 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth; ...@@ -5,9 +5,9 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
import org.apache.commons.lang3.StringUtils;
import java.util.Date; import java.util.Date;
import java.util.Objects;
/** /**
* 全网搜舆情导出实体类 * 全网搜舆情导出实体类
...@@ -42,11 +42,12 @@ public class ExportSearchWholeDTO { ...@@ -42,11 +42,12 @@ public class ExportSearchWholeDTO {
public static ExportSearchWholeDTO creatExportSearchWholeDTO(JSONObject jsonObject){ public static ExportSearchWholeDTO creatExportSearchWholeDTO(JSONObject jsonObject){
ExportSearchWholeDTO dto = new ExportSearchWholeDTO(); ExportSearchWholeDTO dto = new ExportSearchWholeDTO();
dto.setTime(new Date((Long) jsonObject.get("time"))); dto.setTime(new Date((Long) jsonObject.get("time")));
dto.setPlatform(Objects.isNull(jsonObject.getString("platform")) ? "" : jsonObject.getString("platform")); dto.setPlatform(jsonObject.getString("platform"));
dto.setChannel(Objects.isNull(jsonObject.getString("channel")) ? "" : jsonObject.getString("channel")); dto.setChannel(jsonObject.getString("channel"));
dto.setTitle(Objects.isNull(jsonObject.getString("title")) ? "" : jsonObject.getString("title")); // 截取为excel单元格允许的最大长度
dto.setContent(Objects.isNull(jsonObject.getString("content")) ? "" : jsonObject.getString("content")); dto.setTitle(StringUtils.substring(jsonObject.getString("title"), 0, 32767));
dto.setUrl(Objects.isNull(jsonObject.getString("url")) ? "" : jsonObject.getString("url")); dto.setContent(StringUtils.substring(jsonObject.getString("content"), 0, 32767));
dto.setUrl(StringUtils.substring(jsonObject.getString("url"), 0, 32767));
return dto; return dto;
} }
} }
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