Commit fb6756da authored by ppatro's avatar ppatro

Change for wave status and replenishment PND location consider


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92724 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7171eef8
......@@ -94,6 +94,8 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
String userId = " ";
String termId = " ";
String lotSlNew = "", orderType = "";
//Changed By Sumit To check whether all replenishment close
String replStatus = "";
int replOrderLineNo = 0;
double grossRate = 0d;
double convQtyStduom = 0d;
......@@ -498,12 +500,15 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
break;
}
strAllocate = null;
//Changed By Pragyan 21/02/13 To add Order type "I".
// end 16/10/11 manoharan allocation stock for new location
// 16/10/11 manoharan update sordalloc
// 18/09/12 manoharan as the lot_sl also changed and allocation may be for case pick as well as active pick
// reduce the quantity in existing and insert new for the active
//if ("A".equals(orderType) || "E".equals(orderType) || "Q".equals(orderType) || "T".equals(orderType) )
if ("E".equals(orderType) || "P".equals(orderType) || "Q".equals(orderType) || "T".equals(orderType)) // all active replenishment
//if ("E".equals(orderType) || "P".equals(orderType) || "Q".equals(orderType) || "T".equals(orderType)) // all active replenishment
if ("E".equals(orderType) || "P".equals(orderType) || "Q".equals(orderType) || "T".equals(orderType) || "I".equals(orderType)) // all active replenishment
{
//Changed By Pragyan 06/12/2012 To get valid Pick Order.start
/*sql = " SELECT * FROM PICK_ORD_DET "
......@@ -1048,7 +1053,16 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
pstmt = conn.prepareStatement(updateSql);
pstmt.setString(1, "N");
pstmt.setString(2, replOrder);
updCnt = pstmt.executeUpdate();
//Changed by sumit on 21/02/13 if all repl_order confirmed then updating start
//updCnt = pstmt.executeUpdate();
updCnt = 0;
replStatus = isAllDependentTaskConf(replOrder, conn);
if("Y".equalsIgnoreCase(replStatus))
{
updCnt = pstmt.executeUpdate();
}
//Changed by sumit on 21/02/13 if all repl_order confirmed then updating end
if( updCnt > 0 )
{
System.out.println( updCnt + " wave_task rows updated successfully" );
......@@ -1363,4 +1377,60 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
return dataVolumeMap;
}
//
//Changed by sumit on 21/02/13 checking whether all repl is confirmed or not start.
private String isAllDependentTaskConf(String replOrder, Connection conn) throws ITMException
{
String sql = "";
String status = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
sql = " SELECT STATUS, REF_ID FROM WAVE_TASK_DET WHERE REF_ID IN (" +
" SELECT DISTINCT REPL_ORDER FROM PICK_ORD_DET WHERE PICK_ORDER IN (" +
" SELECT PICK_ORDER FROM PICK_ORD_DET WHERE REPL_ORDER = ? ) AND REPL_ORDER IS NOT NULL)";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, replOrder);
rs = pstmt.executeQuery();
while(rs.next())
{
status = rs.getString("STATUS");
System.out.println(" status of repl_id ["+rs.getString("REF_ID")+"] is ["+status+"]");
if( "N".equalsIgnoreCase(status))
{
return status;
}
}
rs.close(); rs= null;
pstmt.close(); pstmt = null;
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(pstmt != null)
{
pstmt.close(); pstmt = null;
}
if( rs != null)
{
rs.close(); rs = null;
}
}
catch(Exception ex)
{
ex.printStackTrace();
throw new ITMException(ex);
}
}
return status;
}
//Changed by sumit on 21/02/13 checking whether all repl is confirmed or not end.
}
......@@ -12849,13 +12849,13 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtRplStk.setInt(13, rptr +1);
pstmtRplStk.setString(15,docLoc);
pstmtRplStk.addBatch();
updateCartonMaster(replRefPNDId, (rptr +1),Double.parseDouble("1"),ptcn,"S-DOC", xtraParams,"", conn);
updateCartonMaster(replRefPNDId, (rptr +1),Double.parseDouble("1"),ptcn,"S-DOC", xtraParams,"",itemCode, conn);
}
else
{
pstmtRplStk.setString(15,docLoc);
pstmtRplStk.addBatch();
updateCartonMaster(replRefDeepId, (rptr +1),Double.parseDouble("1"),ptcn,"S-DOC", xtraParams,"", conn);
pstmtRplStk.addBatch();
updateCartonMaster(replRefDeepId, (rptr +1),Double.parseDouble("1"),ptcn,"S-DOC", xtraParams,"",itemCode,conn);
}
// pstmtRplStk.executeUpdate();
......@@ -13143,7 +13143,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
updateReplenishmentRecord(itemCode, siteCode, lotNo, lotSl, locCode, quantity, prvReplID,"",9999, 2,casePackSize,false, conn);
}
}
updateCartonMaster(pickRefId, pickCtr,Double.parseDouble(noArt),ptcn,"C-PICK", xtraParams,"", conn);
updateCartonMaster(pickRefId, pickCtr,Double.parseDouble(noArt),ptcn,"C-PICK", xtraParams,"",itemCode, conn);
}
}
......@@ -13497,7 +13497,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
}
else
{
updateCartonMaster(pickRefId, pickCtr,Double.parseDouble(noArt),ptcn,"P-PICK", xtraParams,"", conn);
updateCartonMaster(pickRefId, pickCtr,Double.parseDouble(noArt),ptcn,"P-PICK", xtraParams,"",itemCode, conn);
}
......@@ -13577,7 +13577,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
}
if(!("Y".equalsIgnoreCase(isSinglePickMasterPack)))
{
updateCartonMaster(pickRefId, cCTR + 1,Double.parseDouble("1"),ptcn,"M-PACK", xtraParams, conn,caseWeightTotal,caseVolumeTotal,pickType);
updateCartonMaster(pickRefId, cCTR + 1,Double.parseDouble("1"),ptcn,"M-PACK", xtraParams, conn,caseWeightTotal,caseVolumeTotal,pickType,"");
System.out.println("updateCartonMaster M-PACK 6");
}
......@@ -13606,7 +13606,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
System.out.println("CURRENT CASE WEIGHT TOTAL["+caseWeightTotal+"]");
System.out.println("CURRENT CASE VOLUME TOTAL["+caseVolumeTotal+"]");
masterCartonNo = updateCartonMaster(packRefId, j + 1,Double.parseDouble("1"),ptcn,"M-PACK", xtraParams, conn,caseWeightTotal,caseVolumeTotal,pickType);
masterCartonNo = updateCartonMaster(packRefId, j + 1,Double.parseDouble("1"),ptcn,"M-PACK", xtraParams, conn,caseWeightTotal,caseVolumeTotal,pickType,"");
for(int k =0 ; k < tempList.size() ; k++)
{
......@@ -13637,7 +13637,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
System.out.println("Total No art["+currentnoArt+"]");
System.out.println("case Weight["+vMap.get("case_weight")+"]");
System.out.println("case Volume["+vMap.get("case_volume")+"]");
updateCartonMaster(pickRefId, pickCtr,Double.parseDouble(noArt),ptcn,"M-PICK", xtraParams,masterCartonNo, conn);
updateCartonMaster(pickRefId, pickCtr,Double.parseDouble(noArt),ptcn,"M-PICK", xtraParams,masterCartonNo,itemCode, conn);
vMap.put("no_art", currentnoArt - Double.parseDouble(noArt));
}
......@@ -14876,7 +14876,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//////////////////////To add Carton no generation for Actives Hear///////////////////////////////////////
System.out.println("Finally ["+itemWeightTotal+"]Finally itemVolumeTotal["+itemVolumeTotal+"]");
updateCartonMaster(pickRefId, pickCtr,Double.parseDouble(noArt),ptcn,"A-PICK", xtraParams, conn,itemWeightTotal,itemVolumeTotal,pickType);
updateCartonMaster(pickRefId, pickCtr,Double.parseDouble(noArt),ptcn,"A-PICK", xtraParams, conn,itemWeightTotal,itemVolumeTotal,pickType,"");
//Changed by Rohan on 24/11/12 to spilt active pick depending upon cartons.start
cartonCount++;
System.out.println("cartonCount:::"+cartonCount+"Active pick case count::"+Integer.parseInt(actPkCnt));
......@@ -14968,9 +14968,11 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
}
//Changed by sumit sarkar on 26/08/2011 [ WM1ESUN006 ] update pick_ord_hrd & pick_ord_det table end.
//Changed By Pragyan 21/02/12 To add item code for case pick cartons
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-PICKING LOGIC CHANGE
//Added new method by Chandni on 06/06/12 -- To generate carton Master when pick order is generated
private String updateCartonMaster(String pickOrder,int lineNo,Double noArt,String ptcn,String refSeries,String xtraParams,String masterCartonNo,Connection conn)throws Exception
//private String updateCartonMaster(String pickOrder,int lineNo,Double noArt,String ptcn,String refSeries,String xtraParams,String masterCartonNo,Connection conn)throws Exception
private String updateCartonMaster(String pickOrder,int lineNo,Double noArt,String ptcn,String refSeries,String xtraParams,String masterCartonNo,String itemCode,Connection conn)throws Exception
{
String errString = "";
String sql = "",sqlInsert = "";
......@@ -15014,8 +15016,12 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmt.close();
pstmt =null;
keyString = keyString.substring(keyString.indexOf(","));
//Changed By Pragyan 21/02/12 To add item code for case pick cartons
/*sqlInsert = "INSERT INTO CARTON_MASTER (CARTON_NO, STATUS, CHG_DATE, CHG_USER, CHG_TERM, " +
"PICK_ORDER, LINE_NO__PICK ,PTCN,REF_SER,CARTON_TYPE,MASTER_CARTON) VALUES (?,?,?,?,?,?,?,?,?,?,?) ";*/
sqlInsert = "INSERT INTO CARTON_MASTER (CARTON_NO, STATUS, CHG_DATE, CHG_USER, CHG_TERM, " +
"PICK_ORDER, LINE_NO__PICK ,PTCN,REF_SER,CARTON_TYPE,MASTER_CARTON) VALUES (?,?,?,?,?,?,?,?,?,?,?) ";
"PICK_ORDER, LINE_NO__PICK ,PTCN,REF_SER,CARTON_TYPE,MASTER_CARTON,ITEM_CODE) VALUES (?,?,?,?,?,?,?,?,?,?,?,?) ";
pstmtInsert = conn.prepareStatement(sqlInsert);
if(refSeries.startsWith("C"))
{
......@@ -15090,6 +15096,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
{
pstmtInsert.setString(11,masterCartonNo);
}
pstmtInsert.setString(12,itemCode);
pstmtInsert.addBatch();
pstmtInsert.clearParameters();
......@@ -15149,7 +15159,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
return errString;
}
//Changed by Ameya of 07/08/2012 updateCartonMaster
private String updateCartonMaster(String pickOrder,int lineNo,Double noArt,String ptcn,String refSeries,String xtraParams,Connection conn,double weight,double volume, String packType)throws Exception
private String updateCartonMaster(String pickOrder,int lineNo,Double noArt,String ptcn,String refSeries,String xtraParams,Connection conn,double weight,double volume, String packType,String itemCode)throws Exception
{
String errString = "";
String sql = "",sqlInsert = "";
......@@ -15277,8 +15287,12 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
rs = null;
}
keyString = keyString.substring(keyString.indexOf(","));
//Changed By Pragyan 21/02/12 To add item code for case pick cartons
/*sqlInsert = "INSERT INTO CARTON_MASTER (CARTON_NO, STATUS, CHG_DATE, CHG_USER, CHG_TERM, " +
"PICK_ORDER, LINE_NO__PICK ,PTCN,REF_SER,CARTON_TYPE,PACK_CODE,MASTER_CARTON) VALUES (?,?,?,?,?,?,?,?,?,?,?,?) ";*/
sqlInsert = "INSERT INTO CARTON_MASTER (CARTON_NO, STATUS, CHG_DATE, CHG_USER, CHG_TERM, " +
"PICK_ORDER, LINE_NO__PICK ,PTCN,REF_SER,CARTON_TYPE,PACK_CODE,MASTER_CARTON) VALUES (?,?,?,?,?,?,?,?,?,?,?,?) ";
"PICK_ORDER, LINE_NO__PICK ,PTCN,REF_SER,CARTON_TYPE,PACK_CODE,MASTER_CARTON,ITEM_CODE) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?) ";
pstmtInsert = conn.prepareStatement(sqlInsert);
if(refSeries.startsWith("C"))
{
......@@ -15362,6 +15376,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
{
pstmtInsert.setString(12,"");
}
pstmtInsert.setString(13,itemCode);
pstmtInsert.addBatch();
pstmtInsert.clearParameters();
......
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