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
rs = pstmt.executeQuery();
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("<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
pstmt.close();
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
//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
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.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();
if(rs.next())
{
......@@ -1670,6 +1674,7 @@ public class PickIssIC extends ValidatorEJB implements PickIssICLocal, PickIssIC
pstmt = null;
}
//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
double masterPackWeightPerOrder = 0.0;
boolean masterPackAllow = false;
boolean isMasterPackAllow = false;
String isMasterPackBestFit = "N";
double masterPackCountPerOrder = 0.0;
String isSinglePickMasterPack="";
String docLoc = "", tranCode = "",custCodeDlv = "",maxWeight="",locTypeTransport = "",casePickInv = "",activePickInv = "",partialResrvLoc="";
......@@ -10638,7 +10639,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
invDeepReserve = discommon.getDisparams("999999","DEEP_STORE_INVSTAT",conn);
invPndReserve = discommon.getDisparams("999999","PND_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
palletVolume = Double.parseDouble(discommon.getDisparams("999999","PER_PALLET__VOLUME",conn));
palletMaxWeight = Double.parseDouble(discommon.getDisparams("999999","PER_PALLET__WEIGHT",conn));
......@@ -11024,83 +11025,169 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
double packSize = 10;*/
//Logic stands clear.start
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)
{
ArrayList tempList = (ArrayList)allMasterList.get(j);
System.out.println("Loop============"+j);
System.out.println("Remaining cashCount Count+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ["+cashCount+"]");
if(cashCount > 0)
if("Y".equalsIgnoreCase(isMasterPackBestFit))
{
HashMap tempMap = (HashMap)tempList.get(tempList.size() -1);
if(cashCount > 0)
for(int j = 0 ;j < allMasterListlen ; j++)
{
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")+"]");
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);
double remainingWeight = masterPackWeight - lastPackWeight;
double remainingVolume = masterPackVolume - lastPackVolume;
if(remainingWeight >= caseWeight && remainingVolume >= caseVolume && lastPackCount < masterPackCount)
if(cashCount > 0)
{
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)
if(tempMap.containsKey("LAST_PACK_WEIGHT") && tempMap.containsKey("LAST_PACK_VOLUME") && tempMap.containsKey("LAST_PACK_COUNT"))
{
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));
System.out.println("Item Name"+tempMap.get("item"));
System.out.println("Alloc Qty"+tempMap.get("alloc_qty"));
tempList.add(caseTempMap);
cashCount = cashCount - caseToBeStore;
allMasterList.set(j,tempList);
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(j,tempList);
}
}
}
}
}
}
else
{
break;
else
{
break;
}
//}
}
else
{
break;
}
}
//}
}
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
......@@ -19947,14 +20034,16 @@ private String generatedLabelPrint(String waveId, String printer, Connection con
String printMode = "";
String outputFilename = "";
TreeMap argMap = null;
String isReplenishment = "";
String isReplenishment = "N";
String saleOrder = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
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 = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, waveId);
......@@ -19968,8 +20057,9 @@ private String generatedLabelPrint(String waveId, String printer, Connection con
isReplenishment = "N";
}
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);
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();
......
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