Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Component Sharing
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gagandeep Singh Bhatia
Component Sharing
Commits
743fa7e4
Commit
743fa7e4
authored
Mar 12, 2026
by
Ajit Deshmukh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added validations and item change
parent
032c6f10
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
188 additions
and
11 deletions
+188
-11
Ajit/VHB/Deployments/Deployments-02 MARCH/VHB Java component/ReqForQuotationWiz.java
...ments-02 MARCH/VHB Java component/ReqForQuotationWiz.java
+188
-11
No files found.
Ajit/VHB/Deployments/Deployments-02 MARCH/VHB Java component/ReqForQuotationWiz.java
View file @
743fa7e4
...
@@ -51,7 +51,7 @@ public class ReqForQuotationWiz extends ValidatorEJB{
...
@@ -51,7 +51,7 @@ public class ReqForQuotationWiz extends ValidatorEJB{
}
}
public
String
wfValData
(
String
xmlString
,
String
xmlString1
,
String
xmlString2
,
String
objContext
,
String
editFlag
,
String
xtraParams
,
String
formName
)
throws
RemoteException
,
ITMException
public
String
wfValData
(
String
xmlString
,
String
xmlString1
,
String
xmlString2
,
String
objContext
,
String
editFlag
,
String
xtraParams
,
String
formName
)
throws
RemoteException
,
ITMException
{
{
Document
dom
=
null
;
Document
dom
=
null
;
Document
dom1
=
null
;
Document
dom1
=
null
;
...
@@ -95,7 +95,7 @@ public class ReqForQuotationWiz extends ValidatorEJB{
...
@@ -95,7 +95,7 @@ public class ReqForQuotationWiz extends ValidatorEJB{
}
}
return
(
errString
);
return
(
errString
);
}
}
public
String
wfValData
(
Document
dom
,
Document
dom1
,
Document
dom2
,
String
objContext
,
String
editFlag
,
String
xtraParams
,
String
formName
)
throws
RemoteException
,
ITMException
public
String
wfValData
(
Document
dom
,
Document
dom1
,
Document
dom2
,
String
objContext
,
String
editFlag
,
String
xtraParams
,
String
formName
)
throws
RemoteException
,
ITMException
{
{
E12GenericUtility
genericUtility
=
new
ibase
.
utility
.
E12GenericUtility
();
E12GenericUtility
genericUtility
=
new
ibase
.
utility
.
E12GenericUtility
();
...
@@ -114,6 +114,8 @@ public class ReqForQuotationWiz extends ValidatorEJB{
...
@@ -114,6 +114,8 @@ public class ReqForQuotationWiz extends ValidatorEJB{
Connection
connectionObject
=
null
;
Connection
connectionObject
=
null
;
PreparedStatement
pstmt
=
null
;
PreparedStatement
pstmt
=
null
;
ResultSet
rSet
=
null
;
ResultSet
rSet
=
null
;
ResultSet
rs
=
null
;
String
propDateValue
=
""
;
String
propDateValue
=
""
;
int
firstMonth
=
01
;
int
firstMonth
=
01
;
int
lastMonth
=
12
;
int
lastMonth
=
12
;
...
@@ -128,6 +130,8 @@ public class ReqForQuotationWiz extends ValidatorEJB{
...
@@ -128,6 +130,8 @@ public class ReqForQuotationWiz extends ValidatorEJB{
AppConnectParm
appConnect
=
new
AppConnectParm
();
AppConnectParm
appConnect
=
new
AppConnectParm
();
Properties
p
=
appConnect
.
getProperty
();
Properties
p
=
appConnect
.
getProperty
();
itmDBAccessLocal
=
new
ITMDBAccessEJB
();
itmDBAccessLocal
=
new
ITMDBAccessEJB
();
String
sql
=
""
;
System
.
out
.
println
(
"wfValData objContext StrgBrandActWiz:: ["
+
objContext
+
"]"
);
System
.
out
.
println
(
"wfValData objContext StrgBrandActWiz:: ["
+
objContext
+
"]"
);
if
(
objContext
!=
null
&&
objContext
.
trim
().
length
()>
0
)
if
(
objContext
!=
null
&&
objContext
.
trim
().
length
()>
0
)
{
{
...
@@ -135,6 +139,139 @@ public class ReqForQuotationWiz extends ValidatorEJB{
...
@@ -135,6 +139,139 @@ public class ReqForQuotationWiz extends ValidatorEJB{
}
}
switch
(
currentFormNo
)
switch
(
currentFormNo
)
{
{
case
1
:
{
if
(
errString
.
indexOf
(
"<Errors>"
)
==
-
1
)
{
parentList
=
dom
.
getElementsByTagName
(
"Detail"
+
currentFormNo
);
int
parentNodeListLength
=
parentList
.
getLength
();
for
(
int
prntCtr
=
0
;
prntCtr
<
parentNodeListLength
;
prntCtr
++
)
{
parentNode
=
parentList
.
item
(
prntCtr
);
childList
=
parentNode
.
getChildNodes
();
noOfChilds
=
childList
.
getLength
();
for
(
int
ctr
=
0
;
ctr
<
noOfChilds
;
ctr
++)
{
childNode
=
childList
.
item
(
ctr
);
if
(
childNode
.
getNodeType
()
!=
Node
.
ELEMENT_NODE
)
{
continue
;
}
if
(
childNode
!=
null
&&
childNode
.
getFirstChild
()
!=
null
)
{
columnValue
=
childNode
.
getFirstChild
().
getNodeValue
();
}
childNodeName
=
childNode
.
getNodeName
();
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotationWiz childNodeName ["
+
childNodeName
+
"]"
);
if
(
childNodeName
.
equalsIgnoreCase
(
"cust_code"
)
)
{
String
custCode
=
checkNull
(
genericUtility
.
getColumnValue
(
"cust_code"
,
dom
));
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotationWiz custCode wfValData case 1 ["
+
custCode
+
"]"
);
String
checkCustCodeSql
=
"select count(cust_code) as custCodeCount from customer where cust_code = ?"
;
PreparedStatement
checkCustCodePs
=
connectionObject
.
prepareStatement
(
checkCustCodeSql
);
checkCustCodePs
.
setString
(
1
,
custCode
);
ResultSet
checkCustCodeRs
=
checkCustCodePs
.
executeQuery
();
while
(
checkCustCodeRs
.
next
())
{
int
custCodeCont
=
checkCustCodeRs
.
getInt
(
"custCodeCount"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotationWiz custCode wfValData case 1 custCodeCont::["
+
custCodeCont
+
"]"
);
if
(
custCodeCont
<=
0
)
{
errString
=
getErrorString
(
"cust_code"
,
"VTCUST1"
,
userId
);
break
;
}
}
if
(
checkCustCodeRs
!=
null
)
{
checkCustCodeRs
.
close
();
checkCustCodeRs
=
null
;
}
if
(
checkCustCodePs
!=
null
)
{
checkCustCodePs
.
close
();
checkCustCodePs
=
null
;
}
}
if
(
childNodeName
.
equalsIgnoreCase
(
"site_code"
)
)
{
String
siteCode
=
checkNull
(
genericUtility
.
getColumnValue
(
"site_code"
,
dom
));
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotationWiz siteCode wfValData case 1 ["
+
siteCode
+
"]"
);
String
checkSiteCodeSql
=
"select count(site_code) as siteCodeCount from site where site_code = ?"
;
PreparedStatement
checkSiteCodePs
=
connectionObject
.
prepareStatement
(
checkSiteCodeSql
);
checkSiteCodePs
.
setString
(
1
,
siteCode
);
ResultSet
checkSiteCodeRs
=
checkSiteCodePs
.
executeQuery
();
while
(
checkSiteCodeRs
.
next
())
{
int
siteCodeCont
=
checkSiteCodeRs
.
getInt
(
"siteCodeCount"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotationWiz siteCode wfValData case 1 siteCodeCont::["
+
siteCodeCont
+
"]"
);
if
(
siteCodeCont
<=
0
)
{
errString
=
getErrorString
(
"site_code"
,
"VTSITCD1"
,
userId
);
break
;
}
}
if
(
checkSiteCodeRs
!=
null
)
{
checkSiteCodeRs
.
close
();
checkSiteCodeRs
=
null
;
}
if
(
checkSiteCodePs
!=
null
)
{
checkSiteCodePs
.
close
();
checkSiteCodePs
=
null
;
}
}
if
(
childNodeName
.
equalsIgnoreCase
(
"item_ser"
)
)
{
String
itemSerStr
=
checkNull
(
genericUtility
.
getColumnValue
(
"item_ser"
,
dom
));
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotationWiz itemSerStr wfValData case 1 ["
+
itemSerStr
+
"]"
);
if
(
itemSerStr
!=
null
&&
itemSerStr
.
length
()
>
0
)
{
String
[]
itemSerArr
=
itemSerStr
.
split
(
","
);
for
(
String
itemSer
:
itemSerArr
)
{
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotationWiz item_ser wfValData case 1 itemSer ["
+
itemSer
+
"]"
);
sql
=
"SELECT count(1) FROM itemser WHERE item_ser = ?"
;
pstmt
=
connectionObject
.
prepareStatement
(
sql
);
pstmt
.
setString
(
1
,
itemSer
.
trim
());
rs
=
pstmt
.
executeQuery
();
long
count
=
0
;
if
(
rs
.
next
())
{
count
=
rs
.
getLong
(
1
);
}
rs
.
close
();
rs
=
null
;
pstmt
.
close
();
pstmt
=
null
;
if
(
count
==
0
)
{
errString
=
getErrorString
(
"item_ser"
,
"VTITEMSER1"
,
userId
);
break
;
}
}
}
if
(
pstmt
!=
null
)
{
pstmt
.
close
();
pstmt
=
null
;
}
if
(
rs
!=
null
)
{
rs
.
close
();
rs
=
null
;
}
}
}
//end of inner for loop
}
//end of first for loop
}
break
;
}
case
2
:
case
2
:
{
{
if
(
errString
.
indexOf
(
"<Errors>"
)
==
-
1
)
if
(
errString
.
indexOf
(
"<Errors>"
)
==
-
1
)
...
@@ -159,28 +296,60 @@ public class ReqForQuotationWiz extends ValidatorEJB{
...
@@ -159,28 +296,60 @@ public class ReqForQuotationWiz extends ValidatorEJB{
columnValue
=
childNode
.
getFirstChild
().
getNodeValue
();
columnValue
=
childNode
.
getFirstChild
().
getNodeValue
();
}
}
childNodeName
=
childNode
.
getNodeName
();
childNodeName
=
childNode
.
getNodeName
();
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotationWiz childNodeName ["
+
childNodeName
+
"]"
);
if
(
childNodeName
.
equalsIgnoreCase
(
"item_code"
)
)
{
String
itemCode
=
checkNull
(
genericUtility
.
getColumnValue
(
"item_code"
,
dom
));
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotationWiz itemCode wfValData case 1 ["
+
itemCode
+
"]"
);
String
checkItemCodeSql
=
"select count(item_code) as itemCodeCount from item where cust_code = ?"
;
PreparedStatement
checkItemCodePs
=
connectionObject
.
prepareStatement
(
checkItemCodeSql
);
checkItemCodePs
.
setString
(
1
,
itemCode
);
ResultSet
checkItemCodeRs
=
checkItemCodePs
.
executeQuery
();
while
(
checkItemCodeRs
.
next
())
{
int
itemCodeCont
=
checkItemCodeRs
.
getInt
(
"itemCodeCount"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotationWiz itemCode wfValData case 1 itemCodeCont::["
+
itemCodeCont
+
"]"
);
if
(
itemCodeCont
<=
0
)
{
errString
=
getErrorString
(
"item_code"
,
"STKVALITNE"
,
userId
);
break
;
}
}
if
(
checkItemCodeRs
!=
null
)
{
checkItemCodeRs
.
close
();
checkItemCodeRs
=
null
;
}
if
(
checkItemCodePs
!=
null
)
{
checkItemCodePs
.
close
();
checkItemCodePs
=
null
;
}
}
if
(
childNodeName
.
equalsIgnoreCase
(
"ptr_flag"
)
)
if
(
childNodeName
.
equalsIgnoreCase
(
"ptr_flag"
)
)
{
{
String
ptrFlag
=
checkNull
(
genericUtility
.
getColumnValue
(
"ptr_flag"
,
dom
));
String
ptrFlag
=
checkNull
(
genericUtility
.
getColumnValue
(
"ptr_flag"
,
dom
));
String
competitorRate
=
checkNull
(
genericUtility
.
getColumnValue
(
"competitor_rate"
,
dom
));
String
competitorRate
=
checkNull
(
genericUtility
.
getColumnValue
(
"competitor_rate"
,
dom
));
String
competitorItem
=
checkNull
(
genericUtility
.
getColumnValue
(
"competitor_item"
,
dom
));
String
competitorItem
=
checkNull
(
genericUtility
.
getColumnValue
(
"competitor_item"
,
dom
));
String
competitorName
=
checkNull
(
genericUtility
.
getColumnValue
(
"competitor_name"
,
dom
));
String
competitorName
=
checkNull
(
genericUtility
.
getColumnValue
(
"competitor_name"
,
dom
));
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotation
IC
ptrFlag wfValData ["
+
ptrFlag
+
"]"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotation
Wiz
ptrFlag wfValData ["
+
ptrFlag
+
"]"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotation
IC
competitorRate wfValData ["
+
competitorRate
+
"]"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotation
Wiz
competitorRate wfValData ["
+
competitorRate
+
"]"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotation
IC
competitorItem wfValData ["
+
competitorItem
+
"]"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotation
Wiz
competitorItem wfValData ["
+
competitorItem
+
"]"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotation
IC
competitorNane wfValData ["
+
competitorName
+
"]"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotation
Wiz
competitorNane wfValData ["
+
competitorName
+
"]"
);
if
(
ptrFlag
.
equalsIgnoreCase
(
"N"
)
||
ptrFlag
.
trim
().
isEmpty
())
{
if
(
ptrFlag
.
equalsIgnoreCase
(
"N"
)
||
ptrFlag
.
trim
().
isEmpty
())
{
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotation
IC
in condition ptrFlag wfValData::: ["
+
ptrFlag
+
"]"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotation
Wiz
in condition ptrFlag wfValData::: ["
+
ptrFlag
+
"]"
);
// Check if any of the competitor fields are null or blank
// Check if any of the competitor fields are null or blank
if
((
competitorRate
==
null
||
competitorRate
.
trim
().
isEmpty
())
if
((
competitorRate
==
null
||
competitorRate
.
trim
().
isEmpty
())
||
(
competitorItem
==
null
||
competitorItem
.
trim
().
isEmpty
())
||
(
competitorItem
==
null
||
competitorItem
.
trim
().
isEmpty
())
||
(
competitorName
==
null
||
competitorName
.
trim
().
isEmpty
()))
{
||
(
competitorName
==
null
||
competitorName
.
trim
().
isEmpty
()))
{
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotation
IC
in competitor details null ["
+
ptrFlag
+
"]"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotation
Wiz
in competitor details null ["
+
ptrFlag
+
"]"
);
errString
=
getErrorString
(
"ptr_flag"
,
"COMPDETM"
,
userId
);
errString
=
getErrorString
(
"ptr_flag"
,
"COMPDETM"
,
userId
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotation
IC
in competitor details null errString:: ["
+
errString
+
"]"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"ReqForQuotation
Wiz
in competitor details null errString:: ["
+
errString
+
"]"
);
break
;
break
;
}
}
}
}
...
@@ -189,6 +358,7 @@ public class ReqForQuotationWiz extends ValidatorEJB{
...
@@ -189,6 +358,7 @@ public class ReqForQuotationWiz extends ValidatorEJB{
}
//end of inner for loop
}
//end of inner for loop
}
//end of first for loop
}
//end of first for loop
}
//end of errorstring
}
//end of errorstring
break
;
}
}
}
//end of validation of first form
}
//end of validation of first form
...
@@ -498,21 +668,28 @@ public class ReqForQuotationWiz extends ValidatorEJB{
...
@@ -498,21 +668,28 @@ public class ReqForQuotationWiz extends ValidatorEJB{
String
custCodeForIC
=
checkNull
(
genericUtility
.
getColumnValue
(
"cust_code"
,
dom
,
"1"
));
String
custCodeForIC
=
checkNull
(
genericUtility
.
getColumnValue
(
"cust_code"
,
dom
,
"1"
));
String
custName
=
""
;
String
custName
=
""
,
addr1
=
""
,
addr2
=
""
,
addr3
=
""
;
BaseLogger
.
log
(
"0"
,
null
,
userId
,
"case 1---------custCodeForIC------["
+
custCodeForIC
+
"]"
);
BaseLogger
.
log
(
"0"
,
null
,
userId
,
"case 1---------custCodeForIC------["
+
custCodeForIC
+
"]"
);
String
custNameSql
=
"select cust_name from customer where cust_code = ?"
;
String
custNameSql
=
"select cust_name
, addr1 , addr2 , addr3
from customer where cust_code = ?"
;
PreparedStatement
custNamePs
=
conn
.
prepareStatement
(
custNameSql
);
PreparedStatement
custNamePs
=
conn
.
prepareStatement
(
custNameSql
);
custNamePs
.
setString
(
1
,
custCodeForIC
);
custNamePs
.
setString
(
1
,
custCodeForIC
);
ResultSet
custNameRs
=
custNamePs
.
executeQuery
();
ResultSet
custNameRs
=
custNamePs
.
executeQuery
();
while
(
custNameRs
.
next
())
{
while
(
custNameRs
.
next
())
{
custName
=
custNameRs
.
getString
(
"cust_name"
);
custName
=
custNameRs
.
getString
(
"cust_name"
);
addr1
=
custNameRs
.
getString
(
"addr1"
);
addr2
=
custNameRs
.
getString
(
"addr2"
);
addr3
=
custNameRs
.
getString
(
"addr3"
);
}
}
valueXmlString
.
append
(
"<Detail"
+
objContext
+
" domID='"
+
1
+
"' objContext = '"
+
currentFormNo
+
"' objName=\"qc_resentry_wiz\" selected=\"N\">\r\n"
);
valueXmlString
.
append
(
"<Detail"
+
objContext
+
" domID='"
+
1
+
"' objContext = '"
+
currentFormNo
+
"' objName=\"qc_resentry_wiz\" selected=\"N\">\r\n"
);
valueXmlString
.
append
(
"<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"tran_id\"/>\r\n"
);
valueXmlString
.
append
(
"<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"tran_id\"/>\r\n"
);
valueXmlString
.
append
(
"<cust_name>"
).
append
(
"<![CDATA["
+
custName
+
"]]>"
).
append
(
"</cust_name>"
);
valueXmlString
.
append
(
"<cust_name>"
).
append
(
"<![CDATA["
+
custName
+
"]]>"
).
append
(
"</cust_name>"
);
valueXmlString
.
append
(
"<addr1>"
).
append
(
"<![CDATA["
+
addr1
+
"]]>"
).
append
(
"</addr1>"
);
valueXmlString
.
append
(
"<addr2>"
).
append
(
"<![CDATA["
+
addr2
+
"]]>"
).
append
(
"</addr2>"
);
valueXmlString
.
append
(
"<addr3>"
).
append
(
"<![CDATA["
+
addr3
+
"]]>"
).
append
(
"</addr3>"
);
valueXmlString
.
append
(
"</Detail"
+
objContext
+
">"
);
valueXmlString
.
append
(
"</Detail"
+
objContext
+
">"
);
if
(
custNameRs
!=
null
)
if
(
custNameRs
!=
null
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment