Commit d62f5506 by shenjunjie

全网搜导出调整

parent ba925574
......@@ -5,7 +5,6 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.ToString;
import org.apache.commons.lang3.StringUtils;
import java.util.Date;
......@@ -39,15 +38,15 @@ public class ExportSearchWholeDTO {
@ExcelProperty("地址")
private String url;
public static ExportSearchWholeDTO creatExportSearchWholeDTO(JSONObject jsonObject){
public static ExportSearchWholeDTO creatExportSearchWholeDTO(JSONObject jsonObject) {
ExportSearchWholeDTO dto = new ExportSearchWholeDTO();
dto.setTime(new Date((Long) jsonObject.get("time")));
dto.setPlatform(jsonObject.getString("platform"));
dto.setChannel(jsonObject.getString("channel"));
// 截取为excel单元格允许的最大长度
dto.setTitle(StringUtils.substring(jsonObject.getString("title"), 0, 32767));
dto.setContent(StringUtils.substring(jsonObject.getString("content"), 0, 32767));
dto.setUrl(StringUtils.substring(jsonObject.getString("url"), 0, 32767));
dto.setTitle(jsonObject.getString("title"));
dto.setContent(jsonObject.getString("content"));
dto.setUrl(jsonObject.getString("url"));
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