public static List<CollectionRecordInfo> assembly360ObjectInfo(List<List<Object>> list) {
List<CollectionRecordInfo> recordInfoList = new ArrayList();
List<Object> titleRow = list.get(0);
Field externalCode = ReflectionUtils.findField(CollectionRecordInfo.class, "externalCode");
Field contactResult = ReflectionUtils.findField(CollectionRecordInfo.class, "contactResult");
Field actionType = ReflectionUtils.findField(CollectionRecordInfo.class, "actionType");
Field dates = ReflectionUtils.findField(CollectionRecordInfo.class, "dates");
Map<String, Field> titleRefFiled = new HashMap<>();
titleRefFiled.put("offer_req_no", externalCode);
titleRefFiled.put("code_name", contactResult);
titleRefFiled.put("type", actionType);
titleRefFiled.put("act_date", dates);
for (int i = 1; i < list.size(); i++) {
CollectionRecordInfo recordInfo = new CollectionRecordInfo();
List<Object> rows = list.get(i);
for (int cellIndex = 0; cellIndex < rows.size(); cellIndex++) {
String value = (String) rows.get(cellIndex);
Field field = titleRefFiled.get(titleRow.get(cellIndex));
if (field == null) {
continue;
}
if (field.getName().equals("dates")) {
String datesValue = value + ReminderConstant.TIME_VALUE;
ReflectionUtils.setField(field, recordInfo, datesValue);
} else {
ReflectionUtils.setField(field, recordInfo, value);
}
}
recordInfo.setCollectionAgency(ReminderConstant.HZJG_360);
recordInfo.setImportPerson(ReminderConstant.IMPORT_PERSON);
recordInfo.setImportDate(FormatDate.formatTime(new Date()));
recordInfo.setActionCode(ReminderConstant.CJ_HZJG);
recordInfoList.add(recordInfo);
}
return recordInfoList;
}