Commit ed3752a5 authored by jshinde's avatar jshinde

request id:W16CSUN008 updated for req_type and criteria req changes


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@103531 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 77a36fa9
......@@ -8,17 +8,20 @@ package ibase.webitm.ejb.wms;
import ibase.system.config.*;
import ibase.webitm.ejb.*;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.utility.E12GenericUtility;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.*;
import org.w3c.dom.*;
@javax.ejb.Stateless
public class PalletReqGenIC extends ValidatorEJB implements PalletReqGenICLocal, PalletReqGenICRemote
{
DistCommon discommon = new DistCommon();
@Override
public String wfValData() throws RemoteException, ITMException
{
......@@ -97,7 +100,7 @@ public class PalletReqGenIC extends ValidatorEJB implements PalletReqGenICLocal,
ArrayList <String>errFields = new ArrayList <String> ();
E12GenericUtility genericUtility;
String siteCode = "",userId = "",childNodeName = "",errString = "",reqType= "";
int ctr = 0, currentFormNo = 0, childNodeListLength = 0,cnt=0;
int ctr = 0, currentFormNo = 0, childNodeListLength = 0,cnt=0,cnt3=0,cnt4=0,cntLoc=0,palcnt=0;
String objName="",criteria= "";
objName = getObjNameFromDom(dom, "objName", "2");
System.out.println("objName----->>["+objName+"]");
......@@ -114,6 +117,10 @@ public class PalletReqGenIC extends ValidatorEJB implements PalletReqGenICLocal,
conn = getConnection();
conn.setAutoCommit(false);
//connDriver = null;
PreparedStatement pstmt=null;
ResultSet rs =null;
String pallet_no="",item_code="",sql="",locSuffixDisp="",stkSql="";
char lastChar;
userId = getValueFromXTRA_PARAMS(xtraParams, "loginCode");
if (objContext != null && objContext.trim().length() > 0)
......@@ -134,6 +141,10 @@ public class PalletReqGenIC extends ValidatorEJB implements PalletReqGenICLocal,
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
locSuffixDisp = checkNullAndTrim(discommon.getDisparams("999999", "AWMS_LOCATION_SUFFIX", conn));
System.out.println("AWMS_LOCATION_SUFFIX["+locSuffixDisp+"]");
String[] locS = locSuffixDisp.split(",");
for (ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
......@@ -153,7 +164,7 @@ public class PalletReqGenIC extends ValidatorEJB implements PalletReqGenICLocal,
errFields.add( childNodeName.toLowerCase() );
}
}
if("criteria".equalsIgnoreCase(childNodeName))
else if("criteria".equalsIgnoreCase(childNodeName))
{
reqType = checkNullAndTrim(genericUtility.getColumnValue("req_type",dom));
......@@ -176,6 +187,144 @@ public class PalletReqGenIC extends ValidatorEJB implements PalletReqGenICLocal,
}
}
}
else if("pallet_no".equalsIgnoreCase(childNodeName) )
{
pallet_no = checkNullAndTrim(genericUtility.getColumnValue("pallet_no",dom));
pallet_no = pallet_no==null ? "" : pallet_no.trim();
System.out.println("pallet_no:::::"+pallet_no);
if(pallet_no.trim().length() > 0){
sql = "SELECT COUNT(1) FROM LOCATION WHERE INV_STAT = ? AND LOC_CODE =? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "AWMS");
pstmt.setString(2, pallet_no);
rs = pstmt.executeQuery();
if(rs.next())
{
cntLoc = rs.getInt(1);
System.out.println( "cntLoc:::"+cntLoc);
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if(cntLoc > 0)
{
lastChar=pallet_no.charAt(pallet_no.trim().length()-1);
System.out.println("lastChar:"+lastChar);
System.out.println("locSuffix disparm=["+locSuffixDisp+"] and lastChar["+lastChar+"]");
if(locSuffixDisp.contains(String.valueOf(lastChar)))
{
System.out.println("****Match found in disparm for"+lastChar);
System.out.println("location with suffix");
errCode = "VTPALLEEXT";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
break;
}
else
{
//Changed by Jagruti Shinde,for considering QC rejected locations in Pallet out.Request id:[W16ASUN022]
stkSql = "SELECT COUNT(1) FROM STOCK WHERE INV_STAT IN(?,?) AND LOC_CODE IN (?,?,?,?,?,?,?,?,?) AND SITE_CODE=? AND QUANTITY>0";
pstmt = conn.prepareStatement(stkSql);
pstmt.setString(1, "AWMS");
pstmt.setString(2, "AWMSQ");
pstmt.setString(3, pallet_no);
pstmt.setString(4, pallet_no+"Q");
pstmt.setString(5, pallet_no+"B");
pstmt.setString(6, pallet_no+"X");
pstmt.setString(7, pallet_no+"M");
pstmt.setString(8, pallet_no+"U");
pstmt.setString(9, pallet_no+"P");
pstmt.setString(10,pallet_no+"S");
//Changed by Jagruti Shinde ,for considering QC rejected locations in Pallet out.Request id:[W16ASUN022]
pstmt.setString(11,pallet_no+"R");
pstmt.setString(12, siteCode);
rs = pstmt.executeQuery();
if(rs.next())
{
palcnt = rs.getInt(1);
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (rs != null)
{
rs.close();
rs = null;
}
if(palcnt == 0)
{
System.out.println("awms pallet count" +palcnt);
errCode = "VMPALLETQN";//pallet quantity should be more than zero
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
break;
}
}
}
else
{
System.out.println("pallet not in AWMS" +cntLoc);
errCode = "VTPALLEEXT";//pallet
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
break;
}
}//Change by Jagruti Shinde Request Id:[W15JSUN017] requirement change for Exempted/BSR location inv_stat[End]
}
else if("item_code".equalsIgnoreCase(childNodeName))
{
item_code = checkNullAndTrim(genericUtility.getColumnValue("item_code",dom));
item_code = item_code==null ? "" : item_code.trim();
System.out.println("item_code:::"+item_code);
if(item_code.trim().length()>0){
sql="select count(*) as count from siteitem where item_code=? and site_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, item_code);
pstmt.setString(2, siteCode);
rs = pstmt.executeQuery();
while(rs.next())
{
cnt3=rs.getInt("count");
}
if(cnt3==0)
{
errCode = "VMINVIC";//Invalid item_code for Stock
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
else
{
String sql2="select count(*) as count from stock where site_code = ? and quantity > 0 and inv_stat in ('AWMS','AWMSQ') and item_code=?";
pstmt = conn.prepareStatement(sql2);
pstmt.setString(1, siteCode);
pstmt.setString(2, item_code);
rs = pstmt.executeQuery();
while(rs.next())
{
cnt4=rs.getInt("count");
}
if(cnt4==0)
{
errCode = "VMICNF";//Invalid item_code for Stock
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
}
}
}
}
break;
} //switch end
......@@ -408,6 +557,8 @@ public class PalletReqGenIC extends ValidatorEJB implements PalletReqGenICLocal,
siteDescr = checkNullAndTrim(getColumnDescr(conn, "descr", "site", "site_code", siteCode));
valueXmlString.append( "<site_code><![CDATA[" ).append( siteCode ).append( "]]></site_code>\r\n" );
valueXmlString.append( "<site_descr><![CDATA[" ).append( siteDescr ).append( "]]></site_descr>\r\n" );
valueXmlString.append( "<req_type><![CDATA[" ).append("S").append( "]]></req_type>\r\n" );
valueXmlString.append( "<criteria protect='1'><![CDATA[" ).append("P").append( "]]></criteria>\r\n" );
}
valueXmlString.append( "<tran_date><![CDATA[" ).append( tranDate ).append( "]]></tran_date>\r\n" );
valueXmlString.append("</Detail1>\r\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