Commit 97e0d917 authored by wansari's avatar wansari

W15GSUN003 updated source for in_out column value P.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99484 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 8ec2ba76
......@@ -101,11 +101,12 @@ public class ScheduleAWMSInOutTasks implements Schedule
{
Connection conn = null;
ResultSet rs = null,rsInf = null;
PreparedStatement pstmt = null, interfacePstmt = null;
String errString = "", sql = "",inOut = "",refSer = "",refId = "",palletRej = "",sqlInf = "",tranId = "";
PreparedStatement pstmt = null, interfacePstmt = null,pstmtUpdate = null;
String errString = "", sql = "",inOut = "",refSer = "",refId = "",palletRej = "",sqlInf = "",tranId = "",sqlUpdate = "";
boolean isCountPllt = false;
int flag,countError;
String lineNo = "";
int caseCount = 0;
try
{
......@@ -115,7 +116,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
conn.setAutoCommit(false);
//sql = "SELECT DISTINCT REF_ID,REF_SER,IN_OUT,MSG_STAT FROM INTERFACE WHERE SYSDATE > TRANS_DT_ACK";
sql = "SELECT DISTINCT REF_ID,REF_SER FROM WMS_TO_HOST WHERE REF_ID IN "
sql = "SELECT DISTINCT REF_ID,REF_SER,IN_OUT FROM WMS_TO_HOST WHERE REF_ID IN "
+ "(SELECT REF_ID FROM SWMS_TO_AWMS WHERE SCHEDULE_STATUS = 'N')";//Changed by wasim on 26-11-15 to schedule_status is null to N
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
......@@ -125,17 +126,22 @@ public class ScheduleAWMSInOutTasks implements Schedule
{
refSer = checkNullAndTrim(rs.getString("REF_SER"));
refId = checkNullAndTrim(rs.getString("REF_ID"));
inOut = checkNullAndTrim(rs.getString("IN_OUT"));
System.out.println("Schedullar going to schedule for refId["+refId+"]["+refSer+"]");
System.out.println("Schedullar going to schedule for refId["+refId+"]["+refSer+"]["+inOut+"]");
HashMap interfaceHmap = new HashMap();
interfaceHmap.put("REF_ID", refId);
interfaceHmap.put("REF_SER", refSer);
interfaceHmap.put("IN_OUT", inOut);
countError = 0;
flag = 0;
sqlInf = "SELECT COUNT(*) AS COUNT FROM WMS_TO_HOST WHERE REF_ID = ? AND MSG_STAT = 'E' "
+ "AND LINE_NO IN (SELECT LINE_NO FROM SWMS_TO_AWMS WHERE REF_ID = ? AND SCHEDULE_STATUS = 'N')";//Changed by wasim on 26-11-15 to schedule_status is null to N
//Changed by wasim on 21-12-2015 for ref ser PZ not to go on hold if in_out P [start]
/*sqlInf = "SELECT COUNT(*) AS COUNT FROM WMS_TO_HOST WHERE REF_ID = ? AND MSG_STAT = 'E' "
+ "AND LINE_NO IN (SELECT LINE_NO FROM SWMS_TO_AWMS WHERE REF_ID = ? AND SCHEDULE_STATUS = 'N')";//Changed by wasim on 26-11-15 to schedule_status is null to N*/
sqlInf = "SELECT COUNT(*) AS COUNT FROM WMS_TO_HOST WHERE REF_ID = ? AND IN_OUT = 'P' "
+ "AND LINE_NO IN (SELECT LINE_NO FROM SWMS_TO_AWMS WHERE REF_ID = ? AND SCHEDULE_STATUS = 'N')";
//Changed by wasim on 21-12-2015 for ref ser PZ not to go on hold if in_out P [end]
interfacePstmt = conn.prepareStatement(sqlInf);
interfacePstmt.setString(1, refId);
interfacePstmt.setString(2, refId);
......@@ -149,9 +155,31 @@ public class ScheduleAWMSInOutTasks implements Schedule
if(countError > 0)
{
System.out.println("Going for inventory hold");
if(!"PZ".equalsIgnoreCase(refSer))
{
System.out.println("Schedullar going to inventory hold refId["+refId+"]["+refSer+"]["+inOut+"]");
errString = inventoryHold(interfaceHmap, siteCode, xtraParams, conn);
//flag = 1;
}
else
{
sqlUpdate = " UPDATE SWMS_TO_AWMS SET SCHEDULE_STATUS = 'Y' WHERE REF_ID = ? AND "
+" LINE_NO IN (SELECT LINE_NO FROM WMS_TO_HOST WHERE IN_OUT = 'P' AND REF_ID = ?)";
pstmtUpdate = conn.prepareStatement(sqlUpdate);
pstmtUpdate.setString(1, refId);
pstmtUpdate.setString(2, refId);
caseCount = pstmtUpdate.executeUpdate();
System.out.println("Updated ="+caseCount);
pstmtUpdate.close();pstmtUpdate = null;
sqlUpdate = "UPDATE PALLET_HDR SET STATUS = 'R' WHERE TRAN_ID = ?";
pstmtUpdate = conn.prepareStatement(sqlUpdate);
pstmtUpdate.setString(1, refId);
caseCount = pstmtUpdate.executeUpdate();
System.out.println("Updated ="+caseCount);
pstmtUpdate.close();pstmtUpdate = null;
conn.commit();
}
}
System.out.println("Going for stock transfer refId["+refId+"]refSer["+refSer+"]inOut["+inOut+"]");
......@@ -194,6 +222,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
}
if(pstmt != null){pstmt.close();pstmt=null;}
if(interfacePstmt != null){interfacePstmt.close();interfacePstmt=null;}
if(pstmtUpdate != null){pstmtUpdate.close();pstmtUpdate=null;}
if(rs != null){rs.close();rs=null;}
if(rsInf != null){rsInf.close();rsInf=null;}
}
......@@ -321,8 +350,9 @@ public class ScheduleAWMSInOutTasks implements Schedule
pstmtDet = conn.prepareStatement(insertSql);
sqlInterface = "SELECT DISTINCT (LINE_NO),PALLET_NO FROM WMS_TO_HOST WHERE REF_ID = ? AND MSG_STAT != 'E'"
+ " AND LINE_NO IN (SELECT LINE_NO FROM SWMS_TO_AWMS WHERE REF_ID = ? AND SCHEDULE_STATUS = 'N')";//Changed by wasim on 26-11-15 to schedule_status is null to N
sqlInterface = "SELECT DISTINCT (LINE_NO),PALLET_NO FROM WMS_TO_HOST WHERE REF_ID = ? "//Changed by wasim on 21-12-15 to not consider msg_stat column
+ " AND LINE_NO IN (SELECT LINE_NO FROM SWMS_TO_AWMS WHERE REF_ID = ? AND SCHEDULE_STATUS = 'N')"//Changed by wasim on 26-11-15 to schedule_status is null to N
+ " AND IN_OUT != 'P'"; //Changed by wasim on 14-12-2015 for not to accept in_out parameter as P
pstmtInterface = conn.prepareStatement(sqlInterface);
pstmtInterface.setString(1, refId);
pstmtInterface.setString(2, refId);
......@@ -811,7 +841,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
}
pstmt = conn.prepareStatement(sql);
sqlInterface = "SELECT LINE_NO FROM WMS_TO_HOST WHERE REF_ID = ? AND MSG_STAT = 'E'"
sqlInterface = "SELECT LINE_NO FROM WMS_TO_HOST WHERE REF_ID = ? AND IN_OUT = 'P'" //Changed by wasim on 21-12-15 to change msg_stat to in_out = p
+ " AND LINE_NO IN (SELECT LINE_NO FROM SWMS_TO_AWMS WHERE REF_ID = ? AND SCHEDULE_STATUS = 'N')";//Changed by wasim on 26-11-15 to schedule_status is null to N
pstmtInterface = conn.prepareStatement(sqlInterface);
pstmtInterface.setString(1, refId);
......@@ -906,7 +936,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
//if("PR".equalsIgnoreCase(refSer))//Changed by wasim on 19-11-2015 to add new ref ser PRS
if("PR".equalsIgnoreCase(refSer) || "PRS".equalsIgnoreCase(refSer))
{
sqlUpdate = "UPDATE PALLET_REQ_DET SET STATUS = 'H' WHERE TRAN_ID = ? AND LINE_NO = ?";
sqlUpdate = "UPDATE PALLET_REQ_DET SET STATUS = 'R' WHERE TRAN_ID = ? AND LINE_NO = ?";
pstmtUpdate = conn.prepareStatement(sqlUpdate);
pstmtUpdate.setString(1, refId);
pstmtUpdate.setString(2, lineNoInterface);
......
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