|
|
@ -1,12 +1,13 @@ |
|
|
package in.gov.chennaicorporation.gccoffice.pgr.service; |
|
|
package in.gov.chennaicorporation.gccoffice.pgr.service; |
|
|
|
|
|
|
|
|
import java.sql.Connection; |
|
|
import java.sql.Connection; |
|
|
|
|
|
|
|
|
import java.sql.PreparedStatement; |
|
|
import java.sql.PreparedStatement; |
|
|
import java.sql.ResultSet; |
|
|
import java.sql.ResultSet; |
|
|
import java.sql.ResultSetMetaData; |
|
|
import java.sql.ResultSetMetaData; |
|
|
import java.sql.SQLException; |
|
|
import java.sql.SQLException; |
|
|
|
|
|
import java.sql.Statement; |
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.Collections; |
|
|
import java.util.HashMap; |
|
|
import java.util.HashMap; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
|
@ -15,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
import in.gov.chennaicorporation.gccoffice.pgr.dbconnection.DBConnection; |
|
|
import in.gov.chennaicorporation.gccoffice.pgr.dbconnection.DBConnection; |
|
|
|
|
|
import in.gov.chennaicorporation.gccoffice.pgr.dto.Dtoworeopen; |
|
|
|
|
|
|
|
|
@Service |
|
|
@Service |
|
|
public class ReopenZoneWiseDaskboards { |
|
|
public class ReopenZoneWiseDaskboards { |
|
|
@ -24,6 +26,51 @@ public class ReopenZoneWiseDaskboards { |
|
|
|
|
|
|
|
|
public String sFrDate =""; |
|
|
public String sFrDate =""; |
|
|
public String sToDate =""; |
|
|
public String sToDate =""; |
|
|
|
|
|
public List<Dtoworeopen> getAlldtozwreopen() { |
|
|
|
|
|
List<Dtoworeopen> complaintdept = new ArrayList<>(); |
|
|
|
|
|
Connection con = DBConnection.getConnection(); |
|
|
|
|
|
Statement stmt = null; |
|
|
|
|
|
ResultSet rs = null; |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
stmt = con.createStatement(); |
|
|
|
|
|
rs = stmt.executeQuery(getdtozwreopenQuery()); |
|
|
|
|
|
|
|
|
|
|
|
while (rs.next()) { |
|
|
|
|
|
Dtoworeopen dtozwreopen = new Dtoworeopen(); |
|
|
|
|
|
dtozwreopen.setId(rs.getString("id_dept")); |
|
|
|
|
|
dtozwreopen.setName(rs.getString("dept_name")); |
|
|
|
|
|
complaintdept.add(dtozwreopen); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return complaintdept; |
|
|
|
|
|
} catch (SQLException e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
} finally { |
|
|
|
|
|
try { |
|
|
|
|
|
if (rs != null) { |
|
|
|
|
|
rs.close(); |
|
|
|
|
|
} |
|
|
|
|
|
if (stmt != null) { |
|
|
|
|
|
stmt.close(); |
|
|
|
|
|
} |
|
|
|
|
|
if (con != null) { |
|
|
|
|
|
con.close(); |
|
|
|
|
|
} |
|
|
|
|
|
} catch (SQLException e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return Collections.emptyList(); // Return an empty list if there's an error |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private String getdtozwreopenQuery() { |
|
|
|
|
|
return "SELECT id_dept, dept_name " |
|
|
|
|
|
+ "FROM EG_DEPARTMENT@ERP " |
|
|
|
|
|
+ "WHERE NVL(dept_name, '0') NOT LIKE 'F%' AND dept_name IS NOT NULL AND id_dept >= 32 " |
|
|
|
|
|
+ "ORDER BY id_dept"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public String getReopenZonewisedaskboardQuery(String DEPTID) { |
|
|
public String getReopenZonewisedaskboardQuery(String DEPTID) { |
|
|
String sQry = "SELECT * FROM (SELECT a.deptid, " + |
|
|
String sQry = "SELECT * FROM (SELECT a.deptid, " + |
|
|
|