Commit e6c9218c authored by wansari's avatar wansari

updated source to stock transfer for only Palletization and RePalletization.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101436 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6bcd3d04
......@@ -282,108 +282,30 @@ public class ScheduleAWMSInOutTasks implements Schedule
refId = (String) interfaceMap.get("REF_ID");
inOut = (String) interfaceMap.get("IN_OUT");
if("D-SO".equalsIgnoreCase(refSer))
{
sqlDso = "SELECT COUNT(*) AS COUNT FROM DISTORDER_ALLOC WHERE DIST_ORDER = ?";
pstmtDso = conn.prepareStatement(sqlDso);
pstmtDso.setString(1, refId);
rsDso = pstmtDso.executeQuery();
if(rsDso.next())
{
countDso = rsDso.getInt("COUNT");
}
if(pstmtDso != null){pstmtDso.close();pstmtDso = null;}
if(rsDso != null){rsDso.close();rsDso = null;}
System.out.println("Count DSO ="+countDso);
if(countDso == 0)
{
//Changed by wasim on 04-12-2015 to join sql from stock and DISTORD_ISSDET
/*sql = "SELECT D.TRAN_ID,D.ITEM_CODE,D.LINE_NO,D.QUANTITY,D.LOT_NO,D.LOT_SL,D.LOC_CODE,H.SITE_CODE"
+" FROM DISTORD_ISSDET D,DISTORD_ISS H WHERE D.TRAN_ID = H.TRAN_ID AND H.CONFIRMED = 'N' AND D.DIST_ORDER = ?"
+ "AND D.LINE_NO = ? AND D.QUANTITY > 0";*/
sql = "SELECT D.TRAN_ID,D.ITEM_CODE,D.LINE_NO,S.QUANTITY,D.LOT_NO,D.LOT_SL,D.LOC_CODE,H.SITE_CODE,S.ALLOC_QTY,D.NO_ART"
+" FROM DISTORD_ISSDET D,DISTORD_ISS H,STOCK S "
+" WHERE D.TRAN_ID = H.TRAN_ID AND H.CONFIRMED = 'N' AND D.DIST_ORDER = ? AND D.LINE_NO = ? AND D.QUANTITY > 0 "
+" AND S.LOC_CODE = D.LOC_CODE AND S.LOT_NO = D.LOT_NO"
+" AND S.LOT_SL = D.LOT_SL AND S.ITEM_CODE = D.ITEM_CODE AND S.SITE_CODE = H.SITE_CODE";
}
else
{
/*sql = "SELECT ITEM_CODE,LINE_NO,QUANTITY,QTY_ALLOC,LOT_NO,LOT_SL,LOC_CODE,SITE_CODE__MFG AS SITE_CODE"
+ " FROM DISTORDER_ALLOC WHERE DIST_ORDER = ? AND LINE_NO = ? AND QUANTITY > 0";*/
sql = " SELECT D.QTY_ALLOC,D.SITE_CODE__MFG,D.QUANTITY AS DIST_QTY,DT.LINE_NO AS LINE_NO_DIST,"
+" H.SITE_CODE,H.TRAN_TYPE,DT.TAX_CLASS,DT.TAX_CHAP,DT.TAX_ENV,"
+" S.ITEM_CODE,S.LOT_NO,S.LOT_SL,S.QUANTITY,S.ALLOC_QTY,S.EXP_DATE, S.UNIT,S.UNIT__ALT,S.ITEM_SER, S.MFG_DATE,S.NO_ART,"
+" S.POTENCY_PERC, S.PACK_CODE, S.LOC_CODE, S.BATCH_NO, S.GRADE , S.GROSS_WEIGHT, S.TARE_WEIGHT, "
+" S.NET_WEIGHT, S.DIMENSION, S.RETEST_DATE, S.SUPP_CODE__MFG, S.PACK_INSTR,S.RATE "
+" FROM DISTORDER_ALLOC D,DISTORDER H,DISTORDER_DET DT,STOCK S "
+" WHERE D.DIST_ORDER = ? AND D.LINE_NO = ? AND S.QUANTITY > 0 "
+" AND D.DIST_ORDER = H.DIST_ORDER AND H.DIST_ORDER = DT.DIST_ORDER AND D.LINE_NO = DT.LINE_NO AND"
+" D.LOT_NO = S.LOT_NO AND D.LOT_SL = S.LOT_SL AND D.ITEM_CODE = S.ITEM_CODE AND D.LOC_CODE = S.LOC_CODE"
+" AND S.SITE_CODE = H.SITE_CODE ";
}
}
else if("S-ORD".equalsIgnoreCase(refSer))
{
/*sql = "SELECT ITEM_CODE,LINE_NO,QUANTITY,QTY_ALLOC,UNIT__STD AS UNIT,LOT_NO,LOT_SL,MFG_DATE,EXP_DATE,LOC_CODE,SITE_CODE "
+ "FROM SORDALLOC WHERE SALE_ORDER = ? AND LINE_NO = ? AND QUANTITY > 0";*/
sql = "SELECT S.ITEM_CODE,D.LINE_NO,S.QUANTITY,S.ALLOC_QTY,D.QTY_ALLOC,S.LOT_NO,S.LOT_SL,S.LOC_CODE,S.SITE_CODE,S.NO_ART"
+" FROM SORDALLOC D,SORDER H,STOCK S "
+" WHERE D.SALE_ORDER = ? AND D.LINE_NO = ? AND S.QUANTITY > 0"
+" AND D.SALE_ORDER = H.SALE_ORDER"
+" AND D.LOT_NO = S.LOT_NO AND D.LOT_SL = S.LOT_SL"
+" AND D.ITEM_CODE = S.ITEM_CODE AND D.LOC_CODE = S.LOC_CODE AND D.SITE_CODE = S.SITE_CODE";
}
else if("PZ".equalsIgnoreCase(refSer))
if("PZ".equalsIgnoreCase(refSer))
{
sql = "SELECT P.ITEM_CODE,P.LINE_NO,P.QUANTITY,P.ALLOC_QTY,P.LOT_NO,P.LOT_SL,P.NO_ART,"
+ " P.LOC_CODE,P.SITE_CODE,P.PALLET_NO FROM PALLET_DET P,STOCK S WHERE TRAN_ID = ? AND P.LINE_NO = ?"
+ " AND P.ITEM_CODE = S.ITEM_CODE AND P.SITE_CODE = S.SITE_CODE"
+ " AND P.LOC_CODE = S.LOC_CODE AND P.LOT_NO = S.LOT_NO AND P.LOT_SL = S.LOT_SL AND S.QUANTITY > 0";
//sqlQc = "SELECT STATUS FROM QC_ORDER WHERE SITE_CODE = ? AND LOC_CODE = ? AND ITEM_CODE = ? AND LOT_NO = ? AND LOT_SL = ?";
sqlQc = "SELECT STATUS FROM QC_ORDER WHERE SITE_CODE = ? AND ITEM_CODE = ? AND LOT_NO = ?";
pstmtQc = conn.prepareStatement(sqlQc);
}
else if("PR".equalsIgnoreCase(refSer))
{
sql = "SELECT S.ITEM_CODE,S.QUANTITY,S.LOT_NO,S.LOT_SL,P.LOC_CODE,S.LOC_CODE AS LOC_CODE_FROM,S.ALLOC_QTY,P.NO_ART,"+ //Changed by wasim on 4-12-2015 to take loc_code from stock
//" S.SITE_CODE FROM STOCK S,PALLET_REQ_DET P WHERE S.INV_STAT = 'AWMS'" + Changed by wasim on 08-12-2015 to add inv stat AWMSQ
" S.SITE_CODE FROM STOCK S,PALLET_REQ_DET P WHERE S.INV_STAT IN ('AWMS','AWMSQ')" +
" AND P.TRAN_ID = ? AND P.LINE_NO = ? AND (S.LOC_CODE = P.PALLET_NO OR S.LOC_CODE = ? ) AND S.QUANTITY > 0"; //Changed by wasim on 4-12-2015 to check Q loc code if not found data
}
else if("PRS".equalsIgnoreCase(refSer))
{
sql = "SELECT P.ITEM_CODE,S.QUANTITY,P.LOT_NO,P.LOT_SL,P.LOC_CODE,S.LOC_CODE AS LOC_CODE_FROM,H.SITE_CODE,S.ALLOC_QTY,P.NO_ART"
+" 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 OR S.LOC_CODE = ? )"
+" AND P.LOT_NO = S.LOT_NO"
+" AND P.LOT_SL = S.LOT_SL AND S.QUANTITY > 0";
}
else if("RPZ".equalsIgnoreCase(refSer))
{
/*sql = "SELECT S.ITEM_CODE,S.QUANTITY,S.LOT_NO,S.LOT_SL,P.LOC_CODE,S.LOC_CODE AS LOC_CODE_FROM,S.ALLOC_QTY,P.NO_ART,"+
" S.SITE_CODE FROM STOCK S,PALLET_REQ_DET P WHERE S.INV_STAT IN ('AWMS','AWMSQ')" +
" AND P.TRAN_ID = ? AND P.LINE_NO = ? AND (S.LOC_CODE = P.PALLET_NO OR S.LOC_CODE = ? ) AND S.QUANTITY > 0"; */
sql = "SELECT S.ITEM_CODE,S.QUANTITY,S.LOT_NO,S.LOT_SL,P.LOC_CODE,S.LOC_CODE AS LOC_CODE_FROM,S.ALLOC_QTY,P.NO_ART,"
sql = "SELECT S.ITEM_CODE,S.QUANTITY,S.LOT_NO,S.LOT_SL,S.LOC_CODE,S.ALLOC_QTY,P.NO_ART,"
+" S.SITE_CODE FROM STOCK S,PALLET_REQ_DET P WHERE"
+" P.TRAN_ID = ? AND P.LINE_NO = ? AND"
+" (S.LOC_CODE = P.PALLET_NO OR S.LOC_CODE = ? OR S.LOC_CODE = ? OR S.LOC_CODE = ? OR S.LOC_CODE = ? OR S.LOC_CODE = ? OR S.LOC_CODE = ? OR S.LOC_CODE = ?) "
+" AND S.QUANTITY > 0";
}
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,"
+ " CCTR_CODE__DR, CCTR_CODE__CR, NO_ART) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
pstmtDet = conn.prepareStatement(insertSql);
sqlInterface = "SELECT DISTINCT (LINE_NO),PALLET_NO,BAY_NO FROM WMS_TO_HOST WHERE REF_ID = ? "//Changed by wasim on 21-12-15 to not consider msg_stat column
+ " AND LINE_NO IN (SELECT LINE_NO FROM SWMS_TO_AWMS WHERE REF_ID = ? AND SCHEDULE_STATUS = 'N')"//Changed by wasim on 26-11-15 to schedule_status is null to N
+ " AND IN_OUT != 'P'"; //Changed by wasim on 14-12-2015 for not to accept in_out parameter as P
sqlInterface = "SELECT DISTINCT (LINE_NO),PALLET_NO,BAY_NO FROM WMS_TO_HOST WHERE REF_ID = ? "
+ " AND LINE_NO IN (SELECT LINE_NO FROM SWMS_TO_AWMS WHERE REF_ID = ? AND SCHEDULE_STATUS = 'N')"
+ " AND IN_OUT != 'P'";
pstmtInterface = conn.prepareStatement(sqlInterface);
pstmtInterface.setString(1, refId);
pstmtInterface.setString(2, refId);
......@@ -395,16 +317,8 @@ public class ScheduleAWMSInOutTasks implements Schedule
isRecordExist = false;
}
if("S-ORD".equalsIgnoreCase(refSer))//this is because sordalloc has char(3) in line_no
{
lineNoInterface = checkNullAndTrim(rsInterface.getString("LINE_NO"));
lineNoInterface = " " + lineNoInterface;
lineNoInterface = lineNoInterface.substring( lineNoInterface.length()-3 );
}
else
{
lineNoInterface = checkNullAndTrim(rsInterface.getString("LINE_NO"));
}
lineNoInterface = checkNullAndTrim(rsInterface.getString("LINE_NO"));
System.out.println("Line number is ["+lineNoInterface+"]");
if(headerFlag)
......@@ -435,8 +349,8 @@ public class ScheduleAWMSInOutTasks implements Schedule
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refId);
pstmt.setString(2, lineNoInterface);
//Changed by wasim on 4-12-2015 to check Q loc code if not found data [start]
if("PR".equalsIgnoreCase(refSer) || "PRS".equalsIgnoreCase(refSer) || "RPZ".equalsIgnoreCase(refSer))
if("RPZ".equalsIgnoreCase(refSer))
{
locCodeQuarnt = checkNullAndTrim(rsInterface.getString("PALLET_NO"));
rePalltLocCodeTo = checkNullAndTrim(rsInterface.getString("BAY_NO"));//Added by wasim on 12-01-2016
......@@ -448,45 +362,25 @@ public class ScheduleAWMSInOutTasks implements Schedule
pstmt.setString(8, locCodeQuarnt+"B");
pstmt.setString(9, locCodeQuarnt+"S");
}
//Changed by wasim on 4-12-2015 to check Q loc code if not found data [end]
rs = pstmt.executeQuery();
while(rs.next())
{
lineNoList.add(lineNoInterface);
isRecordExist = true;
itemCode = checkNullAndTrim(rs.getString("ITEM_CODE"));
quantity = rs.getDouble("QUANTITY");
lotNo = checkNullAndTrim(rs.getString("LOT_NO"));
lotSl = checkNullAndTrim(rs.getString("LOT_SL"));
siteCode = checkNullAndTrim(rs.getString("SITE_CODE"));
noArt = checkNullAndTrim(rs.getString("NO_ART"));
allocQty = rs.getDouble("ALLOC_QTY");
locCodeFrom = checkNullAndTrim(rs.getString("LOC_CODE"));
if("PZ".equalsIgnoreCase(refSer))
{
locCodeFrom = checkNullAndTrim(rs.getString("LOC_CODE"));
//locCodeTo = checkNullAndTrim(rs.getString("PALLET_NO"));//Commented by wasim on 20-01-2016 as it will be calledonly once
allocQty = rs.getDouble("ALLOC_QTY");//Changed by wasim on 02-12-2015 for allocating stock to loc code to for palletization
//noArt = checkNullAndTrim(rs.getString("NO_ART"));//Changed by wasim on 03-12-2015
System.out.println("Before location code TO is=["+locCodeTo+"]");
/*pstmtQc.setString(1, siteCode);
pstmtQc.setString(2, itemCode);
pstmtQc.setString(3, lotNo);
rsQc = pstmtQc.executeQuery();
if(rsQc.next())
{
qcOrderStatus = checkNullAndTrim(rsQc.getString("STATUS"));
}
pstmtQc.clearParameters();
System.out.println("Qc order status is=["+qcOrderStatus+"]");
if("U".equalsIgnoreCase(qcOrderStatus))
{
locCodeTo = locCodeTo + "Q";
}*/
System.out.println("countInLoc"+countInLoc);
if(countInLoc == 0)
{
......@@ -496,30 +390,9 @@ public class ScheduleAWMSInOutTasks implements Schedule
countInLoc++;
}
}
//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) || "RPZ".equalsIgnoreCase(refSer))
else if("RPZ".equalsIgnoreCase(refSer))
{
locCodeFrom = checkNullAndTrim(rs.getString("LOC_CODE_FROM"));
//locCodeTo = checkNullAndTrim(rs.getString("LOC_CODE"));
locCodeTo = rePalltLocCodeTo;
allocQty = rs.getDouble("ALLOC_QTY");
}
else
{
locCodeFrom = checkNullAndTrim(rs.getString("LOC_CODE"));
allocQty = rs.getDouble("ALLOC_QTY");
//noArt = checkNullAndTrim(rs.getString("NO_ART"));//Changed by wasim on 07-12-2015
if(countDso > 0 && "D-SO".equalsIgnoreCase(refSer))
{
//tranIdIssList.add(checkNullAndTrim(rs.getString("TRAN_ID")));//Added by wasim on 10-11-2015
distOrderAlloc = rs.getDouble("QTY_ALLOC");
}
if("S-ORD".equalsIgnoreCase(refSer))
{
sordAllocQty = rs.getDouble("QTY_ALLOC");
}
//locCodeTo = getLocCodeTo(itemCode,conn);
locCodeTo = distComm.getDisparams("999999",refSer,conn);
}
System.out.println("Loc code to recieved=["+locCodeTo+"]Loc Code From["+locCodeFrom+"]");
......@@ -562,40 +435,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
hashMap1.put("chg_user", userId);
hashMap1.put("chg_term", chgTerm);
System.out.println("COUNTD_SO="+countDso);
if("D-SO".equalsIgnoreCase(refSer) && countDso > 0 )
{
hashMap1.put("tran_type", rs.getString("TRAN_TYPE"));
hashMap1.put("line_no_dist", rs.getString("LINE_NO_DIST"));
hashMap1.put("exp_date", rs.getTimestamp("EXP_DATE"));
hashMap1.put("unit", rs.getString("UNIT"));
hashMap1.put("unit__alt", rs.getString("UNIT__ALT"));
hashMap1.put("item_ser", rs.getString("ITEM_SER"));
hashMap1.put("site_code__mfg", rs.getString("SITE_CODE__MFG"));
hashMap1.put("mfg_date", rs.getTimestamp("MFG_DATE"));
hashMap1.put("potency_perc", rs.getDouble("POTENCY_PERC"));
hashMap1.put("quantity", rs.getDouble("DIST_QTY"));
hashMap1.put("qty_alloc", rs.getDouble("ALLOC_QTY"));
hashMap1.put("pack_code", rs.getString("PACK_CODE"));
hashMap1.put("pack_instr", rs.getString("PACK_INSTR"));
hashMap1.put("batch_no", rs.getString("BATCH_NO"));
hashMap1.put("grade", rs.getString("GRADE"));
hashMap1.put("gross_weight", rs.getDouble("GROSS_WEIGHT"));
hashMap1.put("tare_weight", rs.getDouble("TARE_WEIGHT"));
hashMap1.put("net_weight", rs.getDouble("NET_WEIGHT"));
hashMap1.put("dimension", rs.getString("DIMENSION"));
hashMap1.put("retest_date", rs.getTimestamp("RETEST_DATE"));
hashMap1.put("supp_code__mfg", rs.getString("SUPP_CODE__MFG"));
hashMap1.put("rate", rs.getString("RATE"));
hashMap1.put("tax_class", rs.getString("TAX_CLASS"));
hashMap1.put("tax_chap", rs.getString("TAX_CHAP"));
hashMap1.put("tax_env", rs.getString("TAX_ENV"));
DistStkList.add(hashMap1);
}
//if("PR".equalsIgnoreCase(refSer))Changed by wasim on 19-11-2015 to add new ref ser PRS
//if("PR".equalsIgnoreCase(refSer) || "PRS".equalsIgnoreCase(refSer)) Changed by wasim on 19-11-2015 to add new ref ser D-SO to allocate stock on from location
if("PR".equalsIgnoreCase(refSer) || "PRS".equalsIgnoreCase(refSer) || "D-SO".equalsIgnoreCase(refSer) || "S-ORD".equalsIgnoreCase(refSer) || "RPZ".equalsIgnoreCase(refSer))
if("RPZ".equalsIgnoreCase(refSer))
{
if((quantity-allocQty) > 0)
{
......@@ -606,13 +446,7 @@ 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))
//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))
//Changed by wasim on 19-11-2015 to remove ref ser PRS/PR
//if("D-SO".equalsIgnoreCase(refSer) || "S-ORD".equalsIgnoreCase(refSer) || "PR".equalsIgnoreCase(refSer) || "PRS".equalsIgnoreCase(refSer))
if("D-SO".equalsIgnoreCase(refSer) || "S-ORD".equalsIgnoreCase(refSer) || "PZ".equalsIgnoreCase(refSer) || "PR".equalsIgnoreCase(refSer) || "PRS".equalsIgnoreCase(refSer) || "RPZ".equalsIgnoreCase(refSer))
if("PZ".equalsIgnoreCase(refSer) || "RPZ".equalsIgnoreCase(refSer))
{
//HashMap allocation = new HashMap();
ArrayList allocLocList = new ArrayList();
......@@ -632,36 +466,13 @@ public class ScheduleAWMSInOutTasks implements Schedule
hashMap.put("chg_user", userId);
hashMap.put("chg_term", chgTerm);
if(("PZ".equalsIgnoreCase(refSer) || "PRS".equalsIgnoreCase(refSer) || "PR".equalsIgnoreCase(refSer) || "D-SO".equalsIgnoreCase(refSer) || "S-ORD".equalsIgnoreCase(refSer) || "RPZ".equalsIgnoreCase(refSer)) && allocQty > 0)
if(("PZ".equalsIgnoreCase(refSer) || "RPZ".equalsIgnoreCase(refSer)) && allocQty > 0)
{
//allocation = checkStockAllocation(siteCode,itemCode,lotNo,lotSl,locCodeFrom,locCodeTo,conn);
allocLocList = checkStockAllocation(siteCode,itemCode,lotNo,lotSl,locCodeFrom,locCodeTo,conn);
if("S-ORD".equalsIgnoreCase(refSer))
{
/*if((allocQty - sordAllocQty) > 0)
{
System.out.println("Sorder location code TO alloc quantity will be="+(allocQty - sordAllocQty));
hashMap.put("alloc_qty", (allocQty - sordAllocQty));
allocList.add(hashMap);
}*/
hashMap.put("alloc_qty", allocQty);
hashMap.put("dealloc_qty", -sordAllocQty);
allocList.add(hashMap);
}
else
{
hashMap.put("alloc_qty", allocQty);
hashMap.put("dealloc_qty", -distOrderAlloc);
allocList.add(hashMap);
}
hashMap.put("alloc_qty", allocQty);
allocList.add(hashMap);
locationList.add(allocLocList);
}
//Changed by wasim on 04-12-2015 as working for d-so will be same as PR
/*else if("D-SO".equalsIgnoreCase(refSer) || "S-ORD".equalsIgnoreCase(refSer))
{
hashMap.put("alloc_qty", quantity);
allocList.add(hashMap);
}*/
}
sqlUpdate = "UPDATE SWMS_TO_AWMS SET SCHEDULE_STATUS = 'Y' WHERE REF_ID = ? AND LINE_NO = ?";
......@@ -672,8 +483,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
System.out.println("Updated ="+caseCount);
pstmtUpdate.close();pstmtUpdate = null;
//if("PR".equalsIgnoreCase(refSer))//Changed by wasim on 19-11-2015 to add new ref ser PRS
if("PR".equalsIgnoreCase(refSer) || "PRS".equalsIgnoreCase(refSer) || "RPZ".equalsIgnoreCase(refSer))
if("RPZ".equalsIgnoreCase(refSer))
{
sqlUpdate = "UPDATE PALLET_REQ_DET SET STATUS = 'V' WHERE TRAN_ID = ? AND LINE_NO = ?";
pstmtUpdate = conn.prepareStatement(sqlUpdate);
......@@ -689,20 +499,15 @@ public class ScheduleAWMSInOutTasks implements Schedule
pstmt.close();pstmt = null;
rs.close();rs = null;
//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) || "RPZ".equalsIgnoreCase(refSer)) && isRecordExist)
if(("RPZ".equalsIgnoreCase(refSer)) && isRecordExist)
{
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/PRS="+errString);
if( errString != null && errString.indexOf( "CONFSUCC" ) > -1)
{
//Changed by wasim on 30-11-2015 to not allow to allocate stock for location code to for PR/PRS [END]
//errString = allocStockLocCodeTo(allocList,tranIdIssList,refSer,refId,countDso,conn);//Changed by wasim on 07-12-2015 to allocate stock for any ref ser and removed D-SO update
//errString = allocStockLocCodeTo(allocList,conn);
errString = allocStockLocCodeTo(allocList,false,conn);
System.out.println("Return from alloc To for PR/PRS="+errString);
......@@ -719,25 +524,17 @@ public class ScheduleAWMSInOutTasks implements Schedule
{
throw new Exception (errString);
}
//conn.commit();
//Changed by wasim on 30-11-2015 to not allow to allocate stock for location code to for PR/PRS [END]
}
else
{
conn.rollback();
}
}
/*else
{
conn.rollback();
System.out.println("PR/PRS detail not found hence header is rollbacked");
}*/
}
pstmtInterface.close();pstmtInterface = null;
rsInterface.close();rsInterface = null;
//if(isRecordExist && !"PR".equalsIgnoreCase(refSer))
if(isRecordExist && (!"PR".equalsIgnoreCase(refSer) && !"PRS".equalsIgnoreCase(refSer) && !"RPZ".equalsIgnoreCase(refSer)))//Changed by wasim on 19-11-2015 to add new ref ser PRS
if(isRecordExist && (!"RPZ".equalsIgnoreCase(refSer)))
{
System.out.println("Inside record exist block------------");//CONFSUCC
StockTransferConf stkConf = new StockTransferConf();
......@@ -747,68 +544,17 @@ public class ScheduleAWMSInOutTasks implements Schedule
if( errString != null && errString.indexOf( "CONFSUCC" ) > -1)
{
//errString = allocStockLocCodeTo(allocList,tranIdIssList,refSer,refId,countDso,conn);//Changed by wasim on 07-12-2015 to allocate stock for any ref ser and removed D-SO update
//errString = allocStockLocCodeTo(allocList,conn);
errString = allocStockLocCodeTo(allocList,false,conn);
System.out.println("Return from alloc To="+errString);
if(errString != null && (errString.indexOf("CONFSTKSUCC") > -1))
{
if("D-SO".equalsIgnoreCase(refSer) && countDso > 0)//Changed by wasim on 09-11-2015 to add countDso if dist issue required
{
//errString = callDistIssue(loginSiteCode, refId,lineNoList, xtraParams, conn);//Changed by wasim on 31-12-2015
errString = allocStockLocCodeTo(allocList,true,conn);
System.out.println("For D-SO after stock transfer connection need to be committed....so connection committed");
conn.commit();
System.out.println("Going for Distribution issue");
errString = createDistIssue(loginSiteCode, refId, DistStkList, xtraParams, conn);
System.out.println("Return from dist issue"+errString);
if( errString != null && (errString.indexOf( "Success" ) > -1 || errString.indexOf( "VTCONPARM" ) > -1))//VTCONPARM
{
System.out.println("Distribution issue created successfully---------");
conn.commit();
}
else
{
throw new Exception (errString);
}
}
else if("S-ORD".equalsIgnoreCase(refSer))
{
//errString = createDespatch(refId,lineNoList,conn);//VTCONPARM
errString = allocStockLocCodeTo(allocList,true,conn);
System.out.println("For s-ord after stock transfer connection need to be committed....so connection committed");
conn.commit();
System.out.println("Going for Despatch");
errString = despatchOrder(refId,lineNoList,xtraParams,conn);
System.out.println("Return from despatch"+errString);
if( errString != null && errString.indexOf( "Success" ) > -1)
{
System.out.println("Despatch created successfully and commited");
conn.commit();
}
else
{
throw new Exception (errString);
}
}
else if ("PZ".equalsIgnoreCase(refSer))
{
if ("PZ".equalsIgnoreCase(refSer))
{
updateLocation(locationList,conn);
conn.commit();
System.out.println("Stock Transfer for PZ completed successfully and committed");
}
else if ("D-SO".equalsIgnoreCase(refSer))//D-SO is required if dist_issue already created then only stock transfer will be done
{
updateLocation(locationList,conn);
conn.commit();
System.out.println("Stock Transfer for D-SO completed successfully and committed");
}
}
else
{
......
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