Subversion Repositories SmartDukaan

Rev

Rev 31314 | Rev 33737 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 31314 Rev 33172
Line 19... Line 19...
19
import java.io.InputStream;
19
import java.io.InputStream;
20
import java.io.OutputStream;
20
import java.io.OutputStream;
21
import java.time.LocalDateTime;
21
import java.time.LocalDateTime;
22
import java.time.ZoneId;
22
import java.time.ZoneId;
23
import java.util.*;
23
import java.util.*;
-
 
24
import java.util.stream.Collectors;
24
 
25
 
25
public class ExcelUtils {
26
public class ExcelUtils {
26
	private static final String TAG_ID = "Tag Id";
27
	private static final String TAG_ID = "Tag Id";
27
	private static final String TAG_LABEL = "Tag Label";
28
	private static final String TAG_LABEL = "Tag Label";
28
	private static final String ITEM_ID = "Item Id";
29
	private static final String ITEM_ID = "Item Id";
Line 38... Line 39...
38
	private static final String FOFO_ID = "fofoId";
39
	private static final String FOFO_ID = "fofoId";
39
	private static final String STORE_NAME = "storeName";
40
	private static final String STORE_NAME = "storeName";
40
	private static final String EMAIL = "email";
41
	private static final String EMAIL = "email";
41
	private static final String TARGET_VALUE = "targetValue";
42
	private static final String TARGET_VALUE = "targetValue";
42
 
43
 
-
 
44
	private static List<Character> ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".chars().mapToObj(c -> (char) c).collect(Collectors.toList());
-
 
45
 
-
 
46
 
43
	private static final List<WalletReferenceType> BULK_WALLET_REFERENCES = Arrays.asList(
47
	private static final List<WalletReferenceType> BULK_WALLET_REFERENCES = Arrays.asList(
44
			WalletReferenceType.SCHEME_OUT,
48
			WalletReferenceType.SCHEME_OUT,
45
			WalletReferenceType.BRAND_FEE, WalletReferenceType.FESTIVE_OFFER, WalletReferenceType.GOODWILL_GESTURE,
49
			WalletReferenceType.BRAND_FEE, WalletReferenceType.FESTIVE_OFFER, WalletReferenceType.GOODWILL_GESTURE,
46
			WalletReferenceType.EOL, WalletReferenceType.ACTIVATION_SCHEME, WalletReferenceType.BRAND_PAYOUT,
50
			WalletReferenceType.EOL, WalletReferenceType.ACTIVATION_SCHEME, WalletReferenceType.BRAND_PAYOUT,
47
			WalletReferenceType.SALES_MARKETING_SUPPORT, WalletReferenceType.INVESTMENT_PAYOUT,
51
			WalletReferenceType.SALES_MARKETING_SUPPORT, WalletReferenceType.INVESTMENT_PAYOUT,
Line 928... Line 932...
928
			}
932
			}
929
			return walletHistoryModels;
933
			return walletHistoryModels;
930
		}
934
		}
931
	}
935
	}
932
 
936
 
-
 
937
 
-
 
938
	public static String toAlphabet(int number) {
-
 
939
		StringBuffer sb = new StringBuffer();
-
 
940
		boolean loop = true;
-
 
941
		while (loop) {
-
 
942
			sb.append(ALPHABETS.get(number % 26));
-
 
943
			number = number / 26;
-
 
944
			loop = number > 0;
-
 
945
 
-
 
946
		}
-
 
947
		return sb.reverse().toString();
-
 
948
	}
-
 
949
 
-
 
950
 
-
 
951
	public static String getCellValue(Cell cell) {
-
 
952
		if (cell == null) {
-
 
953
			return "Null cell";
-
 
954
		}
-
 
955
		switch (cell.getCellTypeEnum()) {
-
 
956
			case STRING:
-
 
957
				return cell.getStringCellValue().trim();
-
 
958
			case NUMERIC:
-
 
959
				if (DateUtil.isCellDateFormatted(cell)) {
-
 
960
					return cell.getDateCellValue().toString();
-
 
961
				} else {
-
 
962
					return Double.toString(cell.getNumericCellValue());
-
 
963
				}
-
 
964
			case BOOLEAN:
-
 
965
				return Boolean.toString(cell.getBooleanCellValue());
-
 
966
			case FORMULA:
-
 
967
				return cell.getCellFormula();
-
 
968
			default:
-
 
969
				return "";
-
 
970
		}
-
 
971
	}
-
 
972
 
933
}
973
}