Commit 23c2bcfd authored by dsawant's avatar dsawant

updated new changes


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95875 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 729efc25
...@@ -635,10 +635,10 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -635,10 +635,10 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
System.out.println("itm_default >>>>> 2>>"); System.out.println("itm_default >>>>> 2>>");
workOrder = genericUtility.getColumnValue("work_order", dom1); workOrder = genericUtility.getColumnValue("work_order", dom1);
sql = "select count(1) from workorder_receipt where work_order = ? and confirmed = ?"; sql = "select count(1) from workorder_receipt where CASE WHEN confirmed IS NULL THEN 'N' ELSE CONFIRMED END = 'N' and work_order = ?";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1,workOrder); pstmt.setString(1,workOrder);
pstmt.setString(2,"N");
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
...@@ -661,10 +661,10 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -661,10 +661,10 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
sql = "select a.tran_id,a.tran_date,a.site_code,a.work_order,a.date__start," 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.item_code,b.descr,a.loc_code,a.lot_sl,a.quantity,a.no_art,a.unit "
+ "FROM workorder_receipt a,item b WHERE a.item_code = b.item_code and a.work_order = ? and a.confirmed = ?"; + "FROM workorder_receipt a,item b WHERE a.item_code = b.item_code and CASE WHEN confirmed IS NULL THEN 'N' ELSE CONFIRMED END = 'N' and work_order = ?";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1,workOrder); pstmt.setString(1,workOrder);
pstmt.setString(2,"N");
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while(rs.next()) while(rs.next())
{ {
...@@ -714,8 +714,8 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -714,8 +714,8 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
tdate = new java.sql.Timestamp(System.currentTimeMillis()) ; tdate = new java.sql.Timestamp(System.currentTimeMillis()) ;
stdate = simpleDateFormat.format(tdate); stdate = simpleDateFormat.format(tdate);
count++;
valueXmlString.append("<Detail2 domID='" +count+ "' objContext = '"+currentFormNo+"' selected=\"Y\">\r\n"); valueXmlString.append("<Detail2 domID='1' objContext = '"+currentFormNo+"' selected=\"Y\">\r\n");
valueXmlString.append("<attribute selected=\"Y\" updateFlag=\"E\" status=\"O\" pkNames=\"\"/>\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_id>").append("<![CDATA[" + tranid + "]]>").append("</tran_id>");
valueXmlString.append("<tran_date>").append("<![CDATA[" + currAppdate + "]]>").append("</tran_date>"); valueXmlString.append("<tran_date>").append("<![CDATA[" + currAppdate + "]]>").append("</tran_date>");
...@@ -793,6 +793,10 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -793,6 +793,10 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
{ {
sStartDate = simpleDateFormat.format(startDate); sStartDate = simpleDateFormat.format(startDate);
} }
else
{
sStartDate = currAppdate;
}
if(expDate != null) if(expDate != null)
{ {
sExpDate = simpleDateFormat.format(expDate); sExpDate = simpleDateFormat.format(expDate);
...@@ -817,7 +821,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -817,7 +821,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
valueXmlString.append("<item_code>").append("<![CDATA[" + itemCode + "]]>").append("</item_code>"); valueXmlString.append("<item_code>").append("<![CDATA[" + itemCode + "]]>").append("</item_code>");
valueXmlString.append("<loc_code>").append("<![CDATA[ ]]>").append("</loc_code>"); valueXmlString.append("<loc_code>").append("<![CDATA[ ]]>").append("</loc_code>");
valueXmlString.append("<lot_no>").append("<![CDATA[" + lotNo + "]]>").append("</lot_no>"); valueXmlString.append("<lot_no>").append("<![CDATA[" + lotNo + "]]>").append("</lot_no>");
valueXmlString.append("<lot_sl>").append("<![CDATA[]]>").append("</lot_sl>"); valueXmlString.append("<lot_sl>").append("<![CDATA[ ]]>").append("</lot_sl>");
valueXmlString.append("<exp_date>").append("<![CDATA[" + sExpDate + "]]>").append("</exp_date>"); valueXmlString.append("<exp_date>").append("<![CDATA[" + sExpDate + "]]>").append("</exp_date>");
valueXmlString.append("<site_code__own>").append("<![CDATA[" + woSiteCode + "]]>").append("</site_code__own>"); valueXmlString.append("<site_code__own>").append("<![CDATA[" + woSiteCode + "]]>").append("</site_code__own>");
...@@ -924,9 +928,6 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -924,9 +928,6 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
valueXmlString.append("<pack_code>").append("<![CDATA[" + packCode + "]]>").append("</pack_code>"); valueXmlString.append("<pack_code>").append("<![CDATA[" + packCode + "]]>").append("</pack_code>");
valueXmlString.append("<potency_perc>").append("<![CDATA[0]]>").append("</potency_perc>"); valueXmlString.append("<potency_perc>").append("<![CDATA[0]]>").append("</potency_perc>");
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[" + currAppdate + "]]>").append("</chg_date>");
valueXmlString.append("<confirmed>").append("<![CDATA[N]]>").append("</confirmed>"); valueXmlString.append("<confirmed>").append("<![CDATA[N]]>").append("</confirmed>");
valueXmlString.append("<mfg_date>").append("<![CDATA[" + sMfgDateStart + "]]>").append("</mfg_date>"); valueXmlString.append("<mfg_date>").append("<![CDATA[" + sMfgDateStart + "]]>").append("</mfg_date>");
...@@ -953,6 +954,11 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -953,6 +954,11 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
valueXmlString.append("<tare_weight>").append("<![CDATA[0]]>").append("</tare_weight>"); valueXmlString.append("<tare_weight>").append("<![CDATA[0]]>").append("</tare_weight>");
valueXmlString.append("<net_weight>").append("<![CDATA[0]]>").append("</net_weight>"); valueXmlString.append("<net_weight>").append("<![CDATA[0]]>").append("</net_weight>");
*/ */
valueXmlString.append("<chg_user>").append("<![CDATA[" + chgUser + "]]>").append("</chg_user>"); //changes done by deepak
valueXmlString.append("<chg_term>").append("<![CDATA[" + chgTerm + "]]>").append("</chg_term>");
valueXmlString.append("<chg_date>").append("<![CDATA[" + currAppdate + "]]>").append("</chg_date>");
valueXmlString.append("<quantity>").append("<![CDATA[0]]>").append("</quantity>");
valueXmlString.append("</Detail2>"); valueXmlString.append("</Detail2>");
} }
...@@ -967,19 +973,38 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -967,19 +973,38 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
//tranid = genericUtility.getColumnValue("tran_id", dom2, "2"); //tranid = genericUtility.getColumnValue("tran_id", dom2, "2");
tranid = genericUtility.getColumnValue("tranid", dom1); tranid = genericUtility.getColumnValue("tran_id", dom1);
workOrder = genericUtility.getColumnValue("work_order", dom1);
//childNodeListLength = childNodeList.getLength(); //childNodeListLength = childNodeList.getLength();
System.out.println("tran val"+tranid); System.out.println("tran val"+tranid+"workOrder>>>"+workOrder);
sql = "select tran_id from workorder_receipt where CASE WHEN confirmed IS NULL THEN 'N' ELSE CONFIRMED END = 'N' and work_order = ?";
pstmt1=conn.prepareStatement(sql);
pstmt1.setString(1,workOrder);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
tranid = rs1.getString(1) == null ? "":rs1.getString(1);
}
pstmt1.close();
rs1.close();
pstmt1 = null;
rs1 = null;
System.out.println("tranid FROM QUERY"+tranid);
if(currentColumn.trim().equalsIgnoreCase("itm_default")) if(currentColumn.trim().equalsIgnoreCase("itm_default"))
{ {
System.out.println("tran id is"+tranid); System.out.println("tran id is"+tranid);
sql = "select work_order,item_code,lot_sl,lot_no,no_art,quantity,line_no,gross_weight, tare_weight,net_weight " sql = "select work_order,item_code,lot_sl,lot_no,no_art,quantity,line_no,gross_weight, tare_weight,net_weight "
+ "from workorder_rcp_det where tran_id = ? and confirmed = ?"; + "from workorder_rcp_det where tran_id = ?";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1,tranid); pstmt.setString(1,tranid);
pstmt.setString(2,"N");
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while(rs.next()) while(rs.next())
{ {
...@@ -1050,7 +1075,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -1050,7 +1075,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
//tranid = genericUtility.getColumnValue("tran_id", dom2, "2"); //tranid = genericUtility.getColumnValue("tran_id", dom2, "2");
//workOrder = genericUtility.getColumnValue("work_order", dom2, "2"); //workOrder = genericUtility.getColumnValue("work_order", dom2, "2");
//itemCode = genericUtility.getColumnValue("item_code", dom2, "2"); //itemCode = genericUtility.getColumnValue("item_code", dom2, "2");
tranid = genericUtility.getColumnValue("tranid", dom1); //tranid = genericUtility.getColumnValue("tranid", dom1);
workOrder = genericUtility.getColumnValue("work_order", dom1); workOrder = genericUtility.getColumnValue("work_order", dom1);
itemCode = genericUtility.getColumnValue("item_code", dom1); itemCode = genericUtility.getColumnValue("item_code", dom1);
...@@ -1079,10 +1104,10 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -1079,10 +1104,10 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
sql = "select work_order,item_code,lot_sl,lot_no,no_art,quantity " sql = "select work_order,item_code,lot_sl,lot_no,no_art,quantity "
+ "from workorder_receipt where tran_id = ? and confirmed = ?"; + "from workorder_receipt where tran_id = ? and CASE WHEN confirmed IS NULL THEN 'N' ELSE CONFIRMED END = 'N'";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1,tranid); pstmt.setString(1,tranid);
pstmt.setString(2,"N");
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
...@@ -1095,6 +1120,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -1095,6 +1120,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
quantity = rs.getDouble(6); quantity = rs.getDouble(6);
lineNo++; lineNo++;
System.out.println(">>>>>>>>>>>>>..dom"+lineNo);
valueXmlString.append("<Detail3 domID='" + lineNo+ "' objContext = '"+currentFormNo+"' selected=\"N\">\r\n"); valueXmlString.append("<Detail3 domID='" + lineNo+ "' objContext = '"+currentFormNo+"' selected=\"N\">\r\n");
valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>\r\n"); valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>\r\n");
valueXmlString.append("<tran_id><![CDATA[" + tranid + "]]></tran_id>"); valueXmlString.append("<tran_id><![CDATA[" + tranid + "]]></tran_id>");
...@@ -1194,10 +1220,12 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -1194,10 +1220,12 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
else if(currentColumn.trim().equalsIgnoreCase("no_art")) else if(currentColumn.trim().equalsIgnoreCase("no_art"))
{ {
System.out.println(">>>>START>>>>");
noOfArts = genericUtility.getColumnValue("no_art",dom); noOfArts = genericUtility.getColumnValue("no_art",dom);
lotNo = genericUtility.getColumnValue("lot_no",dom); lotNo = genericUtility.getColumnValue("lot_no",dom);
itemCode = genericUtility.getColumnValue("item_code",dom); itemCode = genericUtility.getColumnValue("item_code",dom);
String currDomStr = genericUtility.serializeDom(dom);
System.out.println("currDomStr[" + currDomStr + "]");
if (noOfArts == null || noOfArts.trim().length() == 0) if (noOfArts == null || noOfArts.trim().length() == 0)
{ {
...@@ -1210,6 +1238,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -1210,6 +1238,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
if(noOfArt > 0) if(noOfArt > 0)
{ {
System.out.println(">>>>START>>>>>>>>>");
sql = "select shipper_size,gross_weight,net_weight from item_lot_packsize where item_code = ? and lot_no = ? and lot_no__from <= ? and lot_no__to >= ? "; sql = "select shipper_size,gross_weight,net_weight from item_lot_packsize where item_code = ? and lot_no = ? and lot_no__from <= ? and lot_no__to >= ? ";
pstmt1=conn.prepareStatement(sql); pstmt1=conn.prepareStatement(sql);
pstmt1.setString(1,itemCode); pstmt1.setString(1,itemCode);
...@@ -1265,10 +1294,17 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -1265,10 +1294,17 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
setNodeValue( dom, "net_weight", getAbsString(""+(noOfArt * netWeight))); setNodeValue( dom, "net_weight", getAbsString(""+(noOfArt * netWeight)));
valueXmlString.append("<tare_weight protect=\"0\">").append("<![CDATA[" + ( (noOfArt * grossWeight) - (noOfArt * netWeight)) + "]]>").append("</tare_weight>"); valueXmlString.append("<tare_weight protect=\"0\">").append("<![CDATA[" + ( (noOfArt * grossWeight) - (noOfArt * netWeight)) + "]]>").append("</tare_weight>");
setNodeValue( dom, "tare_weight", getAbsString(""+( (noOfArt * grossWeight) - (noOfArt * netWeight)))); setNodeValue( dom, "tare_weight", getAbsString(""+( (noOfArt * grossWeight) - (noOfArt * netWeight))));
currDomStr = currDomStr.replace("</Detail3>", valueXmlString.toString() + "</Detail3>");
System.out.println("after currDomStr[" + currDomStr + "]");
valueXmlString.append(currDomStr);
}
System.out.println(">>>>END>>>>>>>>>");
} }
else if(currentColumn.trim().equalsIgnoreCase("quantity")) else if(currentColumn.trim().equalsIgnoreCase("quantity"))
{ {
String currDomStr = genericUtility.serializeDom(dom);
quantity = Double.parseDouble(genericUtility.getColumnValue("quantity",dom)); quantity = Double.parseDouble(genericUtility.getColumnValue("quantity",dom));
lotNo = genericUtility.getColumnValue("lot_no",dom); lotNo = genericUtility.getColumnValue("lot_no",dom);
itemCode = genericUtility.getColumnValue("item_code",dom); itemCode = genericUtility.getColumnValue("item_code",dom);
...@@ -1313,15 +1349,30 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -1313,15 +1349,30 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
setNodeValue( dom, "net_weight", getAbsString(""+(quantity * netWeight))); setNodeValue( dom, "net_weight", getAbsString(""+(quantity * netWeight)));
valueXmlString.append("<tare_weight protect=\"0\">").append("<![CDATA[" + ( (quantity * grossWeight) - (quantity * netWeight)) + "]]>").append("</tare_weight>"); valueXmlString.append("<tare_weight protect=\"0\">").append("<![CDATA[" + ( (quantity * grossWeight) - (quantity * netWeight)) + "]]>").append("</tare_weight>");
setNodeValue( dom, "tare_weight", getAbsString(""+( (quantity * grossWeight) - (quantity * netWeight)))); setNodeValue( dom, "tare_weight", getAbsString(""+( (quantity * grossWeight) - (quantity * netWeight))));
}
currDomStr = currDomStr.replace("</Detail3>", valueXmlString.toString() + "</Detail3>");
System.out.println("after currDomStr[" + currDomStr + "]");
valueXmlString.append(currDomStr);
} }
break; break;
} }
if(("no_art".equalsIgnoreCase(currentColumn)) || ("quantity".equalsIgnoreCase(currentColumn)))
{
System.out.println("CHK VAL");
String currDomStr = genericUtility.serializeDom(dom2);
System.out.println("currDomStr[" + currDomStr + "]");
StringBuffer valueXmlStr = new StringBuffer(currDomStr);
System.out.println("@@@@@@@@@@@ after serialize : valueXmlStr ["+valueXmlStr+"]");
StringBuffer valueXmlString1 = new StringBuffer("<?xml version=\"1.0\"?><Root><header><editFlag>");
valueXmlString1.append(editFlag).append("</editFlag></header>");
valueXmlString1.append(valueXmlStr);
valueXmlString = valueXmlString1;
}
valueXmlString.append("</Root>"); valueXmlString.append("</Root>");
} }
catch(Exception e) catch(Exception e)
......
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