Project

General

Profile

Wiki » History » Version 5

Soh Keong, 06/11/2021 04:51 PM

1 1 Soh Keong
{{toc}}
2
3
h1. Specification
4
5
h1. Activity Diagram
6
!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 5 Soh Keong
"Jar":/redmine/attachments/download/602/lib.rar
18
"Lib":/redmine/attachments/download/602/lib.rar
19 2 Soh Keong
20
h2. Database Table
21
22
<pre>
23
CREATE TABLE KEYWORD_PRODUCT (
24
	KEYWORD_REF_NO INTEGER NOT NULL,
25
	KEYWORD VARCHAR(50) NOT NULL,
26
	STATUS VARCHAR(2) DEFAULT 'A', 
27
	CREATE_DATETIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
28
	MODIFY_DATETIME TIMESTAMP,
29
	PRIMARY KEY (KEYWORD_REF_NO))
30
31
CREATE UNIQUE INDEX UI_PROD_KEYWORD ON KEYWORD_PRODUCT(KEYWORD)
32
</pre>
33
34
<pre>
35
CREATE TABLE KEYWORD_PRODUCT_PATTERN (
36
	PRODUCT_REF_NO INTEGER NOT NULL,
37
	KEYWORD_REF_NO INTEGER NOT NULL,
38
	PRIORITY INTEGER,
39
	STATUS VARCHAR(2) DEFAULT 'A', 
40
	CREATE_DATETIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
41
	MODIFY_DATETIME TIMESTAMP,
42
	PRIMARY KEY (PRODUCT_REF_NO,KEYWORD_REF_NO))
43
	
44
CREATE INDEX IX_KEYWORD_PRODUCT_PATTERN_PRIO ON KEYWORD_PRODUCT_PATTERN(PRIORITY)
45
CREATE INDEX IX_KEYWORD_PRODUCT_PATTERN_STATUS ON KEYWORD_PRODUCT_PATTERN(STATUS)
46
</pre>
47
48
<pre>
49
CREATE TABLE KEYWORD_SEARCH_PRODUCT (
50
	PRODUCT_REF_NO INTEGER NOT NULL,
51
	SHOPPER_REF_NO INTEGER NOT NULL,
52
	SEARCH_TYPE VARCHAR(5) NOT NULL, 
53
	CREATE_DATETIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
54
	MODIFY_DATETIME TIMESTAMP,
55
	PRIMARY KEY (PRODUCT_REF_NO,SHOPPER_REF_NO,SEARCH_TYPE))
56
	
57
CREATE INDEX IX_KEYWORD_SEARCH_PRODUCT_MODI ON KEYWORD_SEARCH_PRODUCT(MODIFY_DATETIME)
58
</pre>
59
60
<pre>
61
CREATE TABLE KEYWORD_SEARCH_PATTERN (
62
	SHOPPER_REF_NO INTEGER NOT NULL,
63
	KEYWORD_REF_NO INTEGER NOT NULL,
64
	PRIORITY INTEGER NOT NULL,
65
	CREATE_DATETIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
66
	MODIFY_DATETIME TIMESTAMP,
67
	PRIMARY KEY (SHOPPER_REF_NO, KEYWORD_REF_NO, PRIORITY))
68
69
CREATE INDEX IX_KEYWORD_SEARCH_PATTERN_MODIFY ON KEYWORD_SEARCH_PATTERN(MODIFY_DATETIME)
70 1 Soh Keong
</pre>
71
72 5 Soh Keong
h2. Methods
73 3 Soh Keong
74 5 Soh Keong
h3. Keyword
75 3 Soh Keong
76 1 Soh Keong
<pre>
77 3 Soh Keong
com.cosway.keyword.service.KeywordService service = new com.cosway.keyword.service.KeywordService();
78
</pre>
79
80
<pre>
81 5 Soh Keong
boolean              added      = service.addKeyword(Connection conn, String keyword)
82
boolean              updated    = service.updateKeywordStatus(Connection conn, int keywordRefNo, String status)
83
Map<Integer, String> KeywordMap = service.getKeywordAInActiveMap(Connection conn) 
84
Map<Integer, String> KeywordMap = service.getKeywordAllMap(Connection conn)
85
Map<Integer, String> KeywordMap = service.getKeywordPrefixMap(Connection conn, String search)
86
Map<Integer, String> KeywordMap = service.getKeywordwildcardMap(Connection conn, String search)
87 3 Soh Keong
</pre>
88
89 1 Soh Keong
h3. Product
90 3 Soh Keong
91
<pre>
92 5 Soh Keong
com.cosway.keyword.service.ProductService service = new com.cosway.keyword.service.ProductService();
93 1 Soh Keong
</pre>
94
95 5 Soh Keong
<pre>
96
boolean                        added      = service.addProductKeyword(Connection conn, KeywordBean keyword)
97
boolean                        updated    = service.updateProductStatus(Connection conn, int productRefNo, String status)
98
Map<Integer, Set<KeywordBean>> productMap = service.getProductKeywordMap(Connection conn)
99
Set<KeywordBean>               productSet = service.getProductKeywordSetByProductRefNo(Connection conn, int productRefNo)
100
Set<Integer>                   productSet = service.getProductSetByStatus(Connection conn, String status)
101
</pre>
102
103 4 Soh Keong
h3. Add product Keyword
104
105
<pre>
106 5 Soh Keong
com.cosway.keyword.service.PurchaseService service = new com.cosway.keyword.service.PurchaseService();
107 4 Soh Keong
</pre>
108
109 5 Soh Keong
<pre>
110
boolean added = service.addProductPattern(Connection conn, PurchaseBean bean)
111
</pre>
112
113 4 Soh Keong
h3. Search
114
115
<pre>
116 5 Soh Keong
com.cosway.keyword.service.SearchService service = new com.cosway.keyword.service.SearchService();
117
</pre>
118
119
<pre>
120
Set<Integer>          productSet = service.getProductListByType(Connection conn, SearchBean searchBean)
121
Map<Integer, Integer> productMap = service.getProductRefNoByLevel(Connection conn, SearchBean searchBean)
122 4 Soh Keong
</pre>