Commit 6f1dae3e authored by ppatro's avatar ppatro

WM2lSUN015

In a master pack wave which has haz and non haz items in different carton
System should not allow to put the haz item in the non haz item master
carton.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92876 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2db6942d
......@@ -670,6 +670,7 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma
break;
case 3 :
{
boolean isCurrentItemHaz = false;
System.out.println("Inside case3 validation");
//Changed By Pragyan 21/01/13.start
outerCarton = checkNull(genericUtility.getColumnValue( "outer_carton_no", hdrDom ));
......@@ -710,7 +711,8 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma
rsInner = null;
pstmtInner.close();
pstmtInner = null;
isCurrentItemHaz = isHazardOusItem(currItemCode, conn);
System.out.println("Selected Item Haz="+isCurrentItemHaz);
parentList = allDom.getElementsByTagName( "Detail" + currentFormNo );
int noOfParent = parentList.getLength();
System.out.println("no of parent="+noOfParent);
......@@ -735,6 +737,19 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma
System.out.println("carton no == "+innerCarton);
System.out.println("item code == ["+itemCode+"] lot_no ["+lotNo+"]");
System.out.println("ptcn== "+ptcn);
boolean checkItemHaz = isHazardOusItem(itemCode, conn);
System.out.println("Current Item Haz="+checkItemHaz);
if(!checkItemHaz && isCurrentItemHaz)
{
errList.add( "INVCURITEM" );
errFields.add( childNodeName.toLowerCase() );
}
if(checkItemHaz && !isCurrentItemHaz)
{
errList.add( "INVHAZITEM" );
errFields.add( childNodeName.toLowerCase() );
}
if( innerCarton == null || innerCarton.trim().length() == 0 )
{
......@@ -1480,7 +1495,7 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma
//change done by Kunal on 08/08/12
//sql = "select pick_order,line_no__pick from carton_master where PTCN in (SELECT PTCN FROM WAVE_TASK_DET WHERE REF_SER = 'M-PACK' and ref_id = ?) " ;
sql = "select carton_no,pick_order,line_no__pick from carton_master where carton_type = 'C' and " +
sql = "select carton_no,pick_order,line_no__pick,item_code from carton_master where carton_type = 'C' and " +
" PTCN IN (SELECT PTCN FROM WAVE_TASK_DET WHERE ref_id = ? ) AND CARTON_NO NOT IN (SELECT CARTON_NO FROM PACK_DET WHERE TRAN_ID = ? ) AND STATUS = 'A' " +
" order by carton_no";
pstmt = conn.prepareStatement(sql);
......@@ -1493,7 +1508,7 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma
{
pickOrder1 = checkNullAndTrim(rs.getString("pick_order"));
lineNo1 = checkNullAndTrim(rs.getString("line_no__pick"));
itemCode = checkNullAndTrim(rs.getString("item_code"));
sql1 = "SELECT SALE_ORDER,LINE_NO__SORD,ITEM_CODE,SITE_CODE,LOC_CODE,LOT_NO,LOT_SL,QUANTITY,NO_ART FROM PICK_ORD_DET WHERE PICK_ORDER = ? AND LINE_NO = ? "; //change done by kunal on 7/08/12 as per S Manoharan Sir intruction.
......@@ -1505,7 +1520,7 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma
if(rs1.next())
{
itemCode = checkNullAndTrim(rs1.getString("ITEM_CODE"));
//itemCode = checkNullAndTrim(rs1.getString("ITEM_CODE"));
lotNo = checkNullAndTrim(rs1.getString("LOT_NO"));
HashMap ItemPackMap = getItemVoumeMap(itemCode,lotNo,conn);
packSize = (Double)ItemPackMap.get("PACK_SIZE");
......@@ -2108,4 +2123,77 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma
return attribValue;
}
//Changed by sumit on 08/02/13 reteriving selected value end.
//Changeed by Pragyan WM2LSUN015 26/03/13 To check the item is hazardous or not.start
private boolean isHazardOusItem(String itemCode,Connection conn) throws ITMException
{
String sql = "";
boolean isHazardous = false;
ResultSet rs = null;
PreparedStatement pstmt = null;
String hazardous = "N";
try
{
sql = "SELECT HAZARDOUS FROM ITEM WHERE ITEM_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
hazardous = rs.getString("HAZARDOUS");
}
if( rs != null )
{
rs.close();
rs = null;
}
if( pstmt != null )
{
pstmt.close();
pstmt = null;
}
System.out.println("Checking Hazardous ["+hazardous+"]");
if("Y".equalsIgnoreCase(hazardous))
{
System.out.println("Checking Hazardous 1["+hazardous+"]");
isHazardous = true;
}
}
catch(Exception e)
{
System.out.println("Exception in == >"+e);
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if( rs != null )
{
rs.close();
rs = null;
}
if( pstmt != null )
{
pstmt.close();
pstmt = null;
}
}
catch (Exception e1)
{
throw new ITMException(e1);
}
}
return isHazardous;
}
//Changeed by Pragyan WM2LSUN015 26/03/13 To check the item is hazardous or not.end
}
......@@ -36018,6 +36018,67 @@ COMMIT;
-----------------changed by sankara 26/03/13 WM2lSUN005 End ---
---changed By Pragyan 26/03/13 WM2lSUN015----
INSERT INTO MESSAGES (
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input,
mail_option )
VALUES (
'INVCURITEM',
'Non hazardous item not allowed',
'Non hazardous items not allowed in this master carton',
'E',
'E',
NULL,
NULL,
NULL,
TO_DATE('13-02-2008 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'RAKESH ',
'RAKESH ',
NULL,
NULL);
INSERT INTO MESSAGES (
msg_no ,
msg_str ,
msg_descr ,
msg_type ,
msg_opt ,
msg_time ,
alarm ,
err_source ,
chg_date ,
chg_user ,
chg_term ,
override_input,
mail_option )
VALUES (
'INVHAZITEM',
'hazardous item not allowed',
'Hazardous items not allowed in this master carton',
'E',
'E',
NULL,
NULL,
NULL,
TO_DATE('13-02-2008 00:00:00','DD-MM-YYYY HH24:MI:SS'),
'RAKESH ',
'RAKESH ',
NULL,
NULL);
commit;
......
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