Commit bd071b47 authored by jshinde's avatar jshinde

Request Id:[W16CSUN009] Same as in expiry and near expiry request user want...

Request Id:[W16CSUN009]  Same as in expiry and near expiry request user want flag for full and partial pallet in rejection status.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@102364 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 05ff86f4
...@@ -65,6 +65,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -65,6 +65,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
String userId = "", termId = "", lckGroup = ""; String userId = "", termId = "", lckGroup = "";
ibase.utility.E12GenericUtility genericUtility = new ibase.utility.E12GenericUtility(); ibase.utility.E12GenericUtility genericUtility = new ibase.utility.E12GenericUtility();
CommonConstants commonConstants = new CommonConstants(); CommonConstants commonConstants = new CommonConstants();
DistCommon distCommon = new DistCommon();
// overloaded method added to call the confirm method from postsave // overloaded method added to call the confirm method from postsave
// component - 25/11/11 - Gulzar // component - 25/11/11 - Gulzar
...@@ -129,9 +130,9 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -129,9 +130,9 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
ConnDriver connDriver = null; ConnDriver connDriver = null;
connDriver = new ConnDriver(); connDriver = new ConnDriver();
//Changes and Commented By Bhushan on 09-06-2016 :START //Changes and Commented By Bhushan on 09-06-2016 :START
//conn = connDriver.getConnectDB("DriverITM"); //conn = connDriver.getConnectDB("DriverITM");
conn = getConnection(); conn = getConnection();
//Changes and Commented By Bhushan on 09-06-2016 :END //Changes and Commented By Bhushan on 09-06-2016 :END
conn.setAutoCommit(false); conn.setAutoCommit(false);
connDriver = null; connDriver = null;
connStatus = true; connStatus = true;
...@@ -804,7 +805,9 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -804,7 +805,9 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
// not required for Taro to be done later // not required for Taro to be done later
if (detCnt > noStk) if (detCnt > noStk)
{ {
retString = createQc(tranId, siteCode, conn); //Changed by Jagruti Shinde Request id:[W16CSUN009]
//retString = createQc(tranId, siteCode, conn);
retString = createQc(tranId, siteCode, conn,xtraParams);
if ((retString != null) && (retString.trim().length() > 0)) if ((retString != null) && (retString.trim().length() > 0))
{ {
// break; // break;
...@@ -1778,7 +1781,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -1778,7 +1781,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
stkUpdMap.put("site_code", siteRcp); stkUpdMap.put("site_code", siteRcp);
stkUpdMap.put("loc_code", locCode); stkUpdMap.put("loc_code", locCode);
System.out.println("Lot No=" + lotNo); System.out.println("Lot No=[" + lotNo+"]");
stkUpdMap.put("lot_no", lotNo); stkUpdMap.put("lot_no", lotNo);
stkUpdMap.put("lot_sl", lotSl); stkUpdMap.put("lot_sl", lotSl);
...@@ -2349,6 +2352,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -2349,6 +2352,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
lockCode = (String) itemMapEntry.getKey(); lockCode = (String) itemMapEntry.getKey();
System.out.println(">>>>>>>>>Generate inv hold lockCode:" + lockCode); System.out.println(">>>>>>>>>Generate inv hold lockCode:" + lockCode);
tempList = (ArrayList) lockCodeWiseMap.get(lockCode); tempList = (ArrayList) lockCodeWiseMap.get(lockCode);
System.out.println("tempList on confirm:::"+tempList);
errString = invHoldGen.generateHoldTrans(lockCode, tranId, "P-RCP", siteRcp, tempList, xtraParams, conn); errString = invHoldGen.generateHoldTrans(lockCode, tranId, "P-RCP", siteRcp, tempList, xtraParams, conn);
if (errString != null && errString.trim().length() > 0) if (errString != null && errString.trim().length() > 0)
{ {
...@@ -2967,7 +2971,9 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -2967,7 +2971,9 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
return retString; return retString;
} }
public String createQc(String tranId, String siteCode, Connection conn) throws RemoteException, ITMException //Changed by Jagruti Shinde Req id:[W16CSUN009]
//public String createQc(String tranId, String siteCode, Connection conn) throws RemoteException, ITMException
public String createQc(String tranId, String siteCode, Connection conn, String xtraParams) throws RemoteException, ITMException
{ {
PreparedStatement pstmtSql = null; PreparedStatement pstmtSql = null;
PreparedStatement pstmtUpd = null; PreparedStatement pstmtUpd = null;
...@@ -3019,7 +3025,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -3019,7 +3025,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
String emp = ""; String emp = "";
String procMth = ""; String procMth = "";
String poRcpDetSpec = ""; String poRcpDetSpec = "";
String dbName = "", useSuppLot = "", qcOrdType = ""; String dbName = "", useSuppLot = "", qcOrdType = "",qcLockDsp= "",lineNoSl="";//Added by Jagruti Shinde Req id:[W16CSUN009]
String suppCode = "", suppCodeMnfr = "";// added by Kunal on 8/11/12 String suppCode = "", suppCodeMnfr = "";// added by Kunal on 8/11/12
String apprLocLogic = "", apprLocUdf = "", qcLotLocCode = "",apprLocUdfInput="";// added by String apprLocLogic = "", apprLocUdf = "", qcLotLocCode = "",apprLocUdfInput="";// added by
// chandrashekar // chandrashekar
...@@ -3049,8 +3055,11 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -3049,8 +3055,11 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
int updCnt = 0, updCnt1 = 0; int updCnt = 0, updCnt1 = 0;
SimpleDateFormat dtFormat = null; SimpleDateFormat dtFormat = null;
String xmlValues = ""; String xmlValues = "",lotNoUpdated="";
java.util.Date date = null; java.util.Date date = null;
//Changed by Jagruti Shinde Req id:[W16CSUN009]
ArrayList qcRejectedList ;
InvHoldGen invHoldGen = new InvHoldGen();
try try
{ {
...@@ -3070,6 +3079,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -3070,6 +3079,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
Timestamp newsysDate = java.sql.Timestamp.valueOf(sdf1.format(currentDate) + " 00:00:00.0"); Timestamp newsysDate = java.sql.Timestamp.valueOf(sdf1.format(currentDate) + " 00:00:00.0");
nullPo = distCommon.getDisparams("999999", "RCP_WO_PO", conn); nullPo = distCommon.getDisparams("999999", "RCP_WO_PO", conn);
//Changed by Jagruti Shinde Req id:[W16CSUN009]
qcLockDsp = checkNullAndTrim(distCommon.getDisparams("999999", "QUARNTINE_LOCKCODE", conn));
sql = "SELECT KEY_STRING FROM TRANSETUP WHERE TRAN_WINDOW = ? "; sql = "SELECT KEY_STRING FROM TRANSETUP WHERE TRAN_WINDOW = ? ";
pstmtSql = conn.prepareStatement(sql); pstmtSql = conn.prepareStatement(sql);
...@@ -3168,19 +3179,25 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -3168,19 +3179,25 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
} }
jobWorkType = distCommon.getDisparams("999999", "JOBWORK_TYPE", conn); jobWorkType = distCommon.getDisparams("999999", "JOBWORK_TYPE", conn);
if (jobWorkType == null) //Changed by Jagruti Shinde Req id:[W16CSUN009]
//if (jobWorkType == null )
if (jobWorkType == null || "NULLFOUND".equalsIgnoreCase(jobWorkType) )
{ {
jobWorkType = ""; jobWorkType = "";
} }
subContractType = distCommon.getDisparams("999999", "SUBCONTRACT_TYPE", conn); subContractType = distCommon.getDisparams("999999", "SUBCONTRACT_TYPE", conn);
if (subContractType == null) //Changed by Jagruti Shinde Req id:[W16CSUN009]
//if (subContractType == null)
if (subContractType == null || "NULLFOUND".equalsIgnoreCase(subContractType))
{ {
subContractType = ""; subContractType = "";
} }
genLotSubctr = distCommon.getDisparams("999999", "GEN_LOT_SUBCTR", conn); genLotSubctr = distCommon.getDisparams("999999", "GEN_LOT_SUBCTR", conn);
if (genLotSubctr == null) //Changed by Jagruti Shinde Req id:[W16CSUN009]
//if (genLotSubctr == null)
if (genLotSubctr == null || "NULLFOUND".equalsIgnoreCase(genLotSubctr))
{ {
genLotSubctr = ""; genLotSubctr = "";
} }
...@@ -3623,6 +3640,11 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -3623,6 +3640,11 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
{ {
// retString = // retString =
// gbf_updlotnowithqcno(as_tranid,ls_itemcode,ls_lineno,ls_lotno_rcp,ls_qcno) // gbf_updlotnowithqcno(as_tranid,ls_itemcode,ls_lineno,ls_lotno_rcp,ls_qcno)
//Changed by Jagruti Shinde Request id:[W16CSUN009][Start]
//Updated to add Autogenerated Lot No in porcpdet
updateLotNo(lotNoRcp,tranId, itemCode, locCode, lineNo, conn) ;
//Changed by Jagruti Shinde Request id:[W16CSUN009][End]
if (retString != null && retString.trim().length() > 0) if (retString != null && retString.trim().length() > 0)
{ {
break; break;
...@@ -3634,6 +3656,11 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -3634,6 +3656,11 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
lotNoRcp = qcNo; lotNoRcp = qcNo;
// retString = // retString =
// gbf_updlotnowithqcno(as_tranid,ls_itemcode,ls_lineno,ls_lotno_rcp,ls_qcno) // gbf_updlotnowithqcno(as_tranid,ls_itemcode,ls_lineno,ls_lotno_rcp,ls_qcno)
//Changed by Jagruti Shinde Request id:[W16CSUN009][Start]
//Updated to add Autogenerated Lot No in porcpdet
updateLotNo(lotNoRcp,tranId, itemCode, locCode, lineNo, conn) ;
//Changed by Jagruti Shinde Request id:[W16CSUN009][End]
if (retString != null && retString.trim().length() > 0) if (retString != null && retString.trim().length() > 0)
{ {
break; break;
...@@ -3641,6 +3668,24 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -3641,6 +3668,24 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
} }
} }
} }
qcRejectedList = new ArrayList();
//Changed by Jagruti Shinde Request id:[W16CSUN009][Start]
if(qcLockDsp.length() != 0 && !qcLockDsp.equalsIgnoreCase(""))
{
HashMap hashMapQc = new HashMap();
hashMapQc.put("site_code", siteCode);
hashMapQc.put("item_code", itemCode);
hashMapQc.put("lot_no", lotNoRcp);
hashMapQc.put("lot_sl", lotSl);
hashMapQc.put("loc_code", locCode);
hashMapQc.put("line_no", lineNo);
qcRejectedList.add(hashMapQc);
System.out.println("qcRejectedList for qcType S && qcReqdSite Y::" + qcRejectedList);
System.out.println("qcRejectedList size for qcType S && qcReqdSite Y::" + qcRejectedList.size());
retString = invHoldGen.generateHoldTrans(qcLockDsp, tranId, "P-RCP", siteCode, qcRejectedList, xtraParams, conn);
qcRejectedList.clear();
}
//Changed by Jagruti Shinde Request id:[W16CSUN009][End]
} }
// ls_qord_no[upperbound(ls_qord_no[]) + 1] = // ls_qord_no[upperbound(ls_qord_no[]) + 1] =
// ls_qcno; // ls_qcno;
...@@ -3736,8 +3781,9 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -3736,8 +3781,9 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
// on // on
// 8/11/12 // 8/11/12
System.out.println("suppCodeMnfr = " + suppCodeMnfr); System.out.println("suppCodeMnfr = " + suppCodeMnfr);
//Changed by Jagruti Shinde Req id:[W16CSUN009]
sql = "SELECT PURC_ORDER, LINE_NO__ORD" //sql="SELECT PURC_ORDER, LINE_NO__ORD"
sql = "SELECT PURC_ORDER, LINE_NO__ORD , LOT_SL "
// + // +
// ", EXPIRY_DATE , LOT_SL , LINE_NO, MFG_DATE"//Changed // ", EXPIRY_DATE , LOT_SL , LINE_NO, MFG_DATE"//Changed
// by manoj td 21/01/2015 // by manoj td 21/01/2015
...@@ -3753,7 +3799,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -3753,7 +3799,8 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
purcOrder = checkNull(rs2.getString("PURC_ORDER")); purcOrder = checkNull(rs2.getString("PURC_ORDER"));
lineNoOrd = checkNull(rs2.getString("LINE_NO__ORD")); lineNoOrd = checkNull(rs2.getString("LINE_NO__ORD"));
// expiryDate = rs2.getTimestamp("EXPIRY_DATE"); // expiryDate = rs2.getTimestamp("EXPIRY_DATE");
// lotSl = checkNull(rs2.getString("LOT_SL")); //Changed by Jagruti Shinde Req id:[W16CSUN009]
lotSl = checkNull(rs2.getString("LOT_SL"));
// rcpLine = // rcpLine =
// checkNull(rs2.getString("LINE_NO")); // checkNull(rs2.getString("LINE_NO"));
// mfgDate = rs2.getTimestamp("MFG_DATE"); // mfgDate = rs2.getTimestamp("MFG_DATE");
...@@ -4035,45 +4082,45 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -4035,45 +4082,45 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmt2 = null; pstmt2 = null;
rs2.close(); rs2.close();
rs2 = null; rs2 = null;
} }
else if (("U".equalsIgnoreCase(apprLocLogic)) && apprLocUdf != null && apprLocUdf.trim().length() > 0) else if (("U".equalsIgnoreCase(apprLocLogic)) && apprLocUdf != null && apprLocUdf.trim().length() > 0)
{ {
System.out.println("ApprLocationUdfinput Before"+ apprLocUdfInput); System.out.println("ApprLocationUdfinput Before"+ apprLocUdfInput);
if(apprLocUdfInput != null && apprLocUdfInput.trim().length() > 0 && !(apprLocUdfInput.equalsIgnoreCase("NULLFOUND"))) if(apprLocUdfInput != null && apprLocUdfInput.trim().length() > 0 && !(apprLocUdfInput.equalsIgnoreCase("NULLFOUND")))
{ {
System.out.println("ApprLocationUdfinput"+ apprLocUdfInput); System.out.println("ApprLocationUdfinput"+ apprLocUdfInput);
String lotNoIssueOut = ""; String lotNoIssueOut = "";
String lotNoIssueOut1 = ""; String lotNoIssueOut1 = "";
String arrStr[] = apprLocUdfInput.split(","); String arrStr[] = apprLocUdfInput.split(",");
int len =arrStr.length; int len =arrStr.length;
for(int i =0;i<len;i++) for(int i =0;i<len;i++)
{ {
System.out.println("arrStr[i]"+arrStr[i]); System.out.println("arrStr[i]"+arrStr[i]);
if(arrStr[i].equals("LOC_CODE__ISS")) if(arrStr[i].equals("LOC_CODE__ISS"))
{ {
lotNoIssueOut1=locCode; lotNoIssueOut1=locCode;
System.out.println("Orignal Value of lOcation Code is"+locCode); System.out.println("Orignal Value of lOcation Code is"+locCode);
System.out.println("Value of lOcation Code is"+lotNoIssueOut1); System.out.println("Value of lOcation Code is"+lotNoIssueOut1);
} }
if(arrStr[i].equals("SITE_CODE")) if(arrStr[i].equals("SITE_CODE"))
{ {
lotNoIssueOut1=siteCode; lotNoIssueOut1=siteCode;
System.out.println("Orignal Value of Site Code is"+siteCode); System.out.println("Orignal Value of Site Code is"+siteCode);
System.out.println("Value of Site Code is"+lotNoIssueOut1); System.out.println("Value of Site Code is"+lotNoIssueOut1);
} }
if(arrStr[i].equals("ITEM_CODE")) if(arrStr[i].equals("ITEM_CODE"))
{ {
lotNoIssueOut1=itemCode; lotNoIssueOut1=itemCode;
System.out.println("Orignal Value of itemCOde Code is"+itemCode); System.out.println("Orignal Value of itemCOde Code is"+itemCode);
System.out.println("Value of itemCOde Code is"+lotNoIssueOut1); System.out.println("Value of itemCOde Code is"+lotNoIssueOut1);
} }
lotNoIssueOut=lotNoIssueOut + "'"+lotNoIssueOut1+"',"; lotNoIssueOut=lotNoIssueOut + "'"+lotNoIssueOut1+"',";
} }
lotNoIssueOut =lotNoIssueOut.substring(0,lotNoIssueOut.length()-1); lotNoIssueOut =lotNoIssueOut.substring(0,lotNoIssueOut.length()-1);
System.out.println("Value is------>" + lotNoIssueOut); System.out.println("Value is------>" + lotNoIssueOut);
sql = "select " + apprLocUdf + "("+lotNoIssueOut + ") from dual"; sql = "select " + apprLocUdf + "("+lotNoIssueOut + ") from dual";
pstmt2 = conn.prepareStatement(sql); pstmt2 = conn.prepareStatement(sql);
rs2 = pstmt2.executeQuery(); rs2 = pstmt2.executeQuery();
...@@ -4085,12 +4132,12 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -4085,12 +4132,12 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmt2 = null; pstmt2 = null;
rs2.close(); rs2.close();
rs2 = null; rs2 = null;
// } // }
System.out.println("qcLotLocCode"+qcLotLocCode); System.out.println("qcLotLocCode"+qcLotLocCode);
} }
else else
{ {
sql = "select " + apprLocUdf + "('" + locCode + "') from dual"; sql = "select " + apprLocUdf + "('" + locCode + "') from dual";
pstmt2 = conn.prepareStatement(sql); pstmt2 = conn.prepareStatement(sql);
rs2 = pstmt2.executeQuery(); rs2 = pstmt2.executeQuery();
...@@ -4106,7 +4153,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -4106,7 +4153,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
} }
} }
// int // int
// rowcount=InsertQcOrderLots(qcNo,tranId,itemCode,unit,lotNoRcp,qcLotLocCode,conn); // rowcount=InsertQcOrderLots(qcNo,tranId,itemCode,unit,lotNoRcp,qcLotLocCode,conn);
...@@ -4227,6 +4274,26 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -4227,6 +4274,26 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
} }
// added by priyanka // added by priyanka
int rowcount = InsertQcOrderLots(qcNo, tranId, itemCode, unit, lotNoRcp, qcLotLocCode, batchNo, spec, today, mfgDate, expiryDate, conn); int rowcount = InsertQcOrderLots(qcNo, tranId, itemCode, unit, lotNoRcp, qcLotLocCode, batchNo, spec, today, mfgDate, expiryDate, conn);
qcRejectedList = new ArrayList();
//Changed by Jagruti Shinde Request id:[W16CSUN009][Start]
if(qcLockDsp.length() != 0 && !qcLockDsp.equalsIgnoreCase(""))
{
HashMap hashMapQc = new HashMap();
hashMapQc.put("site_code", siteCode);
hashMapQc.put("item_code", itemCode);
hashMapQc.put("lot_no", lotNoRcp);
hashMapQc.put("lot_sl", lotSl);
hashMapQc.put("loc_code", locCode);
qcRejectedList.add(hashMapQc);
System.out.println("qcRejectedList for qcType L && qcReqdSite Y::" + qcRejectedList);
System.out.println("qcRejectedList size for qcType L && qcReqdSite Y::" + qcRejectedList.size());
retString = invHoldGen.generateHoldTrans(qcLockDsp, tranId, "P-RCP", siteCode, qcRejectedList, xtraParams, conn);
qcRejectedList.clear();
}
//Changed by Jagruti Shinde Request id:[W16CSUN009][End]
} }
// ls_qord_no[upperbound(ls_qord_no[]) + 1] = // ls_qord_no[upperbound(ls_qord_no[]) + 1] =
// ls_qcno; // ls_qcno;
...@@ -7691,6 +7758,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -7691,6 +7758,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
int updCnt1 = 0; int updCnt1 = 0;
try try
{ {
System.out.println("qcNo is= " + qcNo + "and tranId is =" + tranId +"itemCode is= " + itemCode + "and unit is =" + unit +"lotNoRcp is= " + lotNoRcp + "and qcLotLocCode is =" + qcLotLocCode + "and batchNo is =" + batchNo + "and spec is =" + spec + "and today is =" + today + "and mfgDate is =" + mfgDate + "and expiryDate is =" + expiryDate );
System.out.println("mfgDate========" + mfgDate); System.out.println("mfgDate========" + mfgDate);
sql = "select * from porcpdet where tran_id=? and item_code=? and lot_no=? and (CASE WHEN BATCH_NO IS NULL THEN ' ' ELSE BATCH_NO END) = ? AND (CASE WHEN SPEC_REF IS NULL THEN ' ' ELSE SPEC_REF END) = ? AND (CASE WHEN MFG_DATE IS NULL THEN ? ELSE MFG_DATE END) = ? AND (CASE WHEN EXPIRY_DATE IS NULL THEN ? ELSE EXPIRY_DATE END) = ? "; sql = "select * from porcpdet where tran_id=? and item_code=? and lot_no=? and (CASE WHEN BATCH_NO IS NULL THEN ' ' ELSE BATCH_NO END) = ? AND (CASE WHEN SPEC_REF IS NULL THEN ' ' ELSE SPEC_REF END) = ? AND (CASE WHEN MFG_DATE IS NULL THEN ? ELSE MFG_DATE END) = ? AND (CASE WHEN EXPIRY_DATE IS NULL THEN ? ELSE EXPIRY_DATE END) = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -7768,5 +7836,60 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp ...@@ -7768,5 +7836,60 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
return updCnt1; return updCnt1;
} }
private static String checkNullAndTrim(String input)
{
if (input==null)
{
input="";
}
return input.trim();
}
//Changed by Jagruti Shinde Request id:[W16CSUN009][Start]
private String updateLotNo(String lotNoRcp,String tranId, String itemCode, String locCode,String lineNo, Connection conn) throws Exception
{
System.out.println("lotNoRcp::"+lotNoRcp +"tranId::"+tranId +"itemCode::" +itemCode +"locCode::"+locCode + "lineNo::"+lineNo);
PreparedStatement pstmtUpd = null;
String sql = "";
String retString = "";
int updCnt = 0;
ITMDBAccessEJB itmDBAccessLocal = new ITMDBAccessEJB();
System.out.println("Enter in UpdateLotNo");
try
{
sql = "UPDATE PORCPDET SET LOT_NO = ? WHERE TRAN_ID = ? AND ITEM_CODE = ? AND LOC_CODE = ? AND LINE_NO = ? ";
pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, lotNoRcp);
pstmtUpd.setString(2, tranId);
pstmtUpd.setString(3, itemCode);
pstmtUpd.setString(4, locCode);
pstmtUpd.setString(5, lineNo);
updCnt = pstmtUpd.executeUpdate();
if (updCnt == 0)
{
retString = itmDBAccessLocal.getErrorString("", "DS000NR", "");
}
}
catch(Exception e)
{
System.out.println("Exception in updateLotNo ::::::: " + e);
e.printStackTrace();
throw new Exception(e);
}
finally
{
if(pstmtUpd!=null)
{
pstmtUpd.close();
pstmtUpd = null;
}
}
return retString;
}
//Changed by Jagruti Shinde Request id:[W16CSUN009][End]
} }
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