Commit d2b6363a authored by cpatil's avatar cpatil

add below sql for date validation

select tran_date from WORKORDER_RECEIPT
where TRAN_ID
in ( select PORCP_NO from qc_order where qorder_no = ?


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93886 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c6915f82
...@@ -88,7 +88,7 @@ QCTransferICRemote { ...@@ -88,7 +88,7 @@ QCTransferICRemote {
Timestamp date2 = null, tranDate = null; Timestamp date2 = null, tranDate = null;
double aprvLeadTime = 0; double aprvLeadTime = 0;
Timestamp qcOrderDate = null; // added by cpatil on 02/11/13 Timestamp qcOrderDate = null,WORecTranDate=null; // added by cpatil on 02/11/13
try { try {
System.out.println("@@@@@@@@ wfvaldata called"); System.out.println("@@@@@@@@ wfvaldata called");
...@@ -195,12 +195,14 @@ QCTransferICRemote { ...@@ -195,12 +195,14 @@ QCTransferICRemote {
System.out System.out
.println("@@@@ tranDate new validation start--------- "); .println("@@@@ tranDate new validation start--------- ");
sql = " Select aprv_lead_time from siteitem where site_code = ? and item_code = ? "; sql = " Select aprv_lead_time from siteitem where site_code = ? and item_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode); pstmt.setString(1, siteCode);
pstmt.setString(2, itemCode); pstmt.setString(2, itemCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next())
{
aprvLeadTime = rs.getDouble("aprv_lead_time"); aprvLeadTime = rs.getDouble("aprv_lead_time");
} }
rs.close(); rs.close();
...@@ -208,19 +210,31 @@ QCTransferICRemote { ...@@ -208,19 +210,31 @@ QCTransferICRemote {
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql = " select tran_date from WORKORDER_RECEIPT " +
" where tran_id in ( select porcp_no from qc_order where qorder_no = ? ) ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, qorderNo);
rs = pstmt.executeQuery();
if (rs.next())
{
WORecTranDate = rs.getTimestamp("tran_date");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("@@@@ site code[" + siteCode System.out.println("@@@@ site code[" + siteCode
+ "]::item code[" + itemCode + "]::item code[" + itemCode
+ "]::aprvLeadTime[" + aprvLeadTime + "]::aprvLeadTime[" + aprvLeadTime
+ "]::date2[" + date2 + "]"); + "]::tranDateStr[" + tranDateStr + "]:::WORecTranDate["+WORecTranDate+"]");
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTime(date2); cal.setTime(WORecTranDate);
cal.add(Calendar.DAY_OF_WEEK, cal.add(Calendar.DAY_OF_WEEK,
(int) Math.round(aprvLeadTime)); (int) Math.round(aprvLeadTime));
qcOrderDate = new Timestamp(cal.getTime().getTime()); qcOrderDate = new Timestamp(cal.getTime().getTime());
System.out.println("@@@@ tranDate new date [" System.out.println("@@@@ tranDate tranDate["+ tranDate + "]:::: new date wo receipt date ["+ qcOrderDate + "]:::::");
+ qcOrderDate + "]:::::tranDate["
+ tranDate + "]");
if (tranDate.before(qcOrderDate)) { if (tranDate.before(qcOrderDate)) {
errCode = "QCTRFDATEI"; errCode = "QCTRFDATEI";
errList.add(errCode); errList.add(errCode);
...@@ -713,9 +727,9 @@ QCTransferICRemote { ...@@ -713,9 +727,9 @@ QCTransferICRemote {
double stdQty1=0,convTemp=0,noArt=0,netWeight=0,stdQty2=0; double stdQty1=0,convTemp=0,noArt=0,netWeight=0,stdQty2=0;
ArrayList setNoartWeightQtyList = null,quantityList=null; ArrayList setNoartWeightQtyList = null,quantityList=null;
String quantityStr="",noArtUnit="",unit="",weightUnit="",netWeightStr="",noArtStr=""; String quantityStr="",noArtUnit="",unit="",weightUnit="",netWeightStr="",noArtStr="";
try { try {
Calendar currentDate = Calendar.getInstance(); Calendar currentDate = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat( SimpleDateFormat sdf = new SimpleDateFormat(
...@@ -914,7 +928,7 @@ QCTransferICRemote { ...@@ -914,7 +928,7 @@ QCTransferICRemote {
itemCode = checkNull(genericUtility.getColumnValue("item_code", dom)); itemCode = checkNull(genericUtility.getColumnValue("item_code", dom));
unit = setDescription("unit", "item", "item_code", itemCode, conn); unit = setDescription("unit", "item", "item_code", itemCode, conn);
quantity = quantityStr==null?0:Double.parseDouble(quantityStr); quantity = quantityStr==null?0:Double.parseDouble(quantityStr);
System.out.println("@@@@@@ unit["+unit+"]:::::quantity["+quantity+"]"); System.out.println("@@@@@@ unit["+unit+"]:::::quantity["+quantity+"]");
setNoartWeightQtyList = setNoartWeightQty("Q",quantity,unit,itemCode, conn); setNoartWeightQtyList = setNoartWeightQty("Q",quantity,unit,itemCode, conn);
if(setNoartWeightQtyList != null && setNoartWeightQtyList.size() > 0 ) if(setNoartWeightQtyList != null && setNoartWeightQtyList.size() > 0 )
...@@ -937,14 +951,14 @@ QCTransferICRemote { ...@@ -937,14 +951,14 @@ QCTransferICRemote {
unit = setDescription("unit", "item", "item_code", itemCode, conn); unit = setDescription("unit", "item", "item_code", itemCode, conn);
System.out.println("@@@@@@ unit["+unit+"]:::::noArt["+noArt+"]"); System.out.println("@@@@@@ unit["+unit+"]:::::noArt["+noArt+"]");
noArt = noArtStr==null?0:Double.parseDouble(noArtStr); noArt = noArtStr==null?0:Double.parseDouble(noArtStr);
setNoartWeightQtyList = setNoartWeightQty("A",noArt,unit,itemCode, conn); setNoartWeightQtyList = setNoartWeightQty("A",noArt,unit,itemCode, conn);
if(setNoartWeightQtyList != null && setNoartWeightQtyList.size() > 0 ) if(setNoartWeightQtyList != null && setNoartWeightQtyList.size() > 0 )
{ {
stdQty1 = Double.parseDouble( setNoartWeightQtyList.get(0).toString() ); stdQty1 = Double.parseDouble( setNoartWeightQtyList.get(0).toString() );
} }
valueXmlString.append("<quantity>").append("<![CDATA[" + stdQty1 + "]]>").append("</quantity>"); valueXmlString.append("<quantity>").append("<![CDATA[" + stdQty1 + "]]>").append("</quantity>");
if(setNoartWeightQtyList != null && setNoartWeightQtyList.size() > 1 ) if(setNoartWeightQtyList != null && setNoartWeightQtyList.size() > 1 )
{ {
stdQty2 = Double.parseDouble( setNoartWeightQtyList.get(1).toString() ); stdQty2 = Double.parseDouble( setNoartWeightQtyList.get(1).toString() );
...@@ -960,14 +974,14 @@ QCTransferICRemote { ...@@ -960,14 +974,14 @@ QCTransferICRemote {
unit = setDescription("unit", "item", "item_code", itemCode, conn); unit = setDescription("unit", "item", "item_code", itemCode, conn);
System.out.println("@@@@@@ unit["+unit+"]:::::netWeight["+netWeight+"]"); System.out.println("@@@@@@ unit["+unit+"]:::::netWeight["+netWeight+"]");
netWeight = netWeightStr==null?0:Double.parseDouble(netWeightStr); netWeight = netWeightStr==null?0:Double.parseDouble(netWeightStr);
setNoartWeightQtyList = setNoartWeightQty("W",netWeight,unit,itemCode, conn); setNoartWeightQtyList = setNoartWeightQty("W",netWeight,unit,itemCode, conn);
if(setNoartWeightQtyList != null && setNoartWeightQtyList.size() > 0 ) if(setNoartWeightQtyList != null && setNoartWeightQtyList.size() > 0 )
{ {
stdQty1 = Double.parseDouble( setNoartWeightQtyList.get(0).toString() ); stdQty1 = Double.parseDouble( setNoartWeightQtyList.get(0).toString() );
} }
valueXmlString.append("<quantity>").append("<![CDATA[" + stdQty1 + "]]>").append("</quantity>"); valueXmlString.append("<quantity>").append("<![CDATA[" + stdQty1 + "]]>").append("</quantity>");
if(setNoartWeightQtyList != null && setNoartWeightQtyList.size() > 1 ) if(setNoartWeightQtyList != null && setNoartWeightQtyList.size() > 1 )
{ {
stdQty2 = Double.parseDouble( setNoartWeightQtyList.get(1).toString() ); stdQty2 = Double.parseDouble( setNoartWeightQtyList.get(1).toString() );
...@@ -975,7 +989,7 @@ QCTransferICRemote { ...@@ -975,7 +989,7 @@ QCTransferICRemote {
valueXmlString.append("<no_art>").append("<![CDATA[" + stdQty2 + "]]>").append("</no_art>"); valueXmlString.append("<no_art>").append("<![CDATA[" + stdQty2 + "]]>").append("</no_art>");
} }
// // added by cpatil on 12-11-13 end // // added by cpatil on 12-11-13 end
valueXmlString.append("</Detail1>"); valueXmlString.append("</Detail1>");
...@@ -1010,7 +1024,7 @@ QCTransferICRemote { ...@@ -1010,7 +1024,7 @@ QCTransferICRemote {
} }
private ArrayList setNoartWeightQty(String flag,Double quantity,String unit,String itemCode,Connection conn) throws ITMException, Exception private ArrayList setNoartWeightQty(String flag,Double quantity,String unit,String itemCode,Connection conn) throws ITMException, Exception
{ {
System.out.println("@@@@@@@@ setNoartWeightQty() called ["+flag+"]@@@@@@@@"); System.out.println("@@@@@@@@ setNoartWeightQty() called ["+flag+"]@@@@@@@@");
String sql = ""; String sql = "";
...@@ -1022,7 +1036,7 @@ QCTransferICRemote { ...@@ -1022,7 +1036,7 @@ QCTransferICRemote {
String mfgAutoConv = "", phyAattributeArt = "", phyAttributeWeight = "", noArtUnit = "", weightUnit = ""; String mfgAutoConv = "", phyAattributeArt = "", phyAttributeWeight = "", noArtUnit = "", weightUnit = "";
double stdQty1=0,convTemp=0,stdQty2=0; double stdQty1=0,convTemp=0,stdQty2=0;
DistCommon discommon= new DistCommon(); DistCommon discommon= new DistCommon();
mfgAutoConv = mfgcommon.getEnvMfg("999999", "MFG_AUTO_CONV", conn); mfgAutoConv = mfgcommon.getEnvMfg("999999", "MFG_AUTO_CONV", conn);
if (mfgAutoConv == null || "NULLFOUND".equalsIgnoreCase(mfgAutoConv) || mfgAutoConv.trim().length() == 0) if (mfgAutoConv == null || "NULLFOUND".equalsIgnoreCase(mfgAutoConv) || mfgAutoConv.trim().length() == 0)
...@@ -1084,9 +1098,9 @@ QCTransferICRemote { ...@@ -1084,9 +1098,9 @@ QCTransferICRemote {
} }
System.out.println("@@@@@@@@@ noArtUnit["+noArtUnit+"]:::::weightUnit["+weightUnit+"]"); System.out.println("@@@@@@@@@ noArtUnit["+noArtUnit+"]:::::weightUnit["+weightUnit+"]");
if( noArtUnit != null && noArtUnit.trim().length() > 0 ) if( noArtUnit != null && noArtUnit.trim().length() > 0 )
{ if("Q".equalsIgnoreCase(flag)) { if("Q".equalsIgnoreCase(flag))
{ {
convQtyFactorList = discommon.convQtyFactor(unit,noArtUnit,itemCode, quantity, convTemp, conn); convQtyFactorList = discommon.convQtyFactor(unit,noArtUnit,itemCode, quantity, convTemp, conn);
} }
...@@ -1098,12 +1112,12 @@ QCTransferICRemote { ...@@ -1098,12 +1112,12 @@ QCTransferICRemote {
{ {
convQtyFactorList = discommon.convQtyFactor(weightUnit,unit,itemCode, quantity, convTemp, conn); convQtyFactorList = discommon.convQtyFactor(weightUnit,unit,itemCode, quantity, convTemp, conn);
} }
stdQty1 = Double.parseDouble( convQtyFactorList.get(1).toString() ); stdQty1 = Double.parseDouble( convQtyFactorList.get(1).toString() );
retValue.add(stdQty1); retValue.add(stdQty1);
convTemp = 0; convTemp = 0;
if("Q".equalsIgnoreCase(flag)) if("Q".equalsIgnoreCase(flag))
{ {
convQtyFactorList = discommon.convQtyFactor(unit,weightUnit,itemCode, quantity, convTemp, conn); convQtyFactorList = discommon.convQtyFactor(unit,weightUnit,itemCode, quantity, convTemp, conn);
...@@ -1116,12 +1130,12 @@ QCTransferICRemote { ...@@ -1116,12 +1130,12 @@ QCTransferICRemote {
{ {
convQtyFactorList = discommon.convQtyFactor(weightUnit,noArtUnit,itemCode, quantity, convTemp, conn); convQtyFactorList = discommon.convQtyFactor(weightUnit,noArtUnit,itemCode, quantity, convTemp, conn);
} }
stdQty2 = Double.parseDouble( convQtyFactorList.get(1).toString() ); stdQty2 = Double.parseDouble( convQtyFactorList.get(1).toString() );
retValue.add(stdQty2); retValue.add(stdQty2);
} }
System.out.println("stdQty1["+stdQty1+"]::::stdQty2["+stdQty2+"]"); System.out.println("stdQty1["+stdQty1+"]::::stdQty2["+stdQty2+"]");
return retValue; return retValue;
} }
private String setDescription(String descrCol, String table, String field, private String setDescription(String descrCol, String table, String field,
......
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