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