Commit dd430ae7 authored by caluka's avatar caluka

Ejb updated to run Physical count Schedule through actual parameter site code [D14DSUN018]


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95744 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 41fb5ded
......@@ -75,7 +75,7 @@ public class PhysicalCountSchedule implements Schedule
{
ibase.utility.UserInfoBean userInfo = null;
//Change by chandrashekar on 13/02/14
String disparmLoginSiteCode="";
String disparmLoginSiteCode="",actualLoginSiteCode="";
ConnDriver connDriver = new ConnDriver();
Connection conn = null;
conn = connDriver.getConnectDB("DriverITM");
......@@ -92,12 +92,45 @@ public class PhysicalCountSchedule implements Schedule
System.out.println("************ ["+scheduleParamXML+"]");
userInfo = new ibase.utility.UserInfoBean( scheduleParamXML );
//change done by chandrashekar on 13/2/14 start
/*
disparmLoginSiteCode = new DistCommon().getDisparams("999999","CYCLE_COUNT_SITE", conn);
if (disparmLoginSiteCode == null|| "NULLFOUND".equalsIgnoreCase(disparmLoginSiteCode))
{
disparmLoginSiteCode = "";
}*/
//change done by chandrashekar on 22/07/14 start
GenericUtility genericUtility=GenericUtility.getInstance();
Document dom=genericUtility.parseString(scheduleParamXML);
NodeList paramList = dom.getElementsByTagName( "SCHEDULE" );
Node currDetail = null ;
int noOfParam = paramList.getLength();
NodeList parentNodeList = null,childNodeList = null;
Node parentNode = null,childNode = null;
String DisparmSites = "";
int childNodeListLength = 0;
String childNodeName = null;
parentNodeList = dom.getElementsByTagName("ACTUALPARAMETERS");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for(int ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if(childNodeName!=null && !"#text".equalsIgnoreCase(childNodeName))
{
if(ctr==0)
{
actualLoginSiteCode=childNode.getFirstChild().getNodeValue();
}
}
}
System.out.println("ActualLoginSiteCode----["+actualLoginSiteCode+"]");
// added by ritesh on 28/02/14 START
int cnt= 0;
sql = " select COUNT(*) from users where CODE = 'SYSTEM' ";
......@@ -115,9 +148,9 @@ public class PhysicalCountSchedule implements Schedule
{
return "";
}
// added by ritesh on 28/02/14 END
if(disparmLoginSiteCode.trim().length() == 0)
//if(actualLoginSiteCode.trim().length() == 0 || actualLoginSiteCode == null)
if(("null".equals(actualLoginSiteCode) || actualLoginSiteCode.trim().length() == 0 ))
{
queryString="select distinct(site_code) from stock";
System.out.println("2-Print queryString---"+queryString);
......@@ -142,19 +175,19 @@ public class PhysicalCountSchedule implements Schedule
}
else
{
String[] arrStr =disparmLoginSiteCode.split(",");
String[] arrStr =actualLoginSiteCode.split(",");
int len =arrStr.length;
for(int i =0;i<len;i++)
{
loginSiteCode =arrStr[i];
if(isExist(conn, "site", "site_code" ,loginSiteCode))
{
System.out.println("Site code from diparm======**************====> "+loginSiteCode);
System.out.println("Site code from actualLoginSiteCode======**************====> "+loginSiteCode);
insertSchedule(loginSiteCode,userInfo.getEmpCode(),userInfo);
}
}
}
//change done by chandrashekar on 13/2/14 end
// End change done by chandrashekar on 22/07/14
//loginSiteCode = userInfo.getSiteCode();
//System.out.println("Site code======**************====> "+loginSiteCode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment