Commit d62f5506 by shenjunjie

全网搜导出调整

parent ba925574
...@@ -5,7 +5,6 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth; ...@@ -5,7 +5,6 @@ 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;
...@@ -39,15 +38,15 @@ public class ExportSearchWholeDTO { ...@@ -39,15 +38,15 @@ public class ExportSearchWholeDTO {
@ExcelProperty("地址") @ExcelProperty("地址")
private String url; private String url;
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(jsonObject.getString("platform")); dto.setPlatform(jsonObject.getString("platform"));
dto.setChannel(jsonObject.getString("channel")); dto.setChannel(jsonObject.getString("channel"));
// 截取为excel单元格允许的最大长度 // 截取为excel单元格允许的最大长度
dto.setTitle(StringUtils.substring(jsonObject.getString("title"), 0, 32767)); dto.setTitle(jsonObject.getString("title"));
dto.setContent(StringUtils.substring(jsonObject.getString("content"), 0, 32767)); dto.setContent(jsonObject.getString("content"));
dto.setUrl(StringUtils.substring(jsonObject.getString("url"), 0, 32767)); dto.setUrl(jsonObject.getString("url"));
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