修改
This commit is contained in:
@@ -381,20 +381,24 @@ public class OfficeProxy{
|
||||
*/
|
||||
public boolean importFromJson(String filePath,int type)
|
||||
{
|
||||
log.info("importFromJson ");
|
||||
String contents = readFileContents(filePath);
|
||||
log.info("contents:" + contents);
|
||||
if(contents == null || contents.isEmpty()) {
|
||||
log.error("contents is empty");
|
||||
return false;
|
||||
}
|
||||
log.info("init head:");
|
||||
initExcelHeader(type);
|
||||
JSONArray componentArray = JSONArray.parseArray(contents);
|
||||
log.info("componentArraySize:" + componentArray.size());
|
||||
for(int i=0;i<componentArray.size();i++)
|
||||
{
|
||||
JSONObject componentObj = componentArray.getJSONObject(i);
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
try {
|
||||
Component component = objectMapper.convertValue(componentObj,Component.class);
|
||||
log.info("component:"+component);
|
||||
log.info("object mapper component:"+component);
|
||||
componentToExcelRow(component,type);
|
||||
for(List<Object> row : rows)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user