Commit 653e8e86 authored by ppatro's avatar ppatro

bug fix on deallocation despacth populated for parcel pick,dist route and no...

bug fix on deallocation despacth populated for parcel pick,dist route and no of article in dock trans head


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96927 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 79ff87ec
......@@ -3112,6 +3112,8 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
String sql = "";
String pickOrder = "";//Added by sumit on 01/APR/13
String confirmed = "";
//Changed By Pragyan 06/DEC/14 for define ref series and transfer status.
String refSer = "";String trfStatus = "N";
int pickLine = 0;//Added by sumit on 01/APR/13
double quantity = 0.0;
PreparedStatement pstmt = null;
......@@ -3123,7 +3125,21 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
try
{
System.out.println(" refId --- ["+refId+"] pick_type ["+pickType+"]");
//Changed By Pragyan 06/DEC/14 to getref series.start
sql = "SELECT REF_SER FROM WAVE_TASK_DET WHERE REF_ID = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refId);
rs = pstmt.executeQuery();
if( rs.next())
{
refSer = rs.getString("REF_SER");
}
rs.close(); rs = null;
pstmt.close(); pstmt = null;
System.out.println(" refId --- ["+refId+"] pick_type ["+pickType+"]refSer["+refSer+"]");
//Changed By Pragyan 06/DEC/14 to getref series.end
if( "PICK".equalsIgnoreCase(task))
{
sql = "SELECT SUM(QUANTITY - CASE WHEN DEALLOC_QTY IS NULL THEN 0 ELSE DEALLOC_QTY END) AS QUANTITY FROM PICK_ORD_DET WHERE PICK_ORDER = ? ";
......@@ -3189,7 +3205,9 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
" AND (QUANTITY - CASE WHEN DEALLOC_QTY IS NULL THEN 0 ELSE DEALLOC_QTY END ) > 0 ";
pstmt = conn.prepareStatement(sql);
sql = " SELECT CONFIRMED FROM PICK_ISS_DET PID, PICK_ISS_HDR PIH, PICK_ORD_DET POD WHERE PID.PICK_ORDER = ? " +
//Changed By Pragyan 06/DEC/14 To get the Transfer Status
//sql = " SELECT CONFIRMED FROM PICK_ISS_DET PID, PICK_ISS_HDR PIH, PICK_ORD_DET POD WHERE PID.PICK_ORDER = ? " +
sql = " SELECT CONFIRMED,TRF_STATUS FROM PICK_ISS_DET PID, PICK_ISS_HDR PIH, PICK_ORD_DET POD WHERE PID.PICK_ORDER = ? " +
" AND PID.LINE_NO__ORD = ? AND PID.PICK_ORDER = POD.PICK_ORDER " +
//Changed By Pragyan 04-JUN-14 To get the confirm flag in proper manner
//" AND PID.LINE_NO__ORD = POD.LINE_NO AND PID.PICK_ORDER = PIH.PICK_ORDER ";
......@@ -3212,6 +3230,9 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
//changed by sankara on 12/06/14 checked null for confirmed.
//confirmed = rs1.getString("CONFIRMED");
confirmed = checkNull(rs1.getString("CONFIRMED"));
//Changed By Pragyan 06/DEC/14 To get the Transfer Status
trfStatus = checkNull(rs1.getString("TRF_STATUS"));
if( "N".equalsIgnoreCase(confirmed) || confirmed.trim().length() == 0 )
{
break;
......@@ -3239,7 +3260,25 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
sql = "UPDATE WAVE_TASK_DET SET STATUS = 'Y' WHERE REF_ID = ? AND STATUS = 'N'";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refId);
//Changed By pragyan 06/12/14 to check transfer status before updating for parcl pack.start
//update = pstmt.executeUpdate();
System.out.println(" Pick Type ["+pickType+"]Trf Status["+trfStatus+"]refSer["+refSer+"]");
if("M".equalsIgnoreCase(pickType) && "P-PICK".equalsIgnoreCase(refSer))
{
if("Y".equalsIgnoreCase(trfStatus))
{
pstmt.setString(1, refId);
update = pstmt.executeUpdate();
}
}
else
{
pstmt.setString(1, refId);
update = pstmt.executeUpdate();
}
//Changed By pragyan 06/12/14 to check transfer status before updating for parcl pack.end
pstmt.close(); pstmt = null;
if(update > 0 )
{
......
......@@ -72,6 +72,10 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
DockTranConf dockconf = new DockTranConf();
/* Connection conn1 = null;
ConnDriver connDriver = null;*/
//Changed By Pragyan on 06/12/14 To calculate no of article on dock tran
double shipperSize = 0.0;
HashMap itmVolumeMap = null;
try
{
/*connDriver = new ConnDriver();
......@@ -180,6 +184,25 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
System.out.println("confDate:"+confDate);
System.out.println("confDate1:"+(Date)confDate);
//Changed By Pragyan on 06/12/14 To calculate no of article on dock tran.start
System.out.println("noArt from data:"+noArt);
itmVolumeMap = getItemVoumeMap(itemCode,lotNo,conn);
shipperSize = (Double)itmVolumeMap.get("PACK_SIZE");
if(quantity >= shipperSize)
{
noArt = Math.floor(quantity /shipperSize);
}
else
{
noArt = 1;
}
System.out.println("noArt after clc:"+noArt);
//Changed By Pragyan on 06/12/14 To calculate no of article on dock tran.end
if(isRecordexist == false)
{
updateSql = " INSERT INTO DOCK_TRAN (TRAN_ID, SITE_CODE, PALLET_NO, TRAN_ID__ISS, EMP_CODE , " +
......@@ -431,6 +454,103 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
}
return input;
}
//Changed By Pragyan to get itm data 06/DEC/14.start
private HashMap getItemVoumeMap(String itemCode,String lotNo,Connection con)throws Exception
{
double packSize = 0,itemSize = 0,lotSize = 0;
PreparedStatement pstmt = null;
String sql="";
ResultSet rs = null;
double itmLen = 0,itmWidth = 0,itmHeight = 0,itemWeight = 0,lotLen = 0 ,lotHeight = 0,lotWidth = 0,lotWeight = 0;
HashMap dataVolumeMap = new HashMap();
try {
sql = "SELECT I.LENGTH ITEM_LEN,I.WIDTH ITEM_WID,I.HEIGHT ITEM_HEIGHT,I.GROSS_WEIGHT ITEM_WEIGHT,"
+" L.LENGTH LITEM_LEN,L.WIDTH LITEM_WID,L.HEIGHT LITEM_HEIGHT,L.SHIPPER_SIZE SHIPSIZE,L.GROSS_WEIGHT LOT_WEIGHT FROM"
+" ITEM I,ITEM_LOT_PACKSIZE L"
+" WHERE I.ITEM_CODE = L.ITEM_CODE"
+" AND L.LOT_NO__FROM <= ? AND L.LOT_NO__TO >= ?"
+" AND I.ITEM_CODE = ?";
pstmt = con.prepareStatement(sql);
if(lotNo != null && lotNo.length() > 0)
{
pstmt.setString(1, lotNo);
pstmt.setString(2, lotNo);
}
else
{
pstmt.setString(1, "00");
pstmt.setString(2, "ZZ");
}
pstmt.setString(3, itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
itmLen = rs.getDouble("ITEM_LEN");
itmWidth = rs.getDouble("ITEM_WID");
itmHeight = rs.getDouble("ITEM_HEIGHT");
itemWeight = rs.getDouble("ITEM_WEIGHT");
lotLen = rs.getDouble("LITEM_LEN");
lotWidth = rs.getDouble("LITEM_WID");
lotHeight = rs.getDouble("LITEM_HEIGHT");
packSize = rs.getDouble("SHIPSIZE");
lotWeight = rs.getDouble("LOT_WEIGHT");
}
//packSize = (lotHeight * lotWidth * lotLen)/(itmLen * itmWidth * itmHeight);
/*itemSize = Math.floor(itmLen * itmWidth * itmHeight);
lotSize = Math.floor((lotHeight * lotWidth * lotLen));*/
itemSize = itmLen * itmWidth * itmHeight;
lotSize = lotHeight * lotWidth * lotLen;
dataVolumeMap.put("PACK_SIZE", packSize);
dataVolumeMap.put("ITEM_SIZE", itemSize);
dataVolumeMap.put("LOT_SIZE", lotSize);
dataVolumeMap.put("ITEM_WEIGHT", itemWeight);
dataVolumeMap.put("PACK_WEIGHT", lotWeight);
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
} catch (Exception e) {
throw e;
}
finally
{
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
}
return dataVolumeMap;
}
//Changed By Pragyan to get itm data 06/DEC/14.end
}
......
......@@ -32,7 +32,7 @@
<grid.lines>0</grid.lines>
</BaseDefinition>
<Header>
<height>19</height>
<height>22</height>
<color>536870912</color>
</Header>
<Summary>
......@@ -100,7 +100,7 @@
<table_column>
<type size="40">char</type>
<updatewhereclause>yes</updatewhereclause>
<name>tran_name</name>
<name>transporter_tran_name</name>
<dbname>transporter.tran_name</dbname>
</table_column>
<table_column>
......@@ -282,7 +282,7 @@
<html>
<valueishtml>0</valueishtml>
</html>
<name>distroutedet_exch_rate_t</name>
<name>exch_rate_t</name>
<visible>1</visible>
<font>
<face>Times</face>
......@@ -394,7 +394,7 @@
<html>
<valueishtml>0</valueishtml>
</html>
<name>state_descr_t</name>
<name>descr_t</name>
<visible>1</visible>
<font>
<face>Times</face>
......@@ -450,7 +450,7 @@
<html>
<valueishtml>0</valueishtml>
</html>
<name>state_descr_1_t</name>
<name>descr_1_t</name>
<visible>1</visible>
<font>
<face>Times</face>
......@@ -506,7 +506,7 @@
<html>
<valueishtml>0</valueishtml>
</html>
<name>tran_name_t</name>
<name>transporter_tran_name_t</name>
<visible>1</visible>
<font>
<face>Times</face>
......@@ -780,7 +780,7 @@
<border>6</border>
<color>33554432</color>
<x>2043</x>
<y>2</y>
<y>1</y>
<height>16</height>
<width>155</width>
<html>
......@@ -1380,7 +1380,7 @@
<html>
<valueishtml>0</valueishtml>
</html>
<name>tran_name</name>
<name>transporter_tran_name</name>
<visible expression="0">1</visible>
<EditStyle style="edit">
<limit>0</limit>
......
......@@ -101,7 +101,7 @@
<table_column>
<type size="40">char</type>
<updatewhereclause>yes</updatewhereclause>
<name>tran_name</name>
<name>transporter_tran_name</name>
<dbname>transporter.tran_name</dbname>
</table_column>
<table_column>
......@@ -735,7 +735,7 @@
<html>
<valueishtml>0</valueishtml>
</html>
<name>tran_name</name>
<name>transporter_tran_name</name>
<visible>1</visible>
<EditStyle style="edit">
<limit>40</limit>
......
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