Commit 051e1eec authored by jshinde's avatar jshinde

Updated ScheduleAWMSInOutTasks


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@103623 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6330ab23
...@@ -1607,6 +1607,110 @@ public class ScheduleAWMSInOutTasks implements Schedule ...@@ -1607,6 +1607,110 @@ public class ScheduleAWMSInOutTasks implements Schedule
System.out.println("ITEM_SER_RG1 found from disparm["+itemSerRgDisparm+"]"); System.out.println("ITEM_SER_RG1 found from disparm["+itemSerRgDisparm+"]");
System.out.println("Exempted found from disparm["+exempted+"]"); System.out.println("Exempted found from disparm["+exempted+"]");
//sql = "SELECT LOC_GROUP FROM LOCATION WHERE LOC_CODE = ? AND SITE_CODE = ?";//Changed by wasim on 19-02-2016 as site code not required
sql = "SELECT LOC_GROUP FROM LOCATION WHERE LOC_CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, locCodeFrom);
rs = pstmt.executeQuery();
if(rs.next())
{
locGroup = checkNullAndTrim(rs.getString("LOC_GROUP"));
}
rs.close();rs = null;
pstmt.close();pstmt = null;
System.out.println("Location group found from location["+locGroup+"]");
String[] exp = exempted.split(",");
String disparmExemp = "";
boolean exempFlag = false;
System.out.println("Exemp Disparm Lenght="+exp.length);
for (int j = 0; j < exp.length; j++)
{
disparmExemp = exp[j].trim();
System.out.println("item ser rg1 disparm=["+disparmExemp+"] and site item rg1["+locGroup+"]");
if(disparmExemp.equalsIgnoreCase(locGroup))
{
System.out.println("****Match found in disparm for"+locGroup);
exempted = locGroup;
exempFlag = true;
break;
}
else
{
System.out.println("****Match not found****");
}
}
System.out.println("####Final flag for Exempted="+exempFlag);
sql = "SELECT ITEM_SER__RG1 FROM SITEITEM WHERE ITEM_CODE = ? AND SITE_CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
rs = pstmt.executeQuery();
if(rs.next())
{
itemSerRg = checkNullAndTrim(rs.getString("ITEM_SER__RG1"));
}
rs.close();rs = null;
pstmt.close();pstmt = null;
System.out.println("Item series RG found from item["+itemSerRg+"]");
String[] rg1 = itemSerRgDisparm.split(",");
String disparmRg1 = "";
boolean flag = false;
System.out.println("Disparm Lenght="+rg1.length);
for (int x = 0; x < rg1.length; x++)
{
disparmRg1 = rg1[x].trim();
System.out.println("item ser rg1 disparm=["+disparmRg1+"] and site item rg1["+itemSerRg+"]");
if(disparmRg1.equalsIgnoreCase(itemSerRg))
{
System.out.println("****Match found in disparm for"+itemSerRg);
itemSerRgDisparm = itemSerRg;
flag = true;
break;
}
else
{
System.out.println("****Match not found****");
}
}
System.out.println("####Final flag for item ser rg1="+flag);
sql = "SELECT STATUS FROM QC_ORDER WHERE SITE_CODE = ? AND ITEM_CODE = ? AND LOT_NO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setString(2, itemCode);
pstmt.setString(3, lotNo);
rs = pstmt.executeQuery();
if(rs.next())
{
QcStatus = checkNullAndTrim(rs.getString("STATUS"));
}
rs.close();rs = null;
pstmt.close();pstmt = null;
System.out.println("QC Status found from QC_ORDER1["+QcStatus+"]");
if(QcStatus == null || QcStatus.length() == 0 || !"U".equalsIgnoreCase(QcStatus))
{
QcStatus = "NA";
}
//if(locGroup == null || locGroup.length() == 0 || !exempted.equalsIgnoreCase(locGroup))
if(locGroup == null || locGroup.length() == 0 || !exempFlag)
{
locGroup = "NA";
}
//if(itemSerRg == null || itemSerRg.length() == 0 || !itemSerRgDisparm.equalsIgnoreCase(itemSerRg))
if(itemSerRg == null || itemSerRg.length() == 0 || !flag)
{
itemSerRg = "NA";
}
//Changed by Jagruti Shinde for palletization stock transfer location should be check whether it is quarantine or approved if qc_order is created at one site and palletization is done on another side Request Id:[W16FSUN009].[Start] //Changed by Jagruti Shinde for palletization stock transfer location should be check whether it is quarantine or approved if qc_order is created at one site and palletization is done on another side Request Id:[W16FSUN009].[Start]
//sqlQcOrder="SELECT COUNT(*) FROM QC_ORDER WHERE SITE_CODE = ? AND ITEM_CODE = ? AND LOT_NO = ? AND STATUS = ? "; //sqlQcOrder="SELECT COUNT(*) FROM QC_ORDER WHERE SITE_CODE = ? AND ITEM_CODE = ? AND LOT_NO = ? AND STATUS = ? ";
sqlQcOrder="SELECT COUNT(*) FROM QC_ORDER WHERE SITE_CODE = ? AND ITEM_CODE = ? AND LOT_NO = ? AND STATUS != ? "; sqlQcOrder="SELECT COUNT(*) FROM QC_ORDER WHERE SITE_CODE = ? AND ITEM_CODE = ? AND LOT_NO = ? AND STATUS != ? ";
...@@ -1614,7 +1718,7 @@ public class ScheduleAWMSInOutTasks implements Schedule ...@@ -1614,7 +1718,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
pstmt.setString(1,siteCode); pstmt.setString(1,siteCode);
pstmt.setString(2,itemCode); pstmt.setString(2,itemCode);
pstmt.setString(3,lotNo); pstmt.setString(3,lotNo);
pstmt.setString(4,"C"); pstmt.setString(4,"C");
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
...@@ -1635,109 +1739,6 @@ public class ScheduleAWMSInOutTasks implements Schedule ...@@ -1635,109 +1739,6 @@ public class ScheduleAWMSInOutTasks implements Schedule
{ {
System.out.println("countQcOrder is greter than 0:::"+countQcOrder); System.out.println("countQcOrder is greter than 0:::"+countQcOrder);
//Changed by Jagruti Shinde for palletization stock transfer location should be check whether it is quarantine or approved if qc_order is created at one site and palletization is done on another side Request Id:[W16FSUN009].[End] //Changed by Jagruti Shinde for palletization stock transfer location should be check whether it is quarantine or approved if qc_order is created at one site and palletization is done on another side Request Id:[W16FSUN009].[End]
//sql = "SELECT LOC_GROUP FROM LOCATION WHERE LOC_CODE = ? AND SITE_CODE = ?";//Changed by wasim on 19-02-2016 as site code not required
sql = "SELECT LOC_GROUP FROM LOCATION WHERE LOC_CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, locCodeFrom);
rs = pstmt.executeQuery();
if(rs.next())
{
locGroup = checkNullAndTrim(rs.getString("LOC_GROUP"));
}
rs.close();rs = null;
pstmt.close();pstmt = null;
System.out.println("Location group found from location["+locGroup+"]");
String[] exp = exempted.split(",");
String disparmExemp = "";
boolean exempFlag = false;
System.out.println("Exemp Disparm Lenght="+exp.length);
for (int j = 0; j < exp.length; j++)
{
disparmExemp = exp[j].trim();
System.out.println("item ser rg1 disparm=["+disparmExemp+"] and site item rg1["+locGroup+"]");
if(disparmExemp.equalsIgnoreCase(locGroup))
{
System.out.println("****Match found in disparm for"+locGroup);
exempted = locGroup;
exempFlag = true;
break;
}
else
{
System.out.println("****Match not found****");
}
}
System.out.println("####Final flag for Exempted="+exempFlag);
sql = "SELECT ITEM_SER__RG1 FROM SITEITEM WHERE ITEM_CODE = ? AND SITE_CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
rs = pstmt.executeQuery();
if(rs.next())
{
itemSerRg = checkNullAndTrim(rs.getString("ITEM_SER__RG1"));
}
rs.close();rs = null;
pstmt.close();pstmt = null;
System.out.println("Item series RG found from item["+itemSerRg+"]");
String[] rg1 = itemSerRgDisparm.split(",");
String disparmRg1 = "";
boolean flag = false;
System.out.println("Disparm Lenght="+rg1.length);
for (int x = 0; x < rg1.length; x++)
{
disparmRg1 = rg1[x].trim();
System.out.println("item ser rg1 disparm=["+disparmRg1+"] and site item rg1["+itemSerRg+"]");
if(disparmRg1.equalsIgnoreCase(itemSerRg))
{
System.out.println("****Match found in disparm for"+itemSerRg);
itemSerRgDisparm = itemSerRg;
flag = true;
break;
}
else
{
System.out.println("****Match not found****");
}
}
System.out.println("####Final flag for item ser rg1="+flag);
sql = "SELECT STATUS FROM QC_ORDER WHERE SITE_CODE = ? AND ITEM_CODE = ? AND LOT_NO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setString(2, itemCode);
pstmt.setString(3, lotNo);
rs = pstmt.executeQuery();
if(rs.next())
{
QcStatus = checkNullAndTrim(rs.getString("STATUS"));
}
rs.close();rs = null;
pstmt.close();pstmt = null;
System.out.println("QC Status found from QC_ORDER1["+QcStatus+"]");
if(QcStatus == null || QcStatus.length() == 0 || !"U".equalsIgnoreCase(QcStatus))
{
QcStatus = "NA";
}
//if(locGroup == null || locGroup.length() == 0 || !exempted.equalsIgnoreCase(locGroup))
if(locGroup == null || locGroup.length() == 0 || !exempFlag)
{
locGroup = "NA";
}
//if(itemSerRg == null || itemSerRg.length() == 0 || !itemSerRgDisparm.equalsIgnoreCase(itemSerRg))
if(itemSerRg == null || itemSerRg.length() == 0 || !flag)
{
itemSerRg = "NA";
}
System.out.println("********Loc Group["+locGroup+"]Item RG1["+itemSerRg+"]QC Status["+QcStatus+"]**********"); System.out.println("********Loc Group["+locGroup+"]Item RG1["+itemSerRg+"]QC Status["+QcStatus+"]**********");
...@@ -1795,15 +1796,37 @@ public class ScheduleAWMSInOutTasks implements Schedule ...@@ -1795,15 +1796,37 @@ public class ScheduleAWMSInOutTasks implements Schedule
rs.close(); rs.close();
rs = null; rs = null;
} }
if("N".equalsIgnoreCase(available)) if("N".equalsIgnoreCase(available) && ("NA".equalsIgnoreCase(locGroup) && "NA".equalsIgnoreCase(itemSerRg)))
{ {
locCodeToReturn = locCodeTo + "Q"; locCodeToReturn = locCodeTo + "Q";
System.out.println("locCodeToReturn for available 'N':::::::"+locCodeToReturn); System.out.println("locCodeToReturn Q for available 'N':::::::"+locCodeToReturn);
}
else if("N".equalsIgnoreCase(available) && (exempted.equalsIgnoreCase(locGroup) && "NA".equalsIgnoreCase(itemSerRg)))
{
locCodeToReturn = locCodeTo + "M";
System.out.println("locCodeToReturn M for available 'N':::::::"+locCodeToReturn);
} }
else if("Y".equalsIgnoreCase(available)) else if("N".equalsIgnoreCase(available) && ("NA".equalsIgnoreCase(locGroup) && itemSerRgDisparm.equalsIgnoreCase(itemSerRg)))
{
locCodeToReturn = locCodeTo + "S";
System.out.println("locCodeToReturn S for available 'N':::::::"+locCodeToReturn);
}
else if("Y".equalsIgnoreCase(available) && ("NA".equalsIgnoreCase(locGroup) && "NA".equalsIgnoreCase(itemSerRg)))
{ {
locCodeToReturn = locCodeTo; locCodeToReturn = locCodeTo;
System.out.println("locCodeToReturn for available 'Y':::::::"+locCodeToReturn); System.out.println("locCodeToReturn Normal for available 'Y':::::::"+locCodeToReturn);
}
else if("Y".equalsIgnoreCase(available) && (exempted.equalsIgnoreCase(locGroup) && "NA".equalsIgnoreCase(itemSerRg)))
{
locCodeToReturn = locCodeTo + "X";
System.out.println("locCodeToReturn for X available 'Y':::::::"+locCodeToReturn);
}
else if("Y".equalsIgnoreCase(available) && ("NA".equalsIgnoreCase(locGroup) && itemSerRgDisparm.equalsIgnoreCase(itemSerRg)))
{
locCodeToReturn = locCodeTo + "B";
System.out.println("locCodeToReturn for B available 'Y':::::::"+locCodeToReturn);
} }
} }
//Changed by Jagruti Shinde for palletization stock transfer location should be check whether it is quarantine or approved if qc_order is created at one site and palletization is done on another side Request Id:[W16FSUN009].[End] //Changed by Jagruti Shinde for palletization stock transfer location should be check whether it is quarantine or approved if qc_order is created at one site and palletization is done on another side Request Id:[W16FSUN009].[End]
......
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