Commit 05ad5234 authored by dsawant's avatar dsawant

UPDATED


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95857 ce508802-f39f-4f6c-b175-0d175dae99d5
parent aad79120
......@@ -645,10 +645,10 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
System.out.println("DOM322 Elements>>["+genericUtility.serializeDom(dom2).toString()+"]");
String workOrder = "",itemCode = "",itemDescr="",sql="",lineNo="",unit="",packCode="",qcReqd="",locGrp="";
double totDetQuan = 0.0,totNoArt=0.0;
java.sql.Timestamp currDate = null,mfgDateStart = null,startDate=null,expDate=null;
java.sql.Timestamp currDate = null,mfgDateStart = null,startDate=null,expDate=null,tdate = null;
double quantity = 0,grossWeight = 0,tareWeight = 0,netWeight = 0,noOfArt=0,shippsize = 0;
SimpleDateFormat sdf = null;
String currAppdate = "",woSiteCode="",sStartDate="",sExpDate="",sMfgDateStart="";
String currAppdate = "",woSiteCode="",sStartDate="",sExpDate="",sMfgDateStart="",stdate="";
String tranid ="";
double rate = 0,conquan,conOldRate,oldAmount,amount,amtdiff,oldRate=0,getquantity=0;
int cnt = 0;
......@@ -731,7 +731,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
xmlValues = xmlValues + "</Detail1></Root>";
System.out.println("xmlValues :["+xmlValues+"]");
TransIDGenerator tg = new TransIDGenerator(xmlValues, "BASE", CommonConstants.DB_NAME);
atranid = tg.generateTranSeqID("W-RCP","tran_id","_spsite_code,T,tran_type,_pptran_date,seq04",conn);
atranid = tg.generateTranSeqID("WORDWI","tran_id","_spsite_code,T,tran_type,_pptran_date,seq04",conn);
System.out.println(">>>>>NEW id"+atranid);
}else
......@@ -769,40 +769,65 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
System.out.println(">>>>>>>>>>>SXD"+workOrder);
sql = "select a.tran_id,a.work_order,a.tran_date,a.item_code,a.no_art,a.quantity,a.gross_weight,"
+ "a.tare_weight,a.net_weight,b.descr from workorder_receipt a,item b where "
+ "a.item_code=b.item_code and work_order = ?";
sql = "select a.tran_id,a.tran_date,a.site_code,a.work_order,a.date__start,"
+ "a.item_code,b.descr,a.loc_code,a.lot_sl,a.quantity,a.no_art,a.unit,a.gross_weight,a.tare_weight,a.net_weight "
+ "FROM workorder_receipt a,item b WHERE a.item_code = b.item_code and a.work_order = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,workOrder);
rs = pstmt.executeQuery();
while(rs.next())
{
tranid = rs.getString(1) == null ? "":rs.getString(1);
workOrder = rs.getString(2) == null ? "":rs.getString(2);
currDate = rs.getTimestamp(3);
itemCode = rs.getString(4) == null ? "":rs.getString(4);
noOfArt = rs.getDouble(5);
quantity = rs.getDouble(6);
grossWeight = rs.getDouble(7);
tareWeight = rs.getDouble(8);
netWeight = rs.getDouble(9);
itemDescr = rs.getString(10) == null ? "":rs.getString(10);
currDate = rs.getTimestamp(2);
siteCode = rs.getString(3) == null ? "":rs.getString(3);
workOrder = rs.getString(4) == null ? "":rs.getString(4);
startDate = rs.getTimestamp(5);
itemCode = rs.getString(6) == null ? "":rs.getString(6);
itemDescr = rs.getString(7) == null ? "":rs.getString(7);
locCode = rs.getString(8) == null ? "":rs.getString(8);
lotsl = rs.getString(9) == null ? "":rs.getString(9);
quantity = rs.getDouble(10);
noOfArt = rs.getDouble(11);
unit = rs.getString(12) == null ? "":rs.getString(12);
grossWeight = rs.getDouble(13);
tareWeight = rs.getDouble(14);
netWeight = rs.getDouble(15);
simpleDateFormat=new SimpleDateFormat(genutility.getApplDateFormat());
currAppdate = simpleDateFormat.format(currDate);
sdf=new SimpleDateFormat(genutility.getApplDateFormat());
if(startDate != null)
{
sStartDate = simpleDateFormat.format(startDate);
}
sdf=new SimpleDateFormat(genutility.getApplDateFormat());
tdate = new java.sql.Timestamp(System.currentTimeMillis()) ;
stdate = simpleDateFormat.format(tdate);
valueXmlString.append("<Detail2 objContext = '"+currentFormNo+"' selected=\"Y\">\r\n");
valueXmlString.append("<attribute selected=\"Y\" updateFlag=\"E\" status=\"O\" pkNames=\"\"/>\r\n");
valueXmlString.append("<tran_id>").append("<![CDATA[" + tranid + "]]>").append("</tran_id>");
valueXmlString.append("<tran_date>").append("<![CDATA[" + currAppdate + "]]>").append("</tran_date>");
valueXmlString.append("<site_code>").append("<![CDATA[" + siteCode + "]]>").append("</site_code>");
valueXmlString.append("<work_order>").append("<![CDATA[" + workOrder + "]]>").append("</work_order>");
valueXmlString.append("<date__start>").append("<![CDATA[" + sStartDate + "]]>").append("</date__start>");
valueXmlString.append("<item_code>").append("<![CDATA[" + itemCode + "]]>").append("</item_code>");
valueXmlString.append("<descr>").append("<![CDATA[" + itemDescr + "]]>").append("</descr>");
valueXmlString.append("<no_art>").append("<![CDATA[" + noOfArt + "]]>").append("</no_art>");
valueXmlString.append("<loc_code>").append("<![CDATA["+ locCode +"]]>").append("</loc_code>");
valueXmlString.append("<lot_sl>").append("<![CDATA["+ lotsl +"]]>").append("</lot_sl>");
valueXmlString.append("<quantity>").append("<![CDATA[" + quantity + "]]>").append("</quantity>");
valueXmlString.append("<no_art>").append("<![CDATA[" + noOfArt + "]]>").append("</no_art>");
valueXmlString.append("<unit>").append("<![CDATA[" + unit + "]]>").append("</unit>");
valueXmlString.append("<gross_weight>").append("<![CDATA[" + grossWeight + "]]>").append("</gross_weight>");
valueXmlString.append("<tare_weight>").append("<![CDATA[" + tareWeight + "]]>").append("</tare_weight>");
valueXmlString.append("<net_weight>").append("<![CDATA[" + netWeight + "]]>").append("</net_weight>");
valueXmlString.append("<chg_user>").append("<![CDATA[" + chgUser + "]]>").append("</chg_user>");
valueXmlString.append("<chg_term>").append("<![CDATA[" + chgTerm + "]]>").append("</chg_term>");
valueXmlString.append("<chg_date>").append("<![CDATA[" + stdate + "]]>").append("</chg_date>");
valueXmlString.append("</Detail2>");
......@@ -837,11 +862,20 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
rs.close();
pstmt = null;
rs = null;
sdf=new SimpleDateFormat(genutility.getApplDateFormat());
if(startDate != null)
{
sStartDate = simpleDateFormat.format(startDate);
}
if(expDate != null)
{
sExpDate = simpleDateFormat.format(expDate);
}
if(mfgDateStart != null)
{
sMfgDateStart = simpleDateFormat.format(mfgDateStart);
}
valueXmlString.append("<Detail2 objContext = '"+currentFormNo+"' selected=\"N\">\r\n");
......@@ -853,6 +887,21 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
valueXmlString.append("<date__start>").append("<![CDATA[" + sStartDate + "]]>").append("</date__start>");
valueXmlString.append("<date__compl>").append("<![CDATA[" + todayDate + "]]>").append("</date__compl>");
valueXmlString.append("<item_code>").append("<![CDATA[" + itemCode + "]]>").append("</item_code>");
sql = "select descr from item where item_code = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
itemDescr = rs.getString(1) == null ? "":rs.getString(1);
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
valueXmlString.append("<descr>").append("<![CDATA[" + itemDescr + "]]>").append("</descr>");
valueXmlString.append("<loc_code>").append("<![CDATA[ ]]>").append("</loc_code>");
valueXmlString.append("<lot_no>").append("<![CDATA[" + lotNo + "]]>").append("</lot_no>");
valueXmlString.append("<lot_sl>").append("<![CDATA[ ]]>").append("</lot_sl>");
......@@ -1053,7 +1102,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
System.out.println("tran id is"+tranid);
/* sql = "select work_order,item_code,lot_sl,lot_no,no_art,quantity,gross_weight,tare_weight,net_weight "
sql = "select work_order,item_code,lot_sl,lot_no,no_art,quantity,gross_weight,tare_weight,net_weight "
+ "from workorder_receipt where tran_id = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,tranid);
......@@ -1142,14 +1191,8 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
pstmt.close();
rs.close();
pstmt = null;
rs = null;*/
valueXmlString.append("<Detail3 domID='" + domId+ "' objContext = '"+currentFormNo+"' selected=\"N\">\r\n");
valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>\r\n");
valueXmlString.append("<tran_id><![CDATA[" + tranid + "]]></tran_id>");
valueXmlString.append("<line_no><![CDATA[" + domId + "]]></line_no>");
valueXmlString.append("<work_order>").append("<![CDATA[" + workOrder + "]]>").append("</work_order>");
valueXmlString.append("<item_code>").append("<![CDATA[" + itemCode + "]]>").append("</item_code>");
valueXmlString.append("</Detail3>");
rs = null;
}
......
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