Commit 2ab77158 authored by dpawar's avatar dpawar

add validation qc lock. addded fields


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96386 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 8847ecb3
......@@ -21,6 +21,7 @@ import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
......@@ -452,8 +453,9 @@ public class DespatchWiz extends ValidatorEJB implements DespatchWizLocal, Despa
else if(childNodeName.equalsIgnoreCase("quantity"))
{
System.out.println("-------------wfvalData..quantity.............");
String lotNo="",locCodeL="",despId="";
String lotNo="",locCodeL="",despId="",qcLockValue="";
double sdetQty=0,despatchQty=0,actQty=0;
ArrayList<String> lockList=new ArrayList<String>();
HashMap<String,String>invHoldMap=new HashMap<String,String>();
sorderNo = checkNull(genericUtility.getColumnValue("sale_order_no", dom1));
squantity = genericUtility.getColumnValue("quantity",dom2);
......@@ -489,17 +491,19 @@ public class DespatchWiz extends ValidatorEJB implements DespatchWizLocal, Despa
{
quantity = Double.parseDouble(squantity);
}
cnt=getInvHoldCount(invHoldMap, conn);
qcLockValue=checkNull(getColumnDescr(conn, "var_value", "disparm", "var_name", "QUARNTINE_LOCKCODE"));
System.out.println("qcLockValue-------->>["+qcLockValue+"]");
lockList=getInvHoldQCLock(invHoldMap, conn);
System.out.println("Return lockList-------->>["+lockList+"]");
int listCount=lockList.size();
int occurence=Collections.frequency(lockList, qcLockValue);
int otherLockCount= listCount - occurence;
System.out.println("Occurence-------->>["+occurence+"]");
if("N".equalsIgnoreCase(avalyn)){
if(cnt == 0){
//Error
if(otherLockCount > 0){
errCode = "DIDOLKCINC";//Despatch can not be created as qunaity is on hold.
errString = getErrorString("quantity",errCode,userId);
break;
}
}
......@@ -684,7 +688,7 @@ public class DespatchWiz extends ValidatorEJB implements DespatchWizLocal, Despa
custCodeBil="",dlvAdd1="",dlvAdd2="",dlvAdd3="",despId="",remarksDes="",noArtDes="",sorderNo="",
siteCodeShip="",availableYn="",addUser="",chgUserL="",chgTermL="",lotslL="",lotStatus="HOLD";
ArrayList<String> addUsersList=new ArrayList<String>();
Date orderDt = null,statusDate=null,mfgDate=null,expiryDate=null,sOrdDate=null;
Date orderDt = null,statusDate=null,mfgDate=null,expiryDate=null,sOrdDate=null,retestDate=null;
try
{
sdf=new SimpleDateFormat(genutility.getApplDateFormat());
......@@ -1303,39 +1307,6 @@ public class DespatchWiz extends ValidatorEJB implements DespatchWizLocal, Despa
valueXmlString.append("<tot_net_amt><![CDATA["+ netAmt +"]]></tot_net_amt>");
/*valueXmlString.append("<gross_weight>").append("<![CDATA[").append(grossWeight1).append("]]>").append("</gross_weight>");
valueXmlString.append("<nett_weight>").append("<![CDATA[").append(netWeight1).append("]]>").append("</nett_weight>");
valueXmlString.append("<tare_weight>").append("<![CDATA[").append(tareWeight1).append("]]>").append("</tare_weight>");
valueXmlString.append("<dimension><![CDATA["+ dimension +"]]></dimension>");
valueXmlString.append("<pallet_wt><![CDATA["+ palletWt +"]]></pallet_wt>");
valueXmlString.append("<pack_code><![CDATA["+ packCode +"]]></pack_code>");*/
/*valueXmlString.append("<rate><![CDATA[ ]]></rate>");
valueXmlString.append("<item_code__ord><![CDATA[ ]]></item_code__ord>");
valueXmlString.append("<item_code><![CDATA[ ]]></item_code>");
valueXmlString.append("<quantity><![CDATA[ ]]></quantity>");
valueXmlString.append("<unit><![CDATA[ ]]></unit>");
valueXmlString.append("<conv__qty_stduom><![CDATA[ ]]></conv__qty_stduom>");
valueXmlString.append("<tax_class><![CDATA[ ]]></tax_class>");
valueXmlString.append("<tax_chap><![CDATA[ ]]></tax_chap>");
valueXmlString.append("<tax_env><![CDATA[ ]]></tax_env>");
valueXmlString.append("<rate__clg><![CDATA[ ]]></rate__clg>");
valueXmlString.append("<site_code><![CDATA[ ]]></site_code>");
valueXmlString.append("<quantity__stduom><![CDATA[ ]]></quantity__stduom>");
valueXmlString.append("<unit__std><![CDATA[ ]]></unit__std>");
valueXmlString.append("<pallet_wt><![CDATA[ ]]></pallet_wt>");
valueXmlString.append("<no_art><![CDATA[ ]]></no_art>");
valueXmlString.append("<rate__stduom><![CDATA[ ]]></rate__stduom>");
valueXmlString.append("<conv__rtuom_stduom><![CDATA[ ]]></conv__rtuom_stduom>");
valueXmlString.append("<quantity_real><![CDATA[ ]]></quantity_real>");
valueXmlString.append("<pending_qty><![CDATA[ ]]></pending_qty>");
valueXmlString.append("<quantity__ord><![CDATA[ ]]></quantity__ord>");
valueXmlString.append("<gross_weight><![CDATA[ ]]></gross_weight>");
valueXmlString.append("<tare_weight><![CDATA[ ]]></tare_weight>");
valueXmlString.append("<dimension><![CDATA[ ]]></dimension>");
valueXmlString.append("<pallet_wt><![CDATA[ ]]></pallet_wt>"); */
valueXmlString.append("</Detail3>");
......@@ -1450,7 +1421,7 @@ public class DespatchWiz extends ValidatorEJB implements DespatchWizLocal, Despa
sql = "select loc_code,lot_no,item_code,quantity,gross_weight,net_weight,tare_weight,no_art,"
+ "hold_qty,alloc_qty,site_code__mfg,mfg_date,exp_date from stock where site_code = ? and lot_sl = ? and quantity > 0";
+ "hold_qty,alloc_qty,site_code__mfg,mfg_date,exp_date,retest_date from stock where site_code = ? and lot_sl = ? and quantity > 0";
pstmt1=conn.prepareStatement(sql);
pstmt1.setString(1,siteCodeL);
pstmt1.setString(2,lotSlL);
......@@ -1474,6 +1445,7 @@ public class DespatchWiz extends ValidatorEJB implements DespatchWizLocal, Despa
siteCodeMfg= checkNull(rs1.getString("site_code__mfg"));
mfgDate=rs1.getDate("mfg_date");
expiryDate=rs1.getDate("exp_date");
retestDate=rs1.getDate("retest_date");
}
pstmt1.close();
......@@ -1501,9 +1473,9 @@ public class DespatchWiz extends ValidatorEJB implements DespatchWizLocal, Despa
valueXmlString.append("<no_art><![CDATA["+ noOfArt+"]]></no_art>");
valueXmlString.append("<loc_code><![CDATA["+ locCode+"]]></loc_code>");
if("Y".equalsIgnoreCase(avalyn)){
actualQty=squantity - (holdQty + allocQty);
}else{
actualQty=squantity - allocQty;
}else{
actualQty=squantity - (holdQty + allocQty);
}
valueXmlString.append("<quantity><![CDATA["+ actualQty+"]]></quantity>");
......@@ -1522,6 +1494,9 @@ public class DespatchWiz extends ValidatorEJB implements DespatchWizLocal, Despa
if(expiryDate !=null){
valueXmlString.append("<exp_date>").append("<![CDATA[").append(sdf.format(expiryDate).toString()).append("]]>").append("</exp_date>");
}
if(expiryDate !=null){
valueXmlString.append("<retest_date>").append("<![CDATA[").append(sdf.format(retestDate).toString()).append("]]>").append("</retest_date>");
}
valueXmlString.append("<lot_sl><![CDATA["+ lotSlL +"]]></lot_sl>");
......@@ -1625,106 +1600,7 @@ public class DespatchWiz extends ValidatorEJB implements DespatchWizLocal, Despa
}
tempNode = null;
}
private String getDetails(String mSiteCode,int mLineNoDist,String mDistOrder,String lsTranType,Connection conn)throws RemoteException,ITMException
{//this method will return xml data
String mItemCode = null,mTaxClass=null,mTaxChap=null,mTaxEnv = null;
String lsUnitAlt = null,lsUnit = null,lsPackInstr =null;
double mQty= 0,lcQty= 0,mRate = 0,mDiscount =0;
String sql = null,lsTranTypeParent ="";
ResultSet rs = null,rs1 =null;
PreparedStatement pstmt = null,pstmt1 =null;
StringBuffer detail2hdr = new StringBuffer("");
try
{
sql="select item_code,((case when qty_confirm is null then 0 else qty_confirm end) - "
+" (case when qty_shipped is null then 0 else qty_shipped end)) as qty,"
+" ((case when qty_shipped is null then 0 else qty_shipped end) - "
+" (case when qty_return is null then 0 else qty_return end)) as lcqty,"
+" tax_class,tax_chap,tax_env,case when rate is null then 0 else rate end as rate,"
+" case when discount is null then 0 else discount end as discount, "
+" rate__clg ,UNIT__ALT ,UNIT,CONV__QTY__ALT,pack_instr "
+" from distorder_det "
+" where dist_order = '"+mDistOrder+"' "
+" and line_no = "+mLineNoDist+""
+ " AND CASE WHEN STATUS IS NULL THEN 'O' ELSE STATUS END<>'C' ";//Added by manoj dtd 24/12/2013 to exclude closed line"
//System.out.println("[DistIssueItemChangeEJB] sql=>"+sql);
pstmt = conn.prepareStatement(sql);
// pstmt.setString(1,mDistOrder);
//pstmt.setInt(2,mLineNoDist);
rs = pstmt.executeQuery();
if(rs.next())
{
mItemCode = rs.getString("item_code")==null?"":rs.getString("item_code");
mQty = rs.getDouble("qty");
lcQty = rs.getDouble("lcqty");
mTaxClass = rs.getString("tax_class")==null?"":rs.getString("tax_class");
mTaxChap = rs.getString("tax_chap")==null?"":rs.getString("tax_chap");
mTaxEnv = rs.getString("tax_env")==null?"":rs.getString("tax_env");
mRate = rs.getDouble("rate");
mDiscount = rs.getDouble("discount");
lsUnitAlt = rs.getString("UNIT__ALT")==null?"":rs.getString("UNIT__ALT");
lsPackInstr = rs.getString("pack_instr")==null?"":rs.getString("pack_instr");
if(lsUnitAlt.trim().length() == 0)
{
lsUnitAlt = lsUnit;
}
// detail2hdr.append("<item_code><![CDATA["+mItemCode+"]]></item_code>");
detail2hdr.append("<unit><![CDATA["+lsUnit+"]]></unit>");
detail2hdr.append("<unit__alt><![CDATA["+lsUnitAlt+"]]></unit__alt>");
detail2hdr.append("<pack_instr><![CDATA["+lsPackInstr+"]]></pack_instr>");
sql=" select tran_type__parent "
+" from distorder_type where tran_type = '"+lsTranType+"' ";
//System.out.println("[DistIssueItemChangeEJB] sql=>"+sql);
pstmt1= conn.prepareStatement(sql);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
lsTranTypeParent = rs1.getString("tran_type__parent") == null ? "": rs1.getString("tran_type__parent").trim();
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
if(! lsTranTypeParent.equalsIgnoreCase(lsTranType.trim()))
{
detail2hdr.append("<quantity>"+lcQty+"</quantity>");
detail2hdr.append("<qty_order__alt>"+lcQty+"</qty_order__alt>");
lcQty = lcQty;
}
else
{
detail2hdr.append("<quantity>"+mQty+"</quantity>");
detail2hdr.append("<qty_order__alt>"+mQty+"</qty_order__alt>");
lcQty = mQty;
}
detail2hdr.append("<tax_class><![CDATA["+mTaxClass+"]]></tax_class>");
detail2hdr.append("<tax_chap><![CDATA["+mTaxChap+"]]></tax_chap>");
detail2hdr.append("<tax_env><![CDATA["+mTaxEnv+"]]></tax_env>");
detail2hdr.append("<rate>"+mRate+"</rate>");
detail2hdr.append("<discount>"+mDiscount+"</discount>");
//System.out.println("[CreateDistIssue] xml return ==>"+detail2hdr.toString());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
catch(Exception e)
{
e.printStackTrace();
}
System.out.println("chandni inside detail::"+detail2hdr.toString());
return detail2hdr.toString();
}
private String getCurrdateAppFormat()
{
......@@ -1788,32 +1664,37 @@ public class DespatchWiz extends ValidatorEJB implements DespatchWizLocal, Despa
SimpleDateFormat sdf = null;
java.sql.Timestamp currDate = null;
int count=0;
double frtAmt=0,insurance=0;
String sql="",siteCode="",currencyCode="",exchRate1="",transMode="",currCodeFrt="",currCodeIns="",stanCode="",stanCodeDlv="";
String dlvCity="",dlvPin="",countCodeDlv="",tranCode="",stanCodeInit="",status="",statusRemarks="",custCode="",custCodeDlv="";
String custCodeBil="",siteCodeShip="",dlvAdd1="",dlvAdd2="",dlvAdd3="",siteCodeDesc="",tranName="",currAppdate="",availableYn="";
Date orderDt=null,statusDate=null;
String custCodeBil="",siteCodeShip="",dlvAdd1="",dlvAdd2="",dlvAdd3="",siteCodeDesc="",tranName="",currAppdate="",availableYn="",
remarks2="",remarks3="",remarks="",licenceNo1="",licenceNo2="",licenceNo3="",orderType="",gpSer="";
Date orderDt=null,statusDate=null,licenceDate1=null,licenceDate2=null,licenceDate3=null;
System.out.println("--------no data found in Despatch-------------");
System.out.println("chgUser567-------->>["+chgUser+"]");
try{
sdf=new SimpleDateFormat(genericUtility.getApplDateFormat());
currDate = new java.sql.Timestamp(System.currentTimeMillis()) ;
currAppdate = sdf.format(currDate);
sql = "select item_ser,site_code,curr_code,exch_rate,tran_code, trans_mode,curr_code__frt,curr_code__ins,cust_code__dlv," +
sql = "select order_type,item_ser,site_code,curr_code,exch_rate,tran_code, trans_mode,curr_code__frt,curr_code__ins,cust_code__dlv," +
"stan_code,order_date,exch_rate__frt,exch_rate__ins,fob_value,conf_date,chg_date,state_code__dlv,udf__str1,udf__str2," +
"dlv_city,dlv_pin,count_code__dlv,tran_code,stan_code,stan_code__init,parent__tran_id,rev__tran,status_remarks,"
+ "spec_reason,dist_route,status,status_date,cust_code,cust_code__dlv,available_yn,"
+ "frt_amt,ins_amt,remarks,remarks2,remarks3,licence_date_1,licence_no_1,licence_date_2,licence_no_2,licence_date_3,licence_no_3,"
+ "cust_code__bil,site_code__ship,dlv_add1,dlv_add2,dlv_add3"+
" from sorder where sale_order = ? " ;//available_yn
" from sorder where sale_order = ? and confirmed = ?" ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,sorderId);
pstmt.setString(2,"Y");
rs = pstmt.executeQuery();
if( rs.next() )
{
count = 1;
orderType=checkNull(rs.getString("order_type"));
siteCode = checkNull(rs.getString("site_code"));
currencyCode = checkNull(rs.getString("curr_code"));
exchRate1 = checkNull(rs.getString("exch_rate"));
transMode = rs.getString("trans_mode") == null ? "R " : rs.getString("trans_mode");
transMode = checkNull(rs.getString("trans_mode"));
currCodeFrt = checkNull(rs.getString("curr_code__frt"));
currCodeIns = checkNull(rs.getString("curr_code__ins"));
......@@ -1838,6 +1719,21 @@ public class DespatchWiz extends ValidatorEJB implements DespatchWizLocal, Despa
dlvAdd2=checkNull(rs.getString("dlv_add2"));
dlvAdd3=checkNull(rs.getString("dlv_add3"));
remarks=checkNull(rs.getString("remarks"));
remarks2=checkNull(rs.getString("remarks2"));
remarks3=checkNull(rs.getString("remarks3"));
frtAmt=rs.getDouble("frt_amt");
insurance=rs.getDouble("ins_amt");
licenceNo1=checkNull(rs.getString("licence_no_1"));
licenceDate1=rs.getDate("licence_date_1");
licenceNo2=checkNull(rs.getString("licence_no_2"));
licenceDate2=rs.getDate("licence_date_2");
licenceNo3=checkNull(rs.getString("licence_no_3"));
licenceDate3=rs.getDate("licence_date_3");
}
if(rs!=null){
rs.close();
......@@ -1857,14 +1753,14 @@ public class DespatchWiz extends ValidatorEJB implements DespatchWizLocal, Despa
valueXmlString.append("<cust_code><![CDATA["+ custCode +"]]></cust_code>");
valueXmlString.append("<cust_code__dlv><![CDATA["+ custCodeDlv +"]]></cust_code__dlv>");
valueXmlString.append("<cust_code__bil><![CDATA["+ custCodeBil +"]]></cust_code__bil>");
valueXmlString.append("<stan_code><![CDATA["+ stanCode.trim() +"]]></stan_code>");
valueXmlString.append("<trans_mode><![CDATA["+ transMode.trim() +"]]></trans_mode>");
valueXmlString.append("<stan_code><![CDATA["+ stanCode +"]]></stan_code>");
valueXmlString.append("<trans_mode><![CDATA["+ transMode +"]]></trans_mode>");
//valueXmlString.append("<lr_date><![CDATA["+ lrDateVal.toString() +"]]></lr_date>");
//valueXmlString.append("<shipment_id><![CDATA["+ shipmentId.trim() +"]]></shipment_id>");
valueXmlString.append("<curr_code__frt><![CDATA["+ currCodeFrt.trim() +"]]></curr_code__frt>");
valueXmlString.append("<curr_code__ins><![CDATA["+ currCodeIns.trim() +"]]></curr_code__ins>");
valueXmlString.append("<curr_code><![CDATA["+ currencyCode.trim() +"]]></curr_code>");
valueXmlString.append("<curr_code__frt><![CDATA["+ currCodeFrt +"]]></curr_code__frt>");
valueXmlString.append("<curr_code__ins><![CDATA["+ currCodeIns+"]]></curr_code__ins>");
valueXmlString.append("<curr_code><![CDATA["+ currencyCode+"]]></curr_code>");
valueXmlString.append("<exch_rate><![CDATA["+ exchRate1 +"]]></exch_rate>");
valueXmlString.append("<exch_rate__frt><![CDATA["+ exchRate1 +"]]></exch_rate__frt>");
valueXmlString.append("<exch_rate__ins><![CDATA["+ exchRate1 +"]]></exch_rate__ins>");
......@@ -1878,27 +1774,93 @@ public class DespatchWiz extends ValidatorEJB implements DespatchWizLocal, Despa
valueXmlString.append("<site_code><![CDATA["+ siteCode +"]]></site_code>");
siteCodeDesc=checkNull(getColumnDescr(conn, "descr", "site", "site_code", siteCode));
valueXmlString.append("<descr><![CDATA["+ siteCodeDesc+"]]></descr>");
valueXmlString.append("<state_code__dlv><![CDATA["+ stanCodeDlv.trim()+"]]></state_code__dlv>");
valueXmlString.append("<state_code__dlv><![CDATA["+ stanCodeDlv.trim()+"]]></state_code__dlv>");
valueXmlString.append("<dlv_add1><![CDATA["+ dlvAdd1 +"]]></dlv_add1>");
valueXmlString.append("<dlv_add2><![CDATA["+ dlvAdd2 +"]]></dlv_add2>");
valueXmlString.append("<dlv_add3><![CDATA["+ dlvAdd3 +"]]></dlv_add3>");
valueXmlString.append("<dlv_city><![CDATA["+ dlvCity +"]]></dlv_city>");
valueXmlString.append("<dlv_pin><![CDATA["+ dlvPin +"]]></dlv_pin>");
valueXmlString.append("<count_code__dlv><![CDATA["+ countCodeDlv +"]]></count_code__dlv>");
//valueXmlString.append("<tran_code><![CDATA["+ tranCode +"]]></tran_code>");
valueXmlString.append("<tran_code><![CDATA["+ tranCode +"]]></tran_code>");
valueXmlString.append("<stan_code__init><![CDATA["+ stanCodeInit +"]]></stan_code__init>");
valueXmlString.append("<status_remarks><![CDATA["+ statusRemarks +"]]></status_remarks>");
valueXmlString.append("<status><![CDATA["+ status +"]]></status>");
//tranName=getColumnDescr(conn,"tran_name" , "transporter", "tran_code", tranCode);
//valueXmlString.append("<tran_name><![CDATA["+ tranName +"]]></tran_name>");
tranName=getColumnDescr(conn,"tran_name" , "transporter", "tran_code", tranCode);
valueXmlString.append("<tran_name><![CDATA["+ tranName +"]]></tran_name>");
valueXmlString.append("<remarks><![CDATA["+ remarks +"]]></remarks>");
valueXmlString.append("<remarks2><![CDATA["+ remarks2 +"]]></remarks2>");
valueXmlString.append("<remarks3><![CDATA["+ remarks3 +"]]></remarks3>");
valueXmlString.append("<freight><![CDATA["+ frtAmt +"]]></freight>");
valueXmlString.append("<insurance><![CDATA["+ insurance +"]]></insurance>");
valueXmlString.append("<eff_date><![CDATA["+ currAppdate +"]]></eff_date>");
if(licenceNo1.length() == 0){
sql="select c.drug_lic_no_1,c.drug_licno1_upto from sorder s,customer c "
+ "where s.cust_code__dlv = c.cust_code and s.sale_order = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,sorderId);
rs=pstmt.executeQuery();
if(rs.next()){
licenceNo1=checkNull(rs.getString(1));
licenceDate1=rs.getDate(2);
}
if(rs!=null){
rs.close();
rs=null;
}
if(pstmt!=null){
pstmt.close();
pstmt=null;
}
}
if(licenceNo2.length() == 0){
sql="select c.drug_lic_no_1,c.drug_licno1_upto from sorder s,customer c "
+ "where s.cust_code__dlv = c.cust_code and s.sale_order = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,sorderId);
rs=pstmt.executeQuery();
if(rs.next()){
licenceNo2=checkNull(rs.getString(1));
licenceDate2=rs.getDate(2);
}
if(rs!=null){
rs.close();
rs=null;
}
if(pstmt!=null){
pstmt.close();
pstmt=null;
}
}
valueXmlString.append("<licence_no_1><![CDATA["+ licenceNo1 +"]]></licence_no_1>");
valueXmlString.append("<licence_date_2><![CDATA["+ licenceNo2 +"]]></licence_date_2>");
valueXmlString.append("<licence_no_3><![CDATA["+ licenceNo3 +"]]></licence_no_3>");
if(licenceDate1!=null){
valueXmlString.append("<licence_date_1><![CDATA["+ sdf.format(licenceDate1).toString()+"]]></licence_date_1>");
}
if(licenceDate2!=null){
valueXmlString.append("<licence_date_2><![CDATA["+ sdf.format(licenceDate2).toString()+"]]></licence_date_2>");
}
if(licenceDate3!=null){
valueXmlString.append("<licence_date_3><![CDATA["+ sdf.format(licenceDate3).toString()+"]]></licence_date_3>");
}
gpSer=checkNull(getColumnDescr(conn, "gp_ser", "sordertype", "order_type", orderType));
valueXmlString.append("<gp_ser>").append("<![CDATA["+gpSer +"]]>").append("</gp_ser>");
valueXmlString.append("<chg_user>").append("<![CDATA[" + chgUser + "]]>").append("</chg_user>");
valueXmlString.append("<chg_term>").append("<![CDATA[" + chgTerm + "]]>").append("</chg_term>");
valueXmlString.append("<chg_date>").append("<![CDATA[" + currAppdate + "]]>").append("</chg_date>");
valueXmlString.append("<chg_date>").append("<![CDATA[" +currAppdate +"]]>").append("</chg_date>");
valueXmlString.append("<add_user>").append("<![CDATA[" + chgUser + "]]>").append("</add_user>");
valueXmlString.append("<add_term>").append("<![CDATA[" + chgTerm + "]]>").append("</add_term>");
......@@ -2005,21 +1967,19 @@ public class DespatchWiz extends ValidatorEJB implements DespatchWizLocal, Despa
return actualQty;
}
private int getInvHoldCount(Map<String,String> invHoldMap,Connection conn)
private ArrayList<String> getInvHoldQCLock(Map<String,String> invHoldMap,Connection conn)
{
System.out.println("----in getInvHoldQuantity method------");
ResultSet rs=null;
PreparedStatement pstmt=null;
String sql="",holdQty="",countS="",qcLockValue="";
int count=0;
try{
qcLockValue=checkNull(getColumnDescr(conn, "var_value", "disparm", "var_name", "QUARNTINE_LOCKCODE"));
System.out.println("qcLockValue------->>["+qcLockValue+"]");
String sql="";
ArrayList<String> lockListL=new ArrayList<String>();
try{
sql="select count(*) from inv_hold h,inv_hold_det d where h.tran_id = d.tran_id "
+"and d.item_code = ? and d.site_code = ? "
+"and d.loc_code = ? and d.lot_no= ? AND h.confirmed= ? "
+"and d.lot_sl= ? and d.hold_status = ? and h.lock_code = ?";
+"and d.lot_sl= ? and d.hold_status = ? ";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, invHoldMap.get("item_code"));
pstmt.setString(2, invHoldMap.get("site_code"));
......@@ -2028,10 +1988,10 @@ public class DespatchWiz extends ValidatorEJB implements DespatchWizLocal, Despa
pstmt.setString(5, "Y");
pstmt.setString(6, invHoldMap.get("lot_sl"));
pstmt.setString(7, "H");
pstmt.setString(8, qcLockValue);
rs=pstmt.executeQuery();
if(rs.next()){
count=rs.getInt(1);
while(rs.next()){
lockListL.add(checkNull(rs.getString(1)));
}
if(rs!=null){
rs.close();
......@@ -2042,36 +2002,13 @@ public class DespatchWiz extends ValidatorEJB implements DespatchWizLocal, Despa
pstmt=null;
}
/*sql="select hold_qty FROM stock where "
+ "item_code = ? and site_code = ? and loc_code = ? and lot_no = ? and lot_sl= ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, invHoldMap.get("item_code"));
pstmt.setString(2, invHoldMap.get("site_code"));
pstmt.setString(3, invHoldMap.get("loc_code"));
pstmt.setString(4, invHoldMap.get("lot_no"));
pstmt.setString(5, invHoldMap.get("lot_sl"));
rs=pstmt.executeQuery();
if(rs.next()){
holdQty=rs.getString("hold_qty");
}
if(rs!=null){
rs.close();
rs=null;
}
if(pstmt!=null){
pstmt.close();
pstmt=null;
}*/
}
catch(Exception e){
e.printStackTrace();
}
holdQty=holdQty==null ? "0" : holdQty.trim();
countS=Integer.toString(count);
System.out.println("count---->>["+count+"]");
return count;
return lockListL;
}
public String checkNull(String str)
......
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