Commit dbfd8456 authored by smane's avatar smane

Changes made for use_supplier_lot (D14CSUN007)


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95650 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 457b568d
......@@ -2702,7 +2702,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
String emp = "";
String procMth = "";
String poRcpDetSpec = "";
String dbName = "";
String dbName = "",useSuppLot="",qcOrdType="";
String suppCode = "",suppCodeMnfr = "";//added by Kunal on 8/11/12
double qty = 0.0;
......@@ -2862,6 +2862,32 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
rs = null;
pstmtSql.close();
pstmtSql = null;
//added by sagar on 10/07/14 start
sql = "SELECT (CASE WHEN USE_SUPPLIER_LOT IS NULL THEN 'N' ELSE USE_SUPPLIER_LOT END) AS USE_SUPPLIER_LOT FROM SUPPLIER WHERE SUPP_CODE= ?";
pstmtSql = conn.prepareStatement(sql);
pstmtSql.setString(1, suppCode);
rs = pstmtSql.executeQuery();
if ( rs.next() )
{
useSuppLot = rs.getString("USE_SUPPLIER_LOT");
}
rs.close();
rs = null;
pstmtSql.close();
pstmtSql = null;
System.out.println(">>>>>>>>>>>>>useSuppLot:"+useSuppLot);
if("Y".equals(useSuppLot))
{
qcOrdType="A";
}
else
{
qcOrdType="I";
}
System.out.println(">>>>>>qcOrdType:"+qcOrdType);
System.out.println(">>>>>>qcReqd:"+qcReqd);
//added by sagar on 10/07/14 end
if ( "Y".equalsIgnoreCase(qcReqd) )
{
......@@ -2953,10 +2979,12 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
{
qcType = "S";
}
System.out.println("qc type new = "+qcType);
System.out.println(">>>>>>>qcType:= "+qcType);
System.out.println(">>>qcReqdSite: = "+qcReqdSite);
if ( "S".equalsIgnoreCase(qcType) && "Y".equalsIgnoreCase(qcReqdSite) )
{
System.out.println(">>>>>>>In S And Y <<<<<<<<<<="+qcReqdSite);
//change done by Kunal on 26/10/12 rename column as CONV__QTY_STDUOM,SPEC_REF,BATCH_NO
sql = "SELECT LINE_NO, LOC_CODE , LOT_NO, LOT_SL, (CASE WHEN QUANTITY IS NULL THEN 0 ELSE QUANTITY END + CASE WHEN EXCESS_SHORT_QTY IS NULL THEN 0 ELSE EXCESS_SHORT_QTY END) , "
+" (CASE WHEN CONV__QTY_STDUOM IS NULL THEN 1 ELSE CONV__QTY_STDUOM END) as CONV__QTY_STDUOM ,"
......@@ -3056,7 +3084,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
xmlValues = xmlValues + "<qorder_no></qorder_no>";
xmlValues = xmlValues + "<site_code>" + siteCode + "</site_code>";
xmlValues = xmlValues + "<qorder_date>" + getCurrdateAppFormat() + "</qorder_date>";
xmlValues = xmlValues + "<qorder_type>I</qorder_type>";
//xmlValues = xmlValues + "<qorder_type>I</qorder_type>";
xmlValues = xmlValues + "<qorder_type>" + qcOrdType + "</qorder_type>";//added by sagar on 10/07/14
xmlValues = xmlValues + "<lot_no>" + lotNoRcp + "</lot_no>";
xmlValues = xmlValues + "<item_ser>" + itemSer + "</item_ser>";
xmlValues = xmlValues + "<porcp_no>" + tranId + "</porcp_no>";
......@@ -3094,21 +3123,24 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
rs2.close();
rs2 = null;
if ( "Y".equalsIgnoreCase(genLotAuto) || "M".equalsIgnoreCase(genLotAuto) )
if(!"Y".equals(useSuppLot)) //Condition added by sagar on 11/07/14
{
if ( (!pordType.equalsIgnoreCase(jobWorkType)) && (!pordType.equalsIgnoreCase(subContractType) ) )
System.out.println(">>>>>>>in S & Y if useSuppLot is not Y:"+useSuppLot);
if ( "Y".equalsIgnoreCase(genLotAuto) || "M".equalsIgnoreCase(genLotAuto) )
{
lotNoRcp = qcNo;
}
else
{
if ( genLotSubctr.equalsIgnoreCase("Y"))
if ( (!pordType.equalsIgnoreCase(jobWorkType)) && (!pordType.equalsIgnoreCase(subContractType) ) )
{
lotNoRcp = qcNo;
}
}
}
else
{
if ( genLotSubctr.equalsIgnoreCase("Y"))
{
lotNoRcp = qcNo;
}
}
}
}
passedQty = qty - qtySample;
......@@ -3159,7 +3191,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
+ " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?)";
pstmtInsert = conn.prepareStatement(sql);
pstmtInsert.setString(1, qcNo);
pstmtInsert.setString(2, "I");
//pstmtInsert.setString(2, "I");
pstmtInsert.setString(2, qcOrdType);//added by sagar on 10/07/14
pstmtInsert.setTimestamp(3, tranDate);
pstmtInsert.setString(4, siteCode);
pstmtInsert.setString(5, itemCode);
......@@ -3237,6 +3270,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
}
else if ( "L".equalsIgnoreCase(qcType) && "Y".equalsIgnoreCase(qcReqdSite) )
{
System.out.println(">>>>>>>In L And Y <<<<<<<<<<="+qcReqdSite);
sql = "SELECT (CASE WHEN BATCH_NO IS NULL THEN ' ' ELSE BATCH_NO END) AS BATCH_NO, "
+ " LOC_CODE, UNIT__STD, "
+ " CASE WHEN (SUM(CASE WHEN (((CASE WHEN QUANTITY IS NULL THEN 0 ELSE QUANTITY END) + "
......@@ -3333,7 +3367,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
xmlValues = xmlValues + "<qorder_no></qorder_no>";
xmlValues = xmlValues + "<site_code>" + siteCode + "</site_code>";
xmlValues = xmlValues + "<qorder_date>" + getCurrdateAppFormat() + "</qorder_date>";
xmlValues = xmlValues + "<qorder_type>I</qorder_type>";
//xmlValues = xmlValues + "<qorder_type>I</qorder_type>";
xmlValues = xmlValues + "<qorder_type>" + qcOrdType + "</qorder_type>";//added by sagar on 10/07/14
xmlValues = xmlValues + "<lot_no>" + lotNoRcp + "</lot_no>";
xmlValues = xmlValues + "<item_ser>" + itemSer + "</item_ser>";
xmlValues = xmlValues + "<porcp_no>" + tranId + "</porcp_no>";
......@@ -3371,22 +3406,24 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
rs2.close();
rs2 = null;
if ( "Y".equalsIgnoreCase(genLotAuto) || "M".equalsIgnoreCase(genLotAuto) )
if(!"Y".equals(useSuppLot)) //Condition added by sagar on 11/07/14
{
if ( (pordType != jobWorkType) && ( pordType != subContractType) )
System.out.println(">>>>>>>in L & Y if useSuppLot is not Y:"+useSuppLot);
if ( "Y".equalsIgnoreCase(genLotAuto) || "M".equalsIgnoreCase(genLotAuto) )
{
lotNoRcp = qcNo;
}
else
{
if ( genLotSubctr.equalsIgnoreCase("Y") )
if ( (pordType != jobWorkType) && ( pordType != subContractType) )
{
lotNoRcp = qcNo;
}
}
else
{
if ( genLotSubctr.equalsIgnoreCase("Y") )
{
lotNoRcp = qcNo;
}
}
}
}
passedQty = qty - qtySample;
if ( spec == null || spec.length() == 0 )
......@@ -3452,7 +3489,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
+" ?,?,?,?,?,?,?,?,?,?,?,?,?,? )";
pstmtInsert = conn.prepareStatement(sql);
pstmtInsert.setString(1, qcNo);
pstmtInsert.setString(2, "I");
//pstmtInsert.setString(2, "I");
pstmtInsert.setString(2, qcOrdType); //added by sagar on 10/07/14
pstmtInsert.setTimestamp(3, tranDate);
pstmtInsert.setString(4, siteCode);
pstmtInsert.setString(5, itemCode);
......@@ -3558,6 +3596,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
}
else if ( "I".equalsIgnoreCase(qcType) && "Y".equalsIgnoreCase(qcReqdSite) )
{
System.out.println(">>>>>>>In I And Y <<<<<<<<<<="+qcReqdSite);
sql = "SELECT LOC_CODE , (CASE WHEN SPEC_REF IS NULL THEN ' ' ELSE SPEC_REF END) AS SPEC_REF, CASE WHEN (SUM(CASE WHEN (((CASE WHEN QUANTITY IS NULL THEN 0 ELSE QUANTITY END) + (CASE WHEN EXCESS_SHORT_QTY IS NULL THEN 0 ELSE EXCESS_SHORT_QTY END)) * (CASE WHEN CONV__QTY_STDUOM IS NULL THEN 1 ELSE CONV__QTY_STDUOM END)) IS NULL THEN 0 ELSE (((CASE WHEN QUANTITY IS NULL THEN 0 ELSE QUANTITY END) + (CASE WHEN EXCESS_SHORT_QTY IS NULL THEN 0 ELSE EXCESS_SHORT_QTY END)) * (CASE WHEN CONV__QTY_STDUOM IS NULL THEN 1 ELSE CONV__QTY_STDUOM END)) END)) IS NULL THEN 0 ELSE (SUM(CASE WHEN (((CASE WHEN QUANTITY IS NULL THEN 0 ELSE QUANTITY END) + (CASE WHEN EXCESS_SHORT_QTY IS NULL THEN 0 ELSE EXCESS_SHORT_QTY END)) * (CASE WHEN CONV__QTY_STDUOM IS NULL THEN 1 ELSE CONV__QTY_STDUOM END)) IS NULL THEN 0 ELSE (((CASE WHEN QUANTITY IS NULL THEN 0 ELSE QUANTITY END) + (CASE WHEN EXCESS_SHORT_QTY IS NULL THEN 0 ELSE EXCESS_SHORT_QTY END)) * (CASE WHEN CONV__QTY_STDUOM IS NULL THEN 1 ELSE CONV__QTY_STDUOM END)) END)) 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 FROM PORCPDET WHERE TRAN_ID = ? AND ITEM_CODE = ? GROUP BY LOC_CODE , (CASE WHEN SPEC_REF IS NULL THEN ' ' ELSE SPEC_REF END),supp_code__mnfr ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, tranId);
......@@ -3587,7 +3626,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
xmlValues = xmlValues + "<qorder_no></qorder_no>";
xmlValues = xmlValues + "<site_code>" + siteCode + "</site_code>";
xmlValues = xmlValues + "<qorder_date>" + getCurrdateAppFormat() + "</qorder_date>";
xmlValues = xmlValues + "<qorder_type>I</qorder_type>";
//xmlValues = xmlValues + "<qorder_type>I</qorder_type>";
xmlValues = xmlValues + "<qorder_type>" + qcOrdType + "</qorder_type>";//added by sagar on 10/07/14
xmlValues = xmlValues + "<item_ser>" + itemSer + "</item_ser>";
xmlValues = xmlValues + "<porcp_no>" + tranId + "</porcp_no>";
xmlValues = xmlValues +"</Detail1></Root>";
......@@ -3694,7 +3734,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
sql = "INSERT INTO QC_ORDER (QORDER_NO, QORDER_TYPE , QORDER_DATE , SITE_CODE , ITEM_CODE, ROUTE_CODE , QUANTITY , QTY_PASSED , QTY_REJECTED, START_DATE , DUE_DATE, REL_DATE, PORCP_NO , PORCP_LINE_NO , LOT_NO , LOT_SL , CHG_DATE , CHG_USER , CHG_TERM , LOC_CODE , QTY_SAMPLE , STATUS, UNIT, QC_CREATE_TYPE , BATCH_NO , EXPIRY_DATE , LOC_CODE__APRV , LOC_CODE__REJ , UNIT__SAMPLE , LOT_NO__NEW , RETEST_DATE , SPEC_REF , ITEM_CODE__NEW , EMP_CODE,SUPP_CODE,SUPP_CODE__MFG) VALUES ( ? ,?, ? , ? , ?, ? , ?, ? , ?, ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?,?,?)";
pstmtInsert = conn.prepareStatement(sql);
pstmtInsert.setString(1, qcNo);
pstmtInsert.setString(2, "I");
//pstmtInsert.setString(2, "I");
pstmtInsert.setString(2, qcOrdType);//added by sagar on 10/07/14
pstmtInsert.setTimestamp(3, tranDate);
pstmtInsert.setString(4, siteCode);
pstmtInsert.setString(5, itemCode);
......@@ -3816,7 +3857,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
xmlValues = xmlValues + "<qorder_no></qorder_no>";
xmlValues = xmlValues + "<site_code>" + siteCode + "</site_code>";
xmlValues = xmlValues + "<qorder_date>" + getCurrdateAppFormat() + "</qorder_date>";
xmlValues = xmlValues + "<qorder_type>I</qorder_type>";
//xmlValues = xmlValues + "<qorder_type>I</qorder_type>";
xmlValues = xmlValues + "<qorder_type>" + qcOrdType + "</qorder_type>";//added by sagar on 10/07/14
xmlValues = xmlValues + "<item_ser>" + itemSer + "</item_ser>";
xmlValues = xmlValues + "<porcp_no>" + tranId + "</porcp_no>";
xmlValues = xmlValues + "<porcp_line_no>" + lineNo + "</porcp_line_no>";
......
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