Commit 22afe201 authored by cpatil's avatar cpatil

added condition ( Double.parseDouble(batchQuantityStr) > WOrderQty - prevIssQty )


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98100 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d3226bda
......@@ -363,7 +363,7 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
System.out.println("@@@@@@@ generateWoIssue function called::");
genericUtility = GenericUtility.getInstance();
SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
// currDate = java.sql.Timestamp.valueOf(sdf1.format(new java.util.Date()).toString() + " 00:00:00.0");
// currDate = java.sql.Timestamp.valueOf(sdf1.format(new java.util.Date()).toString() + " 00:00:00.0");
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"); System.out.println("--login code--"+userId);
termId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId"); System.out.println("--term id--"+termId);
chgUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"chgUser");
......@@ -446,8 +446,9 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
insertHed =" insert into workorder_iss (TRAN_ID,TRAN_DATE,EFF_DATE,WORK_ORDER,OPERATION,SITE_CODE, "
+" REMARKS,CHG_DATE,CHG_USER,CHG_TERM,DEPT_CODE,TRAN_TYPE, "
+" LOC_GROUP,ITEM_CODE,WOIR_TYPE,STATUS,CONFIRMED ,LOT_NO__FG,LOT_SL__FG) "
+" values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ";
+" LOC_GROUP,ITEM_CODE,WOIR_TYPE,STATUS,CONFIRMED ,LOT_NO__FG,LOT_SL__FG"
+" ,UDF__STR1) "
+" values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ";
pstmt = conn.prepareStatement(insertHed);
pstmt.setString(1,tranId);
pstmt.setTimestamp(2,currDate1);
......@@ -470,6 +471,7 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
pstmt.setString(17,"N");
pstmt.setString(18,lotNo);
pstmt.setString(19,lotSl);
pstmt.setString(20,batchQuantityStr);
upd = pstmt.executeUpdate();
pstmt.close();
......@@ -687,8 +689,40 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
propReqQty = propReqQty - ( propReqQty - issueQtyDiff ) ;
}
System.out.println("@@@@@@@@@@@ propReqQty["+propReqQty+"]issueQtyDiff["+issueQtyDiff+"]");
// added by cpatil on 01/06/15 for iss_varience start
String sql4 = "", udfStr1="";
double prevIssQty=0, WOrderQty=0;
sql4 = " select udf__str1 from workorder_iss where work_order = ? and tran_id not in ( ? ) ";
pstmt1 = conn.prepareStatement(sql4);
pstmt1.setString(1,worder);
pstmt1.setString(2,tranId);
rs1 = pstmt1.executeQuery();
while(rs1.next())
{
udfStr1 = rs1.getString("udf__str1")==null?"0":rs1.getString("udf__str1");
prevIssQty = prevIssQty + Double.parseDouble(udfStr1);
}
rs1.close();rs1=null;
pstmt1.close();pstmt1=null;
System.out.println("@@@@@@ prevIssQty ["+prevIssQty+"]");
sql4 = " select quantity from workorder where work_order = ? ";
pstmt1 = conn.prepareStatement(sql4);
pstmt1.setString(1,worder);
rs1 = pstmt1.executeQuery();
while(rs1.next())
{
WOrderQty = rs1.getDouble("quantity");
}
rs1.close();rs1=null;
pstmt1.close();pstmt1=null;
System.out.println("@@@@@@ :batchQuantity["+batchQuantityStr+"] > WOrderQty["+WOrderQty+"]-prevIssQty["+prevIssQty+"]");
// if(propReqQty > ( issueQtyDiff + varValue ) ) // added by cpatil on 01/06/15 for iss_varience
if(propReqQty > issueQtyDiff ) // added by cpatil on 01/06/15 for iss_varience
if(propReqQty > issueQtyDiff || issueQtyDiff == 0 || ( Double.parseDouble(batchQuantityStr) > WOrderQty - prevIssQty ) ) // added by cpatil on 01/06/15 for iss_varience
{
System.out.println("propReqQty["+propReqQty+"]issueQtyDiff["+issueQtyDiff+"]");
list.add(itemCode);
......
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