Commit 7b0f8d43 authored by ajadhav's avatar ajadhav

Changes in itm_defaultedit

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@183421 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f87c7234
...@@ -64,6 +64,7 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -64,6 +64,7 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
Document dom2 = null; Document dom2 = null;
try { try {
dom = parseString(xmlString); dom = parseString(xmlString);
System.out.println("xmlString in WFval : " +xmlString);
dom1 = parseString(xmlString1); dom1 = parseString(xmlString1);
if (xmlString2.trim().length() > 0) if (xmlString2.trim().length() > 0)
{ {
...@@ -408,6 +409,7 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -408,6 +409,7 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
}else if (childNodeName.equalsIgnoreCase("item_code")) }else if (childNodeName.equalsIgnoreCase("item_code"))
{ {
itemCode = this.genericUtility.getColumnValue("item_code", dom); itemCode = this.genericUtility.getColumnValue("item_code", dom);
System.out.println("itemCode : " +itemCode);
siteCode = this.genericUtility.getColumnValue("site_code", dom1); siteCode = this.genericUtility.getColumnValue("site_code", dom1);
itemSer = this.genericUtility.getColumnValue("item_ser", dom1); itemSer = this.genericUtility.getColumnValue("item_ser", dom1);
if(itemCode ==null || itemCode.trim().length() ==0) if(itemCode ==null || itemCode.trim().length() ==0)
...@@ -451,6 +453,9 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -451,6 +453,9 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if("0".equalsIgnoreCase(stkOpt)) if("0".equalsIgnoreCase(stkOpt))
{ {
errCode = "NONSTK"; errCode = "NONSTK";
...@@ -1052,6 +1057,7 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -1052,6 +1057,7 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
try try
{ {
dom = parseString(xmlString); dom = parseString(xmlString);
System.out.println("xmlString["+xmlString+"]");
dom1 = parseString(xmlString1); dom1 = parseString(xmlString1);
if (xmlString2.trim().length() > 0) if (xmlString2.trim().length() > 0)
{ {
...@@ -1080,8 +1086,12 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -1080,8 +1086,12 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
String columnValue = ""; String columnValue = "";
int childNodeListLength = 0,cntTrn=0,stkCnt=0; int childNodeListLength = 0,cntTrn=0,stkCnt=0;
Connection conn = null; Connection conn = null;
//Add on 04/09/18
PreparedStatement pstmt = null;
//END
PreparedStatement pstmt1 = null; PreparedStatement pstmt1 = null;
PreparedStatement pstmt2 = null; PreparedStatement pstmt2 = null;
ResultSet rs = null ;
ResultSet rs1 = null ; ResultSet rs1 = null ;
ResultSet rs2 = null ; ResultSet rs2 = null ;
String divisionDom ="",rateOpt="",sqlItem="",reStr=""; String divisionDom ="",rateOpt="",sqlItem="",reStr="";
...@@ -1092,6 +1102,8 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -1092,6 +1102,8 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
String siteCode="",siteCodeDom="", line="",itemCodeDom="", batchNO="",supCodeMfg="",retestDate="",grossWeight="",netWeight=""; String siteCode="",siteCodeDom="", line="",itemCodeDom="", batchNO="",supCodeMfg="",retestDate="",grossWeight="",netWeight="";
String priceList="",priceListDom="", tranId="",deptCode="",lotSL="",locCode="",lotNo="",lotSl="",qty="",trackShelfLife="",trackShelflife="",trackShelf="",rate=""; String priceList="",priceListDom="", tranId="",deptCode="",lotSL="",locCode="",lotNo="",lotSl="",qty="",trackShelfLife="",trackShelflife="",trackShelf="",rate="";
String previousLineLot ="",lineNoStr="",tareWeight=""; String previousLineLot ="",lineNoStr="",tareWeight="";
//Add
String itemSer="";
long lineNo=0,trackLife=0; long lineNo=0,trackLife=0;
double itmQty=0,mQty=0,mTrackShelflife=0,mAmount=0,mRate=0,mCapacity=0,mNetWt=0,mNetWtItem=0,mNoart=0,mGrossWeight=0,mNetWeight=0,mGrosswt=0,mTareWt=0,mIntegrlQty=0; double itmQty=0,mQty=0,mTrackShelflife=0,mAmount=0,mRate=0,mCapacity=0,mNetWt=0,mNetWtItem=0,mNoart=0,mGrossWeight=0,mNetWeight=0,mGrosswt=0,mTareWt=0,mIntegrlQty=0;
double shelflife=0.0,convQtyFact=0.0,potectRate=0.0; double shelflife=0.0,convQtyFact=0.0,potectRate=0.0;
...@@ -1197,6 +1209,9 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -1197,6 +1209,9 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
valueXmlString.append("<site_code protect=\"0\" ><![CDATA[").append(siteCode).append("]]></site_code>\r\n"); valueXmlString.append("<site_code protect=\"0\" ><![CDATA[").append(siteCode).append("]]></site_code>\r\n");
} }
} }
else if (currentColumn.trim().equalsIgnoreCase("site_code")) else if (currentColumn.trim().equalsIgnoreCase("site_code"))
{ {
...@@ -1285,6 +1300,47 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -1285,6 +1300,47 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
} }
} }
//Add by Ajay on 10/04/2018/:START
if("itm_defaultedit".equalsIgnoreCase(currentColumn.trim()))
{
tranId = checkNull(genericUtility.getColumnValue("tran_id",dom));
priceListDom = checkNull(genericUtility.getColumnValue("price_list",dom));
siteCodeDom = checkNull(genericUtility.getColumnValue("site_code",dom));
itemCodeDom=checkNull(genericUtility.getColumnValue("item_code",dom));
itemSer = this.genericUtility.getColumnValue("item_ser", dom);
System.out.println("itemcodedom"+itemCodeDom);
sql = "select (case when stk_opt is null then '0' else stk_opt end) as stk_opt, item_ser from item where item_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCodeDom);
rs = pstmt.executeQuery();
System.out.println("default edit sql ");
if (rs.next())
{
stkOpt = checkNull(rs.getString("stk_opt")).trim();
itemSer = rs.getString("item_ser");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if("1".equalsIgnoreCase(stkOpt))
{
System.out.println("itemdefault sql");
valueXmlString.append("<lot_no protect=\"1\"><![CDATA[").append(" ").append("]]></lot_no>\r\n");
valueXmlString.append("<lot_sl protect=\"1\" ><![CDATA[").append(" ").append("]]></lot_sl>\r\n");
}
else
{
valueXmlString.append("<lot_no protect=\"0\"><![CDATA[").append(" ").append("]]></lot_no>\r\n");
valueXmlString.append("<lot_sl protect=\"0\" ><![CDATA[").append(" ").append("]]></lot_sl>\r\n");
}
}
////Add by Ajay on 10/04/2018/:END
else if (currentColumn.trim().equalsIgnoreCase("item_code")) else if (currentColumn.trim().equalsIgnoreCase("item_code"))
{ {
itemCodeDom=checkNull(genericUtility.getColumnValue("item_code",dom)); itemCodeDom=checkNull(genericUtility.getColumnValue("item_code",dom));
......
...@@ -6007,6 +6007,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -6007,6 +6007,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
String lotNo=checkNull(genericUtility.getColumnValue("lot_no", dom)); String lotNo=checkNull(genericUtility.getColumnValue("lot_no", dom));
String rate=(genericUtility.getColumnValue("rate", dom)); String rate=(genericUtility.getColumnValue("rate", dom));
String reasCode=(genericUtility.getColumnValue("reas_code", dom)); String reasCode=(genericUtility.getColumnValue("reas_code", dom));
mcode =genericUtility.getColumnValue("item_ser", dom);
sql="select qc_reqd from siteitem where item_code = ? and site_code = ?"; sql="select qc_reqd from siteitem where item_code = ? and site_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsitemcode); pstmt.setString(1, lsitemcode);
...@@ -6020,6 +6021,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -6020,6 +6021,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if(lsqcreqd == null || lsqcreqd.trim().length() == 0) if(lsqcreqd == null || lsqcreqd.trim().length() == 0)
{ {
sql="select (case when qc_reqd is null then 'N' else qc_reqd end) from item where item_code = ?"; sql="select (case when qc_reqd is null then 'N' else qc_reqd end) from item where item_code = ?";
...@@ -6110,6 +6112,36 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -6110,6 +6112,36 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
} }
} }
} }
//Add by Ajay on 10/04/18:START
sql = "select (case when stk_opt is null then '0' else stk_opt end) as stk_opt, item_ser from item where item_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsitemcode);
rs = pstmt.executeQuery();
System.out.println("default edit sql ");
if (rs.next())
{
stkOpt = checkNull(rs.getString("stk_opt")).trim();
mcode = rs.getString("item_ser");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if("1".equalsIgnoreCase(stkOpt))
{
valueXmlString.append("<lot_no protect=\"1\"><![CDATA[").append(" ").append("]]></lot_no>\r\n");
valueXmlString.append("<lot_sl protect=\"1\" ><![CDATA[").append(" ").append("]]></lot_sl>\r\n");
}
else
{
valueXmlString.append("<lot_no protect=\"0\"><![CDATA[").append(" ").append("]]></lot_no>\r\n");
valueXmlString.append("<lot_sl protect=\"0\" ><![CDATA[").append(" ").append("]]></lot_sl>\r\n");
}
//Add by Ajay on 10/04/18:END
sql="select case when po_rate_option is null then 'N' else po_rate_option end" + sql="select case when po_rate_option is null then 'N' else po_rate_option end" +
" from item where item_code = ?"; " from item where item_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -6770,7 +6802,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -6770,7 +6802,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
valueXmlString.append("<rate__clg >").append("<![CDATA[" + lcrateclg + "]]>").append("</rate__clg>"); valueXmlString.append("<rate__clg >").append("<![CDATA[" + lcrateclg + "]]>").append("</rate__clg>");
} }
} }
//mcode = checkNull(genericUtility.getColumnValue( "pack_code", dom ));
lslotsl=checkNull( genericUtility.getColumnValue("lot_sl", dom)); lslotsl=checkNull( genericUtility.getColumnValue("lot_sl", dom));
System.out.println("LotSl is["+lslotsl+"]"); System.out.println("LotSl is["+lslotsl+"]");
varvalue=disscommon.getDisparams("999999", "MFG_LOT_SL", conn); varvalue=disscommon.getDisparams("999999", "MFG_LOT_SL", conn);
...@@ -7079,7 +7111,36 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -7079,7 +7111,36 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
lcbudgetamt = lsbudgetamtanal -lsconsumedamtanal; lcbudgetamt = lsbudgetamtanal -lsconsumedamtanal;
System.out.println("TOtal AMount is"+lcbudgetamt); System.out.println("TOtal AMount is"+lcbudgetamt);
valueXmlString.append("<budget_amt >").append("<![CDATA[" + lcbudgetamt + "]]>").append("</budget_amt>"); valueXmlString.append("<budget_amt >").append("<![CDATA[" + lcbudgetamt + "]]>").append("</budget_amt>");
//Add by Ajay on 10/04/18:START
sql = "select (case when stk_opt is null then '0' else stk_opt end) as stk_opt, item_ser from item where item_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsitemcode);
rs = pstmt.executeQuery();
System.out.println("default edit sql ");
if (rs.next())
{
stkOpt = checkNull(rs.getString("stk_opt")).trim();
mcode = rs.getString("item_ser");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if("1".equalsIgnoreCase(stkOpt))
{
valueXmlString.append("<lot_no protect=\"1\"><![CDATA[").append(" ").append("]]></lot_no>\r\n");
valueXmlString.append("<lot_sl protect=\"1\" ><![CDATA[").append(" ").append("]]></lot_sl>\r\n");
}
else
{
valueXmlString.append("<lot_no protect=\"0\"><![CDATA[").append(" ").append("]]></lot_no>\r\n");
valueXmlString.append("<lot_sl protect=\"0\" ><![CDATA[").append(" ").append("]]></lot_sl>\r\n");
}
//Add by Ajay on 10/04/18:END
} }
else if(currentColumn.trim().equalsIgnoreCase("item_code")) else if(currentColumn.trim().equalsIgnoreCase("item_code"))
{ {
String mpordno="",maccr="",lsunitrate="",lcqty1="",invAcct="",lssuppcd="",lsitemserhdr="",mpordline="",lsshelflifetype=""; String mpordno="",maccr="",lsunitrate="",lcqty1="",invAcct="",lssuppcd="",lsitemserhdr="",mpordline="",lsshelflifetype="";
...@@ -7124,11 +7185,14 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -7124,11 +7185,14 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
pstmt.close(); pstmt.close();
rs = null; rs = null;
pstmt = null; pstmt = null;
//Changes Add by Ajay Jadhav on 03/04/2018:START //Changes Add by Ajay Jadhav on 03/04/2018:START
sql = "select (case when stk_opt is null then '0' else stk_opt end) as stk_opt, item_ser from item where item_code = ? "; sql = "select (case when stk_opt is null then '0' else stk_opt end) as stk_opt, item_ser from item where item_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, mcode); pstmt.setString(1, mcode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
System.out.println("executesql:"+mcode);
if (rs.next()) if (rs.next())
{ {
stkOpt = checkNull(rs.getString("stk_opt")).trim(); stkOpt = checkNull(rs.getString("stk_opt")).trim();
......
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