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
87d997d9
Commit
87d997d9
authored
Feb 20, 2026
by
Ajit Deshmukh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
6051ce7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
196 additions
and
0 deletions
+196
-0
Ajit/VHB/ReqForQuotationProcess.java
Ajit/VHB/ReqForQuotationProcess.java
+196
-0
No files found.
Ajit/VHB/ReqForQuotationProcess.java
0 → 100644
View file @
87d997d9
package
ibase
.
webitm
.
ejb
.
dis
;
import
ibase.webitm.ejb.ITMDBAccessEJB
;
import
ibase.webitm.ejb.MasterStatefulLocal
;
import
ibase.webitm.ejb.ProcessEJB
;
import
ibase.system.config.AppConnectParm
;
import
ibase.system.config.ConnDriver
;
import
ibase.utility.BaseLogger
;
//import ibase.webitm.ejb.fin.adv.DrCrRcpMstConfRemote;
//import ibase.utility.E12GenericUtility;
import
ibase.utility.E12GenericUtility
;
import
ibase.utility.UserInfoBean
;
import
ibase.webitm.utility.ITMException
;
import
java.rmi.RemoteException
;
import
java.sql.Connection
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.naming.InitialContext
;
//import org.nfunk.jep.function.Add;
import
org.w3c.dom.Document
;
public
class
ReqForQuotationProcess
extends
ProcessEJB
{
public
String
process
(
String
xmlString
,
String
xmlString2
,
String
windowName
,
String
xtraParams
)
throws
RemoteException
,
ITMException
{
BaseLogger
.
log
(
"3"
,
getUserInfo
(),
null
,
"^^^^^^^ Inside ReqForQuotationProcess EJB -> Process Method 1 ^^^^^^^"
);
Document
detailDom
=
null
;
Document
headerDom
=
null
;
E12GenericUtility
genericUtility
=
new
E12GenericUtility
();
ITMDBAccessEJB
itmDBAccessEJB
=
new
ITMDBAccessEJB
();
String
retString
=
""
;
try
{
if
(
xmlString
!=
null
&&
xmlString
.
trim
().
length
()
!=
0
)
{
headerDom
=
genericUtility
.
parseString
(
xmlString
);
}
if
(
xmlString2
!=
null
&&
xmlString2
.
trim
().
length
()
!=
0
)
{
detailDom
=
genericUtility
.
parseString
(
xmlString2
);
}
retString
=
process
(
headerDom
,
detailDom
,
windowName
,
xtraParams
);
}
catch
(
Exception
e
)
{
BaseLogger
.
log
(
"3"
,
getUserInfo
(),
null
,
"Exception MilestoneProcess Method 1"
);
e
.
printStackTrace
();
retString
=
itmDBAccessEJB
.
getErrorString
(
""
,
"VTCBFAIL"
,
""
,
1
);
throw
new
ITMException
(
e
);
}
return
retString
;
}
public
String
process
(
Document
headerDom
,
Document
detailDom
,
String
windowName
,
String
xtraParams
)
throws
RemoteException
,
ITMException
{
BaseLogger
.
log
(
"3"
,
getUserInfo
(),
null
,
"^^^^^^^ Inside ReqForQuotationProcess Process--A.J -> Process Method 2 ^^^^^^^"
);
E12GenericUtility
genericUtility
=
new
E12GenericUtility
();
String
retString
=
""
;
StringBuffer
processDynXmlString
=
new
StringBuffer
();
Connection
conn
=
null
;
try
{
int
domId
=
0
;
int
lineNo
=
0
;
UserInfoBean
userInfo
=
getUserInfo
();
AppConnectParm
appConnect
=
new
AppConnectParm
();
InitialContext
initialContext
=
new
InitialContext
(
appConnect
.
getProperty
());
List
<
String
>
itemCodeList
=
new
ArrayList
<>();
if
(
conn
==
null
)
{
ConnDriver
connDriver
=
new
ConnDriver
();
String
transDb
=
userInfo
.
getTransDB
();
String
empCode
=
userInfo
.
getEmpCode
();
BaseLogger
.
log
(
"3"
,
getUserInfo
(),
null
,
"transDb:: "
+
transDb
+
" empCode:: "
+
empCode
);
conn
=
connDriver
.
getConnectDB
(
userInfo
.
getTransDB
());
}
String
quotType
=
checkNull
(
genericUtility
.
getColumnValue
(
"quot_type"
,
headerDom
,
"1"
));
String
custCode
=
checkNull
(
genericUtility
.
getColumnValue
(
"cust_code"
,
headerDom
,
"1"
));
String
siteCode
=
checkNull
(
genericUtility
.
getColumnValue
(
"site_code"
,
headerDom
,
"1"
));
String
itemSer
=
checkNull
(
genericUtility
.
getColumnValue
(
"item_ser"
,
headerDom
,
"1"
));
String
itemSerFromdetailDom
=
checkNull
(
genericUtility
.
getColumnValue
(
"item_ser"
,
detailDom
,
"1"
));
if
(
itemSer
!=
null
&&
itemSer
.
trim
().
length
()
>
0
)
{
String
[]
itemSerArr
=
itemSer
.
split
(
","
);
// Build dynamic IN clause
StringBuilder
sql
=
new
StringBuilder
();
sql
.
append
(
"SELECT item_code FROM item WHERE item_ser IN ("
);
for
(
int
i
=
0
;
i
<
itemSerArr
.
length
;
i
++)
{
sql
.
append
(
"?"
);
if
(
i
<
itemSerArr
.
length
-
1
)
{
sql
.
append
(
","
);
}
}
sql
.
append
(
")"
);
PreparedStatement
pstmt
=
conn
.
prepareStatement
(
sql
.
toString
());
// Bind values
for
(
int
i
=
0
;
i
<
itemSerArr
.
length
;
i
++)
{
pstmt
.
setString
(
i
+
1
,
itemSerArr
[
i
].
trim
());
}
ResultSet
rs
=
pstmt
.
executeQuery
();
while
(
rs
.
next
())
{
itemCodeList
.
add
(
rs
.
getString
(
"item_code"
));
}
rs
.
close
();
pstmt
.
close
();
}
BaseLogger
.
log
(
"3"
,
getUserInfo
(),
null
,
"quotType:: "
+
quotType
+
" custCode:: "
+
custCode
+
" siteCode::"
+
siteCode
+
" itemSeries:"
+
itemSer
+
" itemCodeList::"
+
itemCodeList
.
toString
());
// Start building the XML string
processDynXmlString
.
append
(
"<DocumentRoot><description>Datawindow Root</description><group0>"
);
processDynXmlString
.
append
(
"<description>Group0 description</description><Header0><description>Header0 members</description>"
);
processDynXmlString
.
append
(
"<objName><![CDATA[rfq]]></objName>"
);
processDynXmlString
.
append
(
"<pageContext><![CDATA[1]]></pageContext>"
);
processDynXmlString
.
append
(
"<objContext><![CDATA[1]]></objContext>"
);
processDynXmlString
.
append
(
"<editFlag><![CDATA[A]]></editFlag>"
);
processDynXmlString
.
append
(
"<focusedColumn><![CDATA[]]></focusedColumn>"
);
processDynXmlString
.
append
(
"<action><![CDATA[SAVE]]></action>"
);
processDynXmlString
.
append
(
"<elementName><![CDATA[]]></elementName>"
);
processDynXmlString
.
append
(
"<keyValue><![CDATA[1]]></keyValue>"
);
processDynXmlString
.
append
(
"<saveLevel><![CDATA[1]]></saveLevel>"
);
processDynXmlString
.
append
(
"<forcedSave><![CDATA[false]]></forcedSave>"
);
processDynXmlString
.
append
(
"<Detail1 dbID='' domID='1' objContext='1' objName='rfq'>"
);
processDynXmlString
.
append
(
"<attribute IS_CHANGE='Y' pkNames='TRAN_ID' selected='N' status='N' updateFlag='A'/>"
);
//processDynXmlString.append("<tran_id/>");
processDynXmlString
.
append
(
"<cust_code><![CDATA["
+
custCode
+
"]]></cust_code>"
);
processDynXmlString
.
append
(
"<quot_type><![CDATA["
+
quotType
+
"]]></quot_type>"
);
processDynXmlString
.
append
(
"<item_ser><![CDATA["
+
itemSer
+
"]]></item_ser>"
);
processDynXmlString
.
append
(
"</Detail1>"
);
for
(
String
itemCode
:
itemCodeList
)
{
domId
++;
lineNo
++;
System
.
out
.
println
(
"Item Code: "
+
itemCode
);
processDynXmlString
.
append
(
"<Detail2 dbID=':' domID='"
+
domId
+
"' objName=\"rfq\" objContext=\"2\">"
);
processDynXmlString
.
append
(
"<attribute pkNames=\"tran_id:line_no:\" selected=\"N\" updateFlag=\"A\" status=\"N\" />"
);
processDynXmlString
.
append
(
"<line_no><![CDATA["
).
append
(
lineNo
).
append
(
"]]></line_no>"
);
processDynXmlString
.
append
(
"<item_code><![CDATA["
).
append
(
itemCode
).
append
(
"]]></item_code>"
);
processDynXmlString
.
append
(
"<qty_quot><![CDATA[1]]></qty_quot>"
);
processDynXmlString
.
append
(
"<rate_quot><![CDATA[1]]></rate_quot>"
);
processDynXmlString
.
append
(
"<rate_apprv><![CDATA[1]]></rate_apprv>"
);
processDynXmlString
.
append
(
"</Detail2>"
);
}
processDynXmlString
.
append
(
"</Header0></group0></DocumentRoot>"
);
String
rfqXml
=
processDynXmlString
.
toString
();
BaseLogger
.
log
(
"3"
,
null
,
null
,
" rfqXml:: "
+
rfqXml
+
"]"
);
MasterStatefulLocal
masterStateful
=
(
MasterStatefulLocal
)
initialContext
.
lookup
(
"ibase/MasterStatefulEJB/local"
);
String
processRequestResult
=
masterStateful
.
processRequest
(
userInfo
,
rfqXml
,
false
,
conn
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"processRequest processRequestResultD"
+
processRequestResult
+
"]"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
ITMException
(
e
);
}
return
retString
;
}
private
String
checkNull
(
String
input
)
{
if
(
input
==
null
)
{
input
=
""
;
}
return
input
;
}
}
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