Commit 7b15556a authored by ppatro's avatar ppatro

Master Pack new logic,pick issue error repl,report label


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92282 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c9f85939
...@@ -1305,7 +1305,8 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma ...@@ -1305,7 +1305,8 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while(rs.next()) while(rs.next())
{ {
domID++; //domID++;
domID = rs.getInt("LINE_NO");
//valueXmlString.append( "<Detail3 domID='"+ domID +"' objContext='"+currentFormNo+"' objName=\"master_pack\" selected=\"Y\">\r\n" ); //valueXmlString.append( "<Detail3 domID='"+ domID +"' objContext='"+currentFormNo+"' objName=\"master_pack\" selected=\"Y\">\r\n" );
valueXmlString.append( "<Detail3 domID='"+ domID +"' objContext = '"+currentFormNo+"' objName='master_pack' selected=\"Y\">\r\n" ); valueXmlString.append( "<Detail3 domID='"+ domID +"' objContext = '"+currentFormNo+"' objName='master_pack' selected=\"Y\">\r\n" );
valueXmlString.append("<attribute selected=\"Y\" updateFlag=\"E\" status=\"O\" pkNames=\"\" />\r\n"); //added by Kunal on 22/08/12 valueXmlString.append("<attribute selected=\"Y\" updateFlag=\"E\" status=\"O\" pkNames=\"\" />\r\n"); //added by Kunal on 22/08/12
...@@ -1331,6 +1332,21 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma ...@@ -1331,6 +1332,21 @@ public class MasterPackIC extends ValidatorEJB implements MasterPackICRemote, Ma
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql = "SELECT MAX(LINE_NO) AS MAXLINE FROM PACK_DET WHERE TRAN_ID = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranID);
rs = pstmt.executeQuery();
if(rs.next())
{
domID = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
//change done by Kunal on 08/08/12 //change done by Kunal on 08/08/12
//sql = "select pick_order,line_no__pick from carton_master where PTCN in (SELECT PTCN FROM WAVE_TASK_DET WHERE REF_SER = 'M-PACK' and ref_id = ?) " ; //sql = "select pick_order,line_no__pick from carton_master where PTCN in (SELECT PTCN FROM WAVE_TASK_DET WHERE REF_SER = 'M-PACK' and ref_id = ?) " ;
......
...@@ -1650,10 +1650,14 @@ public class PickIssIC extends ValidatorEJB implements PickIssICLocal, PickIssIC ...@@ -1650,10 +1650,14 @@ public class PickIssIC extends ValidatorEJB implements PickIssICLocal, PickIssIC
pstmt = null; pstmt = null;
selReplCnt = "SELECT COUNT(*) AS COUNT FROM REPL_ORD_DET WHERE PICK_ORDER = ? AND LINE_NO__PICK = ?"; //Changed by sumit on 05/12/12 changing sql for dependable replenishment task confirm or not
//selReplCnt = "SELECT COUNT(*) AS COUNT FROM REPL_ORD_DET WHERE PICK_ORDER = ? AND LINE_NO__PICK = ?";
selReplCnt = "SELECT COUNT(*) AS COUNT FROM WAVE_TASK_DET WHERE REF_ID = ? AND STATUS = ?";
pstmt = conn.prepareStatement(selReplCnt); pstmt = conn.prepareStatement(selReplCnt);
pstmt.setString(1,replOrderPick); pstmt.setString(1,replOrderPick);
pstmt.setString(2,lineNoRepl); //Changed by sumit on 05/12/12 Changing input parameter as per sql.
//pstmt.setString(2,lineNoRepl);
pstmt.setString(2,"N");
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
...@@ -1670,6 +1674,7 @@ public class PickIssIC extends ValidatorEJB implements PickIssICLocal, PickIssIC ...@@ -1670,6 +1674,7 @@ public class PickIssIC extends ValidatorEJB implements PickIssICLocal, PickIssIC
pstmt = null; pstmt = null;
} }
//Changed by Rohan on 29-10-12 to add warinig message in depended repanishment not scan.end //Changed by Rohan on 29-10-12 to add warinig message in depended repanishment not scan.end
......
...@@ -10591,6 +10591,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -10591,6 +10591,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
double masterPackWeightPerOrder = 0.0; double masterPackWeightPerOrder = 0.0;
boolean masterPackAllow = false; boolean masterPackAllow = false;
boolean isMasterPackAllow = false; boolean isMasterPackAllow = false;
String isMasterPackBestFit = "N";
double masterPackCountPerOrder = 0.0; double masterPackCountPerOrder = 0.0;
String isSinglePickMasterPack=""; String isSinglePickMasterPack="";
String docLoc = "", tranCode = "",custCodeDlv = "",maxWeight="",locTypeTransport = "",casePickInv = "",activePickInv = "",partialResrvLoc=""; String docLoc = "", tranCode = "",custCodeDlv = "",maxWeight="",locTypeTransport = "",casePickInv = "",activePickInv = "",partialResrvLoc="";
...@@ -10638,7 +10639,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -10638,7 +10639,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
invDeepReserve = discommon.getDisparams("999999","DEEP_STORE_INVSTAT",conn); invDeepReserve = discommon.getDisparams("999999","DEEP_STORE_INVSTAT",conn);
invPndReserve = discommon.getDisparams("999999","PND_INVSTAT",conn); invPndReserve = discommon.getDisparams("999999","PND_INVSTAT",conn);
partialResrvLoc = discommon.getDisparams("999999","PRSRV_INVSTAT",conn); partialResrvLoc = discommon.getDisparams("999999","PRSRV_INVSTAT",conn);
isMasterPackBestFit = discommon.getDisparams("999999","MASTER_PACK_BEST_FIT",conn);
//The Dimension of pallet are 60*48*40 inches H*L*W = 115200 //The Dimension of pallet are 60*48*40 inches H*L*W = 115200
palletVolume = Double.parseDouble(discommon.getDisparams("999999","PER_PALLET__VOLUME",conn)); palletVolume = Double.parseDouble(discommon.getDisparams("999999","PER_PALLET__VOLUME",conn));
palletMaxWeight = Double.parseDouble(discommon.getDisparams("999999","PER_PALLET__WEIGHT",conn)); palletMaxWeight = Double.parseDouble(discommon.getDisparams("999999","PER_PALLET__WEIGHT",conn));
...@@ -11024,83 +11025,169 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -11024,83 +11025,169 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
double packSize = 10;*/ double packSize = 10;*/
//Logic stands clear.start //Logic stands clear.start
int allMasterListlen = allMasterList.size(); int allMasterListlen = allMasterList.size();
for(int j = 0 ;j < allMasterListlen ; j++)
//To store best FIT Algorithem and NFT Next Fit Algrthem as per user requirement.
if(allMasterListlen > 0)
{ {
if("Y".equalsIgnoreCase(isMasterPackBestFit))
ArrayList tempList = (ArrayList)allMasterList.get(j);
System.out.println("Loop============"+j);
System.out.println("Remaining cashCount Count+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ["+cashCount+"]");
if(cashCount > 0)
{ {
HashMap tempMap = (HashMap)tempList.get(tempList.size() -1);
for(int j = 0 ;j < allMasterListlen ; j++)
if(cashCount > 0)
{ {
if(tempMap.containsKey("LAST_PACK_WEIGHT") && tempMap.containsKey("LAST_PACK_VOLUME") && tempMap.containsKey("LAST_PACK_COUNT")) ArrayList tempList = (ArrayList)allMasterList.get(j);
{ System.out.println("Loop============"+j);
System.out.println("Item Name"+tempMap.get("item")); System.out.println("Remaining cashCount Count+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ["+cashCount+"]");
System.out.println("Alloc Qty"+tempMap.get("alloc_qty"));
if(cashCount > 0)
double lastPackWeight = (Double)tempMap.get("LAST_PACK_WEIGHT"); {
double lastPackVolume = (Double)tempMap.get("LAST_PACK_VOLUME");
double lastPackCount = (Double)tempMap.get("LAST_PACK_COUNT"); HashMap tempMap = (HashMap)tempList.get(tempList.size() -1);
System.out.println("Last Pack Volume#############["+tempMap.get("LAST_PACK_VOLUME")+"]");
System.out.println("Last Pack Weight#############["+tempMap.get("LAST_PACK_WEIGHT")+"]");
System.out.println("Last Pack Count#############["+tempMap.get("LAST_PACK_COUNT")+"]");
double remainingWeight = masterPackWeight - lastPackWeight; if(cashCount > 0)
double remainingVolume = masterPackVolume - lastPackVolume;
if(remainingWeight >= caseWeight && remainingVolume >= caseVolume && lastPackCount < masterPackCount)
{ {
if(tempMap.containsKey("LAST_PACK_WEIGHT") && tempMap.containsKey("LAST_PACK_VOLUME") && tempMap.containsKey("LAST_PACK_COUNT"))
double caseToBeStore = Math.floor(remainingWeight / caseWeight);
double caseToBeStore1 = Math.floor(remainingVolume / caseVolume);
if(caseToBeStore > caseToBeStore1)
{
caseToBeStore = caseToBeStore1;
}
if(caseToBeStore > cashCount)
{
caseToBeStore = cashCount;
}
if((lastPackCount + caseToBeStore) <= masterPackCount)
{ {
System.out.println("Item Name"+tempMap.get("item"));
HashMap caseTempMap = (HashMap)dataMap.clone(); System.out.println("Alloc Qty"+tempMap.get("alloc_qty"));
caseTempMap.put("no_art", ""+caseToBeStore);
caseTempMap.put("alloc_qty", caseToBeStore * packSize);
caseTempMap.put("LAST_PACK_WEIGHT",lastPackWeight + (caseToBeStore * caseWeight));
caseTempMap.put("LAST_PACK_VOLUME", (caseToBeStore * caseVolume) + lastPackVolume);
caseTempMap.put("LAST_PACK_COUNT", (lastPackCount + caseToBeStore));
caseTempMap.put("CASE_VOLUME_TOT", (caseToBeStore * caseVolume));
caseTempMap.put("CASE_WEIGHT_TOT", (caseToBeStore * caseWeight));
tempList.add(caseTempMap); double lastPackWeight = (Double)tempMap.get("LAST_PACK_WEIGHT");
cashCount = cashCount - caseToBeStore; double lastPackVolume = (Double)tempMap.get("LAST_PACK_VOLUME");
double lastPackCount = (Double)tempMap.get("LAST_PACK_COUNT");
allMasterList.set(j,tempList); System.out.println("Last Pack Volume#############["+tempMap.get("LAST_PACK_VOLUME")+"]");
System.out.println("Last Pack Weight#############["+tempMap.get("LAST_PACK_WEIGHT")+"]");
System.out.println("Last Pack Count#############["+tempMap.get("LAST_PACK_COUNT")+"]");
double remainingWeight = masterPackWeight - lastPackWeight;
double remainingVolume = masterPackVolume - lastPackVolume;
if(remainingWeight >= caseWeight && remainingVolume >= caseVolume && lastPackCount < masterPackCount)
{
double caseToBeStore = Math.floor(remainingWeight / caseWeight);
double caseToBeStore1 = Math.floor(remainingVolume / caseVolume);
if(caseToBeStore > caseToBeStore1)
{
caseToBeStore = caseToBeStore1;
}
if(caseToBeStore > cashCount)
{
caseToBeStore = cashCount;
}
if((lastPackCount + caseToBeStore) <= masterPackCount)
{
HashMap caseTempMap = (HashMap)dataMap.clone();
caseTempMap.put("no_art", ""+caseToBeStore);
caseTempMap.put("alloc_qty", caseToBeStore * packSize);
caseTempMap.put("LAST_PACK_WEIGHT",lastPackWeight + (caseToBeStore * caseWeight));
caseTempMap.put("LAST_PACK_VOLUME", (caseToBeStore * caseVolume) + lastPackVolume);
caseTempMap.put("LAST_PACK_COUNT", (lastPackCount + caseToBeStore));
caseTempMap.put("CASE_VOLUME_TOT", (caseToBeStore * caseVolume));
caseTempMap.put("CASE_WEIGHT_TOT", (caseToBeStore * caseWeight));
tempList.add(caseTempMap);
cashCount = cashCount - caseToBeStore;
allMasterList.set(j,tempList);
}
}
} }
} }
} else
} {
else break;
{ }
break; //}
}
else
{
break;
}
} }
//}
} }
else else
{ {
break; ArrayList tempList = (ArrayList)allMasterList.get(allMasterListlen-1);
System.out.println("Remaining cashCount Count+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ["+cashCount+"]");
if(cashCount > 0)
{
HashMap tempMap = (HashMap)tempList.get(tempList.size() -1);
if(cashCount > 0)
{
if(tempMap.containsKey("LAST_PACK_WEIGHT") && tempMap.containsKey("LAST_PACK_VOLUME") && tempMap.containsKey("LAST_PACK_COUNT"))
{
System.out.println("Item Name"+tempMap.get("item"));
System.out.println("Alloc Qty"+tempMap.get("alloc_qty"));
double lastPackWeight = (Double)tempMap.get("LAST_PACK_WEIGHT");
double lastPackVolume = (Double)tempMap.get("LAST_PACK_VOLUME");
double lastPackCount = (Double)tempMap.get("LAST_PACK_COUNT");
System.out.println("Last Pack Volume#############["+tempMap.get("LAST_PACK_VOLUME")+"]");
System.out.println("Last Pack Weight#############["+tempMap.get("LAST_PACK_WEIGHT")+"]");
System.out.println("Last Pack Count#############["+tempMap.get("LAST_PACK_COUNT")+"]");
double remainingWeight = masterPackWeight - lastPackWeight;
double remainingVolume = masterPackVolume - lastPackVolume;
if(remainingWeight >= caseWeight && remainingVolume >= caseVolume && lastPackCount < masterPackCount)
{
double caseToBeStore = Math.floor(remainingWeight / caseWeight);
double caseToBeStore1 = Math.floor(remainingVolume / caseVolume);
if(caseToBeStore > caseToBeStore1)
{
caseToBeStore = caseToBeStore1;
}
if(caseToBeStore > cashCount)
{
caseToBeStore = cashCount;
}
if((lastPackCount + caseToBeStore) <= masterPackCount)
{
HashMap caseTempMap = (HashMap)dataMap.clone();
caseTempMap.put("no_art", ""+caseToBeStore);
caseTempMap.put("alloc_qty", caseToBeStore * packSize);
caseTempMap.put("LAST_PACK_WEIGHT",lastPackWeight + (caseToBeStore * caseWeight));
caseTempMap.put("LAST_PACK_VOLUME", (caseToBeStore * caseVolume) + lastPackVolume);
caseTempMap.put("LAST_PACK_COUNT", (lastPackCount + caseToBeStore));
caseTempMap.put("CASE_VOLUME_TOT", (caseToBeStore * caseVolume));
caseTempMap.put("CASE_WEIGHT_TOT", (caseToBeStore * caseWeight));
tempList.add(caseTempMap);
cashCount = cashCount - caseToBeStore;
allMasterList.set(allMasterListlen-1,tempList);
}
}
}
}
else
{
break;
}
//}
}
else
{
break;
}
} }
} }
//To store best FIT Algorithem and NFT Next Fit Algrthem as per user requirement.end
//Logic stands.end //Logic stands.end
...@@ -19947,14 +20034,16 @@ private String generatedLabelPrint(String waveId, String printer, Connection con ...@@ -19947,14 +20034,16 @@ private String generatedLabelPrint(String waveId, String printer, Connection con
String printMode = ""; String printMode = "";
String outputFilename = ""; String outputFilename = "";
TreeMap argMap = null; TreeMap argMap = null;
String isReplenishment = ""; String isReplenishment = "N";
String saleOrder = ""; String saleOrder = "";
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
try try
{ {
//Changed by sumit 06/10/12 for getting sale order value start.
//Changed as per sagar baht for hardcode passing the value "N" for repleneishment.start
/*//Changed by sumit 06/10/12 for getting sale order value start.
sql = " SELECT REPL_ORDER FROM REPL_ORD_HDR WHERE WAVE_ID = ? "; sql = " SELECT REPL_ORDER FROM REPL_ORD_HDR WHERE WAVE_ID = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, waveId); pstmt.setString(1, waveId);
...@@ -19968,8 +20057,9 @@ private String generatedLabelPrint(String waveId, String printer, Connection con ...@@ -19968,8 +20057,9 @@ private String generatedLabelPrint(String waveId, String printer, Connection con
isReplenishment = "N"; isReplenishment = "N";
} }
pstmt.close();pstmt = null; pstmt.close();pstmt = null;
rs.close(); rs = null; rs.close(); rs = null; */
//Changed as per sagar baht for hardcode passing the value "N" for repleneishment.end
String reportObjName = discommon.getDisparams("999999","WAVE_LABEL_OBJ_NAME",conn); String reportObjName = discommon.getDisparams("999999","WAVE_LABEL_OBJ_NAME",conn);
System.out.println("Printer *->["+printer.trim()+"] report_obj_name ["+reportObjName+"] wave id ->["+waveId+"]"); System.out.println("Printer *->["+printer.trim()+"] report_obj_name ["+reportObjName+"] wave id ->["+waveId+"]");
ibase.webitm.reports.utility.JasperReportGenerator jrGenerator = new ibase.webitm.reports.utility.JasperReportGenerator(); ibase.webitm.reports.utility.JasperReportGenerator jrGenerator = new ibase.webitm.reports.utility.JasperReportGenerator();
......
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