Commit 841bb168 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@102361 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 47378bf7
...@@ -17,19 +17,19 @@ import ibase.utility.E12GenericUtility; ...@@ -17,19 +17,19 @@ import ibase.utility.E12GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
public class StatusChangeRequest implements Schedule { public class StatusChangeRequest implements Schedule {
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
CommonWmsUtil commonWmsUtility = CommonWmsUtil.getInstance(); CommonWmsUtil commonWmsUtility = CommonWmsUtil.getInstance();
@Override @Override
public String schedulePriority(String arg0) throws Exception { public String schedulePriority(String arg0) throws Exception {
return null; return null;
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public String schedule(HashMap arg0) throws Exception { public String schedule(HashMap arg0) throws Exception {
return null; return null;
} }
...@@ -50,79 +50,105 @@ public class StatusChangeRequest implements Schedule { ...@@ -50,79 +50,105 @@ public class StatusChangeRequest implements Schedule {
//Changed by wasim on 28-01-2016 for using same schedular for stock count activity W15JSUN015 [START] //Changed by wasim on 28-01-2016 for using same schedular for stock count activity W15JSUN015 [START]
StockCountActivty(siteCode); StockCountActivty(siteCode);
//Changed by wasim on 28-01-2016 for using same schedular for stock count activity W15JSUN015 [END] //Changed by wasim on 28-01-2016 for using same schedular for stock count activity W15JSUN015 [END]
} }
catch(Exception e) catch(Exception e)
{ {
System.out.println("Inside catch Main scheduler"); System.out.println("Inside catch Main scheduler");
throw new Exception(e); throw new Exception(e);
} }
return ""; return "";
} }
public String statusChange(String siteCode , String scheduleParamXML, String xtraParams) throws ITMException public String statusChange(String siteCode , String scheduleParamXML, String xtraParams) throws ITMException
{ {
String invStat="", sqlVariable="", qtyPerArt = "",unit="",mfgDate="",expiryDate="",quantity="",noArt="",refId="", lineNo="", String invStat="", sqlVariable="", qtyPerArt = "",unit="",mfgDate="",expiryDate="",quantity="",noArt="",refId="", lineNo="",
palletStatus="", palletNo="", locCode="", lotSl="", lotNo="", itemCode="", lockStat="", lockCode="", tranRefSer=""; palletStatus="", palletNo="", locCode="", lotSl="", lotNo="", itemCode="", lockStat="", lockCode="", tranRefSer="";
String damageLocations="", holdLocations=""; String damageLocations="", holdLocations="",refSerSwms="",rejectedLoc="";//Added by Jagruti Shinde
Timestamp today = new Timestamp(System.currentTimeMillis()); Timestamp today = new Timestamp(System.currentTimeMillis());
ArrayList<HashMap<String, String>> awmsIntrArrList = new ArrayList<HashMap<String, String>>(); ArrayList<HashMap<String, String>> awmsIntrArrList = new ArrayList<HashMap<String, String>>();
ArrayList<String> damageLocArryKList = new ArrayList<String>(); ArrayList<String> damageLocArryKList = new ArrayList<String>();
ArrayList<String> holdLocArryKList = new ArrayList<String>(); ArrayList<String> holdLocArryKList = new ArrayList<String>();
//Changed by Jagruti Shinde Request id:[W16CSUN009]
ArrayList<String> rejectedLocArryList = new ArrayList<String>();
ArrayList<String> refSerArryList = new ArrayList<String>();
String sql="", sqlStr =""; String sql="", sqlStr ="";
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
try { try {
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;
conn.setAutoCommit(false); conn.setAutoCommit(false);
DistCommon distComm = new DistCommon(); DistCommon distComm = new DistCommon();
CommonWmsUtil connUtil = new CommonWmsUtil(); CommonWmsUtil connUtil = new CommonWmsUtil();
System.out.println("Inside Status Change Scheduler!"); System.out.println("Inside Status Change Scheduler!");
invStat = distComm.getDisparams("999999","AWMS_LOC_INVSTAT",conn); invStat = distComm.getDisparams("999999","AWMS_LOC_INVSTAT",conn);
sqlVariable = distComm.getDisparams("999999","HLD_LOCK_STAT_CHANGE",conn); sqlVariable = distComm.getDisparams("999999","HLD_LOCK_STAT_CHANGE",conn);
damageLocations = distComm.getDisparams("999999","DM_LOCKS",conn); damageLocations = distComm.getDisparams("999999","DM_LOCKS",conn);
holdLocations = distComm.getDisparams("999999","HOLD_LOCKS",conn); holdLocations = distComm.getDisparams("999999","HOLD_LOCKS",conn);
//Changed by Jagruti Shinde Request id:[W16CSUN009]
rejectedLoc = distComm.getDisparams("999999","REJECTED_LOCKS",conn);
refSerSwms = distComm.getDisparams("999999","REF_SER_SWMS",conn);
invStat = invStat.replace(",", "','"); invStat = invStat.replace(",", "','");
invStat = "'"+invStat+"'"; invStat = "'"+invStat+"'";
System.out.println("AWMS INVSTAT : "+invStat); System.out.println("AWMS INVSTAT : "+invStat);
sqlVariable = sqlVariable.replace(",", "','"); sqlVariable = sqlVariable.replace(",", "','");
sqlVariable = "'"+sqlVariable+"'"; sqlVariable = "'"+sqlVariable+"'";
System.out.println("SQL Vaibale Value : "+sqlVariable); System.out.println("SQL Vaibale Value : "+sqlVariable);
String[] damageLocArry=damageLocations.split(","); String[] damageLocArry=damageLocations.split(",");
for(String value:damageLocArry){ for(String value:damageLocArry){
damageLocArryKList.add(value); damageLocArryKList.add(value);
} }
System.out.println("DAMAGE LOCATINOS ARRAY LIST : "+damageLocArryKList); System.out.println("DAMAGE LOCATINOS ARRAY LIST : "+damageLocArryKList);
String[] holdLocArry = holdLocations.split(","); String[] holdLocArry = holdLocations.split(",");
for(String value:holdLocArry){ for(String value:holdLocArry){
holdLocArryKList.add(value); holdLocArryKList.add(value);
} }
System.out.println("HOLD LOCATIONS ARRAY LIST : "+holdLocArryKList); System.out.println("HOLD LOCATIONS ARRAY LIST : "+holdLocArryKList);
sql="SELECT REF_SER FROM TRANSETUP WHERE TRAN_WINDOW='w_inv_hold'";
//Changed by Jagruti Shinde Request id:[W16CSUN009][start]
String[] rejectedLocArry=rejectedLoc.split(",");
for(String value:rejectedLocArry){
rejectedLocArryList.add(value);
}
System.out.println("REJECTED LOCATINOS ARRAY LIST : "+rejectedLocArryList);
String[] refSerArry=refSerSwms.split(",");
for(String value:refSerArry){
refSerArryList.add(value);
}
System.out.println("REF SER IN SWMS_TO_AWMS : "+refSerArryList);
/*sql="SELECT REF_SER FROM TRANSETUP WHERE TRAN_WINDOW='w_inv_hold'";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs=pstmt.executeQuery(); rs=pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
tranRefSer=rs.getString("REF_SER"); tranRefSer=rs.getString("REF_SER");
...@@ -136,110 +162,120 @@ public class StatusChangeRequest implements Schedule { ...@@ -136,110 +162,120 @@ public class StatusChangeRequest implements Schedule {
{ {
rs.close(); rs.close();
rs = null; rs = null;
} }*/
//Changed by Jagruti Shinde Request id:[W16CSUN009][End]
sqlStr = "SELECT S.QTY_PER_ART,S.UNIT,S.MFG_DATE,S.EXP_DATE,S.QUANTITY,S.NO_ART,S.LOC_CODE,S.LOT_SL,S.LOT_NO,S.ITEM_CODE,D.LINE_NO," System.out.println("refSerArryList.size()"+refSerArryList.size());
+ "D.TRAN_ID,H.LOCK_CODE " for(int i=0; i< refSerArryList.size(); i++)
+ "FROM STOCK S, INV_HOLD H, INV_HOLD_DET D WHERE S.SITE_CODE=? AND S.INV_STAT IN ("+invStat+") AND H.LOCK_CODE IN("+sqlVariable+") " {
+ "AND H.TRAN_ID= D.TRAN_ID AND D.LOT_NO = S.LOT_NO AND D.LOT_SL=S.LOT_SL AND D.ITEM_CODE = S.ITEM_CODE AND D.LOC_CODE =S.LOC_CODE " refSerSwms = refSerArryList.get(i);
+ "AND D.HOLD_STATUS='H' AND S.HOLD_QTY > 0 AND FN_CHECK_SWMS_TO_AWMS(H.TRAN_ID,'"+tranRefSer+"','S')=0"; sqlStr = "SELECT S.QTY_PER_ART,S.UNIT,S.MFG_DATE,S.EXP_DATE,S.QUANTITY,S.NO_ART,S.LOC_CODE,S.LOT_SL,S.LOT_NO,S.ITEM_CODE,D.LINE_NO,"
+ "D.TRAN_ID,H.LOCK_CODE "
pstmt = conn.prepareStatement(sqlStr); + "FROM STOCK S, INV_HOLD H, INV_HOLD_DET D WHERE S.SITE_CODE=? AND S.INV_STAT IN ("+invStat+") AND H.LOCK_CODE IN("+sqlVariable+") "
pstmt.setString(1, siteCode); + "AND H.TRAN_ID= D.TRAN_ID AND D.LOT_NO = S.LOT_NO AND D.LOT_SL=S.LOT_SL AND D.ITEM_CODE = S.ITEM_CODE AND D.LOC_CODE =S.LOC_CODE "
rs = pstmt.executeQuery(); + "AND D.HOLD_STATUS='H' AND S.HOLD_QTY > 0 AND FN_CHECK_SWMS_TO_AWMS(H.TRAN_ID,'"+refSerSwms+"','S')=0";
while(rs.next()) pstmt = conn.prepareStatement(sqlStr);
{ pstmt.setString(1, siteCode);
qtyPerArt = checkNullAndTrim(rs.getString("QTY_PER_ART")); rs = pstmt.executeQuery();
unit = rs.getString("UNIT");
mfgDate = checkNullAndTrim(rs.getString("MFG_DATE")); while(rs.next())
expiryDate = checkNullAndTrim(rs.getString("EXP_DATE")); {
quantity = rs.getString("QUANTITY"); qtyPerArt = checkNullAndTrim(rs.getString("QTY_PER_ART"));
noArt = checkNullAndTrim(rs.getString("NO_ART")); unit = rs.getString("UNIT");
locCode = rs.getString("LOC_CODE"); mfgDate = checkNullAndTrim(rs.getString("MFG_DATE"));
palletNo = rs.getString("LOC_CODE"); expiryDate = checkNullAndTrim(rs.getString("EXP_DATE"));
lotSl = rs.getString("LOT_SL"); quantity = rs.getString("QUANTITY");
lotNo = rs.getString("LOT_NO"); noArt = checkNullAndTrim(rs.getString("NO_ART"));
itemCode = rs.getString("ITEM_CODE"); locCode = rs.getString("LOC_CODE");
lineNo = checkNullAndTrim(rs.getString("LINE_NO")); palletNo = rs.getString("LOC_CODE");
refId = rs.getString("TRAN_ID"); lotSl = rs.getString("LOT_SL");
lockCode = rs.getString("LOCK_CODE"); lotNo = rs.getString("LOT_NO");
itemCode = rs.getString("ITEM_CODE");
ArrayList<HashMap<String, String>> holdStockList = new ArrayList<HashMap<String,String>>(); lineNo = checkNullAndTrim(rs.getString("LINE_NO"));
refId = rs.getString("TRAN_ID");
HashMap<String, String> damageHoldStockLMap = new HashMap<String, String>(); lockCode = rs.getString("LOCK_CODE");
damageHoldStockLMap.put("PALLET_NO", locCode); ArrayList<HashMap<String, String>> holdStockList = new ArrayList<HashMap<String,String>>();
damageHoldStockLMap.put("SITE_CODE", siteCode);
damageHoldStockLMap.put("LOT_SL", lotSl); HashMap<String, String> damageHoldStockLMap = new HashMap<String, String>();
damageHoldStockLMap.put("LOT_NO", lotNo);
damageHoldStockLMap.put("ITEM_CODE", itemCode); damageHoldStockLMap.put("PALLET_NO", locCode);
damageHoldStockLMap.put("LOCK_CODE", lockCode); damageHoldStockLMap.put("SITE_CODE", siteCode);
damageHoldStockLMap.put("LOT_SL", lotSl);
holdStockList.add(damageHoldStockLMap); damageHoldStockLMap.put("LOT_NO", lotNo);
damageHoldStockLMap.put("ITEM_CODE", itemCode);
palletStatus = getPalletStatus(palletNo, siteCode, holdStockList,lockCode,conn); damageHoldStockLMap.put("LOCK_CODE", lockCode);
System.out.println("palletStatus for AWMS :"+palletStatus);
holdStockList.add(damageHoldStockLMap);
//Changed by wasim on 23-01-2016 to consider other suffix locations aprt from Q [START]
palletStatus = getPalletStatus(palletNo, siteCode, holdStockList,lockCode,conn);
/*palletNo = palletNo.charAt(palletNo.trim().length()-1)=='Q'?palletNo.substring(0,palletNo.trim().length()-1):palletNo; System.out.println("palletStatus for AWMS :"+palletStatus);
//Changed by wasim on 23-01-2016 to consider other suffix locations aprt from Q [START]
/*palletNo = palletNo.charAt(palletNo.trim().length()-1)=='Q'?palletNo.substring(0,palletNo.trim().length()-1):palletNo;
System.out.println("Pallet No After removing Q: "+palletNo);*/ System.out.println("Pallet No After removing Q: "+palletNo);*/
palletNo = (palletNo.charAt(palletNo.trim().length()-1)=='Q') || (palletNo.charAt(palletNo.trim().length()-1)=='M') || palletNo = (palletNo.charAt(palletNo.trim().length()-1)=='Q') || (palletNo.charAt(palletNo.trim().length()-1)=='M') ||
(palletNo.charAt(palletNo.trim().length()-1)=='S') || (palletNo.charAt(palletNo.trim().length()-1)=='B') || (palletNo.charAt(palletNo.trim().length()-1)=='S') || (palletNo.charAt(palletNo.trim().length()-1)=='B') ||
(palletNo.charAt(palletNo.trim().length()-1)=='X') || (palletNo.charAt(palletNo.trim().length()-1)=='U') || (palletNo.charAt(palletNo.trim().length()-1)=='X') || (palletNo.charAt(palletNo.trim().length()-1)=='U') ||
(palletNo.charAt(palletNo.trim().length()-1)=='P') || (palletNo.charAt(palletNo.trim().length()-1)=='R') //Changed by wasim on 02-05-2016 to consider rejected location with suffix R (palletNo.charAt(palletNo.trim().length()-1)=='P') || (palletNo.charAt(palletNo.trim().length()-1)=='R') //Changed by wasim on 02-05-2016 to consider rejected location with suffix R
? palletNo.substring(0,palletNo.trim().length()-1):palletNo; ? palletNo.substring(0,palletNo.trim().length()-1):palletNo;
System.out.println("Pallet No After removing suffix: "+palletNo); System.out.println("Pallet No After removing suffix: "+palletNo);
//Changed by wasim on 23-01-2016 to consider other suffix locations aprt from Q [END] //Changed by wasim on 23-01-2016 to consider other suffix locations aprt from Q [END]
HashMap<String, String> awmsMap = new HashMap<String, String>(); HashMap<String, String> awmsMap = new HashMap<String, String>();
awmsMap.put("ITEM_CODE", itemCode); awmsMap.put("ITEM_CODE", itemCode);
awmsMap.put("REF_ID", refId); awmsMap.put("REF_ID", refId);
awmsMap.put("REF_SER", tranRefSer); awmsMap.put("REF_SER", refSerSwms);
awmsMap.put("TRAN_DATE", checkNullAndTrim(String.valueOf(today))); awmsMap.put("TRAN_DATE", checkNullAndTrim(String.valueOf(today)));
awmsMap.put("QTY_PER_ART", qtyPerArt); awmsMap.put("QTY_PER_ART", qtyPerArt);
awmsMap.put("LOT_NO", lotNo); awmsMap.put("LOT_NO", lotNo);
awmsMap.put("LOT_SL", lotSl); awmsMap.put("LOT_SL", lotSl);
awmsMap.put("QUANTITY", noArt); awmsMap.put("QUANTITY", noArt);
awmsMap.put("TOTAL_QTY", quantity); awmsMap.put("TOTAL_QTY", quantity);
awmsMap.put("PALLET_NO", palletNo); awmsMap.put("PALLET_NO", palletNo);
awmsMap.put("LINE_NO", lineNo); awmsMap.put("LINE_NO", lineNo);
awmsMap.put("UNIT", unit); awmsMap.put("UNIT", unit);
awmsMap.put("FAMILY_GRP", ""); awmsMap.put("FAMILY_GRP", "");
awmsMap.put("TRAN_ID", ""); awmsMap.put("TRAN_ID", "");
awmsMap.put("IN_OUT", "S"); awmsMap.put("IN_OUT", "S");
awmsMap.put("EXP_DATE", expiryDate); awmsMap.put("EXP_DATE", expiryDate);
awmsMap.put("MFG_DATE", mfgDate); awmsMap.put("MFG_DATE", mfgDate);
awmsMap.put("PALLET_STATUS", palletStatus); awmsMap.put("PALLET_STATUS", palletStatus);
awmsMap.put("MSG_STAT", "N"); awmsMap.put("MSG_STAT", "N");
if(damageLocArryKList.contains(lockCode.trim())){ if(damageLocArryKList.contains(lockCode.trim())){
lockStat = "DAMAGE"; lockStat = "DAMAGE";
} }
else if(holdLocArryKList.contains(lockCode.trim())){ else if(holdLocArryKList.contains(lockCode.trim())){
lockStat = "HOLD"; lockStat = "HOLD";
}
//Changed by Jagruti Shinde Request id:[W16CSUN009][start]
else if(rejectedLocArryList.contains(lockCode.trim())){
lockStat = "REJ";
}
//Changed by Jagruti Shinde Request id:[W16CSUN009][End]
awmsMap.put("LOCK_STAT", lockStat);
awmsMap.put("ERR_COD", "");
awmsMap.put("ERR_DESC", "");
awmsMap.put("QC_TYPE", "");
awmsMap.put("TRANS_DT_ACK", "");
awmsMap.put("STRO_PREF", "");
awmsIntrArrList.add(awmsMap);
System.out.println("AWMS HashMap:"+awmsMap);
} }
awmsMap.put("LOCK_STAT", lockStat);
awmsMap.put("ERR_COD", "");
awmsMap.put("ERR_DESC", "");
awmsMap.put("QC_TYPE", "");
awmsMap.put("TRANS_DT_ACK", "");
awmsMap.put("STRO_PREF", "");
awmsIntrArrList.add(awmsMap); System.out.println("AWMS Interface List:"+awmsIntrArrList);
System.out.println("AWMS HashMap:"+awmsMap);
if(awmsIntrArrList.size() > 0)
{
connUtil.updateAwmsInterface(awmsIntrArrList, siteCode, conn);
}
} }
System.out.println("AWMS Interface List:"+awmsIntrArrList);
if(awmsIntrArrList.size() > 0)
{
connUtil.updateAwmsInterface(awmsIntrArrList, siteCode, conn);
}
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -289,7 +325,7 @@ public class StatusChangeRequest implements Schedule { ...@@ -289,7 +325,7 @@ public class StatusChangeRequest implements Schedule {
System.out.println("Error in Status Change : "+e.getMessage()); System.out.println("Error in Status Change : "+e.getMessage());
} }
} }
return null; return null;
} }
...@@ -300,37 +336,37 @@ public class StatusChangeRequest implements Schedule { ...@@ -300,37 +336,37 @@ public class StatusChangeRequest implements Schedule {
ResultSet rs = null; ResultSet rs = null;
ArrayList<HashMap<String, String>> stockList = new ArrayList<HashMap<String,String>>(); ArrayList<HashMap<String, String>> stockList = new ArrayList<HashMap<String,String>>();
String palletStatus = "F"; String palletStatus = "F";
DistCommon distComm = new DistCommon(); DistCommon distComm = new DistCommon();
invStat = distComm.getDisparams("999999","AWMS_LOC_INVSTAT",conn); invStat = distComm.getDisparams("999999","AWMS_LOC_INVSTAT",conn);
invStat = invStat.replace(",", "','"); invStat = invStat.replace(",", "','");
invStat = "'"+invStat+"'"; invStat = "'"+invStat+"'";
System.out.println("AWMS INVSTAT in getPalletStatus: "+invStat); System.out.println("AWMS INVSTAT in getPalletStatus: "+invStat);
System.out.println("Inside getPalletStatus..........."); System.out.println("Inside getPalletStatus...........");
try try
{ {
sqlStr = "SELECT LOC_CODE,ITEM_CODE,LOT_NO,LOT_SL,SITE_CODE FROM STOCK WHERE QUANTITY > 0 " sqlStr = "SELECT LOC_CODE,ITEM_CODE,LOT_NO,LOT_SL,SITE_CODE FROM STOCK WHERE QUANTITY > 0 "
+"AND LOC_CODE = ? AND SITE_CODE = ? AND INV_STAT IN ("+invStat+")"; +"AND LOC_CODE = ? AND SITE_CODE = ? AND INV_STAT IN ("+invStat+")";
pstmt = conn.prepareStatement(sqlStr); pstmt = conn.prepareStatement(sqlStr);
pstmt.setString(1, palletNo); pstmt.setString(1, palletNo);
pstmt.setString(2, siteCode); pstmt.setString(2, siteCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while(rs.next()) while(rs.next())
{ {
HashMap<String,String> stockHashMap = new HashMap<String, String>(); HashMap<String,String> stockHashMap = new HashMap<String, String>();
stockHashMap.put("PALLET_NO", rs.getString("LOC_CODE")); stockHashMap.put("PALLET_NO", rs.getString("LOC_CODE"));
stockHashMap.put("SITE_CODE", rs.getString("SITE_CODE")); stockHashMap.put("SITE_CODE", rs.getString("SITE_CODE"));
stockHashMap.put("LOT_SL", rs.getString("LOT_SL")); stockHashMap.put("LOT_SL", rs.getString("LOT_SL"));
stockHashMap.put("LOT_NO", rs.getString("LOT_NO")); stockHashMap.put("LOT_NO", rs.getString("LOT_NO"));
stockHashMap.put("ITEM_CODE", rs.getString("ITEM_CODE")); stockHashMap.put("ITEM_CODE", rs.getString("ITEM_CODE"));
stockHashMap.put("LOCK_CODE", lockCode); stockHashMap.put("LOCK_CODE", lockCode);
stockList.add(stockHashMap); stockList.add(stockHashMap);
} }
System.out.println("AWMS Stock List:"+stockList); System.out.println("AWMS Stock List:"+stockList);
...@@ -349,7 +385,7 @@ public class StatusChangeRequest implements Schedule { ...@@ -349,7 +385,7 @@ public class StatusChangeRequest implements Schedule {
e.printStackTrace(); e.printStackTrace();
throw e; throw e;
} }
return palletStatus; return palletStatus;
} }
...@@ -368,14 +404,14 @@ public class StatusChangeRequest implements Schedule { ...@@ -368,14 +404,14 @@ public class StatusChangeRequest implements Schedule {
ResultSet rs = null,rsPhyscan = null,rsInterface = null; ResultSet rs = null,rsPhyscan = null,rsInterface = null;
PreparedStatement pstmt = null, pstmtPhyscan = null,pstmtInterface = null; PreparedStatement pstmt = null, pstmtPhyscan = null,pstmtInterface = null;
boolean isError = false; boolean isError = false;
String lineNo = "",itemDescr = "",itemCode = "",unit = "",itemType = "",familyGrp = "", String lineNo = "",itemDescr = "",itemCode = "",unit = "",itemType = "",familyGrp = "",
lotNo = "",lotSl = "",palletNo = "",palletStatus = "",lockStat = "",qcType = "",stroPref = "",analysisClass = "", lotNo = "",lotSl = "",palletNo = "",palletStatus = "",lockStat = "",qcType = "",stroPref = "",analysisClass = "",
errString = "",sql = "",sqlPhyScan = "",tranId = "",invStat = "",sqlInterface = ""; errString = "",sql = "",sqlPhyScan = "",tranId = "",invStat = "",sqlInterface = "";
double quantity = 0, noArtQuot = 0,noArtRem = 0,notArt = 0,totalQuantity = 0, qtyPerArt = 0; double quantity = 0, noArtQuot = 0,noArtRem = 0,notArt = 0,totalQuantity = 0, qtyPerArt = 0;
int count = 0; int count = 0;
Timestamp today = new Timestamp(System.currentTimeMillis()); Timestamp today = new Timestamp(System.currentTimeMillis());
Timestamp expDate = null; Timestamp expDate = null;
Timestamp mfgDate = null; Timestamp mfgDate = null;
...@@ -388,19 +424,19 @@ public class StatusChangeRequest implements Schedule { ...@@ -388,19 +424,19 @@ public class StatusChangeRequest implements Schedule {
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;
conn.setAutoCommit(false); conn.setAutoCommit(false);
invStat = distComm.getDisparams("999999","AWMS_LOC_INVSTAT",conn); invStat = distComm.getDisparams("999999","AWMS_LOC_INVSTAT",conn);
invStat = invStat.replace(",", "','"); invStat = invStat.replace(",", "','");
invStat = "'"+invStat+"'"; invStat = "'"+invStat+"'";
System.out.println("AWMS INVSTAT for Physical count: "+invStat); System.out.println("AWMS INVSTAT for Physical count: "+invStat);
//Changed by wasim on 25-04-2016 to not to consider tran_id which is requeted from metis [START] //Changed by wasim on 25-04-2016 to not to consider tran_id which is requeted from metis [START]
/*sqlInterface = " SELECT COUNT(1) FROM SWMS_TO_AWMS WHERE IN_OUT = ? AND TRAN_DATE = ?"; /*sqlInterface = " SELECT COUNT(1) FROM SWMS_TO_AWMS WHERE IN_OUT = ? AND TRAN_DATE = ?";
pstmtInterface = conn.prepareStatement(sqlInterface); pstmtInterface = conn.prepareStatement(sqlInterface);
pstmtInterface.setString(1, "B"); pstmtInterface.setString(1, "B");
pstmtInterface.setTimestamp(2, getCurrtDate()); pstmtInterface.setTimestamp(2, getCurrtDate());
rsInterface = pstmtInterface.executeQuery(); rsInterface = pstmtInterface.executeQuery();
if(rsInterface.next()) if(rsInterface.next())
{ {
count = rsInterface.getInt(1); count = rsInterface.getInt(1);
...@@ -415,31 +451,31 @@ public class StatusChangeRequest implements Schedule { ...@@ -415,31 +451,31 @@ public class StatusChangeRequest implements Schedule {
rsInterface.close(); rsInterface.close();
rsInterface=null; rsInterface=null;
} }
System.out.println("Count from swms_to_amws for in_out B="+count); System.out.println("Count from swms_to_amws for in_out B="+count);
if(count == 0) if(count == 0)
{ */ { */
//Changed by wasim on 25-04-2016 to not to consider tran_id which is requeted from metis [END] //Changed by wasim on 25-04-2016 to not to consider tran_id which is requeted from metis [END]
//Changed by wasim on 25-04-2016 to not to consider tran_id which is requeted from metis [START] //Changed by wasim on 25-04-2016 to not to consider tran_id which is requeted from metis [START]
//sql = " SELECT TRAN_ID FROM PHYSCAN WHERE SITE_CODE = ? AND TRAN_DATE = ?"; //sql = " SELECT TRAN_ID FROM PHYSCAN WHERE SITE_CODE = ? AND TRAN_DATE = ?";
sql = "SELECT P.TRAN_ID FROM PHYSCAN P WHERE P.SITE_CODE = ? AND P.TRAN_DATE = ? " sql = "SELECT P.TRAN_ID FROM PHYSCAN P WHERE P.SITE_CODE = ? AND P.TRAN_DATE = ? "
+ "AND P.TRAN_ID NOT IN (SELECT REF_ID FROM SWMS_TO_AWMS WHERE REF_ID = P.TRAN_ID AND REF_SER = 'PSCAN')"; + "AND P.TRAN_ID NOT IN (SELECT REF_ID FROM SWMS_TO_AWMS WHERE REF_ID = P.TRAN_ID AND REF_SER = 'PSCAN')";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginSiteCode); pstmt.setString(1, loginSiteCode);
pstmt.setTimestamp(2, getCurrtDate()); pstmt.setTimestamp(2, getCurrtDate());
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while(rs.next()) while(rs.next())
{
tranId = checkNullAndTrim(rs.getString("TRAN_ID"));
System.out.println("Physical Scan Tran Id["+tranId+"]");
if(tranId != null && tranId.length() > 0)
{ {
tranId = checkNullAndTrim(rs.getString("TRAN_ID")); /*sqlPhyScan = " SELECT D.LINE_NO,S.ITEM_CODE,I.DESCR,I.UNIT,I.ITEM_TYPE,S.LOT_NO,S.LOT_SL,S.LOC_CODE,P.SITE_CODE,S.QUANTITY,S.NO_ART,S.QTY_PER_ART "
System.out.println("Physical Scan Tran Id["+tranId+"]");
if(tranId != null && tranId.length() > 0)
{
/*sqlPhyScan = " SELECT D.LINE_NO,S.ITEM_CODE,I.DESCR,I.UNIT,I.ITEM_TYPE,S.LOT_NO,S.LOT_SL,S.LOC_CODE,P.SITE_CODE,S.QUANTITY,S.NO_ART,S.QTY_PER_ART "
+" FROM PHYSCAN P,PHYSCANDET D,STOCK S,ITEM I" +" FROM PHYSCAN P,PHYSCANDET D,STOCK S,ITEM I"
+" WHERE P.TRAN_ID = D.TRAN_ID AND P.TRAN_ID = ?" +" WHERE P.TRAN_ID = D.TRAN_ID AND P.TRAN_ID = ?"
+" AND S.ITEM_CODE = D.ITEM_CODE" +" AND S.ITEM_CODE = D.ITEM_CODE"
...@@ -448,110 +484,110 @@ public class StatusChangeRequest implements Schedule { ...@@ -448,110 +484,110 @@ public class StatusChangeRequest implements Schedule {
+" AND S.LOT_SL = D.LOT_SL" +" AND S.LOT_SL = D.LOT_SL"
+" AND S.SITE_CODE = D.SITE_CODE" +" AND S.SITE_CODE = D.SITE_CODE"
+" AND S.LOC_CODE = D.LOC_CODE";*/ +" AND S.LOC_CODE = D.LOC_CODE";*/
sqlPhyScan = " SELECT D.LINE_NO,D.ITEM_CODE,D.LOT_NO,D.LOT_SL,D.LOC_CODE,D.QUANTITY" sqlPhyScan = " SELECT D.LINE_NO,D.ITEM_CODE,D.LOT_NO,D.LOT_SL,D.LOC_CODE,D.QUANTITY"
+" FROM PHYSCAN P,PHYSCANDET D,LOCATION L WHERE P.TRAN_ID = D.TRAN_ID AND P.TRAN_ID = ?" +" FROM PHYSCAN P,PHYSCANDET D,LOCATION L WHERE P.TRAN_ID = D.TRAN_ID AND P.TRAN_ID = ?"
+" AND P.TRAN_ID NOT IN (SELECT REF_ID FROM SWMS_TO_AWMS WHERE REF_ID = ? AND REF_SER = 'PSCAN')" +" AND P.TRAN_ID NOT IN (SELECT REF_ID FROM SWMS_TO_AWMS WHERE REF_ID = ? AND REF_SER = 'PSCAN')"
+" AND L.LOC_CODE = D.LOC_CODE AND L.INV_STAT IN ("+invStat+")"; +" AND L.LOC_CODE = D.LOC_CODE AND L.INV_STAT IN ("+invStat+")";
pstmtPhyscan = conn.prepareStatement(sqlPhyScan); pstmtPhyscan = conn.prepareStatement(sqlPhyScan);
pstmtPhyscan.setString(1, tranId); pstmtPhyscan.setString(1, tranId);
pstmtPhyscan.setString(2, tranId); pstmtPhyscan.setString(2, tranId);
rsPhyscan = pstmtPhyscan.executeQuery(); rsPhyscan = pstmtPhyscan.executeQuery();
while(rsPhyscan.next()) while(rsPhyscan.next())
{ {
lineNo = checkNullAndTrim(rsPhyscan.getString("LINE_NO")); lineNo = checkNullAndTrim(rsPhyscan.getString("LINE_NO"));
itemCode = checkNull(rsPhyscan.getString("ITEM_CODE")); itemCode = checkNull(rsPhyscan.getString("ITEM_CODE"));
//itemDescr = checkNullAndTrim(rs.getString("DESCR")); //itemDescr = checkNullAndTrim(rs.getString("DESCR"));
//unit = checkNullAndTrim(rs.getString("UNIT")); //unit = checkNullAndTrim(rs.getString("UNIT"));
//itemType = checkNullAndTrim(rs.getString("ITEM_TYPE")); //itemType = checkNullAndTrim(rs.getString("ITEM_TYPE"));
lotNo = checkNull(rsPhyscan.getString("LOT_NO")); lotNo = checkNull(rsPhyscan.getString("LOT_NO"));
lotSl = checkNull(rsPhyscan.getString("LOT_SL")); lotSl = checkNull(rsPhyscan.getString("LOT_SL"));
palletNo = checkNull(rsPhyscan.getString("LOC_CODE")); palletNo = checkNull(rsPhyscan.getString("LOC_CODE"));
//quantity = rs.getDouble("QUANTITY"); //quantity = rs.getDouble("QUANTITY");
//notArt = rs.getDouble("NO_ART"); //notArt = rs.getDouble("NO_ART");
//qtyPerArt = rs.getDouble("QTY_PER_ART"); //qtyPerArt = rs.getDouble("QTY_PER_ART");
//analysisClass = checkNullAndTrim(rs.getString("ANALYSIS_CLASS")); //analysisClass = checkNullAndTrim(rs.getString("ANALYSIS_CLASS"));
System.out.println("Pallet No before removing suffix: "+palletNo); System.out.println("Pallet No before removing suffix: "+palletNo);
palletNo = (palletNo.charAt(palletNo.trim().length()-1)=='Q') || (palletNo.charAt(palletNo.trim().length()-1)=='M') || palletNo = (palletNo.charAt(palletNo.trim().length()-1)=='Q') || (palletNo.charAt(palletNo.trim().length()-1)=='M') ||
(palletNo.charAt(palletNo.trim().length()-1)=='S') || (palletNo.charAt(palletNo.trim().length()-1)=='B') || (palletNo.charAt(palletNo.trim().length()-1)=='S') || (palletNo.charAt(palletNo.trim().length()-1)=='B') ||
(palletNo.charAt(palletNo.trim().length()-1)=='X') || (palletNo.charAt(palletNo.trim().length()-1)=='U') || (palletNo.charAt(palletNo.trim().length()-1)=='X') || (palletNo.charAt(palletNo.trim().length()-1)=='U') ||
(palletNo.charAt(palletNo.trim().length()-1)=='P') || (palletNo.charAt(palletNo.trim().length()-1)=='R')//Changed by wasim on 02-05-016 to consider R location for considering damage location (palletNo.charAt(palletNo.trim().length()-1)=='P') || (palletNo.charAt(palletNo.trim().length()-1)=='R')//Changed by wasim on 02-05-016 to consider R location for considering damage location
? palletNo.substring(0,palletNo.trim().length()-1):palletNo; ? palletNo.substring(0,palletNo.trim().length()-1):palletNo;
System.out.println("Pallet No After removing suffix: "+palletNo); System.out.println("Pallet No After removing suffix: "+palletNo);
HashMap<String,String> interfaceHmap = new HashMap<String,String>(); HashMap<String,String> interfaceHmap = new HashMap<String,String>();
interfaceHmap.put("TRAN_ID", ""); interfaceHmap.put("TRAN_ID", "");
interfaceHmap.put("ITEM_CODE", itemCode); interfaceHmap.put("ITEM_CODE", itemCode);
interfaceHmap.put("DESCR", ""); interfaceHmap.put("DESCR", "");
interfaceHmap.put("UNIT", ""); interfaceHmap.put("UNIT", "");
interfaceHmap.put("ITEM_TYPE", ""); interfaceHmap.put("ITEM_TYPE", "");
interfaceHmap.put("FAMILY_GRP", ""); interfaceHmap.put("FAMILY_GRP", "");
interfaceHmap.put("IN_OUT", "B"); interfaceHmap.put("IN_OUT", "B");
interfaceHmap.put("REF_SER", "PSCAN"); interfaceHmap.put("REF_SER", "PSCAN");
interfaceHmap.put("REF_ID", tranId); interfaceHmap.put("REF_ID", tranId);
interfaceHmap.put("TRAN_DATE", checkNullAndTrim(String.valueOf(getCurrtDate()))); interfaceHmap.put("TRAN_DATE", checkNullAndTrim(String.valueOf(getCurrtDate())));
interfaceHmap.put("LOT_NO", lotNo); interfaceHmap.put("LOT_NO", lotNo);
interfaceHmap.put("LOT_SL", lotSl); interfaceHmap.put("LOT_SL", lotSl);
interfaceHmap.put("QUANTITY", ""); interfaceHmap.put("QUANTITY", "");
interfaceHmap.put("QTY_PER_ART", ""); interfaceHmap.put("QTY_PER_ART", "");
interfaceHmap.put("TOTAL_QTY", ""); interfaceHmap.put("TOTAL_QTY", "");
interfaceHmap.put("EXP_DATE", ""); interfaceHmap.put("EXP_DATE", "");
interfaceHmap.put("MFG_DATE", ""); interfaceHmap.put("MFG_DATE", "");
interfaceHmap.put("PALLET_NO", palletNo); interfaceHmap.put("PALLET_NO", palletNo);
interfaceHmap.put("MSG_STAT", "N"); interfaceHmap.put("MSG_STAT", "N");
interfaceHmap.put("PALLET_STATUS", ""); interfaceHmap.put("PALLET_STATUS", "");
interfaceHmap.put("LOCK_STAT", ""); interfaceHmap.put("LOCK_STAT", "");
interfaceHmap.put("ERR_COD", ""); interfaceHmap.put("ERR_COD", "");
interfaceHmap.put("ERR_DESC", ""); interfaceHmap.put("ERR_DESC", "");
interfaceHmap.put("QC_TYPE", ""); interfaceHmap.put("QC_TYPE", "");
interfaceHmap.put("TRANS_DT_ACK", ""); interfaceHmap.put("TRANS_DT_ACK", "");
interfaceHmap.put("STRO_PREF", ""); interfaceHmap.put("STRO_PREF", "");
interfaceHmap.put("LINE_NO", lineNo); interfaceHmap.put("LINE_NO", lineNo);
interfaceArrList.add(interfaceHmap); interfaceArrList.add(interfaceHmap);
} }
if(rsPhyscan != null) if(rsPhyscan != null)
{ {
rsPhyscan.close(); rsPhyscan.close();
rsPhyscan=null; rsPhyscan=null;
} }
if(pstmtPhyscan != null) if(pstmtPhyscan != null)
{ {
pstmtPhyscan.close(); pstmtPhyscan.close();
pstmtPhyscan=null; pstmtPhyscan=null;
}
} }
} }
if(rs != null) }
{ if(rs != null)
rs.close(); {
rs=null; rs.close();
} rs=null;
if(pstmt != null) }
{ if(pstmt != null)
pstmt.close(); {
pstmt=null; pstmt.close();
} pstmt=null;
}
System.out.println("Going to insert in host_to_wms and swms_to_awms");
System.out.println("ArrayList size="+interfaceArrList.size()); System.out.println("Going to insert in host_to_wms and swms_to_awms");
System.out.println("ArrayList size="+interfaceArrList.size());
if(interfaceArrList.size() > 0)
{ if(interfaceArrList.size() > 0)
commonWmsUtility.updateAwmsInterface(interfaceArrList,loginSiteCode,conn); {
} commonWmsUtility.updateAwmsInterface(interfaceArrList,loginSiteCode,conn);
//Changed by wasim on 25-04-2016 to not to consider tran_id which is requeted from metis [START] }
//Changed by wasim on 25-04-2016 to not to consider tran_id which is requeted from metis [START]
/*} /*}
else else
{ {
System.out.println("***************Stock Count Activty is already already runn today************"); System.out.println("***************Stock Count Activty is already already runn today************");
}*/ }*/
//Changed by wasim on 25-04-2016 to not to consider tran_id which is requeted from metis [END] //Changed by wasim on 25-04-2016 to not to consider tran_id which is requeted from metis [END]
//Changed by wasim on 19-02-2016 for updating last_phyc_date in stock W15JSUN015 [START] //Changed by wasim on 19-02-2016 for updating last_phyc_date in stock W15JSUN015 [START]
updatePhyscanDate(conn); updatePhyscanDate(conn);
//Changed by wasim on 19-02-2016 for updating last_phyc_date in stock W15JSUN015 [END] //Changed by wasim on 19-02-2016 for updating last_phyc_date in stock W15JSUN015 [END]
...@@ -620,7 +656,7 @@ public class StatusChangeRequest implements Schedule { ...@@ -620,7 +656,7 @@ public class StatusChangeRequest implements Schedule {
System.out.println("Final return string" + errString); System.out.println("Final return string" + errString);
return errString; return errString;
} }
private java.sql.Timestamp getCurrtDate() throws RemoteException,ITMException private java.sql.Timestamp getCurrtDate() throws RemoteException,ITMException
{ {
java.sql.Timestamp currDate = null; java.sql.Timestamp currDate = null;
...@@ -640,7 +676,7 @@ public class StatusChangeRequest implements Schedule { ...@@ -640,7 +676,7 @@ public class StatusChangeRequest implements Schedule {
return (currDate); return (currDate);
} }
//Changed by wasim on 28-01-2016 for using same schedular for stock count activity W15JSUN015 [END] //Changed by wasim on 28-01-2016 for using same schedular for stock count activity W15JSUN015 [END]
//Changed by wasim on 19-02-2016 to update the last_phy_scan date after acknowledgment received [START] //Changed by wasim on 19-02-2016 to update the last_phy_scan date after acknowledgment received [START]
public void updatePhyscanDate(Connection conn) throws RemoteException,ITMException public void updatePhyscanDate(Connection conn) throws RemoteException,ITMException
{ {
...@@ -655,33 +691,33 @@ public class StatusChangeRequest implements Schedule { ...@@ -655,33 +691,33 @@ public class StatusChangeRequest implements Schedule {
try try
{ {
System.out.println("inside updatePhyscanDate"); System.out.println("inside updatePhyscanDate");
/*ConnDriver connDriver = new ConnDriver(); /*ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;
conn.setAutoCommit(false);*/ conn.setAutoCommit(false);*/
sql = "SELECT REF_ID,LINE_NO,TOTAL_QTY,QUANTITY FROM WMS_TO_HOST WHERE IN_OUT = 'B' AND REF_ID IN " sql = "SELECT REF_ID,LINE_NO,TOTAL_QTY,QUANTITY FROM WMS_TO_HOST WHERE IN_OUT = 'B' AND REF_ID IN "
+ "(SELECT REF_ID FROM SWMS_TO_AWMS WHERE SCHEDULE_STATUS = 'N')"; + "(SELECT REF_ID FROM SWMS_TO_AWMS WHERE SCHEDULE_STATUS = 'N')";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while(rs.next()) while(rs.next())
{ {
refId = checkNullAndTrim(rs.getString("REF_ID")); refId = checkNullAndTrim(rs.getString("REF_ID"));
lineNo = checkNullAndTrim(rs.getString("LINE_NO")); lineNo = checkNullAndTrim(rs.getString("LINE_NO"));
qtyPhysical = rs.getDouble("TOTAL_QTY"); qtyPhysical = rs.getDouble("TOTAL_QTY");
phyInput = rs.getDouble("QUANTITY"); phyInput = rs.getDouble("QUANTITY");
System.out.println("REF_ID["+refId+"]LINE_NO["+lineNo+"]QUANTITY["+phyInput+"]TOTAL_QTY["+qtyPhysical+"]TRANS_DT_ACK["+tranDateAck+"]"); System.out.println("REF_ID["+refId+"]LINE_NO["+lineNo+"]QUANTITY["+phyInput+"]TOTAL_QTY["+qtyPhysical+"]TRANS_DT_ACK["+tranDateAck+"]");
sqlPhyscan = " SELECT D.ITEM_CODE,D.LOT_NO,D.LOT_SL,D.LOC_CODE,D.SITE_CODE FROM PHYSCAN P,PHYSCANDET D WHERE " sqlPhyscan = " SELECT D.ITEM_CODE,D.LOT_NO,D.LOT_SL,D.LOC_CODE,D.SITE_CODE FROM PHYSCAN P,PHYSCANDET D WHERE "
+ " P.TRAN_ID = D.TRAN_ID AND D.TRAN_ID = ? AND D.LINE_NO = ?"; + " P.TRAN_ID = D.TRAN_ID AND D.TRAN_ID = ? AND D.LINE_NO = ?";
pstmtPhyscan = conn.prepareStatement(sqlPhyscan); pstmtPhyscan = conn.prepareStatement(sqlPhyscan);
pstmtPhyscan.setString(1, refId); pstmtPhyscan.setString(1, refId);
pstmtPhyscan.setString(2, lineNo); pstmtPhyscan.setString(2, lineNo);
rsPhyscan = pstmtPhyscan.executeQuery(); rsPhyscan = pstmtPhyscan.executeQuery();
if(rsPhyscan.next()) if(rsPhyscan.next())
{ {
itemCode = checkNull(rsPhyscan.getString("ITEM_CODE")); itemCode = checkNull(rsPhyscan.getString("ITEM_CODE"));
...@@ -689,7 +725,7 @@ public class StatusChangeRequest implements Schedule { ...@@ -689,7 +725,7 @@ public class StatusChangeRequest implements Schedule {
lotSl = checkNull(rsPhyscan.getString("LOT_SL")); lotSl = checkNull(rsPhyscan.getString("LOT_SL"));
locCode = checkNull(rsPhyscan.getString("LOC_CODE")); locCode = checkNull(rsPhyscan.getString("LOC_CODE"));
siteCode = checkNull(rsPhyscan.getString("SITE_CODE")); siteCode = checkNull(rsPhyscan.getString("SITE_CODE"));
sqlUpdate = "UPDATE STOCK SET LAST_PHYC_DATE = ? WHERE ITEM_CODE = ? AND LOT_NO = ? AND LOT_SL = ? AND LOC_CODE = ? AND SITE_CODE = ?"; sqlUpdate = "UPDATE STOCK SET LAST_PHYC_DATE = ? WHERE ITEM_CODE = ? AND LOT_NO = ? AND LOT_SL = ? AND LOC_CODE = ? AND SITE_CODE = ?";
pstmtUpdate = conn.prepareStatement(sqlUpdate); pstmtUpdate = conn.prepareStatement(sqlUpdate);
pstmtUpdate.setTimestamp(1, getCurrtDate()); pstmtUpdate.setTimestamp(1, getCurrtDate());
...@@ -698,7 +734,7 @@ public class StatusChangeRequest implements Schedule { ...@@ -698,7 +734,7 @@ public class StatusChangeRequest implements Schedule {
pstmtUpdate.setString(4, lotSl); pstmtUpdate.setString(4, lotSl);
pstmtUpdate.setString(5, locCode); pstmtUpdate.setString(5, locCode);
pstmtUpdate.setString(6, siteCode); pstmtUpdate.setString(6, siteCode);
updCnt = pstmtUpdate.executeUpdate(); updCnt = pstmtUpdate.executeUpdate();
System.out.println("Updated cnt="+updCnt); System.out.println("Updated cnt="+updCnt);
if(pstmtUpdate != null) if(pstmtUpdate != null)
...@@ -706,14 +742,14 @@ public class StatusChangeRequest implements Schedule { ...@@ -706,14 +742,14 @@ public class StatusChangeRequest implements Schedule {
pstmtUpdate.close(); pstmtUpdate.close();
pstmtUpdate=null; pstmtUpdate=null;
} }
sqlUpdate = "UPDATE PHYSCANDET SET QTY_PHYSICAL = ?,PHY_INPUT = ? WHERE TRAN_ID = ? AND LINE_NO = ?"; sqlUpdate = "UPDATE PHYSCANDET SET QTY_PHYSICAL = ?,PHY_INPUT = ? WHERE TRAN_ID = ? AND LINE_NO = ?";
pstmtUpdate = conn.prepareStatement(sqlUpdate); pstmtUpdate = conn.prepareStatement(sqlUpdate);
pstmtUpdate.setDouble(1, qtyPhysical); pstmtUpdate.setDouble(1, qtyPhysical);
pstmtUpdate.setDouble(2, phyInput); pstmtUpdate.setDouble(2, phyInput);
pstmtUpdate.setString(3, refId); pstmtUpdate.setString(3, refId);
pstmtUpdate.setString(4, lineNo); pstmtUpdate.setString(4, lineNo);
updCnt = pstmtUpdate.executeUpdate(); updCnt = pstmtUpdate.executeUpdate();
System.out.println("Updated cnt="+updCnt); System.out.println("Updated cnt="+updCnt);
if(pstmtUpdate != null) if(pstmtUpdate != null)
...@@ -721,7 +757,7 @@ public class StatusChangeRequest implements Schedule { ...@@ -721,7 +757,7 @@ public class StatusChangeRequest implements Schedule {
pstmtUpdate.close(); pstmtUpdate.close();
pstmtUpdate=null; pstmtUpdate=null;
} }
sqlUpdate = "UPDATE SWMS_TO_AWMS SET SCHEDULE_STATUS = 'Y' WHERE REF_ID = ? AND LINE_NO = ?"; sqlUpdate = "UPDATE SWMS_TO_AWMS SET SCHEDULE_STATUS = 'Y' WHERE REF_ID = ? AND LINE_NO = ?";
pstmtUpdate = conn.prepareStatement(sqlUpdate); pstmtUpdate = conn.prepareStatement(sqlUpdate);
pstmtUpdate.setString(1, refId); pstmtUpdate.setString(1, refId);
...@@ -733,7 +769,7 @@ public class StatusChangeRequest implements Schedule { ...@@ -733,7 +769,7 @@ public class StatusChangeRequest implements Schedule {
pstmtUpdate.close(); pstmtUpdate.close();
pstmtUpdate=null; pstmtUpdate=null;
} }
} }
if(pstmtPhyscan != null) if(pstmtPhyscan != 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