Commit dc9eb22a authored by pjain's avatar pjain

for adsi pass wt (wt+fillerwt+tarewt) and when dealloc master carton then re-cal wt.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96442 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f1f03c3a
...@@ -911,6 +911,12 @@ public class ConsolidatToDoc { ...@@ -911,6 +911,12 @@ public class ConsolidatToDoc {
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
} }
//Changed by Dhanraj on 19-SEP-14 for update despatch tare and filler weight [W14FSUN003]
System.out.println("PTCN ======For updatedespatch method====>> "+ptcn);
errString = updatedespatch(ptcn, conn);
//Changed by Dharnaj on 19-SEP-14 for [W14FSUN003] //Changed by Dharnaj on 19-SEP-14 for [W14FSUN003]
//sqlHdr = "update despatch set gross_weight = ?, tare_weight = ? ,nett_weight = ?, no_art = ? where desp_id = ? "; //added by Kunal on 08/09/12 as per S Manoharan Sir instruction //sqlHdr = "update despatch set gross_weight = ?, tare_weight = ? ,nett_weight = ?, no_art = ? where desp_id = ? "; //added by Kunal on 08/09/12 as per S Manoharan Sir instruction
sqlHdr = "update despatch set gross_weight = ?, tare_weight = tare_weight + ? ,nett_weight = ?, no_art = ? where desp_id = ? "; //added by Kunal on 08/09/12 as per S Manoharan Sir instruction sqlHdr = "update despatch set gross_weight = ?, tare_weight = tare_weight + ? ,nett_weight = ?, no_art = ? where desp_id = ? "; //added by Kunal on 08/09/12 as per S Manoharan Sir instruction
...@@ -1888,4 +1894,89 @@ public class ConsolidatToDoc { ...@@ -1888,4 +1894,89 @@ public class ConsolidatToDoc {
return dataVolumeMap; return dataVolumeMap;
} }
//Changed by sumit on 13/03/12 to reterive shipper size end //Changed by sumit on 13/03/12 to reterive shipper size end
//Changed by Dhanraj on 19-SEP-14 [W14FSUN003]
private String updatedespatch(String ptcn,Connection conn) throws Exception
{
String errString = "";
String sql=null;
double tareWt=0.0;
double fillerWt=0.0;
System.out.println("Call Despatch update method in consolidateToDoc");
PreparedStatement pstmt = null;
ResultSet rSet = null ;
try
{
sql = " SELECT SUM(NVL(FILLER_WEIGHT,0)) FILLER_WEIGHT , SUM(NVL(TARE_WEIGHT,0)) TARE_WEIGHT FROM CARTON_MASTER "
+" WHERE PTCN = ? AND CARTON_TYPE = 'M' AND STATUS <> 'R' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,ptcn);
rSet = pstmt.executeQuery();
if (rSet.next())
{
fillerWt = rSet.getDouble("FILLER_WEIGHT");
tareWt = rSet.getDouble("TARE_WEIGHT");
}
System.out.println("Sum fillerWt consolidateToDoc" +fillerWt);
System.out.println("sum tare wate consolidateToDoc "+tareWt);
if( rSet != null)
{
rSet.close();
rSet = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
sql = " UPDATE DESPATCH SET TARE_WEIGHT= ? ,FILLER_WEIGHT= ? WHERE PTCN= ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, tareWt);
pstmt.setDouble(2, fillerWt);
pstmt.setString(3, ptcn);
int updateCnt=pstmt.executeUpdate();
if(updateCnt > 0){
System.out.println("<============Updation done ConsolidateToDoc==========>");
}
if( pstmt != null )
{
pstmt.close();
pstmt = null;
}
}
catch(Exception e)
{
e.printStackTrace();
throw e;
}
finally
{
try
{
if( rSet != null)
{
rSet.close();
rSet = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception e)
{
e.printStackTrace();
throw e;
}
}
return errString;
}
//End Changed by Dhanraj on 19-SEP-14 [W14FSUN003]
} }
\ No newline at end of file
...@@ -4079,8 +4079,8 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -4079,8 +4079,8 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
try try
{ {
sql=" SELECT NVL(FILLER_WEIGHT,0) FILLER_WEIGHT , NVL(TARE_WEIGHT,0) TARE_WEIGHT " sql=" SELECT NVL(FILLER_WEIGHT,0) FILLER_WEIGHT , NVL(TARE_WEIGHT,0) TARE_WEIGHT "
+" FROM CARTON_MASTER " +" FROM CARTON_MASTER " //Changed sql 19-SEP-14 [W14FSUN003]
+" WHERE PTCN = ? AND STATUS = ? AND (REF_SER = ? AND REF_SER = ?) AND CARTON_NO = ? "; +" WHERE PTCN = ? AND STATUS = ? AND ( REF_SER = ? OR REF_SER = ?) AND CARTON_NO = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,ptcn); pstmt.setString(1,ptcn);
pstmt.setString(2,"R"); pstmt.setString(2,"R");
......
...@@ -187,7 +187,12 @@ public class GenerateLabelsPrc extends ProcessEJB implements GenerateLabelsPrcLo ...@@ -187,7 +187,12 @@ public class GenerateLabelsPrc extends ProcessEJB implements GenerateLabelsPrcLo
pstmtPrintStatus = conn.prepareStatement(sqlPrintStatus); pstmtPrintStatus = conn.prepareStatement(sqlPrintStatus);
//sqlMaster = "SELECT MASTER_CARTON,TRACKING_NO,CARTON_NO,STATUS FROM CARTON_MASTER WHERE PTCN = ? AND CARTON_TYPE <> ? ORDER BY CARTON_NO,MASTER_CARTON"; //sqlMaster = "SELECT MASTER_CARTON,TRACKING_NO,CARTON_NO,STATUS FROM CARTON_MASTER WHERE PTCN = ? AND CARTON_TYPE <> ? ORDER BY CARTON_NO,MASTER_CARTON";
sqlMaster = "SELECT MASTER_CARTON,TRACKING_NO,CARTON_NO,STATUS,CHANGE_STATUS,MSN_NO,CARRIER_SYMBOL,CARRIER_FRIENDLYNAME,CARTON_TYPE FROM CARTON_MASTER WHERE PTCN = ? AND CARTON_TYPE <> ? ORDER BY CARTON_NO,MASTER_CARTON";
//sqlMaster = "SELECT MASTER_CARTON,TRACKING_NO,CARTON_NO,STATUS,CHANGE_STATUS,MSN_NO,CARRIER_SYMBOL,CARRIER_FRIENDLYNAME,CARTON_TYPE FROM CARTON_MASTER WHERE PTCN = ? AND CARTON_TYPE <> ? ORDER BY CARTON_NO,MASTER_CARTON";
//Dhanraj 19-SEP-14 for get f_wt and t_wt [W14FSUN003]
sqlMaster = "SELECT MASTER_CARTON,TRACKING_NO,CARTON_NO,STATUS,CHANGE_STATUS,MSN_NO,CARRIER_SYMBOL,CARRIER_FRIENDLYNAME,CARTON_TYPE " +
" ,FILLER_WEIGHT,TARE_WEIGHT " + //Add fwt and twt Dhanraj
" FROM CARTON_MASTER WHERE PTCN = ? AND CARTON_TYPE <> ? ORDER BY CARTON_NO,MASTER_CARTON";
pstmtMaster = conn.prepareStatement(sqlMaster); pstmtMaster = conn.prepareStatement(sqlMaster);
sqlCrtnChg = "UPDATE CARTON_MASTER SET CHANGE_STATUS = ? WHERE PTCN = ?"; sqlCrtnChg = "UPDATE CARTON_MASTER SET CHANGE_STATUS = ? WHERE PTCN = ?";
...@@ -337,8 +342,16 @@ public class GenerateLabelsPrc extends ProcessEJB implements GenerateLabelsPrcLo ...@@ -337,8 +342,16 @@ public class GenerateLabelsPrc extends ProcessEJB implements GenerateLabelsPrcLo
pstmtMaster.setString(2, "C"); pstmtMaster.setString(2, "C");
rsMaster = pstmtMaster.executeQuery(); rsMaster = pstmtMaster.executeQuery();
//Dhanraj get fwt and twt 19-SEP-14 [W14FSUN003]
double fillerWt=0.0;
double tareWt=0.0;
while(rsMaster.next()) while(rsMaster.next())
{ {
//Add Dhanraj 19-SEP-14 [W14FSUN003]
fillerWt=0.0;
tareWt=0.0;
linkedMap.clear(); linkedMap.clear();
masterCarton = rsMaster.getString("MASTER_CARTON"); masterCarton = rsMaster.getString("MASTER_CARTON");
...@@ -475,7 +488,7 @@ public class GenerateLabelsPrc extends ProcessEJB implements GenerateLabelsPrcLo ...@@ -475,7 +488,7 @@ public class GenerateLabelsPrc extends ProcessEJB implements GenerateLabelsPrcLo
count++; count++;
//Changed By Pragyan.end //Changed By Pragyan.end
continue; continue;
} }//'R' IF END
else else
{ {
...@@ -491,7 +504,19 @@ public class GenerateLabelsPrc extends ProcessEJB implements GenerateLabelsPrcLo ...@@ -491,7 +504,19 @@ public class GenerateLabelsPrc extends ProcessEJB implements GenerateLabelsPrcLo
CommodityInfo[] comInfo = new CommodityInfo[linkedMap.size()]; CommodityInfo[] comInfo = new CommodityInfo[linkedMap.size()];
comInfo = setCommodityInfos(linkedMap, masterCarton, saleOrder, soap,refType, conn); comInfo = setCommodityInfos(linkedMap, masterCarton, saleOrder, soap,refType, conn);
System.out.println("old weight ["+packages2[count].getWeight()+"]"); System.out.println("old weight ["+packages2[count].getWeight()+"]");
System.out.println("new weight ["+weight+"]"); System.out.println("new weight ["+weight+"]");
//Changed by Dhanraj on 19-SEP-14 [W14FSUN003]
System.out.println("weight afer add f and t wt ====>[[[[ "+weight);
fillerWt=rsMaster.getDouble("FILLER_WEIGHT");
tareWt=rsMaster.getDouble("TARE_WEIGHT");
System.out.println("FILLER_WEIGHT====>[[[[ "+fillerWt);
System.out.println("TARE_WEIGHT====>[[[[ "+tareWt);
weight = weight + fillerWt + tareWt;
System.out.println("weight + TARE_WEIGHT + tareWt ====>[[[[ "+weight);
packages2[count].setWeight(weight); packages2[count].setWeight(weight);
System.out.println("old comodity info length ["+packages2[count].getCommodityInfos().length+"]"); System.out.println("old comodity info length ["+packages2[count].getCommodityInfos().length+"]");
System.out.println("new comodity info length ["+comInfo.length+"]"); System.out.println("new comodity info length ["+comInfo.length+"]");
...@@ -520,12 +545,12 @@ public class GenerateLabelsPrc extends ProcessEJB implements GenerateLabelsPrcLo ...@@ -520,12 +545,12 @@ public class GenerateLabelsPrc extends ProcessEJB implements GenerateLabelsPrcLo
} }
count++; count++;
} }//R ELSE END
weight = 0; weight = 0;
System.out.println(" arryOuterCartonNo.size ["+arryOuterCartonNo.size()+"]"); System.out.println(" arryOuterCartonNo.size ["+arryOuterCartonNo.size()+"]");
} }//M IF END
else else
{ {
...@@ -602,6 +627,18 @@ public class GenerateLabelsPrc extends ProcessEJB implements GenerateLabelsPrcLo ...@@ -602,6 +627,18 @@ public class GenerateLabelsPrc extends ProcessEJB implements GenerateLabelsPrcLo
comInfo = setCommodityInfos(linkedMap, masterCarton, saleOrder, soap,refType, conn); comInfo = setCommodityInfos(linkedMap, masterCarton, saleOrder, soap,refType, conn);
System.out.println("old weight ["+packages2[count].getWeight()+"]"); System.out.println("old weight ["+packages2[count].getWeight()+"]");
System.out.println("new weight ["+weight+"]"); System.out.println("new weight ["+weight+"]");
//Dhanraj get fwt and twt 19-SEP-14 [W14FSUN003]
System.out.println("weight afer add f and t wt ====>[[[[ "+weight);
fillerWt=rsMaster.getDouble("FILLER_WEIGHT");
tareWt=rsMaster.getDouble("TARE_WEIGHT");
System.out.println("FILLER_WEIGHT====>[[[[ "+fillerWt);
System.out.println("TARE_WEIGHT====>[[[[ "+tareWt);
weight = weight + fillerWt + tareWt;
System.out.println("weight + TARE_WEIGHT + tareWt ====>[[[[ "+weight);
packages2[count].setWeight(weight); packages2[count].setWeight(weight);
System.out.println("old comodity info length ["+packages2[count].getCommodityInfos().length+"]"); System.out.println("old comodity info length ["+packages2[count].getCommodityInfos().length+"]");
System.out.println("new comodity info length ["+comInfo.length+"]"); System.out.println("new comodity info length ["+comInfo.length+"]");
...@@ -614,7 +651,7 @@ public class GenerateLabelsPrc extends ProcessEJB implements GenerateLabelsPrcLo ...@@ -614,7 +651,7 @@ public class GenerateLabelsPrc extends ProcessEJB implements GenerateLabelsPrcLo
/*rs1.close(); rs1 = null; /*rs1.close(); rs1 = null;
pstmt1.close(); pstmt1 = null;*/ pstmt1.close(); pstmt1 = null;*/
count++; count++;
} }//M ELSE END
}//while(rsMaster.next()) }//while(rsMaster.next())
......
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