Commit f2436578 authored by wansari's avatar wansari

W15GSUN003 added ref_ser source code PRS for pallet_request


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99179 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4d7a6d09
......@@ -312,6 +312,15 @@ public class ScheduleAWMSInOutTasks implements Schedule
" S.SITE_CODE FROM STOCK S,PALLET_REQ_DET P WHERE S.LOC_CODE = P.PALLET_NO AND S.INV_STAT = 'AWMS'" +
" AND P.TRAN_ID = ? AND P.LINE_NO = ? AND S.QUANTITY > 0";
}
else if("PRS".equalsIgnoreCase(refSer))
{
sql = "SELECT P.ITEM_CODE,P.QUANTITY,P.LOT_NO,P.LOT_SL,P.LOC_CODE,P.PALLET_NO,H.SITE_CODE"
+" FROM PALLET_REQ_DET P,STOCK S,PALLET_REQ_HDR H WHERE P.TRAN_ID = ? AND P.LINE_NO = ?"
+" AND P.TRAN_ID = H.TRAN_ID AND P.ITEM_CODE = S.ITEM_CODE"
+" AND H.SITE_CODE = S.SITE_CODE AND P.PALLET_NO = S.LOC_CODE"
+" AND P.LOT_NO = S.LOT_NO"
+" AND P.LOT_SL = S.LOT_SL";
}
insertSql = "INSERT INTO STOCK_TRANSFER_DET(TRAN_ID, LINE_NO, ITEM_CODE, QUANTITY, LOC_CODE__FR,"
+ " LOC_CODE__TO, LOT_NO__FR, LOT_NO__TO, LOT_SL__FR, LOT_SL__TO, ACCT_CODE__CR, ACCT_CODE__DR,"
......@@ -319,7 +328,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
pstmtDet = conn.prepareStatement(insertSql);
sqlInterface = "SELECT LINE_NO FROM WMS_TO_HOST WHERE REF_ID = ? AND MSG_STAT != 'E'"
sqlInterface = "SELECT DISTINCT (LINE_NO) FROM WMS_TO_HOST WHERE REF_ID = ? AND MSG_STAT != 'E'"
+ " AND LINE_NO IN (SELECT LINE_NO FROM SWMS_TO_AWMS WHERE REF_ID = ? AND SCHEDULE_STATUS IS NULL)";
pstmtInterface = conn.prepareStatement(sqlInterface);
pstmtInterface.setString(1, refId);
......@@ -385,7 +394,8 @@ public class ScheduleAWMSInOutTasks implements Schedule
locCodeFrom = checkNullAndTrim(rs.getString("LOC_CODE"));
locCodeTo = checkNullAndTrim(rs.getString("PALLET_NO"));
}
else if("PR".equalsIgnoreCase(refSer))
//else if("PR".equalsIgnoreCase(refSer))Changed by wasim on 19-11-2015 to add new ref ser PRS
else if("PR".equalsIgnoreCase(refSer) || "PRS".equalsIgnoreCase(refSer))
{
locCodeFrom = checkNullAndTrim(rs.getString("PALLET_NO"));
locCodeTo = checkNullAndTrim(rs.getString("LOC_CODE"));
......@@ -425,9 +435,10 @@ public class ScheduleAWMSInOutTasks implements Schedule
System.out.println("UPdate in stock transfer det="+updCnt);
pstmtDet.clearParameters();
if("PR".equalsIgnoreCase(refSer))
//if("PR".equalsIgnoreCase(refSer))Changed by wasim on 19-11-2015 to add new ref ser PRS
if("PR".equalsIgnoreCase(refSer) || "PRS".equalsIgnoreCase(refSer))
{
System.out.println("Going for Allocation location code from for PR");
System.out.println("Going for Allocation location code from for PR/PRS");
HashMap hashMap = new HashMap();
hashMap.put("tran_date", new java.sql.Date(System.currentTimeMillis()));
hashMap.put("ref_ser",refSer);
......@@ -451,7 +462,9 @@ public class ScheduleAWMSInOutTasks implements Schedule
}
//Changed by wasim on 17-11-2015 to allocate quantity to location code to
//else if("D-SO".equalsIgnoreCase(refSer) || "S-ORD".equalsIgnoreCase(refSer))
if("D-SO".equalsIgnoreCase(refSer) || "S-ORD".equalsIgnoreCase(refSer) || "PR".equalsIgnoreCase(refSer))
//Changed by wasim on 19-11-2015 to add new ref ser PRS
//if("D-SO".equalsIgnoreCase(refSer) || "S-ORD".equalsIgnoreCase(refSer) || "PR".equalsIgnoreCase(refSer))
if("D-SO".equalsIgnoreCase(refSer) || "S-ORD".equalsIgnoreCase(refSer) || "PR".equalsIgnoreCase(refSer) || "PRS".equalsIgnoreCase(refSer))
{
System.out.println("Going for Allocation location code TO");
HashMap hashMap = new HashMap();
......@@ -481,7 +494,8 @@ public class ScheduleAWMSInOutTasks implements Schedule
System.out.println("Updated ="+caseCount);
pstmtUpdate.close();pstmtUpdate = null;
if("PR".equalsIgnoreCase(refSer))
//if("PR".equalsIgnoreCase(refSer))//Changed by wasim on 19-11-2015 to add new ref ser PRS
if("PR".equalsIgnoreCase(refSer) || "PRS".equalsIgnoreCase(refSer))
{
sqlUpdate = "UPDATE PALLET_REQ_DET SET STATUS = 'V' WHERE TRAN_ID = ? AND LINE_NO = ?";
pstmtUpdate = conn.prepareStatement(sqlUpdate);
......@@ -497,18 +511,21 @@ public class ScheduleAWMSInOutTasks implements Schedule
pstmt.close();pstmt = null;
rs.close();rs = null;
if("PR".equalsIgnoreCase(refSer) && isRecordExist)
//if("PR".equalsIgnoreCase(refSer) && isRecordExist)//Changed by wasim on 19-11-2015 to add new ref ser PRS
if(("PR".equalsIgnoreCase(refSer) || "PRS".equalsIgnoreCase(refSer)) && isRecordExist)
{
System.out.println(" created successfully PR Case---------------["+tranID+"]refId["+refId);
System.out.println(" created successfully PR/PRS Case---------------["+tranID+"]refId["+refId);
headerFlag = true;
//tranIdList.add(tranID);
StockTransferConf stkConfAdd = new StockTransferConf();
errString = stkConfAdd.confirm(tranID, xtraParams, "", conn, false);
System.out.println("Stock transfer confirm for ===============PR="+errString);
System.out.println("Stock transfer confirm for ===============PR/PRS="+errString);
if( errString != null && errString.indexOf( "CONFSUCC" ) > -1)
{
errString = allocStockLocCodeTo(allocList,tranIdIssList,refSer,refId,countDso,conn);
System.out.println("Return from alloc To for PR="+errString);
System.out.println("Return from alloc To for PR/PRS="+errString);
allocList.clear();//Changed by wasim on to clear list for PR/PRS as we take pallet one by one for this ref ser.
if(errString != null && (errString.indexOf("CONFSTKSUCC") > -1))
{
......@@ -554,7 +571,8 @@ public class ScheduleAWMSInOutTasks implements Schedule
conn.rollback();
}
}*/
if(isRecordExist && !"PR".equalsIgnoreCase(refSer))
//if(isRecordExist && !"PR".equalsIgnoreCase(refSer))
if(isRecordExist && (!"PR".equalsIgnoreCase(refSer) && !"PRS".equalsIgnoreCase(refSer)))//Changed by wasim on 19-11-2015 to add new ref ser PRS
{
System.out.println("Inside record exist block------------");//CONFSUCC
StockTransferConf stkConf = new StockTransferConf();
......@@ -735,6 +753,14 @@ public class ScheduleAWMSInOutTasks implements Schedule
sql = "SELECT S.ITEM_CODE,S.LOT_NO,S.LOT_SL,S.LOC_CODE,"+
" S.SITE_CODE FROM STOCK S,PALLET_REQ_DET P WHERE S.LOC_CODE = P.PALLET_NO AND S.INV_STAT = 'AWMS'" +
" AND P.TRAN_ID = ? AND P.LINE_NO = ? AND S.QUANTITY > 0";
}
else if("PRS".equalsIgnoreCase(refSer))
{
sql = "SELECT P.ITEM_CODE,P.QUANTITY,P.LOT_NO,P.LOT_SL,P.LOC_CODE,H.SITE_CODE,P.PALLET_NO"
+" FROM PALLET_REQ_DET P,STOCK S,PALLET_REQ_HDR H WHERE P.TRAN_ID = ? AND P.LINE_NO = ?"
+" AND P.TRAN_ID = H.TRAN_ID AND S.INV_STAT = 'AWMS'"
+" AND P.ITEM_CODE = S.ITEM_CODE AND H.SITE_CODE = S.SITE_CODE AND P.PALLET_NO = S.LOC_CODE AND P.LOT_NO = S.LOT_NO"
+" AND P.LOT_SL = S.LOT_SL";
}
pstmt = conn.prepareStatement(sql);
......@@ -815,7 +841,8 @@ public class ScheduleAWMSInOutTasks implements Schedule
System.out.println("Updated ="+caseCount);
pstmtUpdate.close();pstmtUpdate = null;
if("PR".equalsIgnoreCase(refSer))
//if("PR".equalsIgnoreCase(refSer))//Changed by wasim on 19-11-2015 to add new ref ser PRS
if("PR".equalsIgnoreCase(refSer) || "PRS".equalsIgnoreCase(refSer))
{
sqlUpdate = "UPDATE PALLET_REQ_DET SET STATUS = 'H' WHERE TRAN_ID = ? AND LINE_NO = ?";
pstmtUpdate = conn.prepareStatement(sqlUpdate);
......@@ -2009,20 +2036,24 @@ public class ScheduleAWMSInOutTasks implements Schedule
stockQty = rs1.getDouble(3) - rs1.getDouble(10);
System.out.println("Available YN="+availableYn);
if (availableYn.equals("Y"))
{
System.out.println("minShelfLife="+minShelfLife);
if (minShelfLife > 0)
{
chkDate = calcExpiry(tranDate, minShelfLife);
System.out.println("chkDate="+chkDate);
chkDate1 = sdf.parse(chkDate);
java.sql.Date date1 = rs1.getDate(4);
java.util.Date date2 = null;
System.out.println("date1="+date1);
if (date1 != null)
{
date2 = new java.util.Date(date1.getTime());
System.out.println("chkDate1="+chkDate1);
System.out.println("date2="+date2);
if (chkDate1.compareTo(date2) > 0)
{
continue;
......@@ -2033,6 +2064,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
if (!checkIntegralQty.equals("N"))
{
integralQty = getIntegralQty(siteCode, itemCode, lotNo, packCode, checkIntegralQty);
System.out.println("integralQty Received="+integralQty);
if (integralQty <= 0.0D)
{
......@@ -2042,13 +2074,16 @@ public class ScheduleAWMSInOutTasks implements Schedule
return errString;
}
}
System.out.println("stockQty="+stockQty);
System.out.println("remQuantity"+remQuantity);
if (stockQty >= remQuantity)
{
if (checkIntegralQty.equals("Y"))
{
remQuantity -= remQuantity % integralQty;
}
System.out.println("New remQuantity"+remQuantity);
minputQty = remQuantity;
remQuantity = 0.0D;
}
......@@ -2061,6 +2096,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
minputQty = stockQty;
remQuantity -= stockQty;
}
System.out.println("@@minputQty"+minputQty);
if (minputQty == 0.0D)
{
continue;
......@@ -2091,6 +2127,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
if (count == 0)
{
rate2 = distComm.pickRate(priceList, tranDate, itemCode, rs1.getString(1), "D", conn);
System.out.println("printing rate2----" + rate2);
}
else
{
......@@ -2098,6 +2135,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
System.out.println("printing tabValue----" + tabValue);
rate2 = distComm.pickRate(priceList, tranDate, itemCode, tabValue, "I", conn);
System.out.println("printing rate2----" + rate2);
}
}
......
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