Commit cad53229 authored by caluka's avatar caluka

qc order is generate time if qc_reqd_type='L' then populate qc_order_lots


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97093 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0b2869e2
...@@ -2811,14 +2811,14 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -2811,14 +2811,14 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
String poRcpDetSpec = ""; String poRcpDetSpec = "";
String dbName = "",useSuppLot="",qcOrdType=""; String dbName = "",useSuppLot="",qcOrdType="";
String suppCode = "",suppCodeMnfr = "";//added by Kunal on 8/11/12 String suppCode = "",suppCodeMnfr = "";//added by Kunal on 8/11/12
String apprLocLogic = "",apprLocUdf = "",qcLotLocCode="";//added by chandrashekar on 07-01-15
double qty = 0.0; double qty = 0.0;
double qtySample = 0.0, qtySampleSiteItem = 0; double qtySample = 0.0, qtySampleSiteItem = 0;
double passedQty = 0.0; double passedQty = 0.0;
double qcLeadTime = 0.0; double qcLeadTime = 0.0;
double convQty = 0.0; double convQty = 0.0;
double quantity = 0.0, excessShortQty = 0.0 ,quantityStduom = 0.0; //added by Kunal on 5/11/12 double quantity = 0.0, excessShortQty = 0.0 ,quantityStduom = 0.0; //added by Kunal on 5/11/12
double netWeight = 0.0,noArt = 0.0;//added by chandrashekar 0n 31-12-2014
java.sql.Timestamp expiryDate = null; java.sql.Timestamp expiryDate = null;
java.sql.Timestamp qcDueDate = null; java.sql.Timestamp qcDueDate = null;
java.sql.Timestamp retestDt = null; java.sql.Timestamp retestDt = null;
...@@ -2829,7 +2829,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -2829,7 +2829,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
ArrayList qtyAr = null; ArrayList qtyAr = null;
int updCnt = 0; int updCnt = 0,updCnt1=0;
SimpleDateFormat dtFormat = null; SimpleDateFormat dtFormat = null;
String xmlValues = ""; String xmlValues = "";
java.util.Date date = null; java.util.Date date = null;
...@@ -3403,11 +3403,13 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -3403,11 +3403,13 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
+ " MIN(LINE_NO), MFG_DATE ,LOT_NO, " + " MIN(LINE_NO), MFG_DATE ,LOT_NO, "
+ " ( CASE WHEN SPEC_REF IS NULL THEN ' ' ELSE SPEC_REF END), " + " ( CASE WHEN SPEC_REF IS NULL THEN ' ' ELSE SPEC_REF END), "
+ " sum(case when excess_short_qty is null then 0 else excess_short_qty end) as excess_short_qty ,sum((case when quantity__stduom is null then 0 else quantity__stduom end)) as quantity__stduom,supp_code__mnfr " //added by kunal on 5/11/12 + " sum(case when excess_short_qty is null then 0 else excess_short_qty end) as excess_short_qty ,sum((case when quantity__stduom is null then 0 else quantity__stduom end)) as quantity__stduom,supp_code__mnfr " //added by kunal on 5/11/12
+ " ,(case when no_art is null then 0 else no_art end) as no_art," //stary added by chandrashekar on 06-01-2015
+ "(case when net_weight is null then 0 else net_weight end) as net_weight"//stary added by chandrashekar on 06-01-2015
+ " FROM PORCPDET WHERE TRAN_ID = ? " + " FROM PORCPDET WHERE TRAN_ID = ? "
+ " AND ITEM_CODE = ? " + " AND ITEM_CODE = ? "
+ " GROUP BY (CASE WHEN BATCH_NO IS NULL THEN ' ' ELSE BATCH_NO END), " + " GROUP BY (CASE WHEN BATCH_NO IS NULL THEN ' ' ELSE BATCH_NO END), "
+ " LOC_CODE, UNIT__STD, (CASE WHEN SPEC_REF IS NULL THEN ' ' ELSE SPEC_REF END), " + " LOC_CODE, UNIT__STD, (CASE WHEN SPEC_REF IS NULL THEN ' ' ELSE SPEC_REF END), "
+ " MFG_DATE ,LOT_NO,supp_code__mnfr " + " MFG_DATE ,LOT_NO,supp_code__mnfr,no_art,net_weight "
+ " ORDER BY MIN(LINE_NO) ASC "; + " ORDER BY MIN(LINE_NO) ASC ";
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, tranId); pstmt1.setString(1, tranId);
...@@ -3652,6 +3654,93 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -3652,6 +3654,93 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
updCnt = pstmtInsert.executeUpdate(); updCnt = pstmtInsert.executeUpdate();
pstmtInsert.close(); pstmtInsert.close();
pstmtInsert = null; pstmtInsert = null;
//start added by chandrashekar on 08-01-2015
noArt = rs1.getDouble("no_art");
netWeight = rs1.getDouble("net_weight");
apprLocLogic = distCommon.getDisparams("999999", "APR_LOC_LOGIC", conn);
apprLocUdf = distCommon.getDisparams("999999", "APR_LOC_UDF", conn);
System.out.println("apprLocLogic:::["+apprLocLogic+"]apprLocUdf["+apprLocUdf+"]");
if (apprLocLogic.equalsIgnoreCase("NULLFOUND") || apprLocLogic.trim().length() == 0)
{
retString = itmDBAccessLocal.getErrorString("", "VTLOCLOG", "");
}
if ("U".equalsIgnoreCase(apprLocLogic))
{
if (apprLocUdf.equalsIgnoreCase("NULLFOUND") || apprLocUdf.trim().length() == 0)
{
retString = itmDBAccessLocal.getErrorString("", "VTLOCUDF", "");
}
}
if ("I".equalsIgnoreCase(apprLocLogic))
{
sql = "select loc_code from item where item_code = ? ";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, itemCode);
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
qcLotLocCode = checkNull(rs2.getString("loc_code"));
}
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
} else if ("S".equalsIgnoreCase(apprLocLogic))
{
sql = "select loc_code__aprv from siteitem where item_code = ? and site_code = ? ";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, itemCode);
pstmt2.setString(2, siteCode);
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
qcLotLocCode = checkNull(rs2.getString("loc_code"));
}
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
} else if (("U".equalsIgnoreCase(apprLocLogic)) && apprLocUdf != null && apprLocUdf.trim().length() > 0)
{
sql = "select " + apprLocUdf + "('" + qcLotLocCode + "') from dual";
pstmt2 = conn.prepareStatement(sql);
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
qcLotLocCode = rs2.getString(1);
}
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
}
sql = " Insert into qc_order_lots (QC_ORDER,LINE_NO,ITEM_CODE,LOT_NO,LOT_SL,LOC_CODE,QUANTITY," +
"UNIT,SAMPLE_QTY,LOCTYPE,LOC_CODE__ISSUE,QORDER_NO,NO_ART,NET_WEIGHT) " +
" values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
pstmtInsert = conn.prepareStatement(sql);
pstmtInsert.setString(1, qcNo);
pstmtInsert.setString(2, rcpLine);
pstmtInsert.setString(3, itemCode);
pstmtInsert.setString(4, lotNoRcp);
pstmtInsert.setString(5, lotSl);
//pstmtInsert.setString(6, locCode);
pstmtInsert.setString(6, qcLotLocCode);
qty = getUnroundDecimal(qty,3);
pstmtInsert.setDouble(7, qty);
pstmtInsert.setString(8, unit);
pstmtInsert.setDouble(9, qtySample);
pstmtInsert.setString(10, "A");
pstmtInsert.setString(11, locCode);
pstmtInsert.setString(12, qcNo);
pstmtInsert.setDouble(13, noArt);
pstmtInsert.setDouble(14, netWeight);
updCnt1 = pstmtInsert.executeUpdate();
pstmtInsert.close();
pstmtInsert = null;
System.out.println("qc_order_lots insert count"+updCnt1);
//end added by chandrashekar on 08-01-2015
spec = poRcpDetSpec; spec = poRcpDetSpec;
......
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