Commit 937931ea authored by jshinde's avatar jshinde

req id[W16GSUN002]


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@103715 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6b7d297c
......@@ -80,11 +80,12 @@ public class StatusChangeRequest implements Schedule {
ArrayList<HashMap<String, String>> holdStockList = new ArrayList<HashMap<String,String>>();
ArrayList<HashMap<String, String>> holdStockListNew = new ArrayList<HashMap<String,String>>();
String sqlStr ="",sqlInvHold ="",tranId="",sqlCount ="",sqlGen= "",shDescr ="";
String sqlStr ="",sqlInvHold ="",tranId="",sqlCount ="",sqlGen= "",shDescr ="",lastCharS ="";
Connection conn = null;
PreparedStatement pstmt = null,pstmtHold = null ,pstmtCount = null ,pstmtGen =null;
ResultSet rs = null,rsCount = null,rsHold = null ,rsGen =null;
int cntSwms = 0;
char lastChar ;
try {
ConnDriver connDriver = new ConnDriver();
......@@ -293,8 +294,47 @@ public class StatusChangeRequest implements Schedule {
holdStockListNew.addAll(holdStockList);
System.out.println("holdStockListNew::::"+holdStockListNew);
//Changed by Jagruti Shinde Req id:[W16GSUN002][Start]
Iterator<HashMap<String, String>> holdIterator=holdStockListNew.iterator();
while(holdIterator.hasNext())
{
HashMap<String, String> holdMap=new HashMap<String, String>();
holdMap=holdIterator.next();
System.out.println("@V@ holdMap size in while loop :- ["+holdMap.size()+"]");
palletNo=holdMap.get("PALLET_NO");
siteCode=holdMap.get("SITE_CODE");
lotSl=holdMap.get("LOT_SL");
lotNo=holdMap.get("LOT_NO");
itemCode=holdMap.get("ITEM_CODE");
lockCode=holdMap.get("LOCK_CODE");
System.out.println("@V@ PALLET_NO :- ["+palletNo+"]");
System.out.println("@V@ SITE_CODE :- ["+siteCode+"]");
System.out.println("@V@ LOT_SL :- ["+lotSl+"]");
System.out.println("@V@ LOT_NO :- ["+lotNo+"]");
System.out.println("@V@ ITEM_CODE :- ["+itemCode+"]");
System.out.println("@V@ LOCK_CODE :- ["+lockCode+"]");
lastChar=palletNo.charAt(palletNo.trim().length()-1);
lastCharS = Character.toString(lastChar);
System.out.println("lastChar of pallet:::"+lastChar);
if("R".equalsIgnoreCase(lastCharS))
{
System.out.println("getRejectedPalletStatus called::::::");
palletStatus = getRejectedPalletStatus(palletNo, siteCode, holdStockListNew,lockCode,conn);
}
else
{
System.out.println("getPalletStatus called::::::");
palletStatus = getPalletStatus(palletNo, siteCode, holdStockListNew,lockCode,conn);
}
}
//palletStatus = getPalletStatus(palletNo, siteCode, holdStockList,lockCode,conn);
palletStatus = getPalletStatus(palletNo, siteCode, holdStockListNew,lockCode,conn);
//palletStatus = getPalletStatus(palletNo, siteCode, holdStockListNew,lockCode,conn);
//Changed by Jagruti Shinde Req id:[W16GSUN002][End]
System.out.println("palletStatus for AWMS :"+palletStatus);
//Changed by Jagruti Shinde Request id:[W16CSUN009] on 13/OCT/16 [End]
......@@ -703,6 +743,96 @@ public class StatusChangeRequest implements Schedule {
return palletStatus;
}
//Changed by Jagruti Shinde Req id:[W16GSUN002][Start]
private String getRejectedPalletStatus(String palletNo,String siteCode,ArrayList<HashMap<String, String>> damageStockList, String lockCode, Connection conn) throws SQLException
{
String invStat="", sqlStr = "" ,palletNoRej ="";
PreparedStatement pstmt = null ;
ResultSet rs = null;
ArrayList<HashMap<String, String>> stockList = new ArrayList<HashMap<String,String>>();
String palletStatus = "F";
String lotSl="",lotNo="",itemCode="";
DistCommon distComm = new DistCommon();
invStat = distComm.getDisparams("999999","AWMS_LOC_INVSTAT",conn);
invStat = invStat.replace(",", "','");
invStat = "'"+invStat+"'";
System.out.println("AWMS INVSTAT in getRejectedPalletStatus: "+invStat);
System.out.println("Inside getRejectedPalletStatus...........");
try
{
palletNoRej=palletNo.substring(0, palletNo.lastIndexOf("R"));
System.out.println("palletNoRej after removing suffix 'R'::::"+palletNoRej);
sqlStr = "SELECT LOC_CODE,ITEM_CODE,LOT_NO,LOT_SL,SITE_CODE FROM STOCK WHERE QUANTITY > 0 "
+"AND LOC_CODE IN (?,?,?,?,?,?,?,?,?) AND SITE_CODE = ? AND INV_STAT IN ("+invStat+")";
pstmt = conn.prepareStatement(sqlStr);
pstmt.setString(1, palletNoRej);
pstmt.setString(2, palletNoRej+"Q");
pstmt.setString(3, palletNoRej+"B");
pstmt.setString(4, palletNoRej+"X");
pstmt.setString(5, palletNoRej+"M");
pstmt.setString(6, palletNoRej+"U");
pstmt.setString(7, palletNoRej+"P");
pstmt.setString(8,palletNoRej+"S");
pstmt.setString(9,palletNoRej+"R");
pstmt.setString(10, siteCode);
rs = pstmt.executeQuery();
while(rs.next())
{
HashMap<String,String> stockHashMap = new HashMap<String, String>();
stockHashMap.put("PALLET_NO", rs.getString("LOC_CODE"));
stockHashMap.put("SITE_CODE", rs.getString("SITE_CODE"));
stockHashMap.put("LOT_SL", rs.getString("LOT_SL"));
stockHashMap.put("LOT_NO", rs.getString("LOT_NO"));
stockHashMap.put("ITEM_CODE", rs.getString("ITEM_CODE"));
stockHashMap.put("LOCK_CODE", lockCode);
stockList.add(stockHashMap);
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
System.out.println("AWMS Stock List:"+stockList);
ArrayList <HashMap<String, String>>tempList=new ArrayList<HashMap <String, String>>();
for(Iterator<HashMap<String, String>> iter = stockList.iterator();iter.hasNext();)
{
System.out.println("Checking...........");
HashMap<String, String> stock = iter.next();
System.out.println("stock before check::::::"+stock);
if(!damageStockList.contains(stock))
{
System.out.println("All items of this pallet are not rejected");
palletStatus = "P";
break;
}
}//END FOR
} catch (SQLException e)
{
e.printStackTrace();
throw e;
}
return palletStatus;
}
//Changed by Jagruti Shinde Req id:[W16GSUN002][End]
private String checkNullAndTrim(String str)
{
if(str == null)
......
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