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
d7acabcb
Commit
d7acabcb
authored
Mar 25, 2026
by
SABURI PATEKAR
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added validation for required columns in the Customer Preferred
Distributor.
parent
3d86e7f5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
6 deletions
+68
-6
Saburi/27-02-26#CUSTOMER_PREF_DIST/java file/CustomerPrefDistIC.java
...2-26#CUSTOMER_PREF_DIST/java file/CustomerPrefDistIC.java
+68
-6
No files found.
Saburi/27-02-26#CUSTOMER_PREF_DIST/java file/CustomerPrefDistIC.java
View file @
d7acabcb
...
@@ -93,6 +93,7 @@ public class CustomerPrefDistIC extends ValidatorEJB implements ValidatorLocal,V
...
@@ -93,6 +93,7 @@ public class CustomerPrefDistIC extends ValidatorEJB implements ValidatorLocal,V
String
stockCustName
=
""
;
String
stockCustName
=
""
;
String
distCustName
=
""
;
String
distCustName
=
""
;
String
distSiteCode
=
""
;
String
distSiteCode
=
""
;
String
errString
=
""
;
try
try
{
{
...
@@ -217,6 +218,27 @@ public class CustomerPrefDistIC extends ValidatorEJB implements ValidatorLocal,V
...
@@ -217,6 +218,27 @@ public class CustomerPrefDistIC extends ValidatorEJB implements ValidatorLocal,V
if
(
currentColumn
.
equalsIgnoreCase
(
"cust_code"
))
if
(
currentColumn
.
equalsIgnoreCase
(
"cust_code"
))
{
{
int
custCount
=
0
;
if
(
custCode
!=
null
&&
custCode
.
trim
().
length
()
>
0
)
{
String
sqlType
=
"SELECT COUNT(*) AS CUST_CODE_COUNT FROM CUSTOMER WHERE CUST_CODE = ?"
;
pstmt
=
conn
.
prepareStatement
(
sqlType
);
pstmt
.
setString
(
1
,
custCode
);
rs
=
pstmt
.
executeQuery
();
if
(
rs
.
next
())
{
custCount
=
rs
.
getInt
(
"CUST_CODE_COUNT"
);
}
}
if
(
custCount
==
0
)
{
errString
=
itmDBAccessEJB
.
getErrorString
(
""
,
"VCCUSTCODE"
,
""
,
""
,
conn
);
return
errString
;
}
valueXmlString
.
append
(
"<cust_name>"
)
valueXmlString
.
append
(
"<cust_name>"
)
.
append
(
"<![CDATA["
+
custName
+
"]]>"
)
.
append
(
"<![CDATA["
+
custName
+
"]]>"
)
.
append
(
"</cust_name>"
);
.
append
(
"</cust_name>"
);
...
@@ -226,10 +248,29 @@ public class CustomerPrefDistIC extends ValidatorEJB implements ValidatorLocal,V
...
@@ -226,10 +248,29 @@ public class CustomerPrefDistIC extends ValidatorEJB implements ValidatorLocal,V
.
append
(
"</city>"
);
.
append
(
"</city>"
);
}
}
if
(
currentColumn
.
equalsIgnoreCase
(
"cust_code__stk"
))
{
String
custTypeStk
=
""
;
if
(
custCodeStk
!=
null
&&
custCodeStk
.
trim
().
length
()
>
0
)
{
String
sqlType
=
"SELECT CUST_TYPE FROM CUSTOMER WHERE CUST_CODE = ?"
;
pstmt
=
conn
.
prepareStatement
(
sqlType
);
pstmt
.
setString
(
1
,
custCodeStk
);
rs
=
pstmt
.
executeQuery
();
if
(
currentColumn
.
equalsIgnoreCase
(
"cust_code__stk"
))
if
(
rs
.
next
(
))
{
{
custTypeStk
=
rs
.
getString
(
"CUST_TYPE"
);
}
}
if
(!
"S"
.
equalsIgnoreCase
(
custTypeStk
))
{
errString
=
itmDBAccessEJB
.
getErrorString
(
""
,
"VCCUSTSTK"
,
""
,
""
,
conn
);
return
errString
;
}
valueXmlString
.
append
(
"<cust_name_1>"
)
valueXmlString
.
append
(
"<cust_name_1>"
)
.
append
(
"<![CDATA["
+
stockCustName
+
"]]>"
)
.
append
(
"<![CDATA["
+
stockCustName
+
"]]>"
)
.
append
(
"</cust_name_1>"
);
.
append
(
"</cust_name_1>"
);
...
@@ -237,6 +278,27 @@ public class CustomerPrefDistIC extends ValidatorEJB implements ValidatorLocal,V
...
@@ -237,6 +278,27 @@ public class CustomerPrefDistIC extends ValidatorEJB implements ValidatorLocal,V
if
(
currentColumn
.
equalsIgnoreCase
(
"cust_code__dist"
))
if
(
currentColumn
.
equalsIgnoreCase
(
"cust_code__dist"
))
{
{
String
custTypeDist
=
""
;
if
(
custCodeDist
!=
null
&&
custCodeDist
.
trim
().
length
()
>
0
)
{
String
sqlType
=
"SELECT CUST_TYPE FROM CUSTOMER WHERE CUST_CODE = ?"
;
pstmt
=
conn
.
prepareStatement
(
sqlType
);
pstmt
.
setString
(
1
,
custCodeDist
);
rs
=
pstmt
.
executeQuery
();
if
(
rs
.
next
())
{
custTypeDist
=
rs
.
getString
(
"CUST_TYPE"
);
}
}
if
(!
"D"
.
equalsIgnoreCase
(
custTypeDist
))
{
errString
=
itmDBAccessEJB
.
getErrorString
(
""
,
"VCUSTDIST"
,
""
,
""
,
conn
);
return
errString
;
}
valueXmlString
.
append
(
"<cust_name_2>"
)
valueXmlString
.
append
(
"<cust_name_2>"
)
.
append
(
"<![CDATA["
+
distCustName
+
"]]>"
)
.
append
(
"<![CDATA["
+
distCustName
+
"]]>"
)
.
append
(
"</cust_name_2>"
);
.
append
(
"</cust_name_2>"
);
...
...
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