Wiki » History » Version 12
Soh Keong, 11/15/2021 02:45 PM
1 | 1 | Soh Keong | {{toc}} |
---|---|---|---|
2 | |||
3 | h1. Specification |
||
4 | |||
5 | 6 | Soh Keong | h1. Chart |
6 | 1 | Soh Keong | !FlowChart.jpg! |
7 | 2 | Soh Keong | |
8 | h1. Programming Guide |
||
9 | |||
10 | h2. Jar version |
||
11 | |||
12 | |_. version |_. Description | |
||
13 | | 1.0 | Init | |
||
14 | |||
15 | h2. Jar File Download |
||
16 | |||
17 | 11 | Soh Keong | "Jar":/redmine/attachments/download/618/keyword-1.0.jar |
18 | 1 | Soh Keong | "Lib":/redmine/attachments/download/602/lib.rar |
19 | 6 | Soh Keong | |
20 | h3. Test Link |
||
21 | |||
22 | https://202.129.164.38:9093/TestPage/page/keyword/addKeyword |
||
23 | |||
24 | 2 | Soh Keong | |
25 | h2. Database Table |
||
26 | |||
27 | <pre> |
||
28 | CREATE TABLE KEYWORD_PRODUCT ( |
||
29 | KEYWORD_REF_NO INTEGER NOT NULL, |
||
30 | KEYWORD VARCHAR(50) NOT NULL, |
||
31 | STATUS VARCHAR(2) DEFAULT 'A', |
||
32 | CREATE_DATETIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, |
||
33 | MODIFY_DATETIME TIMESTAMP, |
||
34 | PRIMARY KEY (KEYWORD_REF_NO)) |
||
35 | |||
36 | CREATE UNIQUE INDEX UI_PROD_KEYWORD ON KEYWORD_PRODUCT(KEYWORD) |
||
37 | </pre> |
||
38 | |||
39 | <pre> |
||
40 | CREATE TABLE KEYWORD_PRODUCT_PATTERN ( |
||
41 | PRODUCT_REF_NO INTEGER NOT NULL, |
||
42 | KEYWORD_REF_NO INTEGER NOT NULL, |
||
43 | PRIORITY INTEGER, |
||
44 | STATUS VARCHAR(2) DEFAULT 'A', |
||
45 | CREATE_DATETIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, |
||
46 | MODIFY_DATETIME TIMESTAMP, |
||
47 | PRIMARY KEY (PRODUCT_REF_NO,KEYWORD_REF_NO)) |
||
48 | |||
49 | CREATE INDEX IX_KEYWORD_PRODUCT_PATTERN_PRIO ON KEYWORD_PRODUCT_PATTERN(PRIORITY) |
||
50 | CREATE INDEX IX_KEYWORD_PRODUCT_PATTERN_STATUS ON KEYWORD_PRODUCT_PATTERN(STATUS) |
||
51 | 10 | Soh Keong | CREATE INDEX IX_KEYWORD_PRODUCT_PATTERN_DATE ON KEYWORD_PRODUCT_PATTERN(MODIFY_DATETIME) |
52 | 2 | Soh Keong | </pre> |
53 | |||
54 | <pre> |
||
55 | CREATE TABLE KEYWORD_SEARCH_PRODUCT ( |
||
56 | PRODUCT_REF_NO INTEGER NOT NULL, |
||
57 | SHOPPER_REF_NO INTEGER NOT NULL, |
||
58 | SEARCH_TYPE VARCHAR(5) NOT NULL, |
||
59 | CREATE_DATETIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, |
||
60 | 9 | Soh Keong | MODIFY_DATETIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, |
61 | 2 | Soh Keong | PRIMARY KEY (PRODUCT_REF_NO,SHOPPER_REF_NO,SEARCH_TYPE)) |
62 | |||
63 | CREATE INDEX IX_KEYWORD_SEARCH_PRODUCT_MODI ON KEYWORD_SEARCH_PRODUCT(MODIFY_DATETIME) |
||
64 | </pre> |
||
65 | |||
66 | <pre> |
||
67 | CREATE TABLE KEYWORD_SEARCH_PATTERN ( |
||
68 | SHOPPER_REF_NO INTEGER NOT NULL, |
||
69 | KEYWORD_REF_NO INTEGER NOT NULL, |
||
70 | PRIORITY INTEGER NOT NULL, |
||
71 | CREATE_DATETIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, |
||
72 | 9 | Soh Keong | MODIFY_DATETIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, |
73 | 2 | Soh Keong | PRIMARY KEY (SHOPPER_REF_NO, KEYWORD_REF_NO, PRIORITY)) |
74 | |||
75 | CREATE INDEX IX_KEYWORD_SEARCH_PATTERN_MODIFY ON KEYWORD_SEARCH_PATTERN(MODIFY_DATETIME) |
||
76 | 1 | Soh Keong | </pre> |
77 | |||
78 | 5 | Soh Keong | h2. Methods |
79 | 3 | Soh Keong | |
80 | 5 | Soh Keong | h3. Keyword |
81 | 3 | Soh Keong | |
82 | 1 | Soh Keong | <pre> |
83 | 3 | Soh Keong | com.cosway.keyword.service.KeywordService service = new com.cosway.keyword.service.KeywordService(); |
84 | </pre> |
||
85 | |||
86 | 12 | Soh Keong | |
87 | 5 | Soh Keong | boolean added = service.addKeyword(Connection conn, String keyword) |
88 | 1 | Soh Keong | boolean updated = service.updateKeywordStatus(Connection conn, int keywordRefNo, String status) |
89 | 12 | Soh Keong | Map<Integer, String> KeywordMap = service.getKeywordAInActiveMap(Connection conn, *int startFrom, int totalRecord* ) |
90 | Map<Integer, String> KeywordMap = service.getKeywordAllMap(Connection conn, *int startFrom, int totalRecord* ) |
||
91 | Map<Integer, String> KeywordMap = service.getKeywordPrefixMap(Connection conn, String search, *int startFrom, int totalRecord* ) |
||
92 | Map<Integer, String> KeywordMap = service.getKeywordwildcardMap(Connection conn, String search, *int startFrom, int totalRecord* ) |
||
93 | 3 | Soh Keong | |
94 | 12 | Soh Keong | |
95 | 1 | Soh Keong | h3. Product |
96 | 3 | Soh Keong | |
97 | 5 | Soh Keong | <pre> |
98 | 1 | Soh Keong | com.cosway.keyword.service.ProductService service = new com.cosway.keyword.service.ProductService(); |
99 | </pre> |
||
100 | 5 | Soh Keong | |
101 | 12 | Soh Keong | |
102 | 5 | Soh Keong | boolean added = service.addProductKeyword(Connection conn, KeywordBean keyword) |
103 | boolean updated = service.updateProductStatus(Connection conn, int productRefNo, String status) |
||
104 | 12 | Soh Keong | Map<Integer, Set<KeywordBean>> productMap = service.getProductKeywordMap(Connection conn, *int startFrom, int totalRecord* ) |
105 | Set<KeywordBean> productSet = service.getProductKeywordSetByProductRefNo(Connection conn, int productRefNo, *int startFrom, int totalRecord* ) |
||
106 | Set<Integer> productSet = service.getProductSetByStatus(Connection conn, String status, *int startFrom, int totalRecord* ) |
||
107 | 5 | Soh Keong | |
108 | 7 | Soh Keong | > * *productRefNo* - |
109 | > * *keywordRefNo* - |
||
110 | 4 | Soh Keong | > * *priority* - |
111 | |||
112 | h3. Add product Keyword |
||
113 | 5 | Soh Keong | |
114 | 4 | Soh Keong | <pre> |
115 | com.cosway.keyword.service.PurchaseService service = new com.cosway.keyword.service.PurchaseService(); |
||
116 | 5 | Soh Keong | </pre> |
117 | |||
118 | boolean added = service.addProductPattern(Connection conn, PurchaseBean bean) |
||
119 | |||
120 | 7 | Soh Keong | > * *productRefNo* - |
121 | > * *searchType* - com.cosway.keyword.constant.SearchType |
||
122 | > * *shopperRefNo* - |
||
123 | 4 | Soh Keong | |
124 | h3. Search |
||
125 | 5 | Soh Keong | |
126 | <pre> |
||
127 | com.cosway.keyword.service.SearchService service = new com.cosway.keyword.service.SearchService(); |
||
128 | </pre> |
||
129 | |||
130 | 1 | Soh Keong | Set<Integer> productSet = service.getProductListByType(Connection conn, SearchBean searchBean) |
131 | 11 | Soh Keong | Map<Integer, Integer> productMap = service.getProductRefNoByLevel(Connection conn, SearchBean searchBean) |
132 | 4 | Soh Keong | Set<Integer> productSet = service.getProductListByProduct(Connection conn, SearchBean searchBean) |
133 | 1 | Soh Keong | |
134 | 11 | Soh Keong | > By Type |
135 | > * *shopperRefNo* - |
||
136 | > * *noOfRecords* - |
||
137 | > * *searchType* - com.cosway.keyword.constant.SearchType |
||
138 | |||
139 | > By Level |
||
140 | > * *shopperRefNo* - |
||
141 | > * *noOfRecords* - |
||
142 | > * *level* - |
||
143 | |||
144 | > By Product |
||
145 | 7 | Soh Keong | > * *productRefNo* - |
146 | > * *noOfRecords* - |
||
147 | 11 | Soh Keong | > * *level* - (By Level & Product only) |