Commit 3ef11e78 authored by jshinde's avatar jshinde

Request ID:[W15JSUN008] update msg_no for invalid pallet and update...

Request ID:[W15JSUN008] update msg_no for invalid pallet and update PalletizationIC for  validation sequence


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@100218 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0695cb7f
......@@ -203,8 +203,16 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
cntLoc = rs.getInt(1);
System.out.println( "cntLoc:::"+cntLoc);
}
if(pstmt != null){pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if(cntLoc > 0)
{
......@@ -213,14 +221,13 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
locSuffixDisp = locS[z].trim();
lastChar=palletNo.charAt(palletNo.trim().length()-1);
lastCharS = Character.toString(lastChar);
System.out.println("lastChar"+lastChar);
System.out.println("lastChar:"+lastChar);
System.out.println("locSuffix disparm=["+locSuffixDisp+"] and lastChar["+lastChar+"]");
if(locSuffixDisp.equalsIgnoreCase(lastCharS))
{
System.out.println("****Match found in disparm for"+lastChar);
System.out.println("location with suffix");
errCode = "VMPALPEEXT";
System.out.println("****Match found in disparm for:"+lastChar);
errCode = "VTPALPEEXT";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
break;
......@@ -230,7 +237,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
else
{
System.out.println("pallet not in AWMS" +cntLoc);
errCode = "VMPALPEEXT";//pallet
errCode = "VTPALPEEXT";//pallet
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
break;
......@@ -257,7 +264,6 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
break;
}
}
}
}
}
......@@ -381,8 +387,8 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
}
else
{
sql = "select count(*) from pallet_det d, pallet_hdr h where d.lot_no = ? and d.lot_sl = ? and "
+ " d.site_code = ? and d.tran_id = h.tran_id and h.confirmed = ? ";
sql = "SELECT COUNT(*) FROM PALLET_DET D, PALLET_HDR H WHERE D.LOT_NO = ? AND D.LOT_SL = ? AND "
+ " D.SITE_CODE = ? AND D.TRAN_ID = H.TRAN_ID AND H.CONFIRMED = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lotNo);
pstmt.setString(2, lotSl);
......@@ -393,8 +399,16 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
{
count = rs.getInt(1);
}
if(pstmt != null){pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if(count > 0)
{
......@@ -405,8 +419,8 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
}
else
{
sql = "select count(*) from stock where lot_no = ? and lot_sl = ? "
+ "and site_code = ? and inv_stat not in (?,?) and quantity > 0 ";
sql = "SELECT COUNT(*) FROM STOCK WHERE LOT_NO = ? AND LOT_SL = ? "
+ "AND SITE_CODE = ? AND INV_STAT NOT IN (?,?) AND QUANTITY > 0 ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lotNo);
pstmt.setString(2, lotSl);
......@@ -418,8 +432,16 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
{
count = rs.getInt(1);
}
if(pstmt != null){pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if(count <= 0)
{
......@@ -504,7 +526,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
else
{
locGroup ="OTHER";
System.out.println(" locationGroup other tha EXEX:::::::::: "+locGroup);
System.out.println(" locationGroup other than EXEX:::::::::: "+locGroup);
}
if(locGroupDB.equalsIgnoreCase(locGroupDisp))
......@@ -515,7 +537,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
else
{
locGroupDB ="OTHER";
System.out.println(" locationGroupDB other tha EXEX:::::::::: "+locGroupDB);
System.out.println(" locationGroupDB other than EXEX:::::::::: "+locGroupDB);
}
/*System.out.println("locGroup :::::::::: " + locGroup);
......@@ -541,7 +563,6 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
status = "C";
}
System.out.println("value of statusDB after if :::::::::: " + statusDB);
System.out.println("value of status after if :::::::::: " + status);
System.out.println("Checking validation for QC order status :::::::::: " );
......@@ -656,8 +677,16 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
{
msgType = rs.getString("MSG_TYPE");
}
if(pstmt != null){pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
}
catch (Exception ex)
{
......@@ -776,8 +805,16 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
{
quantity = rs.getInt(1);
}
if(pstmt != null){ pstmt.close(); pstmt = null; }
if(rs != null){ rs.close(); rs = null; }
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
}
catch(Exception e)
{
......@@ -857,7 +894,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
int count = 0;
try
{
sql ="select count(*) from swms_to_awms where pallet_no = ? and schedule_status = ? and ref_ser = ? ";
sql ="SELECT COUNT(*) FROM SWMS_TO_AWMS WHERE PALLET_NO = ? AND SCHEDULE_STATUS = ? AND REF_SER = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, palletNo);
pstmt.setString(2, "N");
......@@ -867,8 +904,16 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
{
count = rs.getInt(1);
}
if(pstmt != null){ pstmt.close(); pstmt = null; }
if(rs != null){ rs.close(); rs = null; }
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
}
catch(Exception e)
{
......@@ -957,7 +1002,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
String sql = "", status = "";
try
{
sql ="select status from qc_order where item_code = ? and lot_no = ? and site_code = ? " ;
sql ="SELECT STATUS FROM QC_ORDER WHERE ITEM_CODE = ? AND LOT_NO = ? AND SITE_CODE = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, lotNo);
......@@ -1065,7 +1110,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
String sql = "", qcSampleType = "";
try
{
sql ="select qc_sample_type from siteitem where item_code = ? and site_code = ? " ;
sql ="SELECT QC_SAMPLE_TYPE FROM SITEITEM WHERE ITEM_CODE = ? AND SITE_CODE = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
......@@ -1214,10 +1259,10 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
{
System.out.println(" Inside if details 2 for itm_default ::::::::::::::::: ");
sql = "select tran_id, tran_date, site_code, tran_type, pallet_type, pallet_no, remarks, pallet_status, "
+ "chg_user, chg_date, chg_term from pallet_hdr "
+ "where pallet_no = ? "
+ "and site_code = ? and case when confirmed is null then 'N' else confirmed end = 'N' ";
sql = "SELECT TRAN_ID, TRAN_DATE, SITE_CODE, TRAN_TYPE, PALLET_TYPE, PALLET_NO, REMARKS, PALLET_STATUS, "
+ "CHG_USER, CHG_DATE, CHG_TERM FROM PALLET_HDR "
+ "WHERE PALLET_NO = ? "
+ "AND SITE_CODE = ? AND CASE WHEN CONFIRMED IS NULL THEN 'N' ELSE CONFIRMED END = 'N' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, palletNo);
pstmt.setString(2, loginSite);
......@@ -1348,10 +1393,10 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
{
System.out.println("--------------inside itm_default edit mode details 3 ----------------------");
sql = "select d.item_code, i.descr, d.lot_no, d.lot_sl, d.quantity, i.unit, d.no_art, d.loc_code, d.line_no, d.alloc_qty, d.qc_sample_type "
+ "from pallet_hdr h, pallet_det d, item i "
+ "where d.site_code = ? and d.tran_id = ? and d.tran_id = h.tran_id and "
+ "d.item_code = i.item_code ";
sql = "SELECT D.ITEM_CODE, I.DESCR, D.LOT_NO, D.LOT_SL, D.QUANTITY, I.UNIT, D.NO_ART, D.LOC_CODE, D.LINE_NO, D.ALLOC_QTY, D.QC_SAMPLE_TYPE "
+ "FROM PALLET_HDR H, PALLET_DET D, ITEM I "
+ "WHERE D.SITE_CODE = ? AND D.TRAN_ID = ? AND D.TRAN_ID = H.TRAN_ID AND "
+ "D.ITEM_CODE = I.ITEM_CODE ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginSite);
pstmt.setString(2, tranId);
......@@ -1439,10 +1484,10 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
{
System.out.println("--------------inside lot_sl ----------------------");
sql = "select s.item_code, i.descr, s.quantity, s.unit, s.no_art, s.loc_code, s.alloc_qty, si.qc_sample_type "
+ "from stock s, item i, siteitem si "
+ "where s.lot_no = ? and s.lot_sl = ? and s.site_code = ? and s.quantity > 0 and inv_stat not in (?,?) "
+ "and s.item_code = i.item_code and i.item_code = si.item_code and s.item_code = si.item_code and s.site_code = si.site_code ";
sql = "SELECT S.ITEM_CODE, I.DESCR, S.QUANTITY, S.UNIT, S.NO_ART, S.LOC_CODE, S.ALLOC_QTY, SI.QC_SAMPLE_TYPE "
+ "FROM STOCK S, ITEM I, SITEITEM SI "
+ "WHERE S.LOT_NO = ? AND S.LOT_SL = ? AND S.SITE_CODE = ? AND S.QUANTITY > 0 AND INV_STAT NOT IN (?,?) "
+ "AND S.ITEM_CODE = I.ITEM_CODE AND I.ITEM_CODE = SI.ITEM_CODE AND S.ITEM_CODE = SI.ITEM_CODE AND S.SITE_CODE = SI.SITE_CODE ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lotNo);
pstmt.setString(2, lotSl);
......@@ -1574,7 +1619,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
{
if( tranId != null && tranId.trim().length() > 0 ) // edit mode
{
sql = "select max(line_no)+1 as line_no from pallet_det where tran_id = ? ";
sql = "SELECT MAX(LINE_NO)+1 AS LINE_NO FROM PALLET_DET WHERE TRAN_ID = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs= pstmt.executeQuery();
......@@ -1587,8 +1632,8 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
}
else // add mode
{
sql = "select max(line_no)+1 as line_no from pallet_det det, pallet_hdr hdr where "
+ " hdr.pallet_no = ? and hdr.confirmed = ? and hdr.site_code = ? and hdr.tran_id = det.tran_id ";
sql = "SELECT MAX(LINE_NO)+1 AS LINE_NO FROM PALLET_DET DET, PALLET_HDR HDR WHERE "
+ " HDR.PALLET_NO = ? AND HDR.CONFIRMED = ? AND HDR.SITE_CODE = ? AND HDR.TRAN_ID = DET.TRAN_ID ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, palletNo);
pstmt.setString(2, "N");
......
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