null.
- *
- * The default implementation unconditionally returns the value configured
- * by the encoding initialization parameter for this
- * filter.
- *
- * @param request The servlet request we are processing
- */
- protected String selectEncoding(ServletRequest request) {
-
- return (this.encoding);
-
- }
-}
\ No newline at end of file
diff --git a/src/main/java/com/zky/util/CharFilter.java b/src/main/java/com/zky/util/CharFilter.java
deleted file mode 100644
index 6253050..0000000
--- a/src/main/java/com/zky/util/CharFilter.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package com.zky.util;
-
-
-
-import java.io.IOException;
-import java.util.Map;
-import java.util.Set;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-
-public class CharFilter implements Filter {
- String encoding = "utf-8";
-
- public void destroy() {
- }
- @SuppressWarnings("rawtypes")
- public void doFilter(ServletRequest req, ServletResponse res,
- FilterChain chain) throws IOException, ServletException {
- HttpServletRequest request = (HttpServletRequest) req;
- if (request.getMethod().equalsIgnoreCase("POST")) {
- request.setCharacterEncoding(encoding);
- } else {
-
- Map map = request.getParameterMap();
- Set entryset = map.entrySet();
- for (Object object : entryset) {
- Map.Entry entry = (Map.Entry) object;
- String[] value = (String[]) entry.getValue();
- for (int i = 0; i < value.length; i++) {
- value[i] = new String(value[i].getBytes("UTF-8"),
- encoding);
- }
- }
- }
- chain.doFilter(request, res);
- }
-
- public void init(FilterConfig arg0) throws ServletException {
- String s = arg0.getInitParameter("encoding");
- if (s != null && s.length() > 0) {
- encoding = s;
- }
- }
-}
diff --git a/src/main/java/com/zky/util/CheckCoderTool.java b/src/main/java/com/zky/util/CheckCoderTool.java
deleted file mode 100644
index 4db3706..0000000
--- a/src/main/java/com/zky/util/CheckCoderTool.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package com.zky.util;
-
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.Graphics2D;
-import java.awt.image.BufferedImage;
-import java.io.IOException;
-import java.util.Random;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import com.sun.image.codec.jpeg.JPEGCodec;
-import com.sun.image.codec.jpeg.JPEGEncodeParam;
-import com.sun.image.codec.jpeg.JPEGImageEncoder;
-
-
-public class CheckCoderTool extends HttpServlet {
-
- /**
- * 生成登录验证码.
- * 验证码的数据从客户的session中的属性c中获取
- * 生成的验证码以JPEG图片方式输出.
- */
- public void doGet(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- response.setContentType("image/jpeg");
- String c = (String) request.getSession().getAttribute("c");
- if (c == null)c = "";
- int width = c.length() * 8 + 20;
- int height = 22;
- int startX = 8;
- int startY = 15;
- BufferedImage bi = new BufferedImage(width, height,BufferedImage.TYPE_INT_BGR);
- Graphics2D g = bi.createGraphics();
- g.setColor(Color.black);
- g.setBackground(Color.GRAY);
- g.setFont(new Font("Times New Roman",Font.BOLD,18));
- g.clearRect(0, 0, width, height);
- g.drawString(c, startX, startY);
- JPEGImageEncoder encoder = null;
- JPEGEncodeParam param = null;
-
- try {
- encoder = JPEGCodec.createJPEGEncoder(response.getOutputStream());
- param = encoder.getDefaultJPEGEncodeParam(bi);
- param.setQuality(0.9f, false);
- encoder.encode(bi);
- } catch (Exception e) {
- e.printStackTrace();
- } finally {
- bi = null;
- g = null;
- c = null;
- encoder = null;
- param = null;
- }
-
- }
-
-
- /**
- * 生成随机字符串.
- * 随机字符串的内容包含[0-9]的字符.
- *
- * @param randomLength
- * 随机字符串的长度
- * @return 随机字符串.
- */
- public static String randomChars(int randomLength) {
- char[] randoms = { '0','1', '2', '3', '4', '5', '6', '7', '8', '9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' };
- Random random = new Random();
- StringBuffer ret = new StringBuffer();
- for (int i = 0; i < randomLength; i++) {
- ret.append(randoms[random.nextInt(randoms.length)]);
- }
- random = null;
- return ret.toString();
- }
-
-
-
-
-}
-
diff --git a/src/main/java/com/zky/util/OptionBean.java b/src/main/java/com/zky/util/OptionBean.java
deleted file mode 100644
index 97e5843..0000000
--- a/src/main/java/com/zky/util/OptionBean.java
+++ /dev/null
@@ -1,77 +0,0 @@
-
-package com.zky.util;
-
-import org.jdom.Element;
-
-/**
- * @author dy
- *
- */
-public class OptionBean {
- private String text = "";
- private String value = "";
- private String selected = "";
-
- public OptionBean(String value, String text, boolean selected) {
- this.text = text;
- this.value = value;
- if (selected) {
- this.selected = "selected";
- }
- }
- public OptionBean(String value, String text) {
- this.text = text;
- this.value = value;
- }
- /**
- * @return Returns the selected.
- */
- public String getSelected() {
- return this.selected;
- }
- /**
- * @param selected The selected to set.
- */
- public void setSelected(boolean selected) {
- if (selected) {
- this.selected = "selected";
- }
- }
- /**
- * @return Returns the text.
- */
- public String getText() {
- return this.text;
- }
- /**
- * @param text The text to set.
- */
- public void setText(String text) {
- this.text = text;
- }
- /**
- * @return Returns the value.
- */
- public String getValue() {
- return this.value;
- }
- /**
- * @param value The value to set.
- */
- public void setValue(String value) {
- this.value = value;
- }
-
- public Element toXML() {
- return new Element("option")
- .setAttribute("value",value)
- .setAttribute("text",text)
- .setAttribute("selected",selected);
- }
-
- public String toString() {
- return new StringBuffer("").toString();
- }
-}
diff --git a/src/main/java/com/zky/util/OptionsBean.java b/src/main/java/com/zky/util/OptionsBean.java
deleted file mode 100644
index 68c0c87..0000000
--- a/src/main/java/com/zky/util/OptionsBean.java
+++ /dev/null
@@ -1,50 +0,0 @@
-
-package com.zky.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jdom.Element;
-
-/**
- * @author dy
- *
- */
-public class OptionsBean {
- private List list = null;
- private String id = "";
-
- public OptionsBean() {
- this.list = new ArrayList();
- }
-
- public OptionsBean(String id) {
- this.id = id;
- this.list = new ArrayList();
- }
-
- public OptionsBean addOption(OptionBean option) {
- list.add(option);
- return this;
- }
-
- public Element toXML() {
- Element options = new Element("options").setAttribute("id",id);
- for (int i=0; i");
- out.println("");
- buf.append("当前第").append(curPage).append("/").append(pageCount)
- .append("页 每页")
- .append(pageRowCount).append("条")
-// .append(" 本页").append(curRowcount).append("条")
- .append(" 共").append(rowcount).append("条");;
- out.println(buf);
- out.println(" | ");
- out.println("");
-
-
- buf = new StringBuffer("");
- out.println();
-
- //首页的连接
- buf.append(" 9");
- //上一页的连接
- if (curPage > 1) {
- buf.append(" 7");
- }
- //下一页的连接
- if (curPage < pageCount) {
- buf.append(" 8");
- }
- //尾页的连接
- buf.append(" :");
-
- out.println(buf);
-
- out.println(" 转到");
- out.println("");
- out.println(" |
");
-
- out.println("");
-
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- public void setPageContext(PageContext arg0) {
- super.setPageContext(arg0);
- this.request = arg0.getRequest();
- this.session = arg0.getSession();
- }
-
- /**
- * @return Returns the action.
- */
- public String getOperate() {
- return operate;
- }
- /**
- * @param action The action to set.
- */
- public void setOperate(String operate) {
- this.operate = operate;
- }
- /**
- * @return Returns the curPage.
- */
- public long getCurPage() {
- return curPage;
- }
- /**
- * @param curPage The curPage to set.
- */
- public void setCurPage(int curPage) {
- this.curPage = curPage;
- }
- /**
- * @return Returns the pageRowCount.
- */
- public int getPageRowCount() {
- return pageRowCount;
- }
- /**
- * @param pageRowCount The pageRowCount to set.
- */
- public void setPageRowCount(int pageRowCount) {
- this.pageRowCount = pageRowCount;
- }
- /**
- * @return Returns the request.
- */
- public ServletRequest getRequest() {
- return request;
- }
- /**
- * @param request The request to set.
- */
- public void setRequest(ServletRequest request) {
- this.request = request;
- }
- /**
- * @return Returns the scope.
- */
- public String getScope() {
- return scope;
- }
- /**
- * @param scope The scope to set.
- */
- public void setScope(String scope) {
- this.scope = scope;
- }
- /**
- * @return Returns the session.
- */
- public HttpSession getSession() {
- return session;
- }
- /**
- * @param session The session to set.
- */
- public void setSession(HttpSession session) {
- this.session = session;
- }
- /**
- * @return Returns the width.
- */
- public String getWidth() {
- return width;
- }
- /**
- * @param width The width to set.
- */
- public void setWidth(String width) {
- this.width = width;
- }
-
- /**
- * @return 返回 curRowCount。
- */
- public int getCurRowcount() {
- return curRowcount;
- }
- /**
- * @param curRowCount 要设置的 curRowCount。
- */
- public void setCurRowcount(int curRowCount) {
- this.curRowcount = curRowCount;
- }
- /**
- * @return Returns the align.
- */
- public String getAlign() {
- return this.align;
- }
- /**
- * @param align The align to set.
- */
- public void setAlign(String align) {
- this.align = align;
- }
-}
\ No newline at end of file
diff --git a/src/main/java/com/zky/util/PageQuery.java b/src/main/java/com/zky/util/PageQuery.java
deleted file mode 100644
index a1ae5ae..0000000
--- a/src/main/java/com/zky/util/PageQuery.java
+++ /dev/null
@@ -1,93 +0,0 @@
-
-package com.zky.util;
-
-import java.sql.Connection;
-
-import javax.servlet.http.HttpServletRequest;
-import org.apache.log4j.Logger;
-import com.zky.pub.Common;
-import com.zky.util.jdbc.JDBCPageQuery;
-import com.zky.util.jdbc.ResultSetHandler;
-
-/**
- * @author dy
- *
- */
-public class PageQuery {
- private static final Logger log = Logger.getLogger(PageQuery.class);
- private Pageable pageQuery = null;
- private HttpServletRequest request = null;
- private int pageNo;
-
- public PageQuery(Pageable pageQuery, HttpServletRequest request) {
- this.pageQuery = pageQuery;
- this.request = request;
- //如果页码不空,则设置页码及总记录数
- String pageno = request.getParameter("pageno");
- if (!Common.isNull(pageno)) {
- pageNo = Integer.parseInt(pageno);
- } else {
- pageNo = 1;
- }
- }
-
- public PageQuery(Connection conn, String sql, Object[] params, ResultSetHandler handler, HttpServletRequest request) {
- this(new JDBCPageQuery(conn,sql,params,handler), request);
- }
-
- public PageQuery(Connection conn, String sql, Object param, ResultSetHandler handler, HttpServletRequest request) {
- this(new JDBCPageQuery(conn,sql,param,handler), request);
- }
-
- public PageQuery(Connection conn, String sql, ResultSetHandler handler, HttpServletRequest request) {
- this(new JDBCPageQuery(conn,sql,handler), request);
- }
-
- /**
- * 查询页面数据
- * @param pageSize 每页显示的记录数
- * @return
- * @throws Exception
- */
- public Object query(int pageSize) throws Exception{
- try {
- PageBean pageBean = new PageBean();
- pageQuery.setPageSize(pageSize);
-
- Object obj = pageQuery.query(pageNo);
- //设置页面显示数据
- pageBean.setPageSize(pageQuery.getPageSize()); //页面大小
- pageBean.setPageCount(pageQuery.getPageCount()); //总页数
- pageBean.setRowcount(pageQuery.getRowcount()); //总记录数
- pageBean.setPageNum(pageNo); //页码
-// pageBean.setCurRowcount(pageQuery.getCurRowcount()); //当前页记录数
- request.setAttribute("PageBean", pageBean);
- return obj;
- } catch (Exception e) {
- throw e;
- }
- }
-
- /**
- * 查询页面数据
- * @return
- * @throws Exception
- */
- public Object query() throws Exception{
- try {
- PageBean pageBean = new PageBean();
-
- Object obj = pageQuery.query(pageNo);
- //设置页面显示数据
- pageBean.setPageSize(pageQuery.getPageSize()); //页面大小
- pageBean.setPageCount(pageQuery.getPageCount()); //总页数
- pageBean.setRowcount(pageQuery.getRowcount()); //总记录数
- pageBean.setPageNum(pageNo); //页码
-// pageBean.setCurRowcount(pageQuery.getCurRowcount()); //当前页记录数
- request.setAttribute("PageBean", pageBean);
- return obj;
- } catch (Exception e) {
- throw e;
- }
- }
-}
diff --git a/src/main/java/com/zky/util/Pageable.java b/src/main/java/com/zky/util/Pageable.java
deleted file mode 100644
index 56f55aa..0000000
--- a/src/main/java/com/zky/util/Pageable.java
+++ /dev/null
@@ -1,29 +0,0 @@
-
-package com.zky.util;
-
-import java.util.Date;
-import java.util.List;
-
-/**
- * @author dy
- *
- * 分页查询接口
- */
-
-public interface Pageable {
-
- public Object query(int pageNum) throws Exception;
-
- public int getRowcount() throws Exception;
-
-
-// public int getCurRowcount();
-
- public int getPageCount() throws Exception;
-
- public void setPageSize(int pageSize);
-
- public int getPageSize();
-
- //public List getPageDataBlur(int pageNo) throws Exception;
-}
diff --git a/src/main/java/com/zky/util/Test.java b/src/main/java/com/zky/util/Test.java
deleted file mode 100644
index 973d2cb..0000000
--- a/src/main/java/com/zky/util/Test.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.zky.util;
-
-
-public class Test {
- public static void backup(String dbName, String filePath) {
- try {
- @SuppressWarnings("unused")
- Process process = Runtime.getRuntime().exec(
- "cmd /c mysqldump -uroot -proot " + dbName + " > "
- + filePath + "/" + new java.util.Date().getTime()
- + ".sql");
- } catch (Exception e) {
- // TODO Auto-generated catch block
- System.out.println("备份数据库");
- e.printStackTrace();
- }
- }
-
- @SuppressWarnings("unused")
- // 恢复数据库
- public static void load(String dbName, String filePath) {
- try {
- @SuppressWarnings("unused")
- Process process = Runtime.getRuntime().exec(
- "cmd /c mysql -uroot -psa " + dbName + " < " + filePath);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- System.out.println("恢复数据库");
- e.printStackTrace();
- }
- }
-
- public static void main(String[] args) {
- try {
- backup("orcl","d:/");
- //oad("test", "d:/1259138711453.sql");
- System.out.println("ok");
- } catch (Exception e) {
- // TODO: handle exception
- e.getMessage();
- }
-
- }
-}
\ No newline at end of file
diff --git a/src/main/java/com/zky/util/jdbc/BatchParam.java b/src/main/java/com/zky/util/jdbc/BatchParam.java
deleted file mode 100644
index 58b822a..0000000
--- a/src/main/java/com/zky/util/jdbc/BatchParam.java
+++ /dev/null
@@ -1,30 +0,0 @@
-
-package com.zky.util.jdbc;
-
-import java.sql.SQLException;
-import java.util.LinkedList;
-import java.util.List;
-
-
-public class BatchParam {
- private List list = new LinkedList();
- private long num = -1;
-
- public BatchParam(){
-
- }
-
- public void addParam(Object[] param) throws SQLException{
- if(num == -1){
- num = param.length;
- }
- if (num != param.length) {
- throw new SQLException("param length error");
- }
- list.add(param);
- }
-
- public List getBatchAll(){
- return list;
- }
-}
diff --git a/src/main/java/com/zky/util/jdbc/HashFmlBufResultSetHandler.java b/src/main/java/com/zky/util/jdbc/HashFmlBufResultSetHandler.java
deleted file mode 100644
index abfaef7..0000000
--- a/src/main/java/com/zky/util/jdbc/HashFmlBufResultSetHandler.java
+++ /dev/null
@@ -1,35 +0,0 @@
-
-package com.zky.util.jdbc;
-
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import com.zky.pub.Common;
-import com.zky.pub.HashFmlBuf;
-
-/**
- * @author dy
- *
- */
-public class HashFmlBufResultSetHandler implements ResultSetHandler {
-
- public Object handle(ResultSet rs) throws SQLException {
- HashFmlBuf buf = new HashFmlBuf();
- ResultSetMetaData meta = rs.getMetaData();
- int cols = meta.getColumnCount();
- String[] colNames = new String[cols];
- for (int i=0;i= ").append(first)
-// .append("as b");
-//
- //Mysql
- pageSql.append("select * from (")
- .append(sql)
- .append(") as b LIMIT ")
- .append(first).append(", ").append(last);
- return pageSql.toString();
- }
-
- private final String getCountSql(String sql) {
- StringBuffer countSql = new StringBuffer(sql.length()+100);
- //ORACLE
- //countSql.append("select count(*) from (").append(sql).append(")");
- ///Mysql
- countSql.append("select count(*) from (").append(sql).append(") as f");
-
- return countSql.toString();
- }
-}
diff --git a/src/main/java/com/zky/util/jdbc/JDBCUtils.java b/src/main/java/com/zky/util/jdbc/JDBCUtils.java
deleted file mode 100644
index bdebe4f..0000000
--- a/src/main/java/com/zky/util/jdbc/JDBCUtils.java
+++ /dev/null
@@ -1,338 +0,0 @@
-
-package com.zky.util.jdbc;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.sql.Types;
-import java.util.List;
-import com.zky.util.jdbc.SqlBuf;
-
-/**
- * 提供select、delete、update、insert辅助
- * 提供关闭Connection、Statement、ResultSet
- * 使用例子参见 JDBCUtilsExample.java
- *
- * @author dy
- *
- */
-
-public class JDBCUtils {
-
- /**
- * 执行一个查询语句,返回查询结果List
- * @param conn JDBC Connection
- * @param sql sql语句
- * @param params 需要传入的参数
- * @return 返回ResultSetHandler对查询出来的ResultSet处理结果
- * @throws SQLException
- */
- public static List queryToList(Connection conn,String sql,Object[] params) throws SQLException {
- return (List) query(conn,sql,params,new ListResultSetHandler());
- }
- /**
- * 执行无参数的查询语句,返回查询结果List
- * @param conn JDBC Connection
- * @param sql sql语句
- * @return 返回ResultSetHandler对查询出来的ResultSet处理结果
- * @throws SQLException
- */
- public static List queryToList(Connection conn,String sql) throws SQLException {
- return (List) query(conn,sql,(Object[]) null,new ListResultSetHandler());
- }
- /**
- * 执行需要1个参数的查询语句,返回查询结果List
- * @param conn JDBC Connection
- * @param sql sql语句
- * @param param1 需要传入的参数
- * @param handler ResultSetHandler
- * @return 返回ResultSetHandler对查询出来的ResultSet处理结果
- * @throws SQLException
- */
- public static List queryToList(Connection conn,String sql,Object param) throws SQLException {
- return (List) query(conn,sql,(Object[]) new Object[] { param},new ListResultSetHandler());
- }
- /**
- * 执行需要2个参数的查询语句,返回查询结果List
- * @param conn JDBC Connection
- * @param sql sql语句
- * @param param1 需要传入的参数1
- * @param param2 需要传入的参数2
- * @param handler ResultSetHandler
- * @return 返回ResultSetHandler对查询出来的ResultSet处理结果
- * @throws SQLException
- */
- public static List queryToList(Connection conn,String sql,Object param1,Object param2) throws SQLException {
- return (List) query(conn,sql,(Object[]) new Object[] { param1,param2},new ListResultSetHandler());
- }
-
- /**
- * 执行一个查询语句
- * @param conn JDBC Connection
- * @param sql sql语句
- * @param params 需要传入的参数
- * @param handler ResultSetHandler
- * @return 返回ResultSetHandler对查询出来的ResultSet处理结果
- * @throws SQLException
- */
- public static Object query(Connection conn,String sql,Object[] params,ResultSetHandler handler)
- throws SQLException {
-
- PreparedStatement stmt = null;
- ResultSet rs = null;
- try {
- stmt = conn.prepareStatement(sql);
- JDBCUtils.setParams(stmt, params);
- rs = stmt.executeQuery();
- if(handler!=null){
- return handler.handle(rs);
- }
- } catch (SQLException e) {
- throw e;
- } finally {
- JDBCUtils.close(rs);
- JDBCUtils.close(stmt);
- }
- return null;
- }
- /**
- * 执行一个不需要参数的查询语句
- * @param conn JDBC Connection
- * @param sql sql语句
- * @param handler ResultSetHandler
- * @return 返回ResultSetHandler对查询出来的ResultSet处理结果
- * @throws SQLException
- */
- public static Object query(Connection conn, String sql,ResultSetHandler handler)
- throws SQLException {
- return query(conn, sql, (Object[]) null,handler);
- }
-
- /**
- * 执行需要1个参数的查询语句
- * @param conn JDBC Connection
- * @param sql sql语句
- * @param param 需要传入的参数
- * @param handler ResultSetHandler
- * @return 返回ResultSetHandler对查询出来的ResultSet处理结果
- * @throws SQLException
- */
- public static Object query(Connection conn, String sql,Object param,ResultSetHandler handler)
- throws SQLException {
- return query(conn, sql, new Object[] { param},handler);
- }
-
- /**
- * 执行需要2个参数的查询语句
- * @param conn JDBC Connection
- * @param sql sql语句
- * @param param1 需要传入的参数1
- * @param param2 需要传入的参数2
- * @param handler ResultSetHandler
- * @return 返回ResultSetHandler对查询出来的ResultSet处理结果
- * @throws SQLException
- */
- public static Object query(Connection conn, String sql,Object param1,Object param2,ResultSetHandler handler)
- throws SQLException {
- return query(conn, sql, new Object[] { param1,param2},handler);
- }
-
- /**
- * 执行delete或update、insert
- * 方法内无commit和rollback
- * @param conn JDBC Connection
- * @param sql sql语句
- * @param param 需要传入的参数
- * @return delete或update、insert的行数
- * @throws SQLException
- */
- public static int update(Connection conn, String sql, Object[] params)
- throws SQLException {
-
- PreparedStatement stmt = null;
- try {
- stmt = conn.prepareStatement(sql);
- JDBCUtils.setParams(stmt, params);
- return stmt.executeUpdate();
- } catch (SQLException e) {
- if (e.getMessage().toUpperCase().indexOf("ORA-00001")>-1){
- //主键重复
- throw new SQLException("记录已存在");
- }else{
- throw e;
- }
- } finally {
- JDBCUtils.close(stmt);
- }
-
- }
-
- /**
- * 执行不需要参数的delete或update、insert
- * 方法内无commit和rollback
- * @param conn JDBC Connection
- * @param sql sql语句
- * @return delete或update、insert的行数
- * @throws SQLException
- */
- public static int update(Connection conn, String sql) throws SQLException {
- return JDBCUtils.update(conn, sql, (Object[]) null);
- }
-
- /**
- * 执行只有1个参数的delete或update、insert
- * 方法内无commit和rollback
- * @param conn JDBC Connection
- * @param sql sql语句
- * @param param 需要传入的参数
- * @return delete或update、insert的行数
- * @throws SQLException
- */
- public static int update(Connection conn, String sql, Object param)throws SQLException {
- return JDBCUtils.update(conn, sql, new Object[] { param });
- }
-
- /**
- * 执行只有2个参数的delete或update、insert
- * 方法内无commit和rollback
- * @param conn JDBC Connection
- * @param sql sql语句
- * @param param1 需要传入的参数1
- * @param param2 需要传入的参数2
- * @return delete或update、insert的行数
- * @throws SQLException
- */
- public static int update(Connection conn, String sql, Object param1 , Object param2)throws SQLException {
- return JDBCUtils.update(conn, sql, new Object[] { param1,param2 });
- }
-
- /**
- * 批量执行delete或update、insert
- * 方法内无commit和rollback
- * @param conn JDBC Connection
- * @param sql sql语句
- * @param param 需要传入的参数
- * @return delete或update、insert的行数
- * @throws SQLException
- */
- public static int[] updateBatch(Connection conn, String sql,BatchParam param)throws SQLException {
- PreparedStatement stmt = null;
- try {
- stmt = conn.prepareStatement(sql);
- List list = param.getBatchAll();
-
-
- for (int i = 0; i < list.size(); i++) {
- JDBCUtils.setParams(stmt, (Object[]) list.get(i));
- stmt.addBatch();
- }
- return stmt.executeBatch();
- } catch (SQLException e) {
- throw e;
- } finally {
- JDBCUtils.close(stmt);
- }
- }
-
-
- /**
- * 批量执行SQL语句
- */
- public static int update(Connection conn, SqlBuf sqlBuf)throws SQLException {
- Statement stmt=null;
- try{
- String sqlstr="";
- stmt=conn.createStatement();
- conn.setAutoCommit(false);
- for (int i=0;i-1){
- //主键重复
- throw new SQLException("记录已存在");
- }else{
- throw e;
- }
- }finally{
- try{
- if (stmt!=null) stmt.close();
- }catch (Exception ex)
- {
- }
- sqlBuf.setZero();
- }
- return 0;
- }
-
- /**
- * 关闭ResultSet
- * @param rs 被关闭ResultSet
- */
- public static void close(ResultSet rs) {
- if (rs != null) {
- try {
- rs.close();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
-
- /**
- * 关闭Connection
- * @param conn 被关闭Connection
- */
- public static void close(Connection conn) {
- if (conn != null) {
- try {
- conn.close();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
-
- /**
- * 关闭Statement
- * @param stmt 被关闭Statement
- */
- public static void close(Statement stmt) {
- if (stmt != null) {
- try {
- stmt.close();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
-
-
- public static void setParams(PreparedStatement stmt, Object[] params)
- throws SQLException {
-
- if (params == null) return;
-
- for (int i = 0; i < params.length; i++) {
- if (params[i] == null) {
- stmt.setNull(i + 1, Types.CHAR);
- //stmt.setNull(i + 1, Types.OTHER);
- } else {
- stmt.setObject(i + 1, params[i]);
- }
- }
- }
-
-}
diff --git a/src/main/java/com/zky/util/jdbc/JDBCUtilsExample.java b/src/main/java/com/zky/util/jdbc/JDBCUtilsExample.java
deleted file mode 100644
index 2f54feb..0000000
--- a/src/main/java/com/zky/util/jdbc/JDBCUtilsExample.java
+++ /dev/null
@@ -1,54 +0,0 @@
-
-package com.zky.util.jdbc;
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.List;
-
-
-public class JDBCUtilsExample {
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- Connection conn = null;
- try {
- //例子1 查询a=ta and b=1
- //直接传递参数"ta",new Integer(1)
- String sql = "SELECT * FROM tab_test WHERE a=? and b = ?";
- List list = (List) JDBCUtils.query(conn,sql, "ta",new Integer(1),new ListResultSetHandler());
- //或者 将参数作为数组传入
- list = (List) JDBCUtils.query(conn,sql, new Object[]{"tttt",new Integer(1)},
- new ListResultSetHandler());
-
- //例子2
- sql = "update tab_test set a=? where b=?";
- JDBCUtils.update(conn,sql,"12121",new Integer(2005));
- //或者
- JDBCUtils.update(conn,sql,new Object[]{"12121",new Integer(2005)});
- conn.commit();
-
- //例子3,使用一个匿名类来直接处理ResultSet
- //注意外部变量要在匿名类内使用,必须申明成final的
- //申明成final的变量不能放在等号左边使用,呵呵。
- final StringBuffer curDate = new StringBuffer("") ;
- sql = "select date_format(now(),'%Y-%m-%d') from dual";
- JDBCUtils.query(conn,sql,new ResultSetHandler(){
- public Object handle(ResultSet rs) throws SQLException{
- while(rs.next()){
- curDate.append(rs.getString(1));
- }
- return null;
- }
- }
- );
- } catch (SQLException e) {
- e.printStackTrace();
- } finally {
- JDBCUtils.close(conn);
- }
-
- }
-
-}
diff --git a/src/main/java/com/zky/util/jdbc/ListResultSetHandler.java b/src/main/java/com/zky/util/jdbc/ListResultSetHandler.java
deleted file mode 100644
index bcbd0e5..0000000
--- a/src/main/java/com/zky/util/jdbc/ListResultSetHandler.java
+++ /dev/null
@@ -1,34 +0,0 @@
-
-package com.zky.util.jdbc;
-
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * 将ResultSet转换成List,每个List元素是一条记录 Object[]
- * @author dy
- *
- */
-
-public class ListResultSetHandler implements ResultSetHandler {
-
- public Object handle(ResultSet rs) throws SQLException {
- ResultSetMetaData meta = rs.getMetaData();
- int cols = meta.getColumnCount();
- List list = new LinkedList();
- Object[] row;
- while(rs.next()){
- row = new Object[cols];
- for (int i = 0; i < cols; i++) {
- row[i] = rs.getObject(i+1);
- }
- list.add(row);
- }
- return list;
- }
-
-
-}
diff --git a/src/main/java/com/zky/util/jdbc/OptionsResultSetHandler.java b/src/main/java/com/zky/util/jdbc/OptionsResultSetHandler.java
deleted file mode 100644
index e4e1162..0000000
--- a/src/main/java/com/zky/util/jdbc/OptionsResultSetHandler.java
+++ /dev/null
@@ -1,28 +0,0 @@
-
-package com.zky.util.jdbc;
-
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.util.LinkedList;
-import java.util.List;
-
-
-/**
- * @author dy
- *
- * 生成下拉列表选项字符串
- */
-public class OptionsResultSetHandler implements ResultSetHandler {
-
- /* (non-Javadoc)
- * @see com.zky.util.jdbc.ResultSetHandler#handle(java.sql.ResultSet)
- */
- public Object handle(ResultSet rs) throws SQLException {
- StringBuffer buf = new StringBuffer();
- while(rs.next()){
- buf.append("\n");
- }
- return buf.toString();
- }
-}
diff --git a/src/main/java/com/zky/util/jdbc/ResultSetHandler.java b/src/main/java/com/zky/util/jdbc/ResultSetHandler.java
deleted file mode 100644
index ba611db..0000000
--- a/src/main/java/com/zky/util/jdbc/ResultSetHandler.java
+++ /dev/null
@@ -1,15 +0,0 @@
-
-package com.zky.util.jdbc;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-/**
- * 将ResultSet转换成其他对象
- * @author dy
- *
- */
-public interface ResultSetHandler {
- public Object handle(ResultSet rs) throws SQLException;
-
-}
diff --git a/src/main/java/com/zky/util/jdbc/SingleStringRSHandler.java b/src/main/java/com/zky/util/jdbc/SingleStringRSHandler.java
deleted file mode 100644
index a848678..0000000
--- a/src/main/java/com/zky/util/jdbc/SingleStringRSHandler.java
+++ /dev/null
@@ -1,23 +0,0 @@
-
-package com.zky.util.jdbc;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-/**
- * @author dy
- *
- */
-public class SingleStringRSHandler implements ResultSetHandler {
-
- /* (non-Javadoc)
- * @see com.zky.util.jdbc.ResultSetHandler#handle(java.sql.ResultSet)
- */
- public Object handle(ResultSet rs) throws SQLException {
- if (rs.next()) {
- return rs.getString(1);
- }
- return null;
- }
-
-}
diff --git a/src/main/java/com/zky/util/jdbc/SqlBuf.java b/src/main/java/com/zky/util/jdbc/SqlBuf.java
deleted file mode 100644
index 90defc9..0000000
--- a/src/main/java/com/zky/util/jdbc/SqlBuf.java
+++ /dev/null
@@ -1,38 +0,0 @@
-
-package com.zky.util.jdbc;
-import com.zky.pub.HashFmlBuf;
-/**
- * @author dy
- *
- */
-public class SqlBuf {
-
- /**
- *
- */
- private int rowCount=0;
- private HashFmlBuf buf=null;
- public SqlBuf() {
- super();
- // TODO Auto-generated constructor stub
- rowCount=0;
- buf=new HashFmlBuf();
- }
- public void setZero(){
- rowCount=0;
- }
- public int getRowCount(){
- return rowCount;
- }
- public void addSql(String sqlstr){
- buf.fchg("SQL"+Integer.toString(rowCount++),0,sqlstr);
- }
- public String getSql(int i){
- if (i>=rowCount){
- return "";
- }
- else{
- return buf.fget("SQL"+Integer.toString(i),0);
- }
- }
-}
diff --git a/src/main/java/com/zky/util/分页查询.txt b/src/main/java/com/zky/util/分页查询.txt
deleted file mode 100644
index 58151a6..0000000
--- a/src/main/java/com/zky/util/分页查询.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-java:
- //查询sql
- String sql = "select * from tab_department_bak where depttypeid=?";
- //实例化一个分页查询对象
- //方法一:传入参数JDBCPageQuery对象和HttpServletRequest对象
- PageQuery pageQuery = new PageQuery(new JDBCPageQuery(conn,sql,"10",new HashFmlBufResultSetHandler()),request);
- //方法二:
- PageQuery pageQuery = new PageQuery(conn,sql,'10',new HashFmlBufResultHandler(),request);
- //获得查询结果,query方法的传入参数50为每页显示的记录数
- HashFmlBuf buf = (HashFmlBuf)pageQuery.query(50);
-
-jsp:
- 包含auth.jsp页面或者在页面中加入标签引入代码:<%@ taglib uri="/WEB-INF/tlds/PageLinkTag.xml" prefix="tag"%>
- 在查询结果的表格下方加入分页标签代码:
- 其中 operate:查询调用的servlet中的方法名称(optional, default="query");
- scope:="request"(required);
- width:分页表签的宽度(optional, default="90%");
- align:分页标签的对齐方式(optional, default="left");
\ No newline at end of file
diff --git a/src/main/java/com/zky/zhyw/smhd/ActivitiesApplyServlet.java b/src/main/java/com/zky/zhyw/smhd/ActivitiesApplyServlet.java
deleted file mode 100644
index a8b00b9..0000000
--- a/src/main/java/com/zky/zhyw/smhd/ActivitiesApplyServlet.java
+++ /dev/null
@@ -1,465 +0,0 @@
-package com.zky.zhyw.smhd;
-
-import java.io.IOException;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.swing.JButton;
-
-import com.zky.manager.Login;
-import com.zky.manager.StudentPullulate;
-import com.zky.pub.Common;
-import com.zky.pub.DbConn;
-import com.zky.pub.DispatchServlet;
-import com.zky.pub.HashFmlBuf;
-import com.zky.util.PageQuery;
-import com.zky.util.jdbc.HashFmlBufResultSetHandler;
-import com.zky.util.jdbc.JDBCUtils;
-import com.zky.util.jdbc.ResultSetHandler;
-
-public class ActivitiesApplyServlet extends DispatchServlet {
-Connection conn=null;
-PreparedStatement pstmt=null;
-private StudentPullulate p=new StudentPullulate();
- @Override
- public void defaultMethod(HttpServletRequest request,
- HttpServletResponse response) throws Exception {
- // TODO Auto-generated method stub
-
- }
- /**
- * 通过区县读取部门
- * @param request
- * @param response
- * @throws Exception
- */
- public void readAridSchool(HttpServletRequest request,
- HttpServletResponse response)throws Exception{
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid");
-
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
- //HashFmlBuf holdDeptBuf=p.readSchoolByAreaId(areaId,login);
- //HashFmlBuf manageDeptBuf=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("writeDepartment",bufschool);
- request.setAttribute("compereDepartment",bufschool);
- //request.setAttribute("holdDeptBuf",holdDeptBuf);
- //request.setAttribute("manageDeptBuf",manageDeptBuf);
- request.setAttribute("areaid",areaId);
-
- request.getRequestDispatcher("/zhyw/smhd/ActivitiesApplyAdd.jsp").forward(request, response);
-
- }
- //根据部门查询员工
- public void readEmployeeByDepartment(HttpServletRequest request, HttpServletResponse response)throws Exception{
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid"); //获取区县id
- String schoolId=request.getParameter("schoolid"); //获取部门id
- String compereSchoolId=request.getParameter("compereschoolid");
- request.setAttribute("areaid", areaId);
- request.setAttribute("schoolid", schoolId);
- request.setAttribute("compereschoolid",compereSchoolId);
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
- //HashFmlBuf holdDeptBuf=p.readSchoolByAreaId(areaId,login);
- //HashFmlBuf manageDeptBuf=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("writeDepartment",bufschool);
- HashFmlBuf bufCompereSchool=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("compereDepartment",bufCompereSchool);
- //request.setAttribute("compereDepartment",bufschool);
- //request.setAttribute("holdDeptBuf",holdDeptBuf);
- //request.setAttribute("manageDeptBuf",manageDeptBuf);
- //System.out.println("employee--------"+bufschool.getRowCount());
- HashFmlBuf bufEmployee=p.readEmployees(request, response);
- //HashFmlBuf holdEmpBuf=p.readEmployees(request, response);
- //HashFmlBuf manageEmpBuf=p.readEmployees(request, response);
- request.setAttribute("bufEmployee",bufEmployee);
- HashFmlBuf bufCompereEmployee=p.readCompereEmployees(request, response);
- request.setAttribute("bufCompereEmployee",bufCompereEmployee);
- //request.setAttribute("compereEmployee",bufEmployee);
- //request.setAttribute("holdEmpBuf",holdEmpBuf);
- //request.setAttribute("manageEmpBuf",manageEmpBuf);
- request.getRequestDispatcher("/zhyw/smhd/ActivitiesApplyAdd.jsp").forward(request, response);
- }
-
- //根据主持部门查询主持员工
- public void readCompereEmployeeByCompereDepartment(HttpServletRequest request, HttpServletResponse response)throws Exception{
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid"); //获取区县id
- String schoolId=request.getParameter("schoolid"); //获取部门id
- //System.out.println("--schoolId--"+schoolId);
- String compereSchoolId=request.getParameter("compereschoolid");
- //System.out.println("--compere--"+compereSchoolId);
- String employeeId=request.getParameter("writeempid");
- request.setAttribute("areaid", areaId);
- request.setAttribute("schoolid", schoolId);
- request.setAttribute("compereSchoolid",compereSchoolId);
- request.setAttribute("writeempid",employeeId);
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
- //HashFmlBuf holdDeptBuf=p.readSchoolByAreaId(areaId,login);
- //HashFmlBuf manageDeptBuf=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("writeDepartment",bufschool);
- HashFmlBuf bufCompereSchool=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("compereDepartment",bufCompereSchool);
- //request.setAttribute("compereDepartment",bufschool);
- //request.setAttribute("holdDeptBuf",holdDeptBuf);
- //request.setAttribute("manageDeptBuf",manageDeptBuf);
- //System.out.println("employee--------"+bufschool.getRowCount());
- HashFmlBuf bufEmployee=p.readEmployees(request, response);
- System.out.println("employee---"+bufEmployee.getRowCount());
- //HashFmlBuf holdEmpBuf=p.readEmployees(request, response);
- //HashFmlBuf manageEmpBuf=p.readEmployees(request, response);
- request.setAttribute("bufEmployee",bufEmployee);
- HashFmlBuf bufCompereEmployee=p.readCompereEmployees(request, response);
- System.out.println("compereemployee---"+bufCompereEmployee.getRowCount());
- request.setAttribute("bufCompereEmployee",bufCompereEmployee);
- //request.setAttribute("compereEmployee",bufEmployee);
- //request.setAttribute("holdEmpBuf",holdEmpBuf);
- //request.setAttribute("manageEmpBuf",manageEmpBuf);
- request.getRequestDispatcher("/zhyw/smhd/ActivitiesApplyAdd.jsp").forward(request, response);
- }
- public void toAddApply(HttpServletRequest request,HttpServletResponse response) throws IOException
- {
- response.sendRedirect("/zhyw/smhd/ActivitiesApplyAdd.jsp");
- }
- public void addActivitiesApply(HttpServletRequest request,HttpServletResponse response) throws SQLException, ServletException, IOException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String activitiesId=request.getParameter("activitiesId");
- //System.out.println("activities------"+activitiesId);
- String activitiesName=request.getParameter("activitiesName");
- String activitiesMotif=request.getParameter("activities_motif");
- String activitiesContent=request.getParameter("activities_content");
- String activitiesBeginDate=request.getParameter("begindate");
- String activitiesEndDate=request.getParameter("enddate");
- String activitiesType=request.getParameter("activiteType");
- //String participantDepartmentId=request.getParameter("participantDeptId");
- //String participantUserId=request.getParameter("participantUserId");
- //String activitiesBeginDate=request.getParameter("activitiesBeginDate");
-
- String compereUserId=request.getParameter("compereempid");
- String compereDepartmentId=request.getParameter("compereschoolid");
- //String applyType=request.getParameter("applyType");
- String remark=request.getParameter("remark");
- String applyDepartment=request.getParameter("schoolid");
- String applyUserId=request.getParameter("writeempid");
- String query="select a.activities_id from tab_activities_apply a where a.activities_id=?";
- String sql="insert into tab_activities_apply(activities_id,activities_motif,activities_content,activities_begin_date,"+
- "activities_end_date,compere_userid,compere_departmentid,activities_type,apply_type,apply_departmentid,"+
- "apply_userid,apply_date,create_departmentid,create_userid,create_date,activities_apply_name,remark,compere_date) "+
- "values(?,?,?,to_date(?,'%Y-%m-%d'),to_date(?,'%Y-%m-%d'),?,?,?,'0',?,?,now(),?,?,now(),?,?,now())";
-
- try {
- conn=DbConn.getConn();
- HashFmlBuf buf=(HashFmlBuf)JDBCUtils.query(conn,query,new Object[]{activitiesId},new HashFmlBufResultSetHandler());
- if(buf.getRowCount()==0)
- {
- pstmt=conn.prepareStatement(sql);
- pstmt.setString(1,activitiesId);
- pstmt.setString(2,activitiesMotif);
- pstmt.setString(3,activitiesContent);
- //pstmt.setString(4,participantDepartmentId);
- //pstmt.setString(5,participantUserId);
- pstmt.setString(4,activitiesBeginDate);
- pstmt.setString(5,activitiesEndDate);
- pstmt.setString(6,compereUserId);
- pstmt.setString(7,compereDepartmentId);
- pstmt.setString(8,activitiesType);
- //pstmt.setString(12,remark);
- pstmt.setString(9,applyDepartment);
- pstmt.setString(10,applyUserId);
- pstmt.setString(11,login.getDepartid());
- pstmt.setString(12,login.getEmpid());
- pstmt.setString(13,activitiesName);
- pstmt.setString(14,remark);
- pstmt.execute();
- //oracle数据库手动提交,mysql中 自动提交auto();
- conn.commit();
- queryPage(request, response);
- }
- else
- {
- request.setAttribute("activitiesId",activitiesId);
- request.getRequestDispatcher("/zhyw/smhd/error.jsp").forward(request, response);
- }
- } catch (SQLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- finally
- {
- if(pstmt!=null)
- {
- pstmt.close();
- }
- if(conn!=null)
- {
- conn.close();
- }
- }
-
- }
- public void queryPage(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid");
- String departmentId=request.getParameter("schoolid");
- String employeeId=request.getParameter("writeempid");
- String activitiesType=request.getParameter("activitiestype");
- String applyType=request.getParameter("applystate");
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("applyDepartment",bufschool);
- HashFmlBuf bufEmployee=p.readEmployees(request, response);
- request.setAttribute("bufEmployee",bufEmployee);
- StringBuffer sql=new StringBuffer("select a.activities_id,a.activities_motif,a.activities_content," +
- "a.activities_begin_date,a.activities_end_date,a.compere_departmentid,a.compere_userid," +
- "a.activities_type,a.activities_apply_name,a.compere_date,a.apply_type,a.apply_userid,a.apply_departmentid,d.departid,d.departname," +
- "e.empid,e.empname from tab_activities_apply a left join tab_department d on a.apply_departmentid=d.departid" +
- " left join tab_employee e on a.apply_userid=e.empid where 1=1");
- String activitiesId=request.getParameter("activitiesId");
- if(!Common.isNull(activitiesId))
- {
- sql.append(" and a.activities_id='"+activitiesId+"'");
- }
- else{
- if(!Common.isNull(areaId))
- {
- sql.append(" and d.areaid='"+areaId+"'");
- }
- if(!Common.isNull(departmentId))
- {
- sql.append(" and a.apply_departmentid='"+departmentId+"'");
- }
- if(!Common.isNull(activitiesType))
- {
- sql.append(" and a.activities_type='"+activitiesType+"'");
- }
- if(!Common.isNull(applyType))
- {
- sql.append(" and a.apply_type='"+applyType+"'");
- }
- }
- try
- {
- conn=DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf applyBuf=(HashFmlBuf)pageQuery.query(100);
- if (applyBuf != null && applyBuf.getRowCount() > 0) {
- request.setAttribute("applyInfo",applyBuf);
- }
- request.getRequestDispatcher("/zhyw/smhd/ActivitiesApplyManage.jsp").forward(request, response);
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void toEditApply(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
-// String departmentId=request.getParameter("departmentId");
-// String employeeId=request.getParameter("employeeId");
- String activitiesId=request.getParameter("activitiesId");
-
- StringBuffer sql=new StringBuffer("select a.activities_id,a.activities_motif,a.activities_content,a.activities_apply_name," +
- "a.activities_begin_date,a.activities_end_date," +
- "a.compere_userid,a.compere_departmentid,a.activities_type,a.apply_type,a.remark,a.apply_departmentid," +
- "a.apply_userid,a.apply_date,d.departid,d.departname,d.areaid,e.empid,e.empname from tab_activities_apply a left join " +
- "tab_department d on d.departid=a.apply_departmentid and d.departid=a.compere_departmentid left join tab_employee e on a.apply_userid=e.empid and a.compere_userid=e.empid" +
- " where a.activities_id=?");
- HashFmlBuf buf=null;
- Connection conn=null;
- try
- {
- conn=DbConn.getConn();
- buf=(HashFmlBuf)JDBCUtils.query(conn, sql.toString(),new Object[]{activitiesId,},new HashFmlBufResultSetHandler());
- request.setAttribute("activitiesBuf",buf);
- HashFmlBuf bufCompereEmployee=p.readCompereEmployees(request, response);
- //System.out.println("compereemployee---"+bufCompereEmployee.getRowCount());
- request.setAttribute("bufCompereEmployee",bufCompereEmployee);
-
- request.getRequestDispatcher("/zhyw/smhd/ActivitiesApplyEdit.jsp").forward(request,response);
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void updateActivitiesApply(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String remark=request.getParameter("remark");
- String activitiesId=request.getParameter("activitiesId");
- String activitiesMotif=request.getParameter("activities_motif");
- String activitiesContent=request.getParameter("activities_content");
- //String participantDepartmentId=request.getParameter("particantDepartmentId");
- //String participantUserId=reques.getParameter("participantUserId");
- String activitiesBeginDate=request.getParameter("begindate");
- String activitiesEndDate=request.getParameter("enddate");
- //String compereUserId=request.getParameter("compereUserId");
- //String compereDepartmentId=request.getParameter("compereDepartmentId");
- //String activitiesType=request.getParameter("activitiesType");
- //String applyType=request.getParameter("applyType");
- String applyName=request.getParameter("activities_apply_name");
-
- String sql="update tab_activities_apply a set a.activities_motif=?,a.activities_content=?," +
- "a.activities_begin_date=to_date(?,'%Y-%m-%d'),a.activities_end_date=to_date(?,'%Y-%m-%d')," +
- "a.remark=?,a.activities_apply_name=?,a.update_departmentid=?,a.update_userid=?,a.update_date=now() where a.activities_id=?";
- try
- {
- conn=DbConn.getConn();
- pstmt=conn.prepareStatement(sql);
- pstmt.setString(1,activitiesMotif);
- pstmt.setString(2,activitiesContent);
- //pstmt.setString(3,participantDepartmentId);
- //pstmt.setString(4,participantUserId);
- pstmt.setString(3,activitiesBeginDate);
- pstmt.setString(4,activitiesEndDate);
- //pstmt.setString(7,compereUserId);
- //pstmt.setString(8,compereDepartmentId);
- //pstmt.setString(9,activitiesType);
- //pstmt.setString(10,applyType);
- pstmt.setString(5,remark);
- pstmt.setString(6,applyName);
- pstmt.setString(7,login.getDepartid());
- pstmt.setString(8,login.getEmpid());
- pstmt.setString(9,activitiesId);
- pstmt.execute();
- //oracle数据库手动提交,mysql中 自动提交autoCommit();
- conn.commit();
- queryPage(request, response);
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- if(pstmt!=null)
- {
- pstmt.close();
- }
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void updateApplyState(HttpServletRequest request,HttpServletResponse response)
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String activitiesId=request.getParameter("activitiesId");
- String sql="update tab_activities_apply a set a.apply_type='1',a.update_date=now()," +
- "a.update_userid=?,a.update_departmentid=?,a.examine_departmentid=?,a.examine_userid=?,a.examine_date=now() where a.activities_id=?";
- try {
- System.out.println("examine---"+activitiesId);
- conn=DbConn.getConn();
- pstmt=conn.prepareStatement(sql);
- pstmt.setString(1,login.getEmpid());
- pstmt.setString(2,login.getDepartid());
- pstmt.setString(3,login.getDepartid());
- pstmt.setString(4,login.getEmpid());
- pstmt.setString(5,activitiesId);
- pstmt.execute();
- //oracle数据库手动提交,mysql中 自动提交autoCommit();
- conn.commit();
-
- queryPage(request, response);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- public void showApplyInfo(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- HashFmlBuf buf=null;
- String activitiesId=request.getParameter("activitiesId");
- String sql="select a.activities_id,a.activities_motif,a.activities_content,a.activities_apply_name," +
- "a.activities_begin_date,a.activities_end_date,a.compere_userid,a.compere_departmentid," +
- "a.activities_type,a.apply_type,a.remark,a.apply_departmentid,a.apply_userid,a.apply_date,a.examine_departmentid," +
- "a.examine_userid,a.examine_date,d.departid,d.departname,e.empid,e.empname from tab_activities_apply a left join tab_department d" +
- " on a.apply_departmentid=d.departid left join tab_employee e on a.apply_userid=e.empid where a.activities_id=?";
- try
- {
- conn=DbConn.getConn();
- buf=(HashFmlBuf)JDBCUtils.query(conn,sql,new Object[]{activitiesId},new HashFmlBufResultSetHandler());
- System.out.println("buf-----"+buf.getRowCount());
- request.setAttribute("activitiesInfo", buf);
- request.getRequestDispatcher("/zhyw/smhd/showActivities.jsp").forward(request, response);
- }
- catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 通过区县读取部门
- * @param request
- * @param response
- * @throws Exception
- */
- public void readAridSchoolManage(HttpServletRequest request,
- HttpServletResponse response)throws Exception{
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid");
-
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf holdDeptBuf=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf manageDeptBuf=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("applyDepartment",bufschool);
- request.setAttribute("holdDeptBuf",holdDeptBuf);
- request.setAttribute("manageDeptBuf",manageDeptBuf);
-
- request.setAttribute("areaid", areaId);
-
- request.getRequestDispatcher("/zhyw/smhd/ActivitiesApplyManage.jsp").forward(request, response);
-
- }
-
-
-
-
-
-
- //根据部门查询员工
- public void readEmployeeByDepartmentManage(HttpServletRequest request, HttpServletResponse response)throws Exception{
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid"); //获取区县id
- String schoolId=request.getParameter("schoolid"); //获取部门id
- request.setAttribute("areaid", areaId);
- request.setAttribute("schoolid", schoolId);
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
-
- request.setAttribute("applyDepartment",bufschool);
-
- //System.out.println("employee--------"+bufschool.getRowCount());
- HashFmlBuf bufEmployee=p.readEmployees(request, response);
-
- request.setAttribute("bufEmployee",bufEmployee);
-
- request.getRequestDispatcher("/zhyw/smhd/ActivitiesApplyManage.jsp").forward(request, response);
- }
-}
diff --git a/src/main/java/com/zky/zhyw/smhd/ActivitiesNoteServlet.java b/src/main/java/com/zky/zhyw/smhd/ActivitiesNoteServlet.java
deleted file mode 100644
index f96f5a4..0000000
--- a/src/main/java/com/zky/zhyw/smhd/ActivitiesNoteServlet.java
+++ /dev/null
@@ -1,269 +0,0 @@
-package com.zky.zhyw.smhd;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import com.zky.manager.Login;
-import com.zky.pub.DbConn;
-import com.zky.pub.DispatchServlet;
-import com.zky.pub.HashFmlBuf;
-import com.zky.util.PageQuery;
-import com.zky.util.jdbc.HashFmlBufResultSetHandler;
-import com.zky.util.jdbc.JDBCUtils;
-
-public class ActivitiesNoteServlet extends DispatchServlet {
-Connection conn=null;
-PreparedStatement pstmt=null;
-HashFmlBuf buf=null;
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- @Override
- public void defaultMethod(HttpServletRequest request,
- HttpServletResponse response) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- public void addActivitiesNote(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String notesId=request.getParameter("notedId");
- String activitiesId=request.getParameter("activitiesId");
- String activitiesMotif=request.getParameter("activitiesMotif");
- String activitiesContent=request.getParameter("activitiesContent");
- String activitiesBeginDate=request.getParameter("beginDate");
- String activitiesEndDate=request.getParameter("endDate");
- String activitiesAddress=request.getParameter("address");
- String compereDepartmentId=request.getParameter("compereDepartId");
- String compereUserId=request.getParameter("compereUserId");
- String activitiesType=request.getParameter("activitiesType");
- String remark=request.getParameter("remark");
- String meetingSummary=request.getParameter("meetingSummary");
- String workEmphasis=request.getParameter("workEmphasis");
- String noteDepartmentId=request.getParameter("noteDepartmentId");
- String noteUserId=request.getParameter("noteUserId");
- String notesState=request.getParameter("notesState");
- String activitiesDepartmentId=request.getParameter("activitiesDepartmentId");
- String activitiesUserId=request.getParameter("activitiesUserId");
- String query="select notesid from tab_activities_notes where notesid=?";
- String sql="insert into tab_activities_notes(notesid,activities_id,activities_motif," +
- "activities_content,activities_begin_date,activities_end_date,activities_address," +
- "compere_departmentid,compere_userid,activities_type,reamrk,meeting_summary," +
- "work_emphasis,note_departmentid,note_userid,note_date,create_departmentid," +
- "create_userid,create_date,notes_state,activities_apply_departmentid," +
- "activities_apply_userid)" +
- " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,now(),?,?now(),?,?,?)";
- try
- {
- conn=DbConn.getConn();
- buf=(HashFmlBuf)JDBCUtils.query(conn, query,new Object[]{notesId},new HashFmlBufResultSetHandler());
- if(buf.getRowCount()==0)
- {
- pstmt=conn.prepareStatement(sql);
- pstmt.setString(1,notesId);
- pstmt.setString(2,activitiesId);
- pstmt.setString(3,activitiesMotif);
- pstmt.setString(4,activitiesContent);
- pstmt.setString(5,activitiesBeginDate);
- pstmt.setString(6,activitiesEndDate);
- pstmt.setString(7,activitiesAddress);
- pstmt.setString(8,compereDepartmentId);
- pstmt.setString(9,compereUserId);
- pstmt.setString(10,activitiesType);
- pstmt.setString(11,remark);
- pstmt.setString(12,meetingSummary);
- pstmt.setString(13,workEmphasis);
- pstmt.setString(14,noteDepartmentId);
- pstmt.setString(15,noteUserId);
- pstmt.setString(16,login.getDepartid());
- pstmt.setString(17,login.getEmpid());
- pstmt.setString(18,notesState);
- pstmt.setString(19,activitiesDepartmentId);
- pstmt.setString(20,activitiesUserId);
- pstmt.execute();
- //oracle数据库手动提交,mysql中 自动提交autoCommit();
- conn.commit();
- }
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- if(pstmt!=null)
- {
- pstmt.close();
- }
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
-
- public void queryPage(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String notesId=request.getParameter("notesId");
- String departmentId=request.getParameter("departmentId");
- String employeeId=request.getParameter("employeeId");
- String areaId=request.getParameter("areaId");
- String activitesType=request.getParameter("activitiesType");
- String notesState=request.getParameter("notesState");
- //String apllyState=request.getParameter("applyS")
- StringBuffer sql=new StringBuffer("select n.notesid,n.activities_id,n.activities_motif,n.activities_content," +
- "n.notes_state,n.activities_begin_date,n.activities_end_date,n.activities_address," +
- "n.compere_departmentid,n.compere_userid,n.activities_type,n.remark,n.meeting_summary," +
- "n.work_emphasis,n.activities_apply_departmentid,n.activities_apply_userid,a.activities_id," +
- "d.departid,d.departname,e.empid,e.empname from tab_activities_notes n left join tab_activities_apply a" +
- " on n.activities_id=a.activites_id left join tab_department d on n.activities_apply_departmentid=d.departid" +
- " left join tab_employee on n.activities_apply_userid=e.empid where 1=1");
- if(!notesId.equals(""))
- {
- sql.append(" and n.notesid='"+notesId+"'");
- }
- if(!departmentId.equals(""))
- {
- sql.append(" and n.activities_apply_departmentid='"+departmentId+"'");
- }
- if(!employeeId.equals(""))
- {
- sql.append(" and n.activities_apply_userid='"+employeeId+"'");
- }
- if(!activitesType.equals(""))
- {
- sql.append(" and n.activities_type='"+activitesType+"'");
- }
- if(!notesState.equals(""))
- {
- sql.append(" and n.notes_state='"+notesState+"'");
- }
- try
- {
- conn=DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- if (buf != null && buf.getRowCount() > 0) {
- request.setAttribute("notesInfo",buf);
- }
- request.getRequestDispatcher("/zhyw/smhd/notesManage.jsp").forward(request, response);
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void toEditNotes(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String notesId=request.getParameter("notesId");
- String sql="select n.notesid,n.activities_id,n.activities_motif,n.activities_content," +
- "n.activities_begin_date,n.activities_apply_departmentid,n.activities_apply_userid," +
- "n.activities_end_date,n.activities_address,n.compere_departmentid," +
- "n.compere_userid,n.activities_type,n.reamrk,n.meeting_summary,n.work_emphasis,n.notes_departmentid," +
- "n.notes_userid,a.activities_id,d.departid,d.departname,e.empid,e.empname from tab_activities_notes n" +
- " left join tab_activities_apply on n.activities_id=a.activities_id left join tab_department d" +
- " on n.activities_apply_departmentid=d.departid left join tab_employee on n.apply_activities_userid=e.empid where" +
- " n.notesid=?";
- try
- {
- conn=DbConn.getConn();
- buf=(HashFmlBuf)JDBCUtils.query(conn,sql,new Object[]{notesId},new HashFmlBufResultSetHandler());
- request.setAttribute("notesBuf",buf);
- request.getRequestDispatcher("/zhyw/smhd/notesEdit.jsp").forward(request, response);
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void updateNotes(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String notesId=request.getParameter("notesId");
- String activitiesBeginDate=request.getParameter("beginDate");
- String activitiesEndDate=request.getParameter("endDate");
- String activitiesAddress=request.getParameter("activitiesAddress");
- String compereDepartmentId=request.getParameter("compereDepartmentId");
- String compereUserId=request.getParameter("compereUserId");
- String activitiesType=request.getParameter("activitiesType");
- String remark=request.getParameter("remark");
- String meetingSummary=request.getParameter("meetingSummary");
- String workEmphasis=request.getParameter("workEmphasisi");
- String notesDepartmentId=request.getParameter("notesDepartmentId");
- String notesUserId=request.getParameter("notesUserId");
-
- String sql="update tab_activities_notes n set n.activities_begin_date=?,n.activities_end_date=?," +
- "n.activities_address=?,n.compere_departmentid=?,n.compere_userid=?,n.activities_type=?," +
- "n.remark=?,n.meeting_summary=?,n.work_emphasis=?,n.notes_departmentid=?,n.notes_userid=?" +
- " where n.notesid=?";
- try
- {
- conn=DbConn.getConn();
- pstmt=conn.prepareStatement(sql);
-
- pstmt.execute();
- //oracle数据库手动提交,mysql中 自动提交autoCommit();
- conn.commit();
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- if(pstmt!=null)
- {
- pstmt.close();
- }
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void showNotes(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String notesId=request.getParameter("notesId");
- StringBuffer sql=new StringBuffer("select n.notesid,n.activities_id,n.activities_content,n.notes_state,n.activities_begin_date," +
- "n.activities_end_date,n.activities_address,n.compere_departmentid,n.compere_userid,n.activities_type," +
- "n.activities_apply_deparmtnetid,n.activities_apply_userid,d.departid,d.departname,e.empid,e.empname," +
- "n.remark,n.meeting_summary,n.work_emphasis,n.note_departmentid,n.note_userid,n.note_date,a.activities_id from " +
- "tab_activities_notes n left join tab_activities_apply a on n.activities_id=a.activities_id left join tab_department d" +
- " on n.activities_apply_departmentid=d.departid left join tab_employee e on n.activities_apply_userid=e.empid where n.notesid=?");
- try {
- conn=DbConn.getConn();
- buf=(HashFmlBuf)JDBCUtils.query(conn,sql.toString(),new Object[]{notesId},new HashFmlBufResultSetHandler());
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
-}
diff --git a/src/main/java/com/zky/zhyw/smhd/QueryUtils.java b/src/main/java/com/zky/zhyw/smhd/QueryUtils.java
deleted file mode 100644
index f7a24f3..0000000
--- a/src/main/java/com/zky/zhyw/smhd/QueryUtils.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package com.zky.zhyw.smhd;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import com.zky.pub.DbConn;
-import com.zky.pub.HashFmlBuf;
-import com.zky.util.jdbc.HashFmlBufResultSetHandler;
-import com.zky.util.jdbc.JDBCUtils;
-
-public class QueryUtils
-{
- public static String getDepartNameByDepartId(String departId) throws SQLException
- {
- String sql="select departname from tab_department where departId=?";
- Connection conn=null;
- try {
- conn=DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf) JDBCUtils.query(conn, sql, departId, new HashFmlBufResultSetHandler());
- if(buf!=null && buf.getRowCount()>0)
- {
- return buf.fget("departname",0);
- }
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
- }
- public static String getEmpNameByEmpId(String employeeId) throws SQLException
- {
- String sql="select empname from tab_employee where empid=?";
- Connection conn=null;
- try {
- conn=DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf) JDBCUtils.query(conn, sql, employeeId, new HashFmlBufResultSetHandler());
- if(buf!=null && buf.getRowCount()>0)
- {
- return buf.fget("empname",0);
- }
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
- }
-}
diff --git a/src/main/java/com/zky/zhyw/smjc/CheckManageServlet.java b/src/main/java/com/zky/zhyw/smjc/CheckManageServlet.java
deleted file mode 100644
index 2e54572..0000000
--- a/src/main/java/com/zky/zhyw/smjc/CheckManageServlet.java
+++ /dev/null
@@ -1,1595 +0,0 @@
-package com.zky.zhyw.smjc;
-import java.io.IOException;
-import java.net.URLEncoder;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import com.zky.bjca.SM4;
-import cn.org.bjca.utils.Base64;
-import org.apache.log4j.Logger;
-import org.apache.poi.hssf.usermodel.HSSFCell;
-import org.apache.poi.hssf.usermodel.HSSFCellStyle;
-import org.apache.poi.hssf.usermodel.HSSFFont;
-import org.apache.poi.hssf.usermodel.HSSFRow;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.hssf.util.HSSFColor;
-import com.zky.manager.Login;
-import com.zky.manager.Operate;
-import com.zky.manager.StudentPullulate;
-import com.zky.pojo.Check;
-import com.zky.pub.Common;
-import com.zky.pub.DbConn;
-import com.zky.pub.DispatchServlet;
-import com.zky.pub.HashFmlBuf;
-import com.zky.util.PageQuery;
-import com.zky.util.jdbc.HashFmlBufResultSetHandler;
-import com.zky.util.jdbc.JDBCUtils;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-/**
- * @author cxz
- * 检查管理
- * 检查通知管理
- */
-public class CheckManageServlet extends DispatchServlet {
- private static final Logger log = Logger.getLogger(CheckManageServlet.class);
- private StudentPullulate p=new StudentPullulate();
- Connection conn=null;
- /**
- * 登记检查记录
- * @param request
- * @param response
- * @throws IOException
- */
- public void addCheck(HttpServletRequest request, HttpServletResponse response) throws IOException {
- Login login = (Login) request.getSession().getAttribute("login");
- //检查记录信息
- String checkId="";
- String departId=request.getParameter("departId");
- String sj=request.getParameter("sj");
- String qj=request.getParameter("qj");
- String checkStartTime=request.getParameter("checkStartTime");
- String checkName=request.getParameter("checkName");
- String checkContentry=request.getParameter("checkContentry");
- String checkContentryjt=request.getParameter("checkContentryjt");
- String checkContentwj=request.getParameter("checkContentwj");
- String checkContentwjjt=request.getParameter("checkContentwjjt");
- String checkContentsb=request.getParameter("checkContentsb");
- String checkContentsbjt=request.getParameter("checkContentsbjt");
- String checkContentryglzd=request.getParameter("checkContentryglzd");
- String checkContentryglzdjt=request.getParameter("checkContentryglzdjt");
- String checkContentrysmsj=request.getParameter("checkContentrysmsj");
- String checkContentrysmsjjt=request.getParameter("checkContentrysmsjjt");
- String checkContentryother=request.getParameter("checkContentryother");
- String checkContentryotherjt=request.getParameter("checkContentryotherjt");
- String sql =
- "insert into td_check(deptart_Id,check_start_time," +
- "areaId,frameworkId,CHECK_NAME,checkContentry,checkContentwj," +
- "checkContentsb,checkContentryglzd,checkContentrysmsj,checkContentryjt,checkContentwjjt," +
- "checkContentsbjt,checkContentryglzdjt,checkContentrysmsjjt,checkContentryother,checkContentryotherjt) values(?,date_format(?,'%Y-%m-%d'),?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = DbConn.getConn();
- prep = conn.prepareStatement(sql);
- prep.setString(1,login.getDepartid());
- prep.setString(2,checkStartTime);
- prep.setString(3,login.getAreaid());
- prep.setString(4,login.getCompanyid());
- prep.setString(5,checkName);
- prep.setString(6,checkContentry);
- prep.setString(7,checkContentwj);
- prep.setString(8,checkContentsb);
- prep.setString(9,checkContentryglzd);
- prep.setString(10,checkContentrysmsj);
- prep.setString(11,checkContentryjt);
- prep.setString(12,checkContentwjjt);
- prep.setString(13,checkContentsbjt);
- prep.setString(14,checkContentryglzdjt);
- prep.setString(15,checkContentrysmsjjt);
- prep.setString(16,checkContentryother);
- prep.setString(17,checkContentryotherjt);
- prep.execute();
- //oracle数据库手动提交,mysql中 自动提交autoCommit();
- conn.commit();
- Common.updateParaTab("td_check");
- queryCheck(request,response);
- Operate oper=new Operate();
- oper.operatesmbgbgLog(request);
- } catch (SQLException e) {
- String errorinfo = "";
- if (e.getMessage().startsWith("ORA-00001")) {
- errorinfo = "检查报告生成失败,该检查编号[" + checkId + "]已经存在!";
- } else {
- errorinfo = "检查报告生成失败!" + e.toString();
- }
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode(errorinfo,"GB2312")));
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("检查报告生成失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (prep!= null) {
- prep.close();
- }
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 检查通知添加页面
- * @param request
- * @param response
- * @throws IOException
- */
- public void addCheckNotify(HttpServletRequest request, HttpServletResponse response) throws IOException {
- log.debug("# add checkNotify!");
- Login login = (Login) request.getSession().getAttribute("login");
- //检查记录信息
- String notifyStaffid=request.getParameter("notifyStaffid");
- String departId=request.getParameter("school");
- String notifyTime=request.getParameter("notifyTime");
- String notifyContent=request.getParameter("notifyContent");
- String notifyStaffed=request.getParameter("notifyStaffed");
- String sj=request.getParameter("sj");
- String qj=request.getParameter("qj");
- String sql =
- "insert into td_notify(notify_staff_Id,notify_depart_Id,notify_time,notify_content,notify_staffed," +
- "notify_state,areaId,frameworkId) values(?,?,date_format(?,'%Y-%m-%d'),?,?,1,?,?)";
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = DbConn.getConn();
- prep = conn.prepareStatement(sql);
- prep.setString(1,login.getEmpname());
- prep.setString(2,departId);
- prep.setString(3,notifyTime);
- prep.setString(4,notifyContent);
- prep.setString(5,Base64.toBase64String(SM4.SM4Encrypt(notifyStaffed)));
- prep.setString(6,qj);
- prep.setString(7,sj);
- prep.execute();
- //oracle数据库手动提交,mysql中 自动提交autoCommit();
- conn.commit();
- Common.updateParaTab("td_notify");
- queryCheckNotify(request,response);
- Operate oper=new Operate();
- oper.operatesmtzxjLog(request);
- } catch (SQLException e) {
- String errorinfo = "";
- if (e.getMessage().startsWith("ORA-00001")) {
- errorinfo = "检查通知添加失败,";
- } else {
- errorinfo = "检查通知添加失败!" + e.toString();
- }
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode(errorinfo,"GB2312")));
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("检查通知添加失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (prep!= null) {
- prep.close();
- }
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e){
- e.printStackTrace();
- }
- }
- }
- /**
- * 现场检查
- * @param request
- * @param response
- * @throws IOException
- * @throws SQLException
- */
- public void CheckReaultPort(HttpServletRequest request, HttpServletResponse response) throws IOException, SQLException {
- log.debug("# check CheckReaultPort!");
- Login login = (Login) request.getSession().getAttribute("login");
- String checkId=request.getParameter("checkId");
- String checkStartTime=request.getParameter("checkStartTime");
- String checkContentry=request.getParameter("checkContentry");
- String checkContentryjt=request.getParameter("checkContentryjt");
- String checkContentwj=request.getParameter("checkContentwj");
- String checkContentwjjt=request.getParameter("checkContentwjjt");
- String checkContentsb=request.getParameter("checkContentsb");
- String checkContentsbjt=request.getParameter("checkContentsbjt");
- String checkContentryglzd=request.getParameter("checkContentryglzd");
- String checkContentryglzdjt=request.getParameter("checkContentryglzdjt");
- String checkContentrysmsj=request.getParameter("checkContentrysmsj");
- String checkContentrysmsjjt=request.getParameter("checkContentrysmsjjt");
- String checkContentryother=request.getParameter("checkContentryother");
- String checkContentryotherjt=request.getParameter("checkContentryotherjt");
- String sql =
- "update td_check set check_start_time=date_format(?,'%Y-%m-%d')," +
- "checkContentry=?,checkContentwj=?,checkContentsb=?,checkContentryglzd=?,checkContentrysmsj=?,checkContentryjt=?,checkContentwjjt=?," +
- "checkContentsbjt=?,checkContentryglzdjt=?,checkContentrysmsjjt=?,checkContentryother=?,checkContentryotherjt=? where check_id=?";
-
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = DbConn.getConn();
- prep = conn.prepareStatement(sql);
- prep.setString(1,checkStartTime );
- prep.setString(2,checkContentry );
- prep.setString(3,checkContentwj );
- prep.setString(4,checkContentsb );
- prep.setString(5,checkContentryglzd );
- prep.setString(6,checkContentrysmsj );
- prep.setString(7, checkContentryjt);
- prep.setString(8,checkContentwjjt );
- prep.setString(9,checkContentsbjt );
- prep.setString(10,checkContentryglzdjt );
- prep.setString(11,checkContentrysmsjjt );
- prep.setString(12,checkContentryother );
- prep.setString(13,checkContentryotherjt );
- prep.setString(14,checkId );
- prep.execute();
- //oracle数据库手动提交,mysql中 自动提交autoCommit();
- conn.commit();
- Common.updateParaTab("td_check");
- queryCheck(request, response);
- Operate oper=new Operate();
- oper.operatesmbgxgLog(request);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("检查记录修改失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (prep!= null) {
- prep.close();
- }
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 现场检查
- * @param request
- * @param response
- * @throws IOException
- * @throws SQLException
- */
- public void CheckOwnReaultPort(HttpServletRequest request, HttpServletResponse response) throws IOException, SQLException {
- Login login = (Login) request.getSession().getAttribute("login");
- String checkId=request.getParameter("checkId");
- String chenkOwnResultTime=request.getParameter("chenkOwnResultTime");
- String chenkOwnResult1=request.getParameter("chenkOwnResult1");
- String chenkOwnResult2=request.getParameter("chenkOwnResult2");
- String chenkOwnResult3=request.getParameter("chenkOwnResult3");
- String chenkOwnResult4=request.getParameter("chenkOwnResult4");
- String chenkOwnResult5=request.getParameter("chenkOwnResult5");
- String chenkOwnResult6=request.getParameter("chenkOwnResult6");
- String sql=null;
- if(chenkOwnResult1.equals("合格")&&chenkOwnResult2.equals("合格")&&chenkOwnResult3.equals("合格")&&chenkOwnResult4.equals("合格")&&chenkOwnResult5.equals("合格")&&chenkOwnResult6.equals("合格")){
- sql = "update td_check set chenkOwnResultTime=date_format(?,'%Y-%m-%d'),chenkOwnResult1=?,chenkOwnResult2=?,chenkOwnResult3=?,chenkOwnResult4=?,chenkOwnResult5=?,chenkOwnResult6=?,CHECK_STATE=? where check_id=?";
- }else {
- sql = "update td_check set chenkOwnResultTime=date_format(?,'%Y-%m-%d'),chenkOwnResult1=?,chenkOwnResult2=?,chenkOwnResult3=?,chenkOwnResult4=?,chenkOwnResult5=?,chenkOwnResult6=? where check_id=?";
- }
-
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = DbConn.getConn();
- prep = conn.prepareStatement(sql);
- prep.setString(1,chenkOwnResultTime );
- prep.setString(2,chenkOwnResult1 );
- prep.setString(3,chenkOwnResult2 );
- prep.setString(4,chenkOwnResult3 );
- prep.setString(5,chenkOwnResult4 );
- prep.setString(6,chenkOwnResult5 );
- prep.setString(7,chenkOwnResult6);
- if(chenkOwnResult1.equals("合格")&&chenkOwnResult2.equals("合格")&&chenkOwnResult3.equals("合格")&&chenkOwnResult4.equals("合格")&&chenkOwnResult5.equals("合格")&&chenkOwnResult6.equals("合格")){
- prep.setString(8,"0");
- prep.setString(9,checkId );
- }else {
- prep.setString(8,checkId );
- }
- prep.execute();
- conn.commit();
- queryCheck(request, response);
- Operate oper=new Operate();
- oper.operatesmbgxgLog(request);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("检查记录修改失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (prep!= null) {
- prep.close();
- }
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 现场检查
- * @param request
- * @param response
- * @throws IOException
- * @throws SQLException
- */
- public void CheckReault(HttpServletRequest request, HttpServletResponse response) throws IOException, SQLException {
- Login login = (Login) request.getSession().getAttribute("login");
- String checkId=request.getParameter("checkId");
- String checkStartTime=request.getParameter("checkStartTime");
- String checkEndTime=request.getParameter("checkEndTime");
- String checkType=request.getParameter("checkType");
- String checkReault1=request.getParameter("checkReault1");
- String chenkResult2=request.getParameter("chenkResult2");
- String chenkResult3=request.getParameter("chenkResult3");
- String chenkResult4=request.getParameter("chenkResult4");
- String chenkResult5=request.getParameter("chenkResult5");
- String chenkResult6=request.getParameter("chenkResult6");
- String checkstate="";
- System.out.println("-=-=-=-=-=-=-=-=-=-="+checkId);
- /* if(checkReault1.equals("合格")&&chenkResult2.equals("合格")&&chenkResult3.equals("合格")&&chenkResult4.equals("合格")&&chenkResult5.equals("合格")&&chenkResult6.equals("合格")){
- checkstate="0";
- }else{
- checkstate="1";
- }*/
- String remark1=request.getParameter("remark1");
- String remark2=request.getParameter("remark2");
- String remark3=request.getParameter("remark3");
- String remark4=request.getParameter("remark4");
- String remark5=request.getParameter("remark5");
- String remark6=request.getParameter("remark6");
- String departId=request.getParameter("departId");
- String sql=null;
- if(checkReault1.equals("合格")&&chenkResult2.equals("合格")&&chenkResult3.equals("合格")&&chenkResult4.equals("合格")&&chenkResult5.equals("合格")&&chenkResult6.equals("合格")){
- sql ="update td_check a set a.check_start_time=date_format(?,'%Y-%m-%d')," +
- "a.check_end_time=date_format(?,'%Y-%m-%d'), a.check_type=?," +
- "remark1=?,remark2=?,remark3=?,remark4=?,remark5=?,remark6=?,checkReault1=?," +
- "checkReault2=?,checkReault3=?,checkReault4=?,checkReault5=?,checkReault6=?,deptartreault=?" +
- ",a.check_state=?,a.empid=?,CHECK_STATE=? where a.check_id=?";
- }else {
- sql ="update td_check a set a.check_start_time=date_format(?,'%Y-%m-%d')," +
- "a.check_end_time=date_format(?,'%Y-%m-%d'), a.check_type=?," +
- "remark1=?,remark2=?,remark3=?,remark4=?,remark5=?,remark6=?,checkReault1=?," +
- "checkReault2=?,checkReault3=?,checkReault4=?,checkReault5=?,checkReault6=?,deptartreault=?" +
- ",a.check_state=?,a.empid=? where a.check_id=?";
- }
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = DbConn.getConn();
- prep = conn.prepareStatement(sql);
- prep.setString(1,checkStartTime );
- prep.setString(2,checkEndTime );
- prep.setString(3,checkType );
- prep.setString(4,remark1 );
- prep.setString(5,remark2 );
- prep.setString(6,remark3 );
- prep.setString(7,remark4 );
- prep.setString(8,remark5 );
- prep.setString(9,remark6 );
- prep.setString(10,checkReault1 );
- prep.setString(11,chenkResult2 );
- prep.setString(12,chenkResult3 );
- prep.setString(13,chenkResult4 );
- prep.setString(14,chenkResult5 );
- prep.setString(15,chenkResult6 );
- prep.setString(16,departId );
- prep.setString(17,checkstate );
- prep.setString(18,login.getEmpname());
- if(checkReault1.equals("合格")&&chenkResult2.equals("合格")&&chenkResult3.equals("合格")&&chenkResult4.equals("合格")&&chenkResult5.equals("合格")&&chenkResult6.equals("合格")){
- prep.setString(19,"0");
- prep.setString(20,checkId );
- }else{
- prep.setString(19,checkId );
- }
- prep.execute();
- //oracle数据库手动提交,mysql中 自动提交autoCommit();
- conn.commit();
- Common.updateParaTab("td_check");
- StringBuffer sql1 =
- new StringBuffer("select a.check_Id,a.deptart_id,a.empid,date_format(a.check_start_time ,'%Y-%m-%d') as check_start_time,date_format(a.check_end_time ,'%Y-%m-%d') as check_end_time ," +
- "a.check_state,a.check_type,a.check_name,b.empname from td_check a left join tab_employee b on a.empid=b.empid where 1=1");
-
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql1.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("check_info",buf);
- Operate oper=new Operate();
- oper.operatesmbgcxLog(request);
- request.getRequestDispatcher("/zhyw/smjc/CheckManageReault.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("检查记录修改失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (prep!= null) {
- prep.close();
- }
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 检查编辑
- * @param request
- * @param response
- * @throws IOException
- */
- public void UpdateCheck(HttpServletRequest request, HttpServletResponse response) throws IOException {
- Login login = (Login) request.getSession().getAttribute("login");
- String checkId=request.getParameter("checkId");
- String checkStartTime=request.getParameter("checkStartTime");
- String checkEndTime=request.getParameter("checkEndTime");
- String checkType=request.getParameter("checkType");
- String address=request.getParameter("address");
- String checkContentryjt=request.getParameter("checkContentryjt");
- String checkContentwjjt=request.getParameter("checkContentwjjt");
- String checkContentsbjt=request.getParameter("checkContentsbjt");
- String checkContentryglzdjt=request.getParameter("checkContentryglzdjt");
- String checkContentrysmsjjt=request.getParameter("checkContentrysmsjjt");
- String checkContentryotherjt=request.getParameter("checkContentryotherjt");
- String chenkResult1=request.getParameter("chenkResult1");
- String chenkResult2=request.getParameter("chenkResult2");
- String chenkResult3=request.getParameter("chenkResult3");
- String chenkResult4=request.getParameter("chenkResult4");
- String chenkResult5=request.getParameter("chenkResult5");
- String chenkResult6=request.getParameter("chenkResult6");
- String remark1=request.getParameter("remark1");
- String remark2=request.getParameter("remark2");
- String remark3=request.getParameter("remark3");
- String remark4=request.getParameter("remark4");
- String remark5=request.getParameter("remark5");
- String remark6=request.getParameter("remark6");
- String sql =
- "update td_check a set a.check_start_time=date_format(?,'%Y-%m-%d')," +
- "a.check_end_time=date_format(?,'%Y-%m-%d'), a.check_type=?," +
- "a.address=?,a.checkContentryjt=?,a.checkContentwjjt=?,a.checkContentsbjt=?,a.checkContentryglzdjt=?,a.checkContentrysmsjjt=?,a.checkContentryotherjt=?" +
- ",a.remark1=?,a.remark2=?,a.remark3=?,a.remark4=?,a.remark5=?,a.remark6=?,a.checkReault1=?,a.checkReault2=?,a.checkReault3=?,a.checkReault4=?,a.checkReault5=?,a.checkReault6=?" +
- " where a.check_id=?";
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = DbConn.getConn();
- prep = conn.prepareStatement(sql);
- prep.setString(1,checkStartTime );
- prep.setString(2,checkEndTime );
- prep.setString(3,checkType );
- prep.setString(4,address );
- prep.setString(5,checkContentryjt );
- prep.setString(6,checkContentwjjt );
- prep.setString(7,checkContentsbjt );
- prep.setString(8,checkContentryglzdjt );
- prep.setString(9,checkContentrysmsjjt );
- prep.setString(10,checkContentryotherjt );
- prep.setString(11,remark1 );
- prep.setString(12,remark2 );
- prep.setString(13,remark3 );
- prep.setString(14,remark4 );
- prep.setString(15,remark5 );
- prep.setString(16,remark6 );
- prep.setString(17,chenkResult1 );
- prep.setString(18,chenkResult2 );
- prep.setString(19,chenkResult3 );
- prep.setString(20,chenkResult4 );
- prep.setString(21,chenkResult5 );
- prep.setString(22,chenkResult6 );
- prep.setString(23,checkId );
- prep.execute();
- //oracle数据库手动提交,mysql中 自动提交autoCommit();
- conn.commit();
- Common.updateParaTab("td_check");
- StringBuffer sql1 =
- new StringBuffer("select a.check_Id,a.deptart_id,a.empid,date_format(a.check_start_time ,'%Y-%m-%d') as check_start_time,date_format(a.check_end_time ,'%Y-%m-%d') as check_end_time ," +
- "a.check_state,a.check_type,a.check_name,b.empname from td_check a left join tab_employee b on a.empid=b.empid where 1=1");
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql1.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("check_info",buf);
- Operate oper=new Operate();
- oper.operatesmbgcxLog(request);
- request.getRequestDispatcher("/zhyw/smjc/CheckManageReault.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("检查记录修改失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (prep!= null) {
- prep.close();
- }
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 检查通知编辑
- * @param request
- * @param response
- * @throws IOException
- */
- public void UpdateCheckNotify(HttpServletRequest request, HttpServletResponse response) throws IOException {
- Login login = (Login) request.getSession().getAttribute("login");
- //检查记录信息
- String notifyId=request.getParameter("notifyId");
- String notifyTime=request.getParameter("notifyTime");
- String notifyContent=request.getParameter("notifyContent");
- String notifyStaffed=request.getParameter("notifyStaffed");
- String notifyState=request.getParameter("notifyState");
- String sql ="update td_notify set notify_staff_id=?,notify_depart_Id=?,notify_time=date_format(?,'%Y-%m-%d'),notify_content=?,notify_staffed=?,notify_state=? where notify_id=?";
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = DbConn.getConn();
- prep = conn.prepareStatement(sql);
- prep.setString(1,login.getEmpid());
- prep.setString(2,login.getDepartid());
- prep.setString(3,notifyTime );
- prep.setString(4,notifyContent );
- prep.setString(5,Base64.toBase64String(SM4.SM4Encrypt(notifyStaffed)));
- prep.setString(6,notifyState);
- prep.setString(7,notifyId);
- prep.execute();
- //oracle数据库手动提交,mysql中 自动提交autoCommit();
- conn.commit();
- Common.updateParaTab("td_notify");
- StringBuffer sql1 =
- new StringBuffer("select b.departname, a.notify_Id,a.notify_depart_Id,a.notify_staff_Id,date_format(notify_time ,'%Y-%m-%d') as notify_time" +
- ",notify_content,notify_state,notify_staffed from td_notify a left join tab_department b on a.notify_depart_Id=b.departid where 1=1");
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql1.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("checkNotify_info",buf);
- request.getRequestDispatcher("/zhyw/smjc/CheckNotifyManage.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("检查通知记录修改失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (prep!= null) {
- prep.close();
- }
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
-
- /**
- * 查询所有的检查报告记录
- * @param request
- * @param response
- * @throws IOException
- */
- public void queryCheckNotify(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String notifyId = request.getParameter("notifyId");
- String sj= request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs= request.getParameter("pcs");
- StringBuffer sql =
- new StringBuffer("select b.departname, a.notify_Id,a.notify_depart_Id,a.notify_staff_Id,date_format(notify_time ,'%Y-%m-%d') as notify_time" +
- ",notify_content,notify_state,notify_staffed from td_notify a left join tab_department b on a.notify_depart_Id=b.departid where 1=1");
- if (!Common.isNull(sj)) {
- sql.append(" and a.frameworkid='").append(sj).append("'");
- }
- if (!Common.isNull(qj)) {
- sql.append(" and a.areaid='").append(qj).append("'");
- }
- if (!Common.isNull(pcs)) {
- sql.append(" and a.notify_depart_Id='").append(pcs).append("'");
- }
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("checkNotify_info",buf);
- request.getRequestDispatcher("/zhyw/smjc/CheckNotifyManage.jsp").forward(request,response);
- //操作日志
- Operate oper=new Operate();
- oper.operatesmtzcxLog(request);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("检查通知信息查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 查询所有的检查报告记录
- * @param request
- * @param response
- * @throws IOException
- */
- public void queryCheck(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String checkId = request.getParameter("check_id");
- String checkState = request.getParameter("check_state");
- String checkType = request.getParameter("checkType");
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String departId = request.getParameter("departId");
- StringBuffer sql =
- new StringBuffer("select a.check_Id,a.empid,date_format(check_start_time ,'%Y-%m-%d') as check_start_time,date_format(check_end_time ,'%Y-%m-%d') as check_end_time ," +
- "a.check_state,a.check_type,a.check_name,c.departname,b.empname from td_check a left join tab_employee b on a.empid=b.empid left join tab_department c on a.deptart_id=c.departid where 1=1");
- if (!Common.isNull(checkId)) {
- sql.append(" and a.checkId='").append( checkId).append("'");
- } else {
- if (!Common.isNull(sj)) {
- sql.append(" and a.frameworkid='").append(sj).append("'");
- }
- if (!Common.isNull(qj)) {
- sql.append(" and a.areaid='").append(qj).append("'");
- }
- if (!Common.isNull(departId)) {
- sql.append(" and a.deptart_id='").append(departId).append("'");
- }
- if (!Common.isNull(checkType)) {
- sql.append(" and a.check_type='").append(checkType).append("'");
- }
- }
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("check_info",buf);
- Operate oper=new Operate();
- oper.operatesmbgcxLog(request);
- request.getRequestDispatcher("/zhyw/smjc/CheckManage.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("检查信息查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 查询所有的检查结果
- * @param request
- * @param response
- * @throws IOException
- */
- public void queryCheckReault(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String checkId = request.getParameter("check_id");
- String checkState = request.getParameter("check_state");
- String checkType = request.getParameter("checkType");
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String departId = request.getParameter("departId");
- StringBuffer sql =
- new StringBuffer("select a.check_Id,a.deptart_id,a.empid,date_format(a.check_start_time ,'%Y-%m-%d') as check_start_time,date_format(a.check_end_time ,'%Y-%m-%d') as check_end_time ," +
- "a.check_state,a.check_type,a.check_name,b.empname from td_check a left join tab_employee b on a.empid=b.empid where 1=1");
- if (!Common.isNull(checkId)) {
- sql.append(" and a.checkId='").append( checkId).append("'");
- } else {
- if (!Common.isNull(sj)) {
- sql.append(" and a.frameworkid='").append(sj).append("'");
- }
- if (!Common.isNull(qj)) {
- sql.append(" and a.areaid='").append(qj).append("'");
- }
- if (!Common.isNull(departId)) {
- sql.append(" and a.deptart_id='").append(departId).append("'");
- }
- if (!Common.isNull(checkType)) {
- sql.append(" and a.check_type='").append(checkType).append("'");
- }
- }
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("check_info",buf);
- Operate oper=new Operate();
- oper.operatesmbgcxLog(request);
- request.getRequestDispatcher("/zhyw/smjc/CheckManageReault.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("检查信息查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 根据Id查询到相应的记录行
- * @param request
- * @param response
- * @throws IOException
- */
- public void queryCheckById(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String checkId = request.getParameter("checkId");
- StringBuffer sql=new StringBuffer("select a.check_Id,a.empid,date_format(a.check_start_time ,'%Y-%m-%d') as check_start_time," +
- "date_format(a.check_end_time ,'%Y-%m-%d') as check_end_time" +
- ",a.AREAID,a.FRAMEWORKID,a.check_type,a.check_content,a.address ,a.check_name " +
- ",dept.DEPARTNAME,a.checkcontentry,a.checkcontentryjt,a.checkcontentwj,a.checkcontentwjjt,a.checkcontentsb,a.checkcontentsbjt,a.checkcontentrysmsj,a.checkcontentrysmsjjt,a.checkcontentryother,a.checkcontentryotherjt" +
- ",a.checkcontentryglzd,a.checkcontentryglzdjt" +
- " from td_check a left join tab_department dept on a.DEPTART_ID=dept.DEPARTID where a.check_id =?");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sql.toString(),new Object[]{checkId},
- new HashFmlBufResultSetHandler());
- request.setAttribute("by_checkId",buf);
- request.getRequestDispatcher("/zhyw/smjc/showCheck.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("根据编号查询检查记录失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 根据Id查询到相应的记录行
- * @param request
- * @param response
- * @throws IOException
- */
- public void queryCheckByReasultId(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String checkId = request.getParameter("checkId");
- StringBuffer sql=new StringBuffer("select a.check_Id,a.empid,date_format(a.check_start_time ,'%Y-%m-%d') as check_start_time," +
- "date_format(a.check_end_time ,'%Y-%m-%d') as check_end_time,b.departname" +
- ",a.AREAID,a.FRAMEWORKID,a.check_type,a.check_content,a.address ,a.check_result " +
- ",a.deptartreault,a.checkcontentry,a.checkcontentryjt,a.checkcontentwj,a.checkcontentwjjt,a.checkcontentsb,a.checkcontentsbjt,a.checkcontentrysmsj,a.checkcontentrysmsjjt,a.checkcontentryother,a.checkcontentryotherjt" +
- ",a.checkcontentryglzd,a.checkcontentryglzdjt,a.checkreault1,a.checkreault2,a.checkreault3,a.checkreault4,a.checkreault5,a.checkreault6,a.remark1,a.remark2,a.remark3,a.remark4,a.remark5,a.remark6" +
- " from td_check a left join tab_department b on a.deptartreault=b.departid where a.check_id =? ");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sql.toString(),new Object[]{checkId},
- new HashFmlBufResultSetHandler());
- request.setAttribute("by_checkId",buf);
- request.getRequestDispatcher("/zhyw/smjc/showCheckReault.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("根据编号查询检查记录失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 根据Id查询到相应的记录行
- * @param request
- * @param response
- * @throws IOException
- */
- public void queryCheckNotifyById(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String notifyId= request.getParameter("notifyId");
- StringBuffer sql=new StringBuffer("select a.notify_Id,a.notify_depart_Id,dept.DEPARTNAME,a.notify_staff_id,date_format(a.notify_time ,'%Y-%m-%d') as notify_time" +
- ",a.notify_content,a.notify_staffed,a.notify_state,a.AREAID,a.FRAMEWORKID from td_notify a left join tab_department dept on dept.DEPARTID=a.NOTIFY_DEPART_ID where a.notify_id =?");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sql.toString(),new Object[]{notifyId},
- new HashFmlBufResultSetHandler());
- request.setAttribute("by_checknotifyId",buf);
- request.getRequestDispatcher("/zhyw/smjc/showNotify.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("根据编号查询检查记录失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- public void cancelCheck(HttpServletRequest request, HttpServletResponse response) throws IOException {
- log.debug("# cancel check!");
- Login login = (Login) request.getSession().getAttribute("login");
- String[] checkids = request.getParameterValues("checkids");
- String sql = "DELETE FROM td_check WHERE check_id=?";
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = DbConn.getConn();
- conn.setAutoCommit(false);
- prep = conn.prepareStatement(sql);
- for (int i=0; i checks = new ArrayList();;
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- Check check=null;
- if(buf!=null)
- {
- for(int i=0;i checkData) throws ParseException
- {
- HSSFWorkbook workBook=new HSSFWorkbook();
- String[] title={"检查编号","人员姓名","检查状态","检查类型","检查开始时间","检查结束时间","检查内容"};
- int i=0;
- int k=1;
- SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy/MM/dd");
- //检查开始时间
- String checkStarttime="";
- Date checkDate1;
- //检查结束时间
- String checkEndtime="";
- Date checkDate2;
- String checkState="";
- String checkType="";
- String checkNotent="";
- HSSFSheet tableSheet=workBook.createSheet("检查报告");
- HSSFRow row=tableSheet.createRow((short)0);
- //创建标题栏单元格字体
- HSSFFont titleFont=workBook.createFont();
- //创建标题栏样式
- HSSFCellStyle titleStyle=workBook.createCellStyle();
- //设置标题栏字体颜色
- titleFont.setColor(HSSFColor.BLUE.index);
- //设置标题栏字体样式
- titleStyle.setFont(titleFont);
- //创建状态异常的数据行字体
- HSSFFont contentFont=workBook.createFont();
- //创建状态异常的数据行样式
- HSSFCellStyle contentStyle=workBook.createCellStyle();
- //设置状态异常的数据行字体颜色
- contentFont.setColor(HSSFColor.RED.index);
- //为状态异常的数据行样式设置字体
- contentStyle.setFont(contentFont);
- //迭代标题数组,根据数组长度创建单元格,并设置标题栏单元格字体颜色
- for(String s:title)
- {
- HSSFCell cell=row.createCell(i);
- cell.setCellValue(s);
- cell.setCellStyle(titleStyle);
- i++;
- }
- //迭代数据信息,填入数据行
- for(Iterator iterator=checkData.iterator();iterator.hasNext();)
- {
- Check Info=(Check)iterator.next();
- HSSFRow hssfRow=tableSheet.createRow((short)k);
- hssfRow.createCell(0).setCellValue(Info.getCheckId());
- //导出状态
- hssfRow.createCell(1).setCellValue(Info.getCheckName());
- if(Info.getCheckstate().toString().trim().equals("0"))
- {
- checkState="通过";
- }
- else
- {
- checkState="不通过";
- }
- hssfRow.createCell(2).setCellValue(checkState);
- //导出类型
- hssfRow.createCell(3).setCellValue(checkType);
- if(Info.getCheckType().toString().trim().equals("0"))
- {
- checkType="自行检查";
- }
- else
- {
- checkType="保密局检查";
- }
- hssfRow.createCell(3).setCellValue(checkType);
- //导出时间
-// checkDate1=dateFormat.parse(Info.getCheckStartTime());
-// checkStarttime=dateFormat.format(checkDate1);
-
-// checkDate2=dateFormat.parse(Info.getCheckEndTime());
-// checkEndtime=dateFormat.format(checkDate2);
-
- //hssfRow.createCell(4).setCellValue(checkStarttime);
- //int createLength=Info.getCheckStartTime().indexOf(".");
- hssfRow.createCell(4).setCellValue(Info.getCheckStartTime().toString().trim().equals("")?"":Info.getCheckStartTime());
- //hssfRow.createCell(5).setCellValue(checkEndtime);
- //int createLength1=Info.getCheckStartTime().indexOf(".");
- hssfRow.createCell(5).setCellValue(Info.getCheckEndTime().toString().trim().equals("")?"":Info.getCheckEndTime());
- hssfRow.createCell(6).setCellValue(checkNotent);
- if(Info.getCheckContent().toString().trim().equals("0"))
- {
- checkNotent="人员检查";
- }
- else if(Info.getCheckContent().toString().trim().equals("1"))
- {
- checkNotent="资产检查";
- } else if(Info.getCheckContent().toString().trim().equals("2"))
- {
- checkNotent="文件检查";
- }else if(Info.getCheckContent().toString().trim().equals("3"))
- {
- checkNotent="泄密事件";
- }else{
- checkNotent="管理类制度";
- }
- hssfRow.createCell(6).setCellValue(checkNotent);
- k++;
- }
- ByteArrayOutputStream os = new ByteArrayOutputStream();
-
- try {
- workBook.write(os);
- } catch (IOException e) {
- e.printStackTrace();
- }
- byte[] content = os.toByteArray();
- InputStream is = new ByteArrayInputStream(content);
- return is;
-
- }
- @Override
- public void defaultMethod(HttpServletRequest request,
- HttpServletResponse response) throws Exception {
- }
- //删除检查通知信息
- public void deleteCheckNotify(HttpServletRequest request, HttpServletResponse response) throws IOException {
- Login login = (Login) request.getSession().getAttribute("login");
- String[] Infos = request.getParameterValues("Infos");
- String sql = "DELETE FROM td_notify WHERE notify_id=? ";
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = DbConn.getConn();
- conn.setAutoCommit(false);
- prep = conn.prepareStatement(sql);
- for (int i=0; i trainData) throws ParseException
- {
- HSSFWorkbook workBook=new HSSFWorkbook();
- String[] title={"培训编号","人员姓名","培训次数"};
- int i=0;
- int k=1;
- HSSFSheet tableSheet=workBook.createSheet("培训清单");
- HSSFRow row=tableSheet.createRow((short)0);
- //创建标题栏单元格字体
- HSSFFont titleFont=workBook.createFont();
- //创建标题栏样式
- HSSFCellStyle titleStyle=workBook.createCellStyle();
- //设置标题栏字体颜色
- titleFont.setColor(HSSFColor.BLUE.index);
- //设置标题栏字体样式
- titleStyle.setFont(titleFont);
- //创建状态异常的数据行字体
- HSSFFont contentFont=workBook.createFont();
- //创建状态异常的数据行样式
- HSSFCellStyle contentStyle=workBook.createCellStyle();
- //设置状态异常的数据行字体颜色
- contentFont.setColor(HSSFColor.RED.index);
- //为状态异常的数据行样式设置字体
- contentStyle.setFont(contentFont);
- //迭代标题数组,根据数组长度创建单元格,并设置标题栏单元格字体颜色
- for(String s:title)
- {
- HSSFCell cell=row.createCell(i);
- cell.setCellValue(s);
- cell.setCellStyle(titleStyle);
- i++;
- }
-
- //迭代数据信息,填入数据行
- for(Iterator iterator=trainData.iterator();iterator.hasNext();)
- {
- Train Info=(Train)iterator.next();
- HSSFRow hssfRow=tableSheet.createRow((short)k);
- hssfRow.createCell(0).setCellValue(Info.getTrianId());
- hssfRow.createCell(1).setCellValue(Info.getTrainName());
- hssfRow.createCell(2).setCellValue(Info.getTrianNum());
- k++;
- }
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- try {
- workBook.write(os);
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- byte[] content = os.toByteArray();
- InputStream is = new ByteArrayInputStream(content);
- return is;
- }
-
- @Override
- public void defaultMethod(HttpServletRequest request,
- HttpServletResponse response) throws Exception {
- // TODO Auto-generated method stub
-
- }
- /***
- * 导出信息
- * @param request
- * @param response
- * @throws Exception
- */
- public void exportExcelNum(HttpServletRequest request,HttpServletResponse response) throws Exception
- {
-
- // String empid = request.getParameter("empid");
- StringBuffer sql =
- new StringBuffer("select a.train_Id,a.train_time,a.train_type " +
- ",a.train_subject,a.train_mark,a.train_num,a.train_name,a.train_state from td_train a ");
- Connection conn = null;
- List trains = new ArrayList();;
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- Train train=null;
- if(buf!=null)
- {
- for(int i=0;i sbs = new ArrayList();
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- PropertyInfo pro=null;
- if(buf!=null)
- {
- for(int i=0;i sbnetData) throws ParseException
- {
- HSSFWorkbook workBook=new HSSFWorkbook();
- String[] title={"序号","所属市州","所属区县","使用单位","密级","网络名称","终端个数","网络设备数量","登记时间","导出时间"};
- int i=0;
- int k=1;
- HSSFSheet tableSheet=workBook.createSheet("涉密网络表单");
- HSSFRow row=tableSheet.createRow((short)0);
- HSSFFont titleFont=workBook.createFont();
- //创建标题栏样式
- HSSFCellStyle titleStyle=workBook.createCellStyle();
- //设置标题栏字体颜色
- titleFont.setColor(HSSFColor.BLUE.index);
- titleFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
- //设置标题栏字体样式
- titleStyle.setFont(titleFont);
- titleStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT);
- //创建状态异常的数据行字体
- HSSFFont contentFont=workBook.createFont();
- //创建状态异常的数据行样式
- HSSFCellStyle contentStyle=workBook.createCellStyle();
- //设置状态异常的数据行字体颜色
- contentFont.setColor(HSSFColor.RED.index);
- //为状态异常的数据行样式设置字体
- contentStyle.setFont(contentFont);
- tableSheet.setColumnWidth(0, 1000);
- tableSheet.autoSizeColumn((short)1);
- tableSheet.autoSizeColumn((short)2);
- tableSheet.autoSizeColumn((short)3);
- tableSheet.autoSizeColumn((short)4);
- tableSheet.autoSizeColumn((short)5);
- tableSheet.autoSizeColumn((short)6);
- tableSheet.autoSizeColumn((short)7);
- tableSheet.setColumnWidth(8, 5000);
- tableSheet.setColumnWidth(9, 5000);
- for(String s:title)
- {
- HSSFCell cell=row.createCell(i);
- cell.setCellValue(s);
- cell.setCellStyle(titleStyle);
- i++;
- }
- //迭代数据信息,填入数据行
- for(Iterator iterator=sbnetData.iterator();iterator.hasNext();)
- {
- PropertyInfo Info=(PropertyInfo)iterator.next();
- String Secret=Info.getSercent();
- if (Secret.equals("1")) {
- Secret = "秘密";
- }
- else if(Secret.equals("2"))
- {
- Secret = "机密";
- }
- else if(Secret.equals("3")) {
- Secret = "绝密";
- }
- HSSFRow hssfRow=tableSheet.createRow((short)k);
- hssfRow.createCell(0).setCellValue(Info.getIdd());
- hssfRow.createCell(1).setCellValue(Info.getFramework_id());
- hssfRow.createCell(2).setCellValue(Info.getArea_id());
- hssfRow.createCell(3).setCellValue(Info.getRecover_departid());
- hssfRow.createCell(4).setCellValue(Secret);
- hssfRow.createCell(5).setCellValue(Info.getNetName());
- hssfRow.createCell(6).setCellValue(Info.getFinallyNum());
- hssfRow.createCell(7).setCellValue(Info.getNetNum());
- hssfRow.createCell(8).setCellValue(Info.getNetData());
- hssfRow.createCell(9).setCellValue(Info.getRecover_date());
- k++;
- }
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- try {
- workBook.write(os);
- } catch (IOException e) {
- e.printStackTrace();
- }
- byte[] content = os.toByteArray();
- InputStream is = new ByteArrayInputStream(content);
- return is;
- }
-
- /**
- * 网络信息预览
- * @param request
- * @param response
- * @throws SQLException
- */
- public void showInfoProperty(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String useId=request.getParameter("InfoId");
- String operateuseIds=request.getParameter("operateuseId");
- String dwNames=request.getParameter("dwNames");
- String sql="select * from tm_dtl_property_netinfo where id=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf infoBuf=(HashFmlBuf)JDBCUtils.query(conn, sql,new Object[]{useId},new HashFmlBufResultSetHandler());
- request.setAttribute("infoBuf",infoBuf);
- request.setAttribute("operateuseIds", operateuseIds);
- request.setAttribute("dwNa", dwNames);
- request.getRequestDispatcher("/zhyw/smsb/smwl/propertyInfoAddDetail.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void showProperty(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String useId=request.getParameter("useId");
- String sql="select a.net_id,a.net_staffid,date_format(a.net_date,'%Y-%m-%d %H:%i') as net_date,a.NET_Security,a.Terminal,a.NET_RECOVERDEPARTID,b.netname " +
- "from tm_dtl_property_net a left join tm_dtl_property_netinfo b on a.NET_ID=b.NET_ID where b.net_id=?";
- StringBuffer sql1=new StringBuffer("SELECT b.id,b.net_brand,b.net_ip,net_no,net_name,property_sn,remark,netname from tm_dtl_property_netinfo b where b.net_id=?");
- try {
- conn=DbConn.getConn();
- HashFmlBuf useBuf=(HashFmlBuf)JDBCUtils.query(conn, sql,new Object[]{useId},new HashFmlBufResultSetHandler());
- request.setAttribute("useBuf",useBuf);
- HashFmlBuf useInfo=(HashFmlBuf)JDBCUtils.query(conn, sql1.toString(),new Object[]{useId},new HashFmlBufResultSetHandler());
- request.setAttribute("useInfo",useInfo);
- request.getRequestDispatcher("/zhyw/smsb/smwl/showNetProperty.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
-
- /**
- * 批量删除资产信息
- * @author cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void deletePropertyNetInfo(HttpServletRequest request, HttpServletResponse response) throws IOException {
- Login login = (Login) request.getSession().getAttribute("login");
- String[] Infos = request.getParameterValues("Infos");
- String sql = "DELETE FROM tm_dtl_property_netinfo WHERE id=? ";
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = DbConn.getConn();
- conn.setAutoCommit(false);
- prep = conn.prepareStatement(sql);
- for (int i=0; i0){
- //情况1:正常,浏览器按utf-8方式查看
- response.setCharacterEncoding("UTF-8");
- //情况2:正常,浏览器按简体中文方式查看
- response.setContentType("text/html; charset=UTF-8 ");
- out.write("");
- out.close();
- }else{
- conn.commit();
- queryPropertyNetPage(request, response);
- }
- queryPropertyNetPage(request, response);
- } catch (Exception e) {
- if (conn != null) {
- try {
- conn.rollback();
- } catch (SQLException e1) {
- e1.printStackTrace();
- }
- }
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员删除失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (prep!= null) {
- prep.close();
- }
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
-}
diff --git a/src/main/java/com/zky/zhyw/smsb/PropertyProvideManageServlet.java b/src/main/java/com/zky/zhyw/smsb/PropertyProvideManageServlet.java
deleted file mode 100644
index da52afc..0000000
--- a/src/main/java/com/zky/zhyw/smsb/PropertyProvideManageServlet.java
+++ /dev/null
@@ -1,528 +0,0 @@
-package com.zky.zhyw.smsb;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import com.zky.manager.Login;
-import com.zky.manager.Operate;
-import com.zky.manager.StudentPullulate;
-import com.zky.pub.Common;
-import com.zky.pub.DbConn;
-import com.zky.pub.DispatchServlet;
-import com.zky.pub.HashFmlBuf;
-import com.zky.util.PageQuery;
-import com.zky.util.jdbc.HashFmlBufResultSetHandler;
-import com.zky.util.jdbc.JDBCUtils;
-
-public class PropertyProvideManageServlet extends DispatchServlet {
-Connection conn=null;
-PreparedStatement pstmt=null;
-PreparedStatement pstmt1=null;
-private StudentPullulate p=new StudentPullulate();
- @Override
- public void defaultMethod(HttpServletRequest request,
- HttpServletResponse response) throws Exception {
- // TODO Auto-generated method stub
- }
- /**
- * @throws SQLException
- *
- */
- public void toAddProvide(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String useId=request.getParameter("useId");
- String deptSql="select d.departid,d.departname from tab_department d left join tm_dtl_property_use u on d.departid=u.use_departid where u.use_id=?";
- String sql="select u.use_id,u.property_name,u.property_no,u.property_type,u.property_unit,u.use_departid," +
- "u.use_staffid,u.use_date,d.departname,e.empname from tm_dtl_property_use u left join tab_department d " +
- "on u.use_departid=d.departid left join tab_employee e on u.use_staffid=e.empid where u.use_id=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf useBuf=(HashFmlBuf)JDBCUtils.query(conn,sql,new Object[]{useId}, new HashFmlBufResultSetHandler());
- //System.out.println("bufCount----"+useBuf.getRowCount());
- HashFmlBuf departBuf=(HashFmlBuf)JDBCUtils.query(conn,deptSql,new Object[]{useId},new HashFmlBufResultSetHandler());
- request.setAttribute("writeDepartment",departBuf);
- request.setAttribute("useBuf",useBuf);
- request.getRequestDispatcher("/zhyw/smsb/sbff/propertyProvideAdd.jsp").forward(request, response);
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 通过区县读取部门
- * @param request
- * @param response
- * @throws Exception
- */
- public void readAridSchool(HttpServletRequest request,
- HttpServletResponse response)throws Exception{
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid");
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf holdDeptBuf=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf manageDeptBuf=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("writeDepartment",bufschool);
- request.setAttribute("holdDeptBuf",holdDeptBuf);
- request.setAttribute("manageDeptBuf",manageDeptBuf);
- request.setAttribute("areaid", areaId);
- //request.getRequestDispatcher("/zhyw/smsb/sbff/propertyProvideAdd.jsp").forward(request, response);
- toAddProvide(request, response);
- }
- /**
- * 通过部门读取员工信息
- * @param request
- * @param response
- * @throws Exception
- */
- public void readEmployeeByDepartment(HttpServletRequest request, HttpServletResponse response)throws Exception{
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid"); //获取区县id
- String schoolId=request.getParameter("schoolid"); //获取部门id
- request.setAttribute("areaid",areaId);
- request.setAttribute("schoolid",schoolId);
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf holdDeptBuf=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf manageDeptBuf=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("writeDepartment",bufschool);
- request.setAttribute("holdDeptBuf",holdDeptBuf);
- request.setAttribute("manageDeptBuf",manageDeptBuf);
- //System.out.println("employee--------"+bufschool.getRowCount());
- HashFmlBuf bufEmployee=p.readEmployees(request, response);
- HashFmlBuf holdEmpBuf=p.readEmployees(request, response);
- HashFmlBuf manageEmpBuf=p.readEmployees(request, response);
- request.setAttribute("bufEmployee",bufEmployee);
- request.setAttribute("holdEmpBuf",holdEmpBuf);
- request.setAttribute("manageEmpBuf",manageEmpBuf);
- toAddProvide(request, response);
-
- }
- /**
- * 通过区县读取部门
- * @param request
- * @param response
- * @throws Exception
- */
- public void readAridSchoolManage(HttpServletRequest request,
- HttpServletResponse response)throws Exception{
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid");
-
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf holdDeptBuf=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf manageDeptBuf=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("writeDepartment",bufschool);
- request.setAttribute("holdDeptBuf",holdDeptBuf);
- request.setAttribute("manageDeptBuf",manageDeptBuf);
-
- request.setAttribute("areaid", areaId);
-
- request.getRequestDispatcher("/zhyw/smsb/sbff/propertyProvideManage.jsp").forward(request, response);
-
- }
- //根据部门查询员工
- public void readEmployeeByDepartmentManage(HttpServletRequest request, HttpServletResponse response)throws Exception{
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid"); //获取区县id
- String schoolId=request.getParameter("schoolid"); //获取部门id
- request.setAttribute("areaid", areaId);
- request.setAttribute("schoolid", schoolId);
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
-
- request.setAttribute("writeDepartment",bufschool);
-
- //System.out.println("employee--------"+bufschool.getRowCount());
- HashFmlBuf bufEmployee=p.readEmployees(request, response);
-
- request.setAttribute("bufEmployee",bufEmployee);
-
- request.getRequestDispatcher("/zhyw/smsb/sbff/propertyProvideManage.jsp").forward(request, response);
- }
- /**
- * 添加资产发放记录
- * @param request
- * @param response
- * @throws SQLException
- * @throws IOException
- * @throws UnsupportedEncodingException
- */
- public void addPropertyProvide(HttpServletRequest request,HttpServletResponse response) throws SQLException, UnsupportedEncodingException, IOException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String useDepartid=request.getParameter("deptId");
- String useId=request.getParameter("useId");
- String provideDepartId=request.getParameter("schoolid");
- String provideStaffId=request.getParameter("useempid");
- String querySql="select u.use_departid,u.use_staffid from tm_dtl_property_use u where u.use_id=?";
-// String receiveDepartId=request.getParameter("receiveDepartId");
-// String receiveStaffId=request.getParameter("receiveStaffId");
- String remark=request.getParameter("remark");
- String provideId=CreatePropertyIdUtils.createPropertyProvideId(request,response,useDepartid);
- String sql="insert into tm_dtl_property_provide(provide_id,use_id,provide_departid,provide_staffid,provide_date," +
- "remark,update_departid,update_staffid,update_date) values(" +
- "?,?,?,?,now(),?,?,?,now())";
- try {
- conn=DbConn.getConn();
-
- // HashFmlBuf useBuf=(HashFmlBuf)JDBCUtils.query(conn,querySql,new Object[]{useId},new HashFmlBufResultSetHandler());
-
- String updateState="update tr_property_operate set provide_state='1',provide_departid=?,provide_staffid=?,provide_date=now(),hold_departid=?,hold_staffid=?,hold_date=now() where use_id='"+useId+"'";
-// System.out.println("useid----"+useId);
-// System.out.println("provideid-----"+provideId);
- pstmt=conn.prepareStatement(sql);
- pstmt1=conn.prepareStatement(updateState);
- pstmt.setString(1,provideId);
- pstmt.setString(2,useId);
- pstmt.setString(3,provideDepartId);
- pstmt.setString(4,provideStaffId);
-// pstmt.setString(5,useBuf.fget("use_departid",0));
-// pstmt.setString(6,useBuf.fget("use_staffid",0));
- pstmt.setString(5,remark);
- pstmt.setString(6,login.getDepartid());
- pstmt.setString(7,login.getEmpid());
-
- pstmt.execute();
- pstmt1.setString(1,provideDepartId);
- pstmt1.setString(2,provideStaffId);
- pstmt1.setString(3,provideDepartId);
- pstmt1.setString(4,provideStaffId);
- pstmt1.execute();
- conn.commit();
- request.setAttribute("provideId",useId);
- queryProvideInfo(request, response);
- Operate oper=new Operate();
- oper.operatesmsbdjLog(request);
- } catch (Exception e) {
- // TODO: handle exception
- String errorinfo="";
- if (e.getMessage().startsWith("ORA-00001")) {
- errorinfo = "资产发放失败,相关流水号已经存在!";
- } else {
- errorinfo = "资产发放失败!"+ e.toString();
- }
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+Common.toGb(errorinfo)));
- e.printStackTrace();
- e.printStackTrace();
-
- }
- finally
- {
- if(pstmt!=null)
- {
- pstmt.close();
- }
- if(pstmt1!=null)
- {
- pstmt1.close();
- }
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 查询显示最近操作的资产发放记录
- * @param request
- * @param response
- * @throws SQLException
- */
- public void queryProvideInfo(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String provideId=request.getParameter("provideId");
- String provideDepartId=request.getParameter("schoolid");
- String provideStaffId=request.getParameter("writeempid");
- String provideState=request.getParameter("provideState");
- StringBuffer sql=new StringBuffer("select u.use_id,u.property_name,u.property_no,u.property_type,u.property_unit,u.use_departid,u.use_staffid,u.use_date"+
- ",p.provide_id,p.provide_departid,p.provide_staffid,p.provide_date,o.provide_state,d.departname,e.empname from tm_dtl_property_use u left join tm_dtl_property_provide p on u.use_id=p.use_id"+
- " left join tr_property_operate o on u.use_id=o.use_id left join tab_department d on u.use_departid=d.departid left join tab_employee e on u.use_staffid=e.empid where 1=1 and o.extract_state!='1'" );
- if(!Common.isNull(provideId))
- {
- sql.append(" and u.use_id='").append(provideId).append("'");
- }
- else
- {
- if(!Common.isNull(provideDepartId))
- {
- sql.append(" and u.use_departid='").append(provideDepartId).append("'");
- }
- if(!Common.isNull(provideStaffId))
- {
- sql.append(" and u.use_staffid='").append(provideStaffId).append("'");
- }
- if(!Common.isNull(provideState))
- {
- sql.append(" and o.provide_state='").append(provideState).append("'");
- }
- }
- try {
- conn=DbConn.getConn();
- HashFmlBuf provideBuf=(HashFmlBuf)JDBCUtils.query(conn,sql.toString(),new HashFmlBufResultSetHandler());
- request.setAttribute("provideBuf",provideBuf);
- request.getRequestDispatcher("/zhyw/smsb/sbff/propertyProvideManage.jsp").forward(request, response);
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 查询资产发放记录分页信息
- * @param request
- * @param response
- * @throws SQLException
- */
- public void queryProvidePage(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid");
- String departId=request.getParameter("schoolid");
- String employeeId=request.getParameter("writeempid");
- String fileSecret=request.getParameter("filesecret");
- String fileState=request.getParameter("filestate");
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf holdDeptBuf=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf manageDeptBuf=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("writeDepartment",bufschool);
- request.setAttribute("holdDeptBuf",holdDeptBuf);
- request.setAttribute("manageDeptBuf",manageDeptBuf);
- HashFmlBuf bufEmployee=p.readEmployees(request, response);
- HashFmlBuf holdEmpBuf=p.readEmployees(request, response);
- HashFmlBuf manageEmpBuf=p.readEmployees(request, response);
- request.setAttribute("bufEmployee",bufEmployee);
- request.setAttribute("holdEmpBuf",holdEmpBuf);
- request.setAttribute("manageEmpBuf",manageEmpBuf);
- String provideId=request.getParameter("provideId");
- String provideDepartId=request.getParameter("schoolid");
- String provideStaffId=request.getParameter("writeempid");
- String provideState=request.getParameter("provideState");
- StringBuffer sql=new StringBuffer("select u.use_id,u.property_name,u.property_no,u.property_type,u.property_unit,u.use_departid,u.use_staffid,u.use_date"+
- ",p.provide_id,p.provide_departid,p.provide_staffid,p.provide_date,o.provide_state,d.departname,e.empname from tm_dtl_property_use u left join tm_dtl_property_provide p on u.use_id=p.use_id"+
- " left join tr_property_operate o on u.use_id=o.use_id left join tab_department d on u.use_departid=d.departid left join tab_employee e on u.use_staffid=e.empid where 1=1" );
- if(!Common.isNull(provideId))
- {
- sql.append(" and u.use_id='").append(provideId).append("'");
- }
- if(!Common.isNull(provideDepartId))
- {
- sql.append(" and u.use_departid='").append(provideDepartId).append("'");
- }
- if(!Common.isNull(provideStaffId))
- {
- sql.append(" and u.use_staffid='").append(provideStaffId).append("'");
- }
- if(!Common.isNull(provideState))
- {
- sql.append(" and o.provide_state='").append(provideState).append("'");
- }
- try
- {
- conn=DbConn.getConn();
-
- PageQuery pageQuery=new PageQuery(conn, sql.toString(),new HashFmlBufResultSetHandler(), request);
- HashFmlBuf provideBuf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("provideBuf",provideBuf);
-
- Operate oper=new Operate();
- oper.operatesmsbcxLog(request);
- request.getRequestDispatcher("/zhyw/smsb/sbff/propertyProvideManage.jsp").forward(request, response);
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 显示资产发放明细信息
- * @param request
- * @param response
- * @throws SQLException
- */
- public void showProvideInfo(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String useId=request.getParameter("useId");
- String sql="SELECT u.property_name,u.property_no,u.property_num,u.maintain_departid,u.maintain_staffid,u.maintain_date FROM tm_dtl_property_use u" +
- " where u.use_id=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf provideBuf=(HashFmlBuf)JDBCUtils.query(conn, sql,new Object[]{useId},new HashFmlBufResultSetHandler());
- request.setAttribute("provideBuf",provideBuf);
- request.getRequestDispatcher("/zhyw/smsb/sbff/showProperty.jsp").forward(request, response);
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 根据领用编号查询领用部门与领用员工
- * @param request
- * @param response
- * @throws SQLException
- */
- public void queryReceiveInfoByUseId(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid"); //获取区县id
- String schoolId=request.getParameter("schoolid"); //获取部门id
-// System.out.println("schoolid======="+schoolId);
-// String empid=request.getParameter(arg0)
- String useId=request.getParameter("useid");
- String useEmpId=request.getParameter("useempid");
- //System.out.println();
- request.setAttribute("areaid", areaId);
- request.setAttribute("schoolid", schoolId);
- request.setAttribute("useid",useId);
- request.setAttribute("useempid",useEmpId);
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf holdDeptBuf=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf manageDeptBuf=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("writeDepartment",bufschool);
- request.setAttribute("holdDeptBuf",holdDeptBuf);
- request.setAttribute("manageDeptBuf",manageDeptBuf);
- //System.out.println("employee--------"+bufschool.getRowCount());
- HashFmlBuf bufEmployee=p.readEmployees(request, response);
- HashFmlBuf holdEmpBuf=p.readEmployees(request, response);
- HashFmlBuf manageEmpBuf=p.readEmployees(request, response);
- request.setAttribute("bufEmployee",bufEmployee);
- request.setAttribute("holdEmpBuf",holdEmpBuf);
- request.setAttribute("manageEmpBuf",manageEmpBuf);
- String sql="select u.use_id,u.property_name,o.provide_state from tm_dtl_property_use u left join tr_property_operate o on u.use_id=o.use_id " +
- "where o.provide_state='0' and u.use_departid=?";
-
- String querySql="select u.use_id,u.use_departid,u.use_staffid,d.departname,e.empname from tm_dtl_property_use u left join tab_department d on u.use_departid=d.departid left join tab_employee e on u.use_staffid=e.empid where u.use_id='1209321001006'";
- try {
- conn=DbConn.getConn();
- HashFmlBuf useBuf=(HashFmlBuf)JDBCUtils.query(conn,sql,new Object[]{login.getDepartid()},new HashFmlBufResultSetHandler());
- HashFmlBuf receiveBuf=(HashFmlBuf)JDBCUtils.query(conn,querySql,new HashFmlBufResultSetHandler());
- request.setAttribute("useBuf",useBuf);
- request.setAttribute("receiveBuf",receiveBuf);
- request.getRequestDispatcher("/zhyw/smsb/sbff/propertyProvideAdd.jsp").forward(request, response);
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 查询未发放资产
- * @param request
- * @param response
- * @throws SQLException
- */
- public void queryProvideProperty(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid"); //获取区县id
- String schoolId=request.getParameter("schoolid"); //获取部门id
- String useId=request.getParameter("useId");
- request.setAttribute("areaid", areaId);
- request.setAttribute("schoolid", schoolId);
- request.setAttribute("useid",useId);
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf holdDeptBuf=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf manageDeptBuf=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("writeDepartment",bufschool);
- request.setAttribute("holdDeptBuf",holdDeptBuf);
- request.setAttribute("manageDeptBuf",manageDeptBuf);
- //System.out.println("employee--------"+bufschool.getRowCount());
- HashFmlBuf bufEmployee=p.readEmployees(request, response);
- HashFmlBuf holdEmpBuf=p.readEmployees(request, response);
- HashFmlBuf manageEmpBuf=p.readEmployees(request, response);
- request.setAttribute("bufEmployee",bufEmployee);
- request.setAttribute("holdEmpBuf",holdEmpBuf);
- request.setAttribute("manageEmpBuf",manageEmpBuf);
-
- String sql="select u.use_id,u.property_name,o.provide_state from tm_dtl_property_use u left join tr_property_operate " +
- "where o.propertyState='0' and u.use_departid=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf useBuf=(HashFmlBuf)JDBCUtils.query(conn,sql,new Object[]{login.getDepartid()},new HashFmlBufResultSetHandler());
- request.setAttribute("useBuf",useBuf);
- request.getRequestDispatcher("/zhyw/smsb/sbff/propertyProvideAdd.jsp").forward(request, response);
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * @throws SQLException
- *
- */
- public void updateProvideState(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String useId=request.getParameter("useId");
- String sql="update tr_property_operate o set provide_state='1' where use_id=?";
- String updateSql="update tm_dtl_property_recover set recover_type='0' where use_id=?";
- try {
- conn=DbConn.getConn();
- pstmt=conn.prepareStatement(sql);
- pstmt.setString(1,useId);
- pstmt.execute();
- pstmt1=conn.prepareStatement(updateSql);
- pstmt1.setString(1,useId);
- pstmt1.execute();
- conn.commit();
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(pstmt!=null)
- {
- pstmt.close();
- }
- if(conn!=null)
- {
- conn.close();
- }
- }
- request.setAttribute("useId",useId);
- queryProvideInfo(request,response);
- }
-}
diff --git a/src/main/java/com/zky/zhyw/smsb/PropertyTmaManageServlet.java b/src/main/java/com/zky/zhyw/smsb/PropertyTmaManageServlet.java
deleted file mode 100644
index 29f8488..0000000
--- a/src/main/java/com/zky/zhyw/smsb/PropertyTmaManageServlet.java
+++ /dev/null
@@ -1,427 +0,0 @@
-package com.zky.zhyw.smsb;
-
-import java.io.IOException;
-import java.net.URLEncoder;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import cn.org.bjca.utils.Base64;
-import com.zky.bjca.SM4;
-import com.zky.manager.Login;
-import com.zky.manager.Operate;
-import com.zky.manager.StudentPullulate;
-import com.zky.pub.Common;
-import com.zky.pub.DbConn;
-import com.zky.pub.DispatchServlet;
-import com.zky.pub.HashFmlBuf;
-import com.zky.util.PageQuery;
-import com.zky.util.jdbc.HashFmlBufResultSetHandler;
-import com.zky.util.jdbc.JDBCUtils;
-
-public class PropertyTmaManageServlet extends DispatchServlet {
- private StudentPullulate p=new StudentPullulate();
- Connection conn = null;
- PreparedStatement pstmt,pstmt1=null;
- @Override
- public void defaultMethod(HttpServletRequest request,
- HttpServletResponse response) throws Exception {
- }
- /**
- * 添加网络登记信息
- * @param request
- * @param response
- * @throws SQLException
- */
- public void addPropertyTma(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String frameworkid=request.getParameter("sj");
- String areaid=request.getParameter("qj");
- String schoolid=request.getParameter("school");
- String useempid=request.getParameter("useempid");
- String tmaname=request.getParameter("tmaname");
- String netSecret=request.getParameter("netSecret");
- String tmatype=request.getParameter("tmatype");
- String netwebnum=request.getParameter("netwebnum");
- String useyear=request.getParameter("useyear");
- String isassessment=request.getParameter("isassessment");
- String isappoval=request.getParameter("isappoval");
- String isbuild=request.getParameter("isbuild");
- String remark=request.getParameter("remark");
- String tmadeptname=request.getParameter("tmadeptname");
- String manager=request.getParameter("manager");
- String operateuseId=request.getParameter("operateuseId");
- String sf=request.getParameter("sf");
- String sql="insert into tm_dtl_property_tma(TMA_ID,TMA_DEPARTID,TMA_STAFFID,TMA_DATE," +
- "FRAMEWORK_ID,AREA_ID,TMA_SECURITY,TMA_RECOVERDEPARTID,TMANAME,TMATYPE,ISASSESSMENT,ISAPPROVAL,USEYEAR,ISBUILD,REMARK,TERMINAL,PART,TMA_MANAGER,PROVINCE) values(?,?,?,now(),?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
- try {
- conn= (Connection) DbConn.getConn();
- pstmt=conn.prepareStatement(sql);
- pstmt.setString(1,operateuseId);
- pstmt.setString(2,login.getDepartid());
- pstmt.setString(3,useempid);
- pstmt.setString(4,frameworkid);
- pstmt.setString(5,areaid);
- pstmt.setString(6,netSecret);
- pstmt.setString(7,schoolid);
- pstmt.setString(8, Base64.toBase64String(SM4.SM4Encrypt(tmaname)));
- pstmt.setString(9,tmatype);
- pstmt.setString(10,isassessment);
- pstmt.setString(11,isappoval);
- pstmt.setString(12,useyear);
- pstmt.setString(13,isbuild);
- pstmt.setString(14,remark);
- pstmt.setString(15,netwebnum);
- pstmt.setString(16,tmadeptname);
- pstmt.setString(17,manager);
- pstmt.setString(18,sf);
- pstmt.execute();
- conn.commit();
- System.err.println("添加网络");
- StringBuffer querySql=new StringBuffer("SELECT tma.TMA_ID,d.DEPARTNAME,tma.TMA_STAFFID,date_format(tma.TMA_DATE ,'%Y-%m-%d')as TMA_DATE,c.FRAMEWORKNAME,b.AREADEF,tma.TMA_SECURITY,tma.TERMINAL,tma.TMA_RECOVERDEPARTID,tma.PART,TMA_MANAGER from tm_dtl_property_tma tma " +
- "left join tab_area b on tma.AREA_ID=b.AREAID left join tab_framework c on tma.FRAMEWORK_ID=c.FRAMEWORKID" +
- " left join tab_department d on tma.TMA_DEPARTID=d.DEPARTID where 1=1");
- conn= (Connection) DbConn.getConn();
- PageQuery pageQuery=new PageQuery(conn,querySql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf useBuf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("useBuf",useBuf);
- request.getRequestDispatcher("/zhyw/smsb/smzd/propertyTmaManage.jsp").forward(request, response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(pstmt!=null)
- {
- pstmt.close();
- }
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * @author cxz
- * @param request
- * @param response
- * @throws SQLException
- */
- public void queryPropertyNetId(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String useId=request.getParameter("useId");
- String sql="select a.NET_ID,a.NET_DEPARTID,a.NET_STAFFID,a.NET_DATE,c.FRAMEWORKNAME,b.AREADEF,a.NET_SECURITY,a.TERMINAL ,d.DEPARTNAME " +
- "from tm_dtl_property_net a left join tab_area b on a.AREA_ID=b.AREAID left join tab_framework c on a.FRAMEWORK_ID=c.FRAMEWORKID left join tab_department d on a.NET_RECOVERDEPARTID=d.DEPARTID where a.net_id=?";
- try {
- conn= (Connection) DbConn.getConn();
- HashFmlBuf useBuf=(HashFmlBuf)JDBCUtils.query(conn, sql,new Object[]{useId},new HashFmlBufResultSetHandler());
- request.setAttribute("useBuf",useBuf);
- request.getRequestDispatcher("/zhyw/smsb/smwl/propertyNetAddUpdate.jsp?operate=UpdatepropertyUseAdd").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
-
- /**
- * 涉密网络查询
- * @author cxz
- * @param request
- * @param response
- * @throws SQLException
- */
- public void queryPropertyTmaPage(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String school=request.getParameter("school");
- String qj=request.getParameter("qj");
- String sj=request.getParameter("sj");
- StringBuffer querySql=new StringBuffer("SELECT tma.TMA_ID,d.DEPARTNAME,tma.TMA_STAFFID,tma.TMA_DATE ,c.FRAMEWORKNAME,b.AREADEF,tma.TMA_SECURITY,tma.TERMINAL,tma.PART,TMA_MANAGER from tm_dtl_property_tma tma " +
- "left join tab_area b on tma.AREA_ID=b.AREAID left join tab_framework c on tma.FRAMEWORK_ID=c.FRAMEWORKID" +
- " left join tab_department d on tma.TMA_RECOVERDEPARTID=d.DEPARTID where 1=1");
- if(!Common.isNull(school))
- {
- querySql.append(" and tma.TMA_DEPARTID='").append(school).append("'");
- }
- if(!Common.isNull(sj))
- {
- querySql.append(" and tma.framework_id='").append(sj).append("'");
- }
- if(!Common.isNull(qj))
- {
- querySql.append(" and tma.AREA_ID='").append(qj).append("'");
- }
- try {
- conn= (Connection) DbConn.getConn();
- PageQuery pageQuery=new PageQuery(conn,querySql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf useBuf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("useBuf",useBuf);
- request.getRequestDispatcher("/zhyw/smsb/smzd/propertyTmaManage.jsp").forward(request, response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
-
- //返回网络
- public void backCheckInfo(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- try {
- StringBuffer querySql=new StringBuffer("SELECT tma.TMA_ID,d.DEPARTNAME,tma.TMA_STAFFID,date_format(tma.TMA_DATE ,'%Y-%m-%d')as TMA_DATE,c.FRAMEWORKNAME,b.AREADEF,tma.TMA_SECURITY,tma.TERMINAL,tma.PART,TMA_MANAGER from tm_dtl_property_tma tma " +
- "left join tab_area b on tma.AREA_ID=b.AREAID left join tab_framework c on tma.FRAMEWORK_ID=c.FRAMEWORKID" +
- " left join tab_department d on tma.TMA_RECOVERDEPARTID=d.DEPARTID where 1=1");
- conn= (Connection) DbConn.getConn();
- PageQuery pageQuery=new PageQuery(conn,querySql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf Buf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("useBuf",Buf);
- Operate oper=new Operate();
- oper.operatesmbgcxLog(request);
- request.getRequestDispatcher("/zhyw/smsb/smzd/propertyTmaManage.jsp").forward(request, response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 单个删除涉密网络的一行记录
- * @param request
- * @param response
- * @throws IOException
- */
- public void deleteTmaManageRow(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String InfoId=request.getParameter("InfoId");
- System.out.println("ss"+InfoId);
- String sql = "DELETE FROM tm_dtl_property_tma WHERE TMA_ID=? ";
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = (Connection) DbConn.getConn();
- conn.setAutoCommit(false);
- prep = conn.prepareStatement(sql);
- prep.setString(1,InfoId);
- prep.addBatch();
- prep.executeBatch();
- conn.commit();
- queryPropertyTmaPage(request, response);
- } catch (Exception e) {
- if (conn != null) {
- try {
- conn.rollback();
- } catch (SQLException e1) {
- e1.printStackTrace();
- }
- }
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("删除网络信息失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (prep!= null) {
- prep.close();
- }
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- //删除涉密网络信息
- public void deleteTmaManage(HttpServletRequest request, HttpServletResponse response) throws IOException {
- Login login = (Login) request.getSession().getAttribute("login");
- String[] Infos = request.getParameterValues("Infos");
- String sql = "DELETE FROM tm_dtl_property_tma WHERE TMA_ID=?";
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = (Connection) DbConn.getConn();
- conn.setAutoCommit(false);
- prep = conn.prepareStatement(sql);
- for (int i=0; i0){
-
- //情况1:正常,浏览器按utf-8方式查看
- response.setCharacterEncoding("UTF-8");
- //情况2:正常,浏览器按简体中文方式查看
-
- response.setContentType("text/html; charset=UTF-8 ");
- out.write("");
- out.close();
- }else{
- conn.commit();
- queryPropertyUsePage(request, response);
- }
- queryPropertyUsePage(request, response);
- } catch (Exception e) {
- if (conn != null) {
- try {
- conn.rollback();
- } catch (SQLException e1) {
- e1.printStackTrace();
- }
- }
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员注销失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (prep!= null) {
- prep.close();
- }
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- // /**
-// * 单个删除一行记录
-// * @param request
-// * @param response
-// * @throws IOException
-// */
- public void deleteInfoManageRow(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String InfoId=request.getParameter("InfoId");
- String operateuseIds=request.getParameter("operateuseId");
- String operatereNames=request.getParameter("operatereName");
- String reName=new String(operatereNames.getBytes("ISO-8859-1"),"UTF-8");
- String reNames=reName;
- response.setContentType("text/html;charset=UTF-8");
- System.out.println("operatereNames3333333"+reNames);
- String sql = "DELETE from tm_dtl_property_info WHERE id=? ";
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = (Connection) DbConn.getConn();
- conn.setAutoCommit(false);
- prep = conn.prepareStatement(sql);
- prep.setString(1,InfoId);
- prep.addBatch();
- prep.executeBatch();
- conn.commit();
- request.setAttribute("operateuseIds", operateuseIds);
- request.setAttribute("opeds", reNames);
- queryPropertyInfodelete(request, response);
- } catch (Exception e) {
- if (conn != null) {
- try {
- conn.rollback();
- } catch (SQLException e1) {
- e1.printStackTrace();
- }
- }
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员注销失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (prep!= null) {
- prep.close();
- }
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- public void deletePropertyInfo(HttpServletRequest request, HttpServletResponse response) throws IOException {
- Login login = (Login) request.getSession().getAttribute("login");
- String[] Infos = request.getParameterValues("Infos");
- String sql = "DELETE FROM tm_dtl_property_info WHERE id=? ";
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = (Connection) DbConn.getConn();
- conn.setAutoCommit(false);
- prep = conn.prepareStatement(sql);
- for (int i=0; i importQuestionInfoData(String fileName) throws FileNotFoundException, IOException, ParseException
- {
- List PropertynetInfoData=new ArrayList();
- Questionexam PropertyInfo;
- //获取上传的文件
- //创建工作簿
- HSSFWorkbook workBook=new HSSFWorkbook(new FileInputStream(fileName));
- //得到工作表,因为本项目将所有学生信息导出后放在一个工作表中,所以获取第一张工作表即可
- HSSFSheet sheet=workBook.getSheetAt(0);
- //迭代数据行集合,第一行(0)为标题行所以从1开始
- HSSFRow hssfRow;
- for(int j=1;j<=sheet.getLastRowNum();j++)
- {
- Questionexam Info=new Questionexam();
- //获取数据行中具体的一行数据行
- hssfRow=sheet.getRow(j);
- //获取数据行中每个数据列的信息,并填入实体
- //序号
-
- //题目标题
- if(hssfRow.getCell(1)!=null||!hssfRow.getCell(1).toString().trim().equals(""))
- {
- Info.setQ_SUBJECT(hssfRow.getCell(1).toString().trim());
- }
- //题目类型
- if(hssfRow.getCell(2)!=null||!hssfRow.getCell(2).toString().trim().equals(""))
- {
- String Secret="";
- if(hssfRow.getCell(2).toString().trim().equals("专业题库"))
- {
- Secret="1";
- }
- else if(hssfRow.getCell(2).toString().trim().equals("基础题库"))
- {
- Secret="2";
- }
- else
- {
- Secret="1";
- }
- Info.setTYPEID(Secret);
- }
- //选项A
- if(hssfRow.getCell(3)!=null||!hssfRow.getCell(3).toString().trim().equals(""))
- {
- Info.setOPTIONA(hssfRow.getCell(3).toString().trim());
- }
- //选项B
- if(hssfRow.getCell(4)!=null||!hssfRow.getCell(4).toString().trim().equals(""))
- {
- Info.setOPTIONB(hssfRow.getCell(3).toString().trim());
-
- }
- //选项C
- if(hssfRow.getCell(5)!=null||!hssfRow.getCell(5).toString().trim().equals(""))
- {
- Info.setOPTIONC(hssfRow.getCell(5).toString().trim());
- }
- //选项D
- if(hssfRow.getCell(6)!=null||!hssfRow.getCell(6).toString().trim().equals(""))
- {
- Info.setOPTIOND(hssfRow.getCell(6).toString().trim());
- }
- //答案
- if(hssfRow.getCell(7)!=null||!hssfRow.getCell(7).toString().trim().equals(""))
- {
- Info.setNOTE(hssfRow.getCell(7).toString().trim());
- }
- //出题人
- if(hssfRow.getCell(8)!=null||!hssfRow.getCell(8).toString().trim().equals(""))
- {
- Info.setCREATEPERSON(hssfRow.getCell(8).toString().trim());
- }
- PropertynetInfoData.add(Info);
- }
- return PropertynetInfoData;
- }
- /**
- * 涉密题库统计
- * @author cxz
- * @param PropertyInfoData:excel表中遍历并填充的实体集合
- * @throws Exception
- * @throws IOException
- * @throws ServletException
- * @throws SQLException
- */
- public static void insertQuestionData(List PropertynetInfoData,HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException, SQLException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- Connection conn = null;
- Questionexam InfoData;
- //查询数据库中如果存在相应的数据就不插入数据,如果不存在相关的数据就插入date_format('20501231','%Y-%m-%d %H:%i:%s')
- String sqldata="select a.id,a.typeid,a.q_subject,a.q_answer " +
- ",a.optiona,a.optionb,a.optionc,a.optiond,note,createperson from td_question a where 1=1";
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sqldata.toString(),new HashFmlBufResultSetHandler());
- request.setAttribute("buf",buf);
- //网络数据导入
- String sql="insert into td_question(q_subject,typeid,optiona,optionb,optionc," +
- "optiond,note,createperson,createdate) values(?,?,?,?,?,?,?,?,?)";
- String sql1="insert into td_question1(q_subject,typeid,optiona,optionb,optionc," +
- "optiond,note,createperson,createdate) values(?,?,?,?,?,?,?,?,?)";
- PreparedStatement pstmt=null;
- try {
- for(Iterator iterator=PropertynetInfoData.iterator();iterator.hasNext();)
- {
- InfoData=(Questionexam)iterator.next();
- conn = DbConn.getConn();
- String id=InfoData.getId();
- for (int i = 0; i < buf.getRowCount(); i++) {
- String frameworkId=buf.fget("q_subject", i);
- if(frameworkId.equals(InfoData.getQ_SUBJECT())){
- response.sendRedirect(Common.GbConvertIso("/zhyw/smsj/ImportExcelQuestionDataError.jsp"));
- return;
- }
- }
- if(InfoData.getTYPEID().equals("1")){
- pstmt=conn.prepareStatement(sql1);
- }else{
- pstmt=conn.prepareStatement(sql);
- }
- pstmt.setString(1,InfoData.getQ_SUBJECT()); //标题
- pstmt.setString(2,InfoData.getTYPEID());//类型
- pstmt.setString(3,InfoData.getOPTIONA());//选项A
- pstmt.setString(4,InfoData.getOPTIONB());//选项B
- pstmt.setString(5,InfoData.getOPTIONC()); //选项C
- pstmt.setString(6,InfoData.getOPTIOND()); //选项D
- pstmt.setString(7,InfoData.getNOTE()); //答案
- pstmt.setString(8,InfoData.getCREATEPERSON()); //出题人
- pstmt.setString(9,MyUtils.getDateString()); //出题时间
- pstmt.execute();
- conn.commit();
- request.getRequestDispatcher("/zhyw/smsj/QuestionManage.jsp").forward(request,response);
- }
- } catch (SQLException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 添加试卷记录
- * @param request
- * @param response
- * @throws IOException
- */
- public void addQuestion(HttpServletRequest request, HttpServletResponse response) throws IOException {
- Login login = (Login) request.getSession().getAttribute("login");
- //试卷记录信息
- String id=request.getParameter("id");
- String qsubject=request.getParameter("qsubject");
- String optiona=request.getParameter("optiona");
- String optionb=request.getParameter("optionb");
- String optionc=request.getParameter("optionc");
- String optiond=request.getParameter("optiond");
- String note=request.getParameter("note");
- String createdate=request.getParameter("createdate");
- String createperson=request.getParameter("createperson");
- String tklxtype=request.getParameter("tklxtype");
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- if(tklxtype.equals("2")){
- String sql =
- "insert into td_question(typeid,q_subject,optiona,optionb,optionc," +
- "optiond,note,createdate,createperson) values(?,?,?,?,?,?,?,now(),?)";
- conn = DbConn.getConn();
- prep = conn.prepareStatement(sql);
- prep.setString(1, tklxtype);
- prep.setString(2,qsubject);
- prep.setString(3,optiona);
- prep.setString(4, optionb);
- prep.setString(5,optionc);
- prep.setString(6,optiond);
- prep.setString(7,note);
- prep.setString(8,createdate);
- prep.setString(9,createperson);
- prep.execute();
- //oracle数据库手动提交,mysql中 自动提交autoCommit();
- conn.commit();
- Common.updateParaTab("td_question");
- queryTryBook(request,response);
- }else if(tklxtype.equals("1")){
- String sql =
- "insert into td_question1(typeid,q_subject,optiona,optionb,optionc," +
- "optiond,note,createdate,createperson) values(?,?,?,?,?,?,?,now(),?)";
- conn = DbConn.getConn();
- prep = conn.prepareStatement(sql);
- prep.setString(1, tklxtype);
- prep.setString(2,qsubject);
- prep.setString(3,optiona);
- prep.setString(4, optionb);
- prep.setString(5,optionc);
- prep.setString(6,optiond);
- prep.setString(7,note);
- prep.setString(8,createdate);
- prep.setString(9,createperson);
- prep.execute();
- //oracle数据库手动提交,mysql中 自动提交autoCommit();
- conn.commit();
- Common.updateParaTab("td_question1");
- queryTryBook(request,response);
- }
- } catch (SQLException e) {
- String errorinfo = "";
- if (e.getMessage().startsWith("ORA-00001")) {
- errorinfo = "试卷添加失败,该试卷编号[" + id + "]已经存在!";
- } else {
- errorinfo = "试卷添加失败!" + e.toString();
- }
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode(errorinfo,"GB2312")));
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("试卷添加失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (prep!= null) {
- prep.close();
- }
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 试卷编辑
- * @param request
- * @param response
- * @throws IOException
- */
- @SuppressWarnings({ "null", "null" })
- public void UpdateQuestion(HttpServletRequest request, HttpServletResponse response) throws IOException {
- //试卷信息管理
- String tklxtype = request.getParameter("tklxtype");
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- String id=request.getParameter("id");
- String qsubject=request.getParameter("qsubject");
- String optiona=request.getParameter("optiona");
- String optionb=request.getParameter("optionb");
- String optionc=request.getParameter("optionc");
- String optiond=request.getParameter("optiond");
- String note=request.getParameter("note");
- String createdate=request.getParameter("createdate");
- String createperson=request.getParameter("createperson");
- if(tklxtype.equals("1")){
- String sql ="update td_question1 a set q_subject=?,optiona=?, optionb=?,optionc=?,optiond=?,note=?,createdate=now(),createperson=? where id=?";
- conn = DbConn.getConn();
- prep = conn.prepareStatement(sql);
- prep.setString(1,id);
- prep.setString(2,qsubject );
- prep.setString(3,optiona );
- prep.setString(4,optionb );
- prep.setString(5,optionc );
- prep.setString(6,optiond );
- prep.setString(7,note);
- prep.setString(8,createdate);
- prep.setString(9,createperson);
-
- prep.execute();
- //oracle数据库手动提交,mysql中 自动提交autoCommit();
- conn.commit();
- }else if(tklxtype.equals("2")){
- String sql ="update td_question a set q_subject=?,optiona=?, optionb=?,optionc=?,optiond=?,note=?,createdate=now(),createperson=? where id=?";
- conn = DbConn.getConn();
- prep = conn.prepareStatement(sql);
- prep.setString(1,id);
- prep.setString(2,qsubject );
- prep.setString(3,optiona );
- prep.setString(4,optionb );
- prep.setString(5,optionc );
- prep.setString(6,optiond );
- prep.setString(7,note);
- prep.setString(8,createdate);
- prep.setString(9,createperson);
-
- prep.execute();
- //oracle数据库手动提交,mysql中 自动提交autoCommit();
- conn.commit();
- }
- if(tklxtype.equals("1")){
- Common.updateParaTab("td_question1");
- queryTryBook(request,response);
- }else if(tklxtype.equals("2")){
- Common.updateParaTab("td_question");
- queryTryBook(request,response);
- }
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("试卷记录修改失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (prep!= null) {
- prep.close();
- }
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 查询所有的试卷记录
- * @param request
- * @param response
- * @throws IOException
- */
- public void queryTryBook(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String Id = request.getParameter("Id");
- String q_subject = request.getParameter("q_subject");
- String createperson = request.getParameter("createperson");
- String tklxtype = request.getParameter("tklxtype");
- Connection conn = null;
- try {
- if(tklxtype.equals("2")){
- StringBuffer sql =
- new StringBuffer("select a.id,a.typeid,a.q_subject,a.q_answer " +
- ",a.optiona,a.optionb,a.optionc,a.optiond,note,createperson from td_question a where 1=1");
- if (!Common.isNull(Id)) {
- sql.append(" and a.id='").append( Id).append("'");
- } else {
- if (!Common.isNull(q_subject)) {
- sql.append(" and q_subject like '%").append( q_subject).append("%'");
- }
- if (!Common.isNull(createperson)) {
- sql.append(" and createperson like '%").append( createperson).append("%'");
- }
- }
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("tryBook_info",buf);
- request.getRequestDispatcher("/zhyw/smsj/QuestionManage.jsp").forward(request,response);
- }else if(tklxtype.equals("1")){
- StringBuffer sql =
- new StringBuffer("select a.id,a.typeid,a.q_subject,a.q_answer " +
- ",a.optiona,a.optionb,a.optionc,a.optiond,note,createperson from td_question1 a where 1=1");
- if (!Common.isNull(Id)) {
- sql.append(" and a.id='").append( Id).append("'");
- } else {
- if (!Common.isNull(q_subject)) {
- sql.append(" and q_subject like '%").append( q_subject).append("%'");
- }
- if (!Common.isNull(createperson)) {
- sql.append(" and createperson like '%").append( createperson).append("%'");
- }
- }
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("tryBook_info",buf);
- request.getRequestDispatcher("/zhyw/smsj/QuestionManage.jsp").forward(request,response);
-
- }else{
- StringBuffer sql =
- new StringBuffer("select a.id,a.typeid,a.q_subject,a.q_answer " +
- ",a.optiona,a.optionb,a.optionc,a.optiond,note,createperson from td_question1 a where 1=1");
- if (!Common.isNull(Id)) {
- sql.append(" and a.id='").append( Id).append("'");
- } else {
- if (!Common.isNull(q_subject)) {
- sql.append(" and q_subject like '%").append( q_subject).append("%'");
- }
- if (!Common.isNull(createperson)) {
- sql.append(" and createperson like '%").append( createperson).append("%'");
- }
- }
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("tryBook_info",buf);
- request.getRequestDispatcher("/zhyw/smsj/QuestionManage.jsp").forward(request,response);
- }
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("题库信息查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- public void canceQuestion(HttpServletRequest request, HttpServletResponse response) throws IOException {
- Login login = (Login) request.getSession().getAttribute("login");
- String tklxtype=request.getParameter("tklxtype1");
- String[] questions = request.getParameterValues("questions");
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- if(tklxtype.equals("2")){
- String sql = "DELETE FROM td_question WHERE id=? ";
- conn = DbConn.getConn();
- conn.setAutoCommit(false);
- prep = conn.prepareStatement(sql);
- for (int i=0; i
- */
- public void destroy() {
- super.destroy(); // Just puts "destroy" string in log
- // Put your code here
- }
-
- public void doGet(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- OutputStream out = response.getOutputStream();
-
- try {
- String type = request.getParameter("type");
-
- JFreeChart chart = null;
- if (type.equals("pie")) {
- chart = JFCDaoFactory.getJFCDaoNewInstance().createPieChart();
- System.out.println(chart);
- } else if (type.equals("bar")) {
- chart = JFCDaoFactory.getJFCDaoNewInstance().createBarChart();
- }
- if (chart != null) {
- response.setContentType("image/png");
- ChartUtilities.writeChartAsPNG(out, chart, 800, 600);
- }
- } catch (Exception e) {
- System.err.println(e.toString());
- } finally {
- out.close();
- }
-
- }
-
- public void doPost(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- doGet(request,response);
-
- }
-
- public void init() throws ServletException {
- // Put your code here
- }
-
-}
diff --git a/src/main/java/com/zky/zhyw/smtj/JFCServlet1.java b/src/main/java/com/zky/zhyw/smtj/JFCServlet1.java
deleted file mode 100644
index c73602d..0000000
--- a/src/main/java/com/zky/zhyw/smtj/JFCServlet1.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package com.zky.zhyw.smtj;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.jfree.chart.ChartUtilities;
-import org.jfree.chart.JFreeChart;
-
-
-public class JFCServlet1 extends HttpServlet {
-
- /**
- * Constructor of the object.
- */
- public JFCServlet1() {
- super();
- }
-
- /**
- * Destruction of the servlet.
- */
- public void destroy() {
- super.destroy(); // Just puts "destroy" string in log
- // Put your code here
- }
-
- public void doGet(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- OutputStream out = response.getOutputStream();
-
- try {
- String type = request.getParameter("type");
-
- JFreeChart chart = null;
- if (type.equals("pie")) {
- chart = JFCDaoFactory1.getJFCDaoNewInstance().createPieChart1();
- System.out.println(chart);
- } else if (type.equals("bar")) {
- chart = JFCDaoFactory1.getJFCDaoNewInstance().createBarChart1();
- }
- if (chart != null) {
- response.setContentType("image/png");
- ChartUtilities.writeChartAsPNG(out, chart, 800, 600);
- }
- } catch (Exception e) {
- System.err.println(e.toString());
- } finally {
- out.close();
- }
-
- }
-
- public void doPost(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- doGet(request,response);
-
- }
-
- public void init() throws ServletException {
- // Put your code here
- }
-
-}
diff --git a/src/main/java/com/zky/zhyw/smtj/JFCServlet2.java b/src/main/java/com/zky/zhyw/smtj/JFCServlet2.java
deleted file mode 100644
index 768804c..0000000
--- a/src/main/java/com/zky/zhyw/smtj/JFCServlet2.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package com.zky.zhyw.smtj;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.jfree.chart.ChartUtilities;
-import org.jfree.chart.JFreeChart;
-
-
-public class JFCServlet2 extends HttpServlet {
-
- /**
- * Constructor of the object.
- */
- public JFCServlet2() {
- super();
- }
-
- /**
- * Destruction of the servlet.
- */
- public void destroy() {
- super.destroy(); // Just puts "destroy" string in log
- // Put your code here
- }
-
- public void doGet(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- OutputStream out = response.getOutputStream();
-
- try {
- String type = request.getParameter("type");
-
- JFreeChart chart = null;
- if (type.equals("pie")) {
- chart = JFCDaoFactory2.getJFCDaoNewInstance().createPieChart2();
- System.out.println(chart);
- } else if (type.equals("bar")) {
- chart = JFCDaoFactory2.getJFCDaoNewInstance().createBarChart2();
- }
- if (chart != null) {
- response.setContentType("image/png");
- ChartUtilities.writeChartAsPNG(out, chart, 800, 600);
- }
- } catch (Exception e) {
- System.err.println(e.toString());
- } finally {
- out.close();
- }
-
- }
-
- public void doPost(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- doGet(request,response);
-
- }
-
- public void init() throws ServletException {
- // Put your code here
- }
-
-}
diff --git a/src/main/java/com/zky/zhyw/smtj/Jdbc.java b/src/main/java/com/zky/zhyw/smtj/Jdbc.java
deleted file mode 100644
index e206e9b..0000000
--- a/src/main/java/com/zky/zhyw/smtj/Jdbc.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.zky.zhyw.smtj;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-
-public class Jdbc {
-
-// private static final String DRIVER = "com.mysql.cj.jdbc.Driver";
-// private static final String URL = "jdbc:mysql://localhost:3306/orcl";
-
- private static final String DRIVER = "com.kingbase8.Driver";
-
- private static final String URL = "jdbc:kingbase8://192.168.254.197:54321/orcl?useUnicode=true&characterEncoding=utf-8";
-
- private static final String USER = "root";
- private static final String PASS = "123456";
-
- public static Connection getConnection() {
- Connection con = null;
- try {
- Class.forName(DRIVER);
- con = DriverManager.getConnection(URL, USER, PASS);
- return con;
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-}
diff --git a/src/main/java/com/zky/zhyw/smtj/StatManageServlet.java b/src/main/java/com/zky/zhyw/smtj/StatManageServlet.java
deleted file mode 100644
index d0ced90..0000000
--- a/src/main/java/com/zky/zhyw/smtj/StatManageServlet.java
+++ /dev/null
@@ -1,1719 +0,0 @@
-
-package com.zky.zhyw.smtj;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URLEncoder;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.apache.log4j.Logger;
-import org.apache.poi.hssf.usermodel.HSSFCell;
-import org.apache.poi.hssf.usermodel.HSSFCellStyle;
-import org.apache.poi.hssf.usermodel.HSSFFont;
-import org.apache.poi.hssf.usermodel.HSSFRow;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.hssf.util.HSSFColor;
-import com.zky.manager.Login;
-import com.zky.pojo.Employee;
-import com.zky.pojo.FileInfo;
-import com.zky.pojo.MyUtils;
-import com.zky.pojo.PropertyInfo;
-import com.zky.pub.Common;
-import com.zky.pub.DbConn;
-import com.zky.pub.DispatchServlet;
-import com.zky.pub.HashFmlBuf;
-import com.zky.util.PageQuery;
-import com.zky.util.jdbc.HashFmlBufResultSetHandler;
-import com.zky.util.jdbc.JDBCUtils;
-
-/**
- * @author cxz
- * 统计管理
- */
-public class StatManageServlet extends DispatchServlet {
- private static final long serialVersionUID = 1L;
- private static final Logger log = Logger.getLogger(StatManageServlet.class);
- /**
- *员工成绩统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void queryStatScore(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String empid = request.getParameter("empid");
- String empname = request.getParameter("empname");
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- StringBuffer sql =
- new StringBuffer("select empid,empname,emppwd,empstate,")
- .append("empstatedate,emplvl,frameworkid,empcontaddr,empcontphone,")
- .append("empcontmobphone,empfaxnum,date_format(empidbegindate,'%Y-%m-%d') as empidbegindate,")
- .append("date_format(empidenddate,'%Y-%m-%d') as empidenddate,")
- .append("emppwdexpdate,empemail,sex,birthday,departid,nationstate,")
- .append("empage,emphabby,empjob,empeducational,empfamname,empfamage,")
- .append("empfamrelate,empfamjob,empschool,emppolitics,emphomeAddress,")
- .append("examintname,examintstate,examinttime,updatedepartment,updateuserid,examintdepartment,")
- .append("updatedate,rexamintstate,RADIORESULT,RADIORESULT1 from tab_employee a where 1=1");
- if (!Common.isNull(empid)) {
- sql.append(" and a.empid='").append( empid).append("'");
- } else {
- if (!Common.isNull(sj)) {
- sql.append(" and a.frameworkid='").append(sj).append("'");
- }
- if (!Common.isNull(qj)) {
- sql.append(" and a.areaid='").append(qj).append("'");
- }
- if (!Common.isNull(pcs)) {
- sql.append(" and a.departid='").append(pcs).append("'");
- }
- if (!Common.isNull(empname)) {
- sql.append(" and a.empname like '%").append( empname).append("%'");
- }
- }
- Connection conn = null;
-
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("statScore_info",buf);
- request.getRequestDispatcher("/zhyw/smtj/StatScore.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("复核人员查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密人员统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmryStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String empid = request.getParameter("empid");
- String empname = request.getParameter("empname");
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String empstate = request.getParameter("empstate");
- String startDate=request.getParameter("startdate");
- String endDate=request.getParameter("enddate");
- //日期之间的转化
- DateFormat dateFormat = DateFormat.getDateInstance();
- Connection conn = null;
- try {
- StringBuffer sql = new StringBuffer("SELECT b.empstate,b.empschool,b.emppolitics,a.empid,b.empname,c.departname")
- .append(",b.empcontmobphone,date_format(b.empstatedate,'%Y-%m-%d') as empstatedate,f.areadef,e.jobname,a.frameworkid,b.areaid FROM tab_empdept a ")
- .append("LEFT JOIN tab_employee b ON a.empid=b.empid LEFT JOIN tab_department c ON a.departid=c.departid ")
- .append("LEFT JOIN tab_area f ON b.areaid=f.areaid LEFT JOIN tab_job e ON e.jobcode=a.jobcode where 1=1");
- if (!Common.isNull(empid)) {
- sql.append(" and a.empid='").append( empid).append("'");
- } else {
- if (!Common.isNull(sj)) {
- sql.append(" and a.frameworkid='").append(sj).append("'");
- }
- if (!Common.isNull(qj)) {
- sql.append(" and b.areaid='").append(qj).append("'");
- }
- if (!Common.isNull(pcs)) {
- sql.append(" and a.departid='").append(pcs).append("'");
- }
- if (!Common.isNull(empstate)) {
- sql.append(" and b.empstate='").append(empstate).append("'");
- }
- if (!Common.isNull(empname)) {
- sql.append(" and b.empname like '%").append( empname).append("%'");
- }
- if (!Common.isNull(startDate)&&!Common.isNull(endDate)) {
- sql.append("and date_format(b.empstatedate,'%Y-%m-%d')>'").append(startDate).append("'");
- sql.append("and date_format(b.empstatedate,'%Y-%m-%d')<'").append(endDate).append("'");
- }
- }
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmryTj_info=(HashFmlBuf)pageQuery.query(100);
-
- request.setAttribute("SmryTj_info",SmryTj_info);
- request.getRequestDispatcher("/zhyw/smtj/rytj/StatSmry.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员培训统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmallStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- //日期之间的转化
- // DateFormat dateFormat = DateFormat.getDateInstance();
- Connection conn = null;
- try {
- StringBuffer sql = new StringBuffer("select a.frameworkid,a.areaid,a.departid,a.empid,a.empname,a.empstate,a.empjob,a.empschool,b.use_staffid,b.use_departid,b.property_name,b.property_no,b.property_num,c.file_name,c.file_num,c.file_secret,c.file_secretyj,c.instancy_extent,c.provide_count,c.target_departid FROM tab_employee a,tm_dtl_property_use b,tm_dtl_file_provide c ");
-
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmryTj_info_all=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmryTj_info_all",SmryTj_info_all);
- request.getRequestDispatcher("/zhyw/smtj/StatSmall.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员培训统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密文件统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmwjStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String fileId = request.getParameter("fileId");
- String filename = request.getParameter("filename");
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String receivestate = request.getParameter("receivestate");
- String extractstate = request.getParameter("extractstate");
- String destoryState = request.getParameter("destoryState");
- String startDate=request.getParameter("startdate");
- String endDate=request.getParameter("enddate");
- StringBuffer sql = new StringBuffer("SELECT b.receive_state,b.destory_state,b.receive_staffid,a.file_id,c.empname,d.departname, ")
- .append(" a.file_name,a.file_num,a.file_secret,a.provide_count,")
- .append("b.receive_departid,a.provide_staffid,date_format(a.provide_date,'%Y-%m-%d') as provide_date,date_format(b.receive_date,'%Y-%m-%d') as receive_date,date_format(b.extract_date,'%Y-%m-%d') as extract_date,b.extract_departid,b.extract_staffid,")
- .append("b.extract_state,a.frameworkid,a.areaid from tm_dtl_file_provide a LEFT JOIN tm_file_recelve b ON a.file_id=b.file_id ")
- .append("LEFT JOIN tab_employee c ON a.provide_staffid=c.empname LEFT JOIN tab_department d ON b.receive_departid=d.departid WHERE 1=1");
- if (!Common.isNull(fileId)) {
- sql.append(" and a.file_id='").append( fileId).append("'");
- } else {
- if (!Common.isNull(sj)) {
- sql.append(" and a.frameworkid='").append(sj).append("'");
- }
- if (!Common.isNull(qj)) {
- sql.append(" and a.areaid='").append(qj).append("'");
- }
- if (!Common.isNull(pcs)) {
- sql.append(" and a.provide_departid='").append(pcs).append("'");
- }
- if (!Common.isNull(filename)) {
- sql.append(" and a.file_name like '%").append( filename).append("%'");
- }
- if (!Common.isNull(receivestate)) {
- sql.append(" and b.receive_state='").append(receivestate).append("'");
- }
- if (!Common.isNull(extractstate)) {
- sql.append(" and b.extract_state='").append(extractstate).append("'");
- }
- if (!Common.isNull(destoryState)) {
- sql.append(" and b.destory_state='").append(destoryState).append("'");
- }
- if (!Common.isNull(startDate)&&!Common.isNull(endDate)) {
- sql.append("and date_format(a.provide_date,'%Y-%m-%d')>='").append(startDate).append("'");
- sql.append("and date_format(a.provide_date,'%Y-%m-%d')<='").append(endDate).append("'");
- }
- }
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmryWj_info=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmryWj_info",SmryWj_info);
- request.getRequestDispatcher("/zhyw/smtj/StatSmwj.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("文件统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密资产统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmsbStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String protyname = request.getParameter("protyname");
- StringBuffer sql=
- new StringBuffer("select a.use_id,a.use_departid,a.RECOVER_DEPARTID,bb.property_name,date_format(a.USE_DATE,'%Y-%m-%d %H:%i') as USE_DATE," +
- "a.RECOVER_STAFFID,a.framework_id,a.use_staffid,c.frameworkname,d.areadef from tm_dtl_property_use a " +
- "left join tm_dtl_property_info bb on a.use_id=bb.use_id "+
- "left join tab_framework c on a.framework_id=c.frameworkid " +
- "left join tab_area d on d.areaid=a.area_id where 1=1 ");
- if (!Common.isNull(sj)) {
- sql.append("and a.framework_id='").append(sj).append("'");
- }
- if ( !Common.isNull(qj) ) {
- sql.append("and a.area_id='").append(qj).append("'");
- }
- if(!Common.isNull(protyname)){
- sql.append("and bb.property_name='").append(protyname).append("'");
- }
- if ( !Common.isNull(pcs) ) {
- sql.append(" and a.recover_departid like'%").append(pcs).append("%'");
- }
- sql.append("group by a.use_id");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTj_info=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTj_info",SmsbTj_info);
-
- request.getRequestDispatcher("/zhyw/smtj/StatSmsb.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员培训统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密资产统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmsbStatDetail(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String protyname = request.getParameter("protyname");
- StringBuffer sql=
- new StringBuffer("select a.use_id,a.use_departid,a.RECOVER_DEPARTID,bb.property_name,date_format(a.USE_DATE,'%Y-%m-%d') as USE_DATE," +
- "a.RECOVER_STAFFID,a.framework_id,a.use_staffid,c.frameworkname,d.areadef from tm_dtl_property_use a " +
- "left join tm_dtl_property_info bb on a.use_id=bb.use_id "+
- "left join tab_framework c on a.framework_id=c.frameworkid " +
- "left join tab_area d on d.areaid=a.area_id where 1=1 ");
- if (!Common.isNull(sj)) {
- sql.append("and a.framework_id='").append(sj).append("'");
- }
- if ( !Common.isNull(qj) ) {
- sql.append("and a.area_id='").append(qj).append("'");
- }
- if(!Common.isNull(protyname)){
- sql.append("and bb.property_name='").append(protyname).append("'");
- }
- if (!Common.isNull(pcs) ) {
- sql.append("and a.RECOVER_DEPARTID='").append(pcs).append("'");
- }
- sql.append("group by a.use_id ,a.USE_DEPARTID,a.RECOVER_DEPARTID,bb.property_name,a.USE_DATE,a.RECOVER_STAFFID,a.framework_id,a.use_staffid,c.frameworkname,d.areadef");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTj_info=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTj_info",SmsbTj_info);
-
- request.getRequestDispatcher("/zhyw/smsb/sbdj/propertyUseEdit.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员培训统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密资产统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmsbAllStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String useId = request.getParameter("useId");
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String protyname = request.getParameter("protyname");
- String protynamevalue=null;
- if(protyname.equals("其它")){
- protynamevalue="";
- }else{
- protynamevalue=protyname;
- }
- StringBuffer sql = new StringBuffer("select aa.property_name,bb.use_id,bb.recover_departid,dd.frameworkname,bb.USE_STAFFID,bb.RECOVER_STAFFID," +
- "date_format(bb.USE_DATE,'%Y-%m-%d %H:%i') as USE_DATE,date_format(bb.RECOVER_DATE,'%Y-%m-%d %H:%i') as RECOVER_DATE," +
- "cc.areadef,bb.framework_id,bb.area_id ,count(bb.RECOVER_DEPARTID) as ddddd " +
- "from tm_dtl_property_use bb left join tm_dtl_property_info aa on aa.use_id=bb.use_id " +
- "left join tab_area cc on cc.areaid=bb.area_id " +
- "left join tab_framework dd on dd.frameworkid=bb.framework_id where 1=1");
- if (!Common.isNull(sj) ) {
- sql.append(" and bb.framework_id='").append(sj).append("'");
- }
- if (!Common.isNull(qj) ) {
- sql.append(" and bb.area_id='").append(qj).append("'");
- }
- if ( !Common.isNull(pcs) ) {
- sql.append(" and a.recover_departid like'%").append(pcs).append("%'");
- }
- if (!Common.isNull(protynamevalue)) {
- sql.append(" and aa.property_name='").append(protynamevalue).append("'");
- }
- sql.append("group by bb.recover_departid,dd.frameworkname,cc.areadef,aa.property_name,bb.area_id,bb.framework_id,bb.USE_STAFFID,bb.RECOVER_STAFFID,bb.USE_DATE,bb.RECOVER_DATE");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTjALL_info=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTjALL_info",SmsbTjALL_info);
- request.getRequestDispatcher("/zhyw/smtj/StatALLScore.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员培训统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密资产统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmsbeEXStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String useId = request.getParameter("useId");
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String protyname = request.getParameter("protyname");
- String protynamevalue=null;
- String frameworkname=null;
- String areadef=null;
- StringBuffer sql1=new StringBuffer("select a.frameworkid,a.frameworkname from tab_framework a where a.frameworkid='"+sj+"'");
- StringBuffer sql2=new StringBuffer("select b.areaid,b.areadef from tab_area b where b.areaid='"+qj+"'");
- StringBuffer sql= new StringBuffer("select a.recover_staffid,a.ID,a.FRAMEWORK_ID,a.AREA_ID,a.RECOVER_DEPARTID,a.PROPERTY_name,a.PROPERTY_NUM,date_format(a.extent_time,'%Y-%m-%d %H:%i:%s') as extent_time from tm_dtl_property_temp a where 1=1 ");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sql1.toString(),new HashFmlBufResultSetHandler());
- HashFmlBuf buf2 = (HashFmlBuf)JDBCUtils.query(conn,sql2.toString(),new HashFmlBufResultSetHandler());
- for (int i = 0; i < buf.getRowCount(); i++) {
- frameworkname=buf.fget("frameworkname", i);
- }
- for (int i = 0; i < buf2.getRowCount(); i++) {
- areadef=buf2.fget("areadef", i);
- }
- if (!Common.isNull(sj) ) {
- sql.append(" and a.framework_id='").append(frameworkname).append("'");
- }
- if (!Common.isNull(qj) ) {
- sql.append(" and a.area_id='").append(areadef).append("'");
- }
- if ( !Common.isNull(pcs) ) {
- sql.append(" and a.recover_departid like'%").append(pcs).append("%'");
- }
- if (!Common.isNull(protyname)) {
- sql.append(" and a.property_name='").append(protyname).append("'");
- }
- sql.append(" order by a.extent_time desc");
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTjALL_info1=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTjALL_info1",SmsbTjALL_info1);
- request.getRequestDispatcher("/zhyw/smtj/StatALLScore.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员培训统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密资产统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmsbeEXAllStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String useId = request.getParameter("useId");
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String protyname = request.getParameter("protyname");
- String protynamevalue=null;
- if(protyname.equals("其它")){
- protynamevalue="";
- }else{
- protynamevalue=protyname;
- }
- String frameworkname=null;
- String areadef=null;
- StringBuffer sql1=new StringBuffer("select a.frameworkid,a.frameworkname from tab_framework a where a.frameworkid='"+sj+"'");
- StringBuffer sql2=new StringBuffer("select b.areaid,b.areadef from tab_area b where b.areaid='"+qj+"'");
- StringBuffer sql= new StringBuffer("select a.RECOVER_staffID,a.AREA_ID,a.RECOVER_DEPARTID,a.FRAMEWORK_ID,sum(a.PROPERTY_NUM) as total,a.PROPERTY_NAME,a.PROPERTY_NUM,date_format(a.extent_time,'%Y-%m-%d %H:%i:%s') as extent_time from tm_dtl_property_temp a where 1=1 ");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sql1.toString(),new HashFmlBufResultSetHandler());
- HashFmlBuf buf2 = (HashFmlBuf)JDBCUtils.query(conn,sql2.toString(),new HashFmlBufResultSetHandler());
- for (int i = 0; i < buf.getRowCount(); i++) {
- frameworkname=buf.fget("frameworkname", i);
- }
- for (int i = 0; i < buf2.getRowCount(); i++) {
- areadef=buf2.fget("areadef", i);
- }
- if (!Common.isNull(sj) ) {
- sql.append(" and a.framework_id='").append(frameworkname).append("'");
- }
- if (!Common.isNull(qj) ) {
- sql.append(" and a.area_id='").append(areadef).append("'");
- }
- if ( !Common.isNull(pcs) ) {
- sql.append(" and a.recover_departid like'%").append(pcs).append("%'");
- }
- if (!Common.isNull(protynamevalue)) {
- sql.append(" and a.PROPERTY_NAME='").append(protynamevalue).append("'");
- }
- sql.append("group by a.PROPERTY_NAME,a.FRAMEWORK_ID order by a.extent_time desc");
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTjALL_info2=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTjALL_info2",SmsbTjALL_info2);
- request.getRequestDispatcher("/zhyw/smtj/StatALLScore.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员培训统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密资产统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmsbeEXNetStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String useId = request.getParameter("useId");
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String protyname = request.getParameter("protyname");
- String frameworkname=null;
- String areadef=null;
- StringBuffer sql1=new StringBuffer("select a.frameworkid,a.frameworkname from tab_framework a where a.frameworkid='"+sj+"'");
- StringBuffer sql2=new StringBuffer("select b.areaid,b.areadef from tab_area b where b.areaid='"+qj+"'");
- StringBuffer sql= new StringBuffer("select a.ID,a.FRAMEWORK_ID,a.AREA_ID,a.RECOVER_DEPARTID,a.NET_NAME,a.SERCENT,a.FINALLYNUM,a.PROPERTY_NUM,date_format(a.extent_time,'%Y-%m-%d %H:%i:%s') as extent_time from tm_dtl_property_tempnet a where 1=1 ");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sql1.toString(),new HashFmlBufResultSetHandler());
- HashFmlBuf buf2 = (HashFmlBuf)JDBCUtils.query(conn,sql2.toString(),new HashFmlBufResultSetHandler());
- for (int i = 0; i < buf.getRowCount(); i++) {
- frameworkname=buf.fget("frameworkname", i);
- }
- for (int i = 0; i < buf2.getRowCount(); i++) {
- areadef=buf2.fget("areadef", i);
- }
- if (!Common.isNull(sj) ) {
- sql.append(" and a.framework_id='").append(frameworkname).append("'");
- }
- if (!Common.isNull(qj) ) {
- sql.append(" and a.area_id='").append(areadef).append("'");
- }
- if ( !Common.isNull(pcs) ) {
- sql.append(" and a.recover_departid like'%").append(pcs).append("%'");
- }
- if (!Common.isNull(protyname)) {
- sql.append(" and a.net_name='").append(protyname).append("'");
- }
- sql.append(" order by a.extent_time desc");
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTjALL_info1=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTjALL_info1",SmsbTjALL_info1);
- request.getRequestDispatcher("/zhyw/smtj/StatNet.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("涉密网络统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密资产统计--汇总
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmsbeEXNetALLStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String useId = request.getParameter("useId");
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String protyname = request.getParameter("protyname");
- String protynamevalue=null;
- if(protyname.equals("其它")){
- if(!protyname.equals("服务器")&&!protyname.equals("路由器")&&!protyname.equals("防火墙")&&!protyname.equals("网关")){
- protynamevalue="";
- }else{
- protynamevalue=protyname;
- }
- }else{
- protynamevalue=protyname;
- }
- String frameworkname=null;
- String areadef=null;
- StringBuffer sql1=new StringBuffer("select a.frameworkid,a.frameworkname from tab_framework a where a.frameworkid='"+sj+"'");
- StringBuffer sql2=new StringBuffer("select b.areaid,b.areadef from tab_area b where b.areaid='"+qj+"'");
- StringBuffer sql= new StringBuffer("select a.recover_departid,a.FRAMEWORK_ID,sum(a.PROPERTY_NUM) as total,a.NET_NAME,a.PROPERTY_NUM,a.area_id,date_format(a.extent_time,'%Y-%m-%d %H:%i:%s') as extent_time from tm_dtl_property_tempnet a where 1=1 ");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sql1.toString(),new HashFmlBufResultSetHandler());
- HashFmlBuf buf2 = (HashFmlBuf)JDBCUtils.query(conn,sql2.toString(),new HashFmlBufResultSetHandler());
- for (int i = 0; i < buf.getRowCount(); i++) {
- frameworkname=buf.fget("frameworkname", i);
- }
- for (int i = 0; i < buf2.getRowCount(); i++) {
- areadef=buf2.fget("areadef", i);
- }
- if (!Common.isNull(sj) ) {
- sql.append(" and a.framework_id='").append(frameworkname).append("'");
- }
- if (!Common.isNull(qj) ) {
- sql.append(" and a.area_id='").append(areadef).append("'");
- }
- if ( !Common.isNull(pcs) ) {
- sql.append(" and a.recover_departid like'%").append(pcs).append("%'");
- }
- if (!Common.isNull(protynamevalue)) {
- sql.append(" and a.NET_NAME='").append(protynamevalue).append("'");
- }
- sql.append("group by a.NET_NAME,a.FRAMEWORK_ID order by a.extent_time desc");
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTjALL_info2=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTjALL_info2",SmsbTjALL_info2);
- request.getRequestDispatcher("/zhyw/smtj/StatNet.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员培训统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /***
- * 导出区县下面人员
- * @param request
- * @param response
- * @throws Exception
- */
- public void exportExcelsmry(HttpServletRequest request,HttpServletResponse response) throws Exception
- {
- String empid = request.getParameter("empid");
- String empname = request.getParameter("empname");
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String startDate=request.getParameter("startdate");
- String endDate=request.getParameter("enddate");
- //日期之间的转化
- DateFormat dateFormat = DateFormat.getDateInstance();
- Connection conn = null;
- StringBuffer sql = new StringBuffer("SELECT a.empid,b.empname,c.departname")
- .append(",b.empcontmobphone,date_format(b.empstatedate,'%Y-%m-%d') as empstatedate,f.areadef,e.jobname,a.frameworkid,b.areaid FROM tab_empdept a ")
- .append("LEFT JOIN tab_employee b ON a.empid=b.empid LEFT JOIN tab_department c ON a.departid=c.departid ")
- .append("LEFT JOIN tab_area f ON b.areaid=f.areaid LEFT JOIN tab_job e ON e.jobcode=a.jobcode where 1=1");
- if (!Common.isNull(empid)) {
- sql.append(" and a.empid='").append( empid).append("'");
- } else {
- if (!Common.isNull(sj)) {
- sql.append(" and a.frameworkid='").append(sj).append("'");
- }
- if (!Common.isNull(qj)) {
- sql.append(" and b.areaid='").append(qj).append("'");
- }
- if (!Common.isNull(pcs)) {
- sql.append(" and a.departid='").append(pcs).append("'");
- }
- if (!Common.isNull(empname)) {
- sql.append(" and b.empname like '%").append( empname).append("%'");
- }
- if (!Common.isNull(startDate)&&!Common.isNull(endDate)) {
- sql.append("and date_format(b.empstatedate,'%Y-%m-%d')>'").append(startDate).append("'");
- sql.append("and date_format(b.empstatedate,'%Y-%m-%d')<'").append(endDate).append("'");
- }
- }
- List emps = new ArrayList();;
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- Employee emp=null;
- if(buf!=null)
- {
- for(int i=0;i empData) throws ParseException
- {
- HSSFWorkbook workBook=new HSSFWorkbook();
- String[] title={"人员编号","人员姓名","所属单位","人员职位","入职日期","人员手机"};
- int i=0;
- int k=1;
- HSSFSheet tableSheet=workBook.createSheet("资产表单");
- HSSFCellStyle contentStyle=workBook.createCellStyle();
- HSSFFont contentFont=workBook.createFont();
- HSSFRow row=tableSheet.createRow(0);
- row.setHeight((short) 400);
- contentFont.setColor(HSSFColor.RED.index);
-
-
- //创建标题栏单元格字体
- HSSFFont titleFont=workBook.createFont();
- //创建标题栏样式
- HSSFCellStyle titleStyle=workBook.createCellStyle();
- //设置标题栏字体颜色
- titleFont.setColor(HSSFColor.BLUE.index);
- titleFont.setFontName("宋体");
- titleFont.setFontHeight((short)30);
- titleFont.setFontHeightInPoints((short) 10);
- titleFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
- //设置标题栏字体样式
- titleStyle.setFont(titleFont);
- // 设置列宽
- tableSheet.setColumnWidth(0, 2000);
- tableSheet.setColumnWidth(1, 3500);
- tableSheet.setColumnWidth(2, 3500);
- tableSheet.setColumnWidth(3, 6500);
- tableSheet.setColumnWidth(4, 6500);
- tableSheet.setColumnWidth(5, 3500);
- tableSheet.setColumnWidth(6, 2500);
- tableSheet.setColumnWidth(7, 6500);
- for(String s:title)
- {
- HSSFCell cell=row.createCell(i);
- cell.setCellValue(s);
- cell.setCellStyle(titleStyle);
- i++;
- }
- //迭代数据信息,填入数据行
- for(Iterator iterator=empData.iterator();iterator.hasNext();)
- {
- Employee Info=(Employee)iterator.next();
- HSSFRow hssfRow=tableSheet.createRow((short)k);
- hssfRow.createCell(0).setCellValue(Info.getEmpId());
- hssfRow.createCell(1).setCellValue(Info.getEmpName());
- hssfRow.createCell(2).setCellValue(Info.getDepartname());
- hssfRow.createCell(3).setCellValue(Info.getJobename());
- hssfRow.createCell(4).setCellValue(Info.getEmpstarttime().toString().trim().equals("")?"":Info.getEmpstarttime());
- hssfRow.createCell(5).setCellValue(Info.getPhone());
- k++;
- }
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- try {
- workBook.write(os);
- } catch (IOException e) {
- e.printStackTrace();
- }
- byte[] content = os.toByteArray();
- InputStream is = new ByteArrayInputStream(content);
- return is;
- }
- /***
- * 导出文件
- * @param request
- * @param response
- * @throws Exception
- */
- public void exportExcelsmwj(HttpServletRequest request,HttpServletResponse response) throws Exception
- {
- String fileId = request.getParameter("fileId");
- String filename = request.getParameter("filename");
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String startDate=request.getParameter("startdate");
- String endDate=request.getParameter("enddate");
- StringBuffer sql = new StringBuffer("SELECT a.file_id,c.empname,d.departname, ")
- .append(" a.file_name,a.file_num,a.file_secret,a.provide_count,")
- .append("b.receive_departid,a.provide_staffid,date_format(a.provide_date,'%Y-%m-%d') as provide_date,b.receive_date,b.extract_departid,b.extract_staffid,")
- .append("b.extract_state,a.frameworkid,a.areaid from tm_dtl_file_provide a LEFT JOIN tm_file_recelve b ON a.file_id=b.file_id ")
- .append("LEFT JOIN tab_employee c ON a.provide_staffid=c.empid LEFT JOIN tab_department d ON b.receive_departid=d.departid WHERE 1=1");
- Connection conn = null;
- if (!Common.isNull(fileId)) {
- sql.append(" and a.file_id='").append( fileId).append("'");
- } else {
- if (!Common.isNull(sj)) {
- sql.append(" and a.frameworkid='").append(sj).append("'");
- }
- if (!Common.isNull(qj)) {
- sql.append(" and a.areaid='").append(qj).append("'");
- }
- if (!Common.isNull(pcs)) {
- sql.append(" and a.provide_departid='").append(pcs).append("'");
- }
- if (!Common.isNull(filename)) {
- sql.append(" and a.file_name like '%").append( filename).append("%'");
- }
- if (!Common.isNull(startDate)&&!Common.isNull(endDate)) {
- sql.append("and date_format(a.provide_date,'%Y-%m-%d')>='").append(startDate).append("'");
- sql.append("and date_format(a.provide_date,'%Y-%m-%d')<='").append(endDate).append("'");
- }
- }
- List emps = new ArrayList();
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- FileInfo file=null;
- if(buf!=null)
- {
- for(int i=0;i fileData) throws ParseException
- {
- HSSFWorkbook workBook=new HSSFWorkbook();
- String[] title={"文件编号","文件名称","文号","接收单位","发文人员","发文日期"};
- int i=0;
- int k=1;
- HSSFSheet tableSheet=workBook.createSheet("文件表单");
- HSSFRow row=tableSheet.createRow((short)0);
- //创建标题栏单元格字体
- HSSFFont titleFont=workBook.createFont();
- //创建标题栏样式
- HSSFCellStyle titleStyle=workBook.createCellStyle();
- //设置标题栏字体颜色
- titleFont.setColor(HSSFColor.BLUE.index);
- //设置标题栏字体样式
- titleStyle.setFont(titleFont);
- //创建状态异常的数据行字体
- HSSFFont contentFont=workBook.createFont();
- //创建状态异常的数据行样式
- HSSFCellStyle contentStyle=workBook.createCellStyle();
- //设置状态异常的数据行字体颜色
- contentFont.setColor(HSSFColor.RED.index);
- //为状态异常的数据行样式设置字体
- contentStyle.setFont(contentFont);
- //迭代标题数组,根据数组长度创建单元格,并设置标题栏单元格字体颜色
- for(String s:title)
- {
- HSSFCell cell=row.createCell(i);
- cell.setCellValue(s);
- cell.setCellStyle(titleStyle);
- i++;
- }
- //迭代数据信息,填入数据行
- for(Iterator iterator=fileData.iterator();iterator.hasNext();)
- {
- FileInfo Info=(FileInfo)iterator.next();
- HSSFRow hssfRow=tableSheet.createRow((short)k);
- hssfRow.createCell(0).setCellValue(Info.getFileId());
- hssfRow.createCell(1).setCellValue(Info.getFileName());
- hssfRow.createCell(2).setCellValue(Info.getFileNum());
- hssfRow.createCell(3).setCellValue(Info.getTargetDepartName());
- hssfRow.createCell(4).setCellValue(Info.getEmpname());
- hssfRow.createCell(5).setCellValue(Info.getProvideDate().toString().trim().equals("")?"":Info.getProvideDate());
- k++;
- }
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- try {
- workBook.write(os);
- } catch (IOException e) {
- e.printStackTrace();
- }
- byte[] content = os.toByteArray();
- InputStream is = new ByteArrayInputStream(content);
- return is;
- }
- /***
- * 导出涉密资产
- * @param request
- * @param response
- * @throws Exception
- */
- public void exportExcelsmsb(HttpServletRequest request,HttpServletResponse response) throws Exception
- {
- String useId = request.getParameter("useId");
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String protyname = request.getParameter("protyname");
- StringBuffer sql = new StringBuffer("select aa.property_name,bb.use_id,bb.recover_departid,dd.frameworkname,bb.USE_STAFFID,bb.RECOVER_STAFFID," +
- "date_format(bb.USE_DATE,'%Y-%m-%d %H:%i') as USE_DATE,date_format(bb.RECOVER_DATE,'%Y-%m-%d %H:%i') as RECOVER_DATE," +
- "cc.areadef,bb.framework_id,bb.area_id ,count(bb.RECOVER_DEPARTID) as ddddd " +
- "from tm_dtl_property_use bb left join tm_dtl_property_info aa on aa.use_id=bb.use_id " +
- "left join tab_area cc on cc.areaid=bb.area_id " +
- "left join tab_framework dd on dd.frameworkid=bb.framework_id where 1=1");
- if (!Common.isNull(sj) ) {
- sql.append(" and bb.framework_id='").append(sj).append("'");
- }
- if (!Common.isNull(qj) ) {
- sql.append(" and bb.area_id='").append(qj).append("'");
- }
- if ( !Common.isNull(pcs) ) {
- sql.append(" and bb.recover_departid='").append(pcs).append("'");
- }
- if (!Common.isNull(protyname)) {
- sql.append(" and aa.property_name='").append(protyname).append("'");
- }
- sql.append("group by bb.recover_departid,dd.frameworkname,cc.areadef,aa.property_name,bb.area_id,bb.framework_id,bb.USE_STAFFID,bb.RECOVER_STAFFID,bb.USE_DATE,bb.RECOVER_DATE");
- Connection conn = null;
- List sbs = new ArrayList();
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100000);
- PropertyInfo pro=null;
- String arer=buf.fget("areadef", 0);
-
- if(buf!=null)
- {
- for(int i=0;i sbs = new ArrayList();
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100000);
- PropertyInfo pro=null;
- if(buf!=null)
- {
- for(int i=0;i scj = new ArrayList();
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- Employee smcj=null;
- if(buf!=null)
- {
- for(int i=0;i scjData) throws ParseException
- {
- HSSFWorkbook workBook=new HSSFWorkbook();
- String[] title={"人员编号","人员姓名","专业成绩","基础成绩"};
- int i=0;
- int k=1;
- HSSFSheet tableSheet=workBook.createSheet("成绩表单");
- HSSFRow row=tableSheet.createRow((short)0);
- //创建标题栏单元格字体
- HSSFFont titleFont=workBook.createFont();
- //创建标题栏样式
- HSSFCellStyle titleStyle=workBook.createCellStyle();
- //设置标题栏字体颜色
- titleFont.setColor(HSSFColor.BLUE.index);
- //设置标题栏字体样式
- titleStyle.setFont(titleFont);
- //创建状态异常的数据行字体
- HSSFFont contentFont=workBook.createFont();
- //创建状态异常的数据行样式
- HSSFCellStyle contentStyle=workBook.createCellStyle();
- //设置状态异常的数据行字体颜色
- contentFont.setColor(HSSFColor.RED.index);
- //为状态异常的数据行样式设置字体
- contentStyle.setFont(contentFont);
- //迭代标题数组,根据数组长度创建单元格,并设置标题栏单元格字体颜色
- for(String s:title)
- {
- HSSFCell cell=row.createCell(i);
- cell.setCellValue(s);
- cell.setCellStyle(titleStyle);
- i++;
- }
- //迭代数据信息,填入数据行
- for(Iterator iterator=scjData.iterator();iterator.hasNext();)
- {
- Employee smrycj=(Employee)iterator.next();
- HSSFRow hssfRow=tableSheet.createRow((short)k);
- hssfRow.createCell(0).setCellValue(smrycj.getEmpId());
- hssfRow.createCell(1).setCellValue(smrycj.getEmpName());
- hssfRow.createCell(2).setCellValue(smrycj.getRadioresult());
- hssfRow.createCell(3).setCellValue(smrycj.getRadioresult1());
- k++;
- }
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- try {
- workBook.write(os);
- } catch (IOException e) {
- e.printStackTrace();
- }
- byte[] content = os.toByteArray();
- InputStream is = new ByteArrayInputStream(content);
- return is;
- }
- /***
- * 涉密资产登记(数据导出)
- * @author cxz
- * @param sbData
- * @return
- * @throws ParseException
- */
- public InputStream getSbData(List sbData) throws ParseException
- {
- HSSFWorkbook workBook=new HSSFWorkbook();
- String[] title={"序号","所属市州","所属区县","使用单位","使用人","资产名称","资产数量","导出时间"};
- int i=0;
- int k=1;
- HSSFSheet tableSheet=workBook.createSheet("资产表单");
- HSSFRow row=tableSheet.createRow((short)0);
- //创建标题栏单元格字体
- HSSFFont titleFont=workBook.createFont();
- //创建标题栏样式
- HSSFCellStyle titleStyle=workBook.createCellStyle();
- //设置标题栏字体颜色
- titleFont.setColor(HSSFColor.BLUE.index);
- titleFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
- //设置标题栏字体样式
- titleStyle.setFont(titleFont);
- titleStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT);
- //创建状态异常的数据行字体
- HSSFFont contentFont=workBook.createFont();
- //创建状态异常的数据行样式
- HSSFCellStyle contentStyle=workBook.createCellStyle();
- //设置状态异常的数据行字体颜色
- contentFont.setColor(HSSFColor.RED.index);
- //为状态异常的数据行样式设置字体
- contentStyle.setFont(contentFont);
- tableSheet.setColumnWidth(0, 1000);
- tableSheet.autoSizeColumn((short)1);
- tableSheet.autoSizeColumn((short)2);
- tableSheet.autoSizeColumn((short)3);
- tableSheet.autoSizeColumn((short)4);
- tableSheet.autoSizeColumn((short)5);
- tableSheet.autoSizeColumn((short)6);
- tableSheet.setColumnWidth(7, 5000);
- for(String s:title)
- {
- HSSFCell cell=row.createCell(i);
- cell.setCellValue(s);
- cell.setCellStyle(titleStyle);
- i++;
-
- }
- //迭代数据信息,填入数据行
- for(Iterator iterator=sbData.iterator();iterator.hasNext();)
- {
- PropertyInfo Info=(PropertyInfo)iterator.next();
- HSSFRow hssfRow=tableSheet.createRow((short)k);
- hssfRow.setHeight((short)310);
- hssfRow.createCell(0).setCellValue(Info.getIdd());
- hssfRow.createCell(1).setCellValue(Info.getFramework_id());
- hssfRow.createCell(2).setCellValue(Info.getArea_id());
- hssfRow.createCell(3).setCellValue(Info.getRecover_departid());
- hssfRow.createCell(4).setCellValue(Info.getRecover_staffid());
- hssfRow.createCell(5).setCellValue(Info.getPropertyName());
- hssfRow.createCell(6).setCellValue(Info.getPropertyNo());
- hssfRow.createCell(7).setCellValue(Info.getRecover_date());
- k++;
- }
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- try {
- workBook.write(os);
- } catch (IOException e) {
- e.printStackTrace();
- }
- byte[] content = os.toByteArray();
- InputStream is = new ByteArrayInputStream(content);
- return is;
- }
- /***
- * 涉密资产登记(数据导出)
- * @author cxz
- * @param sbData
- * @return
- * @throws ParseException
- */
- public InputStream getSbDatas(List sbData) throws ParseException
- {
- HSSFWorkbook workBook=new HSSFWorkbook();
- String[] title={"序号","所属市州","使用单位","使用人","资产名称","资产数量","导出时间"};
- int i=0;
- int k=1;
- HSSFSheet tableSheet=workBook.createSheet("资产表单");
- HSSFRow row=tableSheet.createRow((short)0);
- //创建标题栏单元格字体
- HSSFFont titleFont=workBook.createFont();
- //创建标题栏样式
- HSSFCellStyle titleStyle=workBook.createCellStyle();
- //设置标题栏字体颜色
- titleFont.setColor(HSSFColor.BLUE.index);
- titleFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
- //设置标题栏字体样式
- titleStyle.setFont(titleFont);
- titleStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT);
- //创建状态异常的数据行字体
- HSSFFont contentFont=workBook.createFont();
- //创建状态异常的数据行样式
- HSSFCellStyle contentStyle=workBook.createCellStyle();
- //设置状态异常的数据行字体颜色
- contentFont.setColor(HSSFColor.RED.index);
- //为状态异常的数据行样式设置字体
- contentStyle.setFont(contentFont);
- tableSheet.setColumnWidth(0, 1000);
- tableSheet.autoSizeColumn((short)1);
- tableSheet.autoSizeColumn((short)2);
- tableSheet.autoSizeColumn((short)3);
- tableSheet.autoSizeColumn((short)4);
- tableSheet.autoSizeColumn((short)5);
- tableSheet.setColumnWidth(6, 5000);
- for(String s:title)
- {
- HSSFCell cell=row.createCell(i);
- cell.setCellValue(s);
- cell.setCellStyle(titleStyle);
- i++;
- }
- //迭代数据信息,填入数据行
- for(Iterator iterator=sbData.iterator();iterator.hasNext();)
- {
- PropertyInfo Info=(PropertyInfo)iterator.next();
- HSSFRow hssfRow=tableSheet.createRow((short)k);
- hssfRow.createCell(0).setCellValue(Info.getIdd());
- hssfRow.createCell(1).setCellValue(Info.getFramework_id());
- hssfRow.createCell(2).setCellValue(Info.getRecover_departid());
- hssfRow.createCell(3).setCellValue(Info.getRecover_staffid());
- hssfRow.createCell(4).setCellValue(Info.getPropertyName());
- hssfRow.createCell(5).setCellValue(Info.getPropertyNo());
- hssfRow.createCell(6).setCellValue(Info.getRecover_date());
- k++;
- }
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- try {
- workBook.write(os);
- } catch (IOException e) {
- e.printStackTrace();
- }
- byte[] content = os.toByteArray();
- InputStream is = new ByteArrayInputStream(content);
- return is;
- }
-
- /**
- * @author cxz
- * @param fileName:需要导入的excel文件名称
- * 方法描述:迭代需要导入的excel文件数据行,将所有数据行数据填入集合,批量插入中使用
- */
- public static List importPropertyInfoData(String fileName) throws FileNotFoundException, IOException, ParseException
- {
- List PropertyInfoData=new ArrayList();
- PropertyInfo PropertyInfo;
- //获取上传的文件
- //创建工作簿
- HSSFWorkbook workBook=new HSSFWorkbook(new FileInputStream(fileName));
- //得到工作表,因为本项目将所有学生信息导出后放在一个工作表中,所以获取第一张工作表即可
- HSSFSheet sheet=workBook.getSheetAt(0);
- //迭代数据行集合,第一行(0)为标题行所以从1开始
- HSSFRow hssfRow;
- for(int j=1;j<=sheet.getLastRowNum();j++)
- {
- PropertyInfo Info=new PropertyInfo();
- //获取数据行中具体的一行数据行
- hssfRow=sheet.getRow(j);
- //获取数据行中每个数据列的信息,并填入实体
- //序号
- if(hssfRow.getCell(0)!=null||!hssfRow.getCell(0).toString().trim().equals(""))
- {
- Info.setId(hssfRow.getCell(0).toString().trim());
- }
- //所属市州
- if(hssfRow.getCell(1)!=null||!hssfRow.getCell(1).toString().trim().equals(""))
- {
- Info.setFramework_id(hssfRow.getCell(1).toString().trim());
- }
- //所属区县
- if(hssfRow.getCell(2)!=null||!hssfRow.getCell(2).toString().trim().equals(""))
- {
- Info.setArea_id(hssfRow.getCell(2).toString().trim());
- }
- //使用单位
- if(hssfRow.getCell(3)!=null||!hssfRow.getCell(3).toString().trim().equals(""))
- {
- Info.setRecover_departid(hssfRow.getCell(3).toString().trim());
- }
- //使用人
- if(hssfRow.getCell(4)!=null||!hssfRow.getCell(4).toString().trim().equals(""))
- {
- Info.setRecover_staffid(hssfRow.getCell(4).toString().trim());
- }
- //资产名称
- if(hssfRow.getCell(5)!=null||!hssfRow.getCell(5).toString().trim().equals(""))
- {
- Info.setPropertyName(hssfRow.getCell(5).toString().trim());
- }
- //数量
- if(hssfRow.getCell(6)!=null||!hssfRow.getCell(6).toString().trim().equals(""))
- {
- Info.setPropertyNo(hssfRow.getCell(6).toString().trim());
- }
- //导入时间
- if(hssfRow.getCell(7)!=null||!hssfRow.getCell(7).toString().trim().equals(""))
- {
- Info.setProvideDate(hssfRow.getCell(7).toString().trim());
- }
- PropertyInfoData.add(Info);
- }
- return PropertyInfoData;
- }
-
-
- /**
- * @author cxz
- * @param PropertyInfoData:excel表中遍历并填充的实体集合
- * @throws SQLException
- */
- public static void insertPropertyData(List PropertyInfoData,HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- Connection conn = null;
- PropertyInfo InfoData = null;
- //查询数据库中如果存在相应的数据就不插入数据,如果不存在相关的数据就插入date_format('20501231','%Y-%m-%d %H:%i:%s')
- String sqldata="select a.FRAMEWORK_ID,a.AREA_ID,a.RECOVER_DEPARTID,date_format(a.EXTENT_TIME,'%Y-%m-%d %H:%i:%s') as EXTENT_TIME from tm_dtl_property_temp a";
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sqldata.toString(),new HashFmlBufResultSetHandler());
- request.setAttribute("buf",buf);
- String sql="insert into tm_dtl_property_temp(id,framework_id,area_id,recover_departid,recover_staffid,property_name,property_num,extent_time) values(?,?,?,?,?,?,?,date_format(?,'%Y-%m-%d %H:%i:%s'))";
- PreparedStatement pstmt=null;
- try {
- for(Iterator iterator=PropertyInfoData.iterator();iterator.hasNext();)
- {
- InfoData=(PropertyInfo)iterator.next();
- conn = DbConn.getConn();
- for (int i = 0; i < buf.getRowCount(); i++) {
- String frameworkId=buf.fget("FRAMEWORK_ID", i);
- String AREAID=buf.fget("AREA_ID",i);
- String RECOVER=buf.fget("RECOVER_DEPARTID", i);
- String EXTENTTIME=buf.fget("EXTENT_TIME", i);
- if(frameworkId.equals(InfoData.getFramework_id())
- && AREAID.equals(InfoData.getArea_id())
- && RECOVER.equals(InfoData.getRecover_departid())
- && EXTENTTIME.equals(InfoData.getProvideDate())){
- response.sendRedirect(Common.GbConvertIso("/zhyw/smtj/ImportExcelDataError.jsp"));
- return;
- }
- }
- pstmt=conn.prepareStatement(sql);
- pstmt.setString(1,MyUtils.getDate22String()); //登记编号
- pstmt.setString(2,InfoData.getFramework_id()); //所属市州
- pstmt.setString(3,InfoData.getArea_id()); //所属区县
- pstmt.setString(4,InfoData.getRecover_departid()); //登记单位
- pstmt.setString(5,InfoData.getRecover_staffid()); //登记单位
- pstmt.setString(6,InfoData.getPropertyName()); //资产名称
- pstmt.setString(7,InfoData.getPropertyNo()); //使用单位
- pstmt.setString(8,InfoData.getProvideDate()); //使用单位
- pstmt.execute();
- conn.commit();
- }
- StatManageServlet ss =new StatManageServlet();
- ss.querySmsbeEXStat(request, response);
- } catch (SQLException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void deleteProperty(HttpServletRequest request, HttpServletResponse response) throws IOException {
- Login login = (Login) request.getSession().getAttribute("login");
- String[] Infos = request.getParameterValues("Infos");
- String sql = "DELETE FROM tm_dtl_property_temp WHERE id=? ";
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = DbConn.getConn();
- prep = conn.prepareStatement(sql);
- for (int i=0; i emps = new ArrayList();;
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- Employee emp=null;
-
- if(buf!=null)
- {
- for(int i=0;i empData) throws ParseException
- {
- HSSFWorkbook workBook=new HSSFWorkbook();
- String[] title={"序号","所属市州","所属区县","单位名称", "考试人员","考试类型","",""};
- int i=0;
- int k=1;
- HSSFSheet tableSheet=workBook.createSheet("涉密人员考试信息表单");
- HSSFCellStyle contentStyle=workBook.createCellStyle();
- HSSFFont contentFont=workBook.createFont();
- HSSFRow row=tableSheet.createRow(0);
- row.setHeight((short) 400);
- contentFont.setColor(HSSFColor.RED.index);
- //创建标题栏单元格字体
- HSSFFont titleFont=workBook.createFont();
- //创建标题栏样式
- HSSFCellStyle titleStyle=workBook.createCellStyle();
- //设置标题栏字体颜色
- titleFont.setColor(HSSFColor.BLUE.index);
- titleFont.setFontName("宋体");
- titleFont.setFontHeight((short)30);
- titleFont.setFontHeightInPoints((short) 10);
- titleFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
- //设置标题栏字体样式
- titleStyle.setFont(titleFont);
- // 设置列宽
- tableSheet.setColumnWidth(0, 2000);
- tableSheet.setColumnWidth(1, 3500);
- tableSheet.setColumnWidth(2, 3500);
- tableSheet.setColumnWidth(3, 5500);
- tableSheet.setColumnWidth(4, 4000);
- tableSheet.setColumnWidth(5, 3500);
- for(String s:title)
- {
- HSSFCell cell=row.createCell(i);
- cell.setCellValue(s);
- cell.setCellStyle(titleStyle);
- i++;
- }
- for(Iterator iterator=empData.iterator();iterator.hasNext();)
- {
- Employee Info=(Employee)iterator.next();
- HSSFRow hssfRow=tableSheet.createRow((short)k);
- hssfRow.createCell(0).setCellValue(Info.getId());
- hssfRow.createCell(1).setCellValue(Info.getEmpId());
- hssfRow.createCell(2).setCellValue(Info.getEmpName());
- hssfRow.createCell(3).setCellValue(Info.getSex());
- hssfRow.createCell(4).setCellValue(Info.getEmpState());
- hssfRow.createCell(5).setCellValue(Info.getDepartname());
- k++;
- }
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- try {
- workBook.write(os);
- } catch (IOException e) {
- e.printStackTrace();
- }
- byte[] content = os.toByteArray();
- InputStream is = new ByteArrayInputStream(content);
- return is;
- }
-}
diff --git a/src/main/java/com/zky/zhyw/smtj/pxtj/TrainTjManageServlet.java b/src/main/java/com/zky/zhyw/smtj/pxtj/TrainTjManageServlet.java
deleted file mode 100644
index bad4717..0000000
--- a/src/main/java/com/zky/zhyw/smtj/pxtj/TrainTjManageServlet.java
+++ /dev/null
@@ -1,333 +0,0 @@
-
-package com.zky.zhyw.smtj.pxtj;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URLEncoder;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.apache.log4j.Logger;
-import org.apache.poi.hssf.usermodel.HSSFCell;
-import org.apache.poi.hssf.usermodel.HSSFCellStyle;
-import org.apache.poi.hssf.usermodel.HSSFFont;
-import org.apache.poi.hssf.usermodel.HSSFRow;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.hssf.util.HSSFColor;
-
-import com.zky.pojo.Employee;
-import com.zky.pub.Common;
-import com.zky.pub.DbConn;
-import com.zky.pub.DispatchServlet;
-import com.zky.pub.HashFmlBuf;
-import com.zky.util.PageQuery;
-import com.zky.util.jdbc.HashFmlBufResultSetHandler;
-
-/**
- * @author cxz
- * 统计管理
- */
-public class TrainTjManageServlet extends DispatchServlet {
- private static final long serialVersionUID = 1L;
- private static final Logger log = Logger.getLogger(TrainTjManageServlet.class);
- @Override
- public void defaultMethod(HttpServletRequest request,HttpServletResponse response) throws Exception {
- }
- /**
- *涉密人员统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void queryTrainStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
-
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String user = request.getParameter("usename");
- Connection conn = null;
- try {
- StringBuffer sql =
- new StringBuffer("select count(a.TRAIN_NAME)as dddddd,a.DEPART_ID,a.TRAIN_NAME,ta.areadef,tf.FRAMEWORKname,td.DEPARTNAME from td_train a")
- .append(" left join tab_framework tf on a.FRAMEWORKID=tf.FRAMEWORKID left join tab_area ta on a.AREAID=ta.AREAID ")
- .append(" left join tab_department td on a.DEPART_ID=td.DEPARTID where 1=1");
- if (!Common.isNull(sj)) {
- sql.append(" and a.frameworkid='").append(sj).append("'");
- }
- if (!Common.isNull(qj)) {
- sql.append(" and a.areaid='").append(qj).append("'");
- }
- if (!Common.isNull(pcs)) {
- sql.append(" and td.DEPARTNAME='").append(pcs).append("'");
- }
- if (!Common.isNull(user)) {
- sql.append(" and a.TRAIN_NAME='").append(user).append("' ");
- }
- sql.append(" group by a.TRAIN_NAME, td.DEPARTNAME,a.DEPART_ID,ta.AREADEF,tf.FRAMEWORKNAME");
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmryTj_info=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmryTj_info",SmryTj_info);
- request.getRequestDispatcher("/zhyw/smtj/pxtj/TrainSmry.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员培训统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密人员培训统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void queryStatScoreShowInfo(HttpServletRequest request, HttpServletResponse response) throws IOException {
- request.setCharacterEncoding("utf-8");
- response.setContentType("text/html;charset=UTF-8");
- String departid = request.getParameter("departid");
- String name = request.getParameter("trainname");
- String fileName=new String(name.getBytes("ISO-8859-1"),"UTF-8");
-
- Connection conn = null;
- try {
- StringBuffer sql =
- new StringBuffer("select date_format( a.train_timeend,'%Y-%m-%d') as train_timeend,a.train_Id,date_format(a.train_time,'%Y-%m-%d') as train_time,a.train_type ,a.train_subject,a.TRAIN_ADDRESS,a.train_num,a.train_name,a.train_state,ta.areadef,tf.FRAMEWORKname,td.DEPARTNAME from td_train a")
- .append(" left join tab_framework tf on a.FRAMEWORKID=tf.FRAMEWORKID left join tab_area ta on a.AREAID=ta.AREAID ")
- .append(" left join tab_department td on a.DEPART_ID=td.DEPARTID where 1=1");
- if (!Common.isNull(departid)) {
- sql.append(" and a.DEPART_ID='").append(departid).append("'");
- }
- if (!Common.isNull(fileName)) {
- sql.append(" and a.TRAIN_NAME='").append(fileName).append("' ");
- }
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmryTj_info=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmryTj_info",SmryTj_info);
- request.getRequestDispatcher("/zhyw/smtj/pxtj/showProperty.jsp").forward(request,response);
- } catch (Exception e){
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员培训统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- }catch (SQLException e) {
- e.printStackTrace();
- }
-
- }
- }
- /***
- * 导出区县下面人员
- * @param request
- * @param response
- * @throws Exception
- */
- public void exportExcelsmry(HttpServletRequest request,HttpServletResponse response) throws Exception
- {
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String user = request.getParameter("usename");
- Connection conn = null;
- try {
- StringBuffer sql =
- new StringBuffer("select a.train_state,a.train_subject,a.TRAIN_ADDRESS,date_format(a.train_timeend,'%Y-%m-%d') as train_timeend,date_format(a.train_time,'%Y-%m-%d') as train_time,a.train_type,a.DEPART_ID,a.TRAIN_NAME,ta.areadef,tf.FRAMEWORKname,td.DEPARTNAME from td_train a")
- .append(" left join tab_framework tf on a.FRAMEWORKID=tf.FRAMEWORKID left join tab_area ta on a.AREAID=ta.AREAID ")
- .append(" left join tab_department td on a.DEPART_ID=td.DEPARTID where 1=1");
- if (!Common.isNull(sj)) {
- sql.append(" and a.frameworkid='").append(sj).append("'");
- }
- if (!Common.isNull(qj)) {
- sql.append(" and a.areaid='").append(qj).append("'");
- }
- if (!Common.isNull(pcs)) {
- sql.append(" and td.DEPARTNAME='").append(pcs).append("'");
- }
- if (!Common.isNull(user)) {
- sql.append(" and a.TRAIN_NAME='").append(user).append("' ");
- }
- List emps = new ArrayList();;
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- Employee emp=null;
-
- if(buf!=null)
- {
- for(int i=0;i empData) throws ParseException
- {
- HSSFWorkbook workBook=new HSSFWorkbook();
- String[] title={"序号","所属市州","所属区县","单位名称","培训人员","培训类型","培训开始时间","培训结束时间","培训状态","培训对象","培训地址"};
- int i=0;
- int k=1;
- HSSFSheet tableSheet=workBook.createSheet("涉密人员培训信息表单");
- HSSFCellStyle contentStyle=workBook.createCellStyle();
- HSSFFont contentFont=workBook.createFont();
- HSSFRow row=tableSheet.createRow(0);
- row.setHeight((short) 400);
- contentFont.setColor(HSSFColor.RED.index);
- //创建标题栏单元格字体
- HSSFFont titleFont=workBook.createFont();
- //创建标题栏样式
- HSSFCellStyle titleStyle=workBook.createCellStyle();
- //设置标题栏字体颜色
- titleFont.setColor(HSSFColor.BLUE.index);
- titleFont.setFontName("宋体");
- titleFont.setFontHeight((short)30);
- titleFont.setFontHeightInPoints((short) 10);
- titleFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
- //设置标题栏字体样式
- titleStyle.setFont(titleFont);
- // 设置列宽
- tableSheet.setColumnWidth(0, 2000);
- tableSheet.setColumnWidth(1, 3500);
- tableSheet.setColumnWidth(2, 3500);
- tableSheet.setColumnWidth(3, 5500);
- tableSheet.setColumnWidth(4, 4000);
- tableSheet.setColumnWidth(5, 3500);
- tableSheet.setColumnWidth(6, 3500);
- tableSheet.setColumnWidth(7, 3500);
- tableSheet.setColumnWidth(8, 5500);
- tableSheet.setColumnWidth(9, 4000);
- tableSheet.setColumnWidth(10, 3500);
- for(String s:title)
- {
- HSSFCell cell=row.createCell(i);
- cell.setCellValue(s);
- cell.setCellStyle(titleStyle);
- i++;
- }
- for(Iterator iterator=empData.iterator();iterator.hasNext();)
- {
- Employee Info=(Employee)iterator.next();
- HSSFRow hssfRow=tableSheet.createRow((short)k);
- hssfRow.createCell(0).setCellValue(Info.getId());
- hssfRow.createCell(1).setCellValue(Info.getEmpId());
- hssfRow.createCell(2).setCellValue(Info.getEmpName());
- hssfRow.createCell(3).setCellValue(Info.getSex());
- hssfRow.createCell(4).setCellValue(Info.getEmpName());
- if (Info.getAddress().equals("0")) {
- hssfRow.createCell(5).setCellValue("资料学习");
- } else if(Info.getAddress().equals("1")) {
- hssfRow.createCell(5).setCellValue("视频学习");
- }else if(Info.getAddress().equals("2")) {
- hssfRow.createCell(5).setCellValue("音频学习");
- }
- hssfRow.createCell(6).setCellValue(Info.getBirthday());
- hssfRow.createCell(7).setCellValue(Info.getBloodType());
- if (Info.getDepartname().equals("0")) {
- hssfRow.createCell(8).setCellValue("通过");
- } else {
- hssfRow.createCell(8).setCellValue("不通过");
- }
- if (Info.getDepartId().equals("0")) {
- hssfRow.createCell(9).setCellValue("涉密文件");
- } else if(Info.getDepartId().equals("1")) {
- hssfRow.createCell(9).setCellValue("涉密设备");
- }else if(Info.getDepartId().equals("2")){
- hssfRow.createCell(9).setCellValue( "涉密资产");
- }else if(Info.getDepartId().equals("3")){
- hssfRow.createCell(9).setCellValue( "涉密人员");
- }
- hssfRow.createCell(10).setCellValue(Info.getRadioresult());
- k++;
- }
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- try {
- workBook.write(os);
- } catch (IOException e) {
- e.printStackTrace();
- }
- byte[] content = os.toByteArray();
- InputStream is = new ByteArrayInputStream(content);
- return is;
- }
-}
diff --git a/src/main/java/com/zky/zhyw/smtj/rytj/EmpTjManageServlet.java b/src/main/java/com/zky/zhyw/smtj/rytj/EmpTjManageServlet.java
deleted file mode 100644
index 14637b0..0000000
--- a/src/main/java/com/zky/zhyw/smtj/rytj/EmpTjManageServlet.java
+++ /dev/null
@@ -1,355 +0,0 @@
-
-package com.zky.zhyw.smtj.rytj;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URLEncoder;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.apache.log4j.Logger;
-import org.apache.poi.hssf.usermodel.HSSFCell;
-import org.apache.poi.hssf.usermodel.HSSFCellStyle;
-import org.apache.poi.hssf.usermodel.HSSFFont;
-import org.apache.poi.hssf.usermodel.HSSFRow;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.hssf.util.HSSFColor;
-
-import com.zky.pojo.Employee;
-import com.zky.pub.Common;
-import com.zky.pub.DbConn;
-import com.zky.pub.DispatchServlet;
-import com.zky.pub.HashFmlBuf;
-import com.zky.util.PageQuery;
-import com.zky.util.jdbc.HashFmlBufResultSetHandler;
-
-/**
- * @author cxz
- * 统计管理
- */
-public class EmpTjManageServlet extends DispatchServlet {
- private static final long serialVersionUID = 1L;
- private static final Logger log = Logger.getLogger(EmpTjManageServlet.class);
- @Override
- public void defaultMethod(HttpServletRequest request,HttpServletResponse response) throws Exception {
- }
- /**
- *涉密人员统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmryStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
-
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String empstate = request.getParameter("empstate");
- //日期之间的转化
- DateFormat dateFormat = DateFormat.getDateInstance();
- Connection conn = null;
- try {
- StringBuffer sql =
- new StringBuffer("select a.empid,a.empname,a.emppwd,a.empstate,a.yaohaidemept,")
- .append("date_format(a.empstatedate,'%Y-%m-%d') as empstatedate,a.emplvl,a.frameworkid,a.empcontaddr,a.empcontphone,")
- .append("a.empcontmobphone,a.empfaxnum,date_format(a.empidbegindate,'%Y-%m-%d') as empidbegindate,")
- .append("a.birthday,")
- .append("a.emppwdexpdate,a.empemail,a.sex,a.departid,a.nationstate,")
- .append("a.empage,a.emphabby,a.empjob,a.empeducational,a.empfamname,a.empfamage,")
- .append("a.empfamrelate,a.empfamjob,a.empschool,a.emppolitics,a.emphomeAddress,")
- .append("a.examintname,a.examintstate,date_format(a.examinttime,'%Y-%m-%d') as examinttime,a.updatedepartment,a.updateuserid,a.examintdepartment,")
- .append("a.updatedate,a.radioresult,ta.AREADEF,tf.FRAMEWORKNAME,td.part,td.DEPARTNAME,count(a.DEPARTID) as dddddd from tab_employee a left join tab_department td on a.DEPARTID=td.DEPARTID left join tab_area ta on a.AREAID=ta.AREAID left join tab_framework tf on a.FRAMEWORKID=tf.FRAMEWORKID where 1=1");
- if (!Common.isNull(sj)) {
- sql.append(" and a.frameworkid='").append(sj).append("'");
- }
- if (!Common.isNull(qj)) {
- sql.append(" and a.areaid='").append(qj).append("'");
- }
- if (!Common.isNull(pcs)) {
- sql.append(" and td.DEPARTNAME='").append(pcs).append("'");
- }
- sql.append(" group by a.DEPARTID");
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmryTj_info=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmryTj_info",SmryTj_info);
- request.getRequestDispatcher("/zhyw/smtj/rytj/StatSmry.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员培训统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密人员统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void queryEmpselectEmpId(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String departid = request.getParameter("departid");
- Connection conn = null;
- try {
- StringBuffer sql =
- new StringBuffer("select a.empid,a.empname,a.emppwd,a.empstate,a.yaohaidemept,")
- .append("date_format(a.empstatedate,'%Y-%m-%d') as empstatedate,a.emplvl,a.frameworkid,a.empcontaddr,a.empcontphone,")
- .append("a.empcontmobphone,a.empfaxnum,date_format(a.empidbegindate,'%Y-%m-%d') as empidbegindate,")
- .append("a.birthday,")
- .append("a.emppwdexpdate,a.empemail,a.sex,a.departid,a.nationstate,")
- .append("a.empage,a.emphabby,a.empjob,a.empeducational,a.empfamname,a.empfamage,")
- .append("a.empfamrelate,a.empfamjob,a.empschool,a.emppolitics,a.emphomeAddress,")
- .append("a.examintname,a.examintstate,date_format(a.examinttime,'%Y-%m-%d') as examinttime,a.updatedepartment,a.updateuserid,a.examintdepartment,")
- .append("a.updatedate,a.radioresult,ta.AREADEF,tf.FRAMEWORKNAME,td.part,td.DEPARTNAME from tab_employee a left join tab_department td on a.DEPARTID=td.DEPARTID left join tab_area ta on a.AREAID=ta.AREAID left join tab_framework tf on a.FRAMEWORKID=tf.FRAMEWORKID where 1=1");
- if (!Common.isNull(departid)) {
- sql.append(" and a.departid='").append(departid).append("'");
- }
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmryTj_info=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmryTj_info",SmryTj_info);
- request.getRequestDispatcher("/zhyw/smtj/rytj/showProperty.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员培训统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- }catch (SQLException e) {
- e.printStackTrace();
- }
-
- }
- }
- /***
- * 导出区县下面人员
- * @param request
- * @param response
- * @throws Exception
- */
- public void exportExcelsmry(HttpServletRequest request,HttpServletResponse response) throws Exception
- {
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- Connection conn = null;
- try {
- StringBuffer sql =
- new StringBuffer("select a.empid,a.empname,a.sanyuan,a.emppwd,a.empstate,a.yaohaidemept,")
- .append("date_format(a.empstatedate,'%Y-%m-%d') as empstatedate,a.emplvl,a.frameworkid,a.empcontaddr,a.empcontphone,")
- .append("a.empcontmobphone,a.empfaxnum,date_format(a.empidbegindate,'%Y-%m-%d') as empidbegindate,")
- .append("a.birthday,")
- .append("a.emppwdexpdate,a.empemail,a.sex,a.departid,a.nationstate,")
- .append("a.empage,a.emphabby,a.empjob,a.empeducational,a.empfamname,a.empfamage,")
- .append("a.empfamrelate,a.empfamjob,a.empschool,a.emppolitics,a.emphomeAddress,")
- .append("a.examintname,a.examintstate,date_format(a.examinttime,'%Y-%m-%d') as examinttime,a.updatedepartment,a.updateuserid,a.examintdepartment,")
- .append("a.updatedate,a.radioresult,ta.AREADEF,tf.FRAMEWORKNAME,td.DEPARTNAME,td.part from tab_employee a left join tab_department td on a.DEPARTID=td.DEPARTID left join tab_area ta on a.AREAID=ta.AREAID left join tab_framework tf on a.FRAMEWORKID=tf.FRAMEWORKID where 1=1");
- if (!Common.isNull(sj)) {
- sql.append(" and a.frameworkid='").append(sj).append("'");
- }
- if (!Common.isNull(qj)) {
- sql.append(" and a.areaid='").append(qj).append("'");
- }
- if (!Common.isNull(pcs)) {
- sql.append(" and td.DEPARTNAME='").append(pcs).append("'");
- }
- //sql.append(" group by a.DEPARTID");count(a.DEPARTID) as dddddd
- List emps = new ArrayList();;
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- Employee emp=null;
-
- if(buf!=null)
- {
- for(int i=0;i empData) throws ParseException
- {
- String sexs=null;
- String sanyuans=null;
- HSSFWorkbook workBook=new HSSFWorkbook();
- String[] title={"序号","所属市州","所属区县","单位名称", "下属部门","人员编号","人员姓名","性别","拟任岗位","涉密程度","角色","是否为要害部门"};
- int i=0;
- int k=1;
- HSSFSheet tableSheet=workBook.createSheet("涉密人员信息表单");
- HSSFCellStyle contentStyle=workBook.createCellStyle();
- HSSFFont contentFont=workBook.createFont();
- HSSFRow row=tableSheet.createRow(0);
- row.setHeight((short) 400);
- contentFont.setColor(HSSFColor.RED.index);
- //创建标题栏单元格字体
- HSSFFont titleFont=workBook.createFont();
- //创建标题栏样式
- HSSFCellStyle titleStyle=workBook.createCellStyle();
- //设置标题栏字体颜色
- titleFont.setColor(HSSFColor.BLUE.index);
- titleFont.setFontName("宋体");
- titleFont.setFontHeight((short)30);
- titleFont.setFontHeightInPoints((short) 10);
- titleFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
- //设置标题栏字体样式
- titleStyle.setFont(titleFont);
- // 设置列宽
- tableSheet.setColumnWidth(0, 2000);
- tableSheet.setColumnWidth(1, 3500);
- tableSheet.setColumnWidth(2, 3500);
- tableSheet.setColumnWidth(3, 5500);
- tableSheet.setColumnWidth(4, 4000);
- tableSheet.setColumnWidth(5, 3500);
- tableSheet.setColumnWidth(6, 2000);
- tableSheet.setColumnWidth(7, 3500);
- tableSheet.setColumnWidth(8, 3500);
- tableSheet.setColumnWidth(9, 5500);
- tableSheet.setColumnWidth(10, 4000);
- tableSheet.setColumnWidth(11, 3500);
- for(String s:title)
- {
- HSSFCell cell=row.createCell(i);
- cell.setCellValue(s);
- cell.setCellStyle(titleStyle);
- i++;
- }
- Employee Info=null;
-// if(Info.getSex().equals("0")){
-// sexs="女";
-// }else{
-// sexs="男";
-// }
-//
-// if(Info.getSubmitbtn().equals("0")){
-// sanyuans="管理员";
-// }else if(Info.getSubmitbtn().equals("1")){
-// sanyuans="审计员";
-// }else{
-// sanyuans="操作员";
-// }
- for(Iterator iterator=empData.iterator();iterator.hasNext();)
- {
- Info=(Employee)iterator.next();
- HSSFRow hssfRow=tableSheet.createRow((short)k);
- hssfRow.createCell(0).setCellValue(Info.getId());
- hssfRow.createCell(1).setCellValue(Info.getEmpfamname());
- hssfRow.createCell(2).setCellValue(Info.getEmpfamage());
- hssfRow.createCell(3).setCellValue(Info.getDepartname());
- hssfRow.createCell(4).setCellValue(Info.getPhone());
- hssfRow.createCell(5).setCellValue(Info.getEmpId());
- hssfRow.createCell(6).setCellValue(Info.getEmpName());
-
- hssfRow.createCell(7).setCellValue(Info.getSex());
- hssfRow.createCell(8).setCellValue(Info.getEmpjob());
- hssfRow.createCell(9).setCellValue(Info.getEmpschool());
- hssfRow.createCell(10).setCellValue(Info.getSubmitbtn());
- hssfRow.createCell(11).setCellValue(Info.getAddress());
- k++;
- //emp.setDepartname(buf.fget("dddddd", i)) ;
- }
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- try {
- workBook.write(os);
- } catch (IOException e) {
- e.printStackTrace();
- }
- byte[] content = os.toByteArray();
- InputStream is = new ByteArrayInputStream(content);
- return is;
- }
-}
diff --git a/src/main/java/com/zky/zhyw/smtj/wjtj/StatWjtjManageServlet.java b/src/main/java/com/zky/zhyw/smtj/wjtj/StatWjtjManageServlet.java
deleted file mode 100644
index bd05ae4..0000000
--- a/src/main/java/com/zky/zhyw/smtj/wjtj/StatWjtjManageServlet.java
+++ /dev/null
@@ -1,312 +0,0 @@
-
-package com.zky.zhyw.smtj.wjtj;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URLEncoder;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.apache.log4j.Logger;
-import org.apache.poi.hssf.usermodel.HSSFCell;
-import org.apache.poi.hssf.usermodel.HSSFCellStyle;
-import org.apache.poi.hssf.usermodel.HSSFFont;
-import org.apache.poi.hssf.usermodel.HSSFRow;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.hssf.util.HSSFColor;
-
-import com.zky.pojo.Employee;
-import com.zky.pojo.FileInfo;
-import com.zky.pub.Common;
-import com.zky.pub.DbConn;
-import com.zky.pub.DispatchServlet;
-import com.zky.pub.HashFmlBuf;
-import com.zky.util.PageQuery;
-import com.zky.util.jdbc.HashFmlBufResultSetHandler;
-
-/**
- * @author syn
- * 统计管理
- */
-public class StatWjtjManageServlet extends DispatchServlet {
- private static final long serialVersionUID = 1L;
- private static final Logger log = Logger.getLogger(StatWjtjManageServlet.class);
- /**
- *涉密文件统计--查询
- * @author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmwjStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String receivestate=request.getParameter("receivestate");
- String extractstate=request.getParameter("extractstate");
- String destoryState=request.getParameter("destoryState");
- Connection conn = null;
- StringBuffer sql = new StringBuffer("select f.FRAMEWORKNAME,a.AREADEF,dept.DEPARTNAME as DEPARTNAME,p.PROVIDE_DEPARTID,count(p.PROVIDE_DEPARTID) as num from tm_dtl_file_provide p " +
- "left join tab_framework f on f.FRAMEWORKID=p.FRAMEWORKID left join tab_area a on a.AREAID=p.AREAID left join tab_department dept on dept.DEPARTID=p.TARGET_DEPARTID where 1=1");
- if (!Common.isNull(sj) ) {
- sql.append(" and p.FRAMEWORKID='").append(sj).append("'");
- }
- if(!Common.isNull(qj))
- {
- sql.append(" and p.AREAID='").append(qj).append("'");
- }
- if(!Common.isNull(pcs))
- {
- sql.append(" and p.PROVIDE_DEPARTID='").append(pcs).append("'");
- }
- if (!Common.isNull(receivestate)) {
- sql.append(" and r.RECEIVE_STATE='").append(receivestate).append("'");
- }
- if (!Common.isNull(extractstate)) {
- sql.append(" and r.EXTRACT_STATE='").append(extractstate).append("'");
- }
- if (!Common.isNull(destoryState)) {
- sql.append(" and r.DESTORY_STATE='").append(destoryState).append("'");
- }
- sql.append(" group by p.PROVIDE_DEPARTID,f.FRAMEWORKNAME,a.AREADEF,DEPARTNAME");
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmwjTj_info_all=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmwjTj_info_all",SmwjTj_info_all);
- request.getRequestDispatcher("/zhyw/smtj/wjtj/StatSmwj.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("文件统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
-
- /**
- * 根据Id查询到相应的记录行(预览文件详细信息)
- * @param request
- * @param response
- * @throws IOException
- */
- public void showStatWjtjId(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String deptname= request.getParameter("deptname");
- System.out.println("文件详细信息"+deptname);
- StringBuffer sql = new StringBuffer("select f.FRAMEWORKNAME,a.AREADEF,dept.DEPARTNAME,p.PROVIDE_DEPARTID,p.FILE_NAME,p.FILE_NUM,p.FILE_PURPOSE,p.PROVIDE_STAFFID," +
- "date_format(p.PROVIDE_DATE,'%Y-%m-%d')as PROVIDE_DATE from tm_dtl_file_provide p left join tab_framework f on f.FRAMEWORKID=p.FRAMEWORKID" +
- " left join tab_area a on a.AREAID=p.AREAID left join tab_department dept on dept.DEPARTID=p.PROVIDE_DEPARTID where p.PROVIDE_DEPARTID=?");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new Object[]{deptname},new HashFmlBufResultSetHandler(),request);
- HashFmlBuf by_WjtjId=(HashFmlBuf)pageQuery.query(100);
- //System.out.println("发hi发挥非"+by_WjtjId.getRowCount());
- request.setAttribute("by_WjtjId",by_WjtjId);
- request.getRequestDispatcher("/zhyw/smtj/wjtj/showStatSmwj.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("根据编号查询文件记录失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /***
- * 导出文件
- * @param request
- * @param response
- * @throws Exception
- */
- public void exportExcelsmwj(HttpServletRequest request,HttpServletResponse response) throws Exception
- {
- System.out.println("涉密文件");
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- Connection conn = null;
- try {
- StringBuffer sql = new StringBuffer("select f.FRAMEWORKNAME,a.AREADEF,dept.DEPARTNAME as DEPARTNAME,p.TARGET_DEPARTID,p.FILE_ID,p.FILE_NAME,p.PROVIDE_COUNT,p.PROVIDE_STAFFID,p.PROVIDE_DATE,p.PROVIDE_LEVEL,p.FILE_SECRET,p.FILE_SECRETYJ,p.INSTANCY_EXTENT,count(p.TARGET_DEPARTID) as num from tm_dtl_file_provide p " +
- "left join tab_framework f on f.FRAMEWORKID=p.FRAMEWORKID left join tab_area a on a.AREAID=p.AREAID left join tab_department dept on dept.DEPARTID=p.TARGET_DEPARTID where 1=1");
- if (!Common.isNull(sj) ) {
- sql.append(" and p.FRAMEWORKID='").append(sj).append("'");
- }
- if(!Common.isNull(qj))
- {
- sql.append(" and p.AREAID='").append(qj).append("'");
- }
- if(!Common.isNull(pcs))
- {
- sql.append(" and p.PROVIDE_DEPARTID='").append(pcs).append("'");
- }
- sql.append(" group by p.TARGET_DEPARTID");
- List files = new ArrayList();;
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- FileInfo file=null;
- if(buf!=null)
- {
- for(int i=0;i fileData) throws ParseException
- {
- HSSFWorkbook workBook=new HSSFWorkbook();
- String[] title={"序号","所属市州","所属区县","单位名称", "文件数量(份)","文件编号","文件名称","登记数量","登记人","密级","定密依据","紧急程度"};
- int i=0;
- int k=1;
- HSSFSheet tableSheet=workBook.createSheet("涉密文件信息表单");
- HSSFCellStyle contentStyle=workBook.createCellStyle();
- HSSFFont contentFont=workBook.createFont();
- HSSFRow row=tableSheet.createRow(0);
- row.setHeight((short) 400);
- contentFont.setColor(HSSFColor.RED.index);
- //创建标题栏单元格字体
- HSSFFont titleFont=workBook.createFont();
- //创建标题栏样式
- HSSFCellStyle titleStyle=workBook.createCellStyle();
- //设置标题栏字体颜色
- titleFont.setColor(HSSFColor.BLUE.index);
- titleFont.setFontName("宋体");
- titleFont.setFontHeight((short)30);
- titleFont.setFontHeightInPoints((short) 10);
- titleFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
- //设置标题栏字体样式
- titleStyle.setFont(titleFont);
- // 设置列宽
- tableSheet.setColumnWidth(0, 2000);
- tableSheet.setColumnWidth(1, 3500);
- tableSheet.setColumnWidth(2, 3500);
- tableSheet.setColumnWidth(3, 5500);
- tableSheet.setColumnWidth(4, 4000);
- tableSheet.setColumnWidth(5, 3500);
- tableSheet.setColumnWidth(6, 4500);
- tableSheet.setColumnWidth(7, 3500);
- tableSheet.setColumnWidth(8, 3500);
- tableSheet.setColumnWidth(9, 3500);
- tableSheet.setColumnWidth(10, 3500);
- tableSheet.setColumnWidth(11, 3500);
- tableSheet.setColumnWidth(12, 3500);
- for(String s:title)
- {
- HSSFCell cell=row.createCell(i);
- cell.setCellValue(s);
- cell.setCellStyle(titleStyle);
- i++;
- }
- for(Iterator iterator=fileData.iterator();iterator.hasNext();)
- {
- FileInfo Info=(FileInfo)iterator.next();
- HSSFRow hssfRow=tableSheet.createRow((short)k);
- hssfRow.createCell(0).setCellValue(Info.getId());
- hssfRow.createCell(1).setCellValue(Info.getFrameWorkName());
- hssfRow.createCell(2).setCellValue(Info.getAreadef());
- hssfRow.createCell(3).setCellValue(Info.getDepartName());
- hssfRow.createCell(4).setCellValue(Info.getFileNum());
- hssfRow.createCell(5).setCellValue(Info.getFileId());
- hssfRow.createCell(6).setCellValue(Info.getFileName());
- hssfRow.createCell(7).setCellValue(Info.getProvideCount());
- hssfRow.createCell(8).setCellValue(Info.getProvideEmpName());
- hssfRow.createCell(9).setCellValue(Info.getProvideLevel());
- hssfRow.createCell(10).setCellValue(Info.getFileSecret());
- hssfRow.createCell(11).setCellValue(Info.getFileSecretyj());
- hssfRow.createCell(11).setCellValue(Info.getInstancyExtent());
- k++;
- }
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- try {
- workBook.write(os);
- } catch (IOException e) {
- e.printStackTrace();
- }
- byte[] content = os.toByteArray();
- InputStream is = new ByteArrayInputStream(content);
- return is;
- }
- @Override
- public void defaultMethod(HttpServletRequest request,
- HttpServletResponse response) throws Exception {
- }
-}
diff --git a/src/main/java/com/zky/zhyw/smtj/wltj/StatWltjManageServlet.java b/src/main/java/com/zky/zhyw/smtj/wltj/StatWltjManageServlet.java
deleted file mode 100644
index 6ba88e7..0000000
--- a/src/main/java/com/zky/zhyw/smtj/wltj/StatWltjManageServlet.java
+++ /dev/null
@@ -1,1264 +0,0 @@
-package com.zky.zhyw.smtj.wltj;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import org.apache.poi.hssf.usermodel.HSSFCell;
-import org.apache.poi.hssf.usermodel.HSSFCellStyle;
-import org.apache.poi.hssf.usermodel.HSSFFont;
-import org.apache.poi.hssf.usermodel.HSSFRow;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.hssf.util.HSSFColor;
-import com.zky.manager.Login;
-import com.zky.manager.StudentPullulate;
-import com.zky.pojo.MyUtils;
-import com.zky.pojo.PropertyInfo;
-import com.zky.pub.Common;
-import com.zky.pub.DbConn;
-import com.zky.pub.DispatchServlet;
-import com.zky.pub.HashFmlBuf;
-import com.zky.util.PageQuery;
-import com.zky.util.jdbc.HashFmlBufResultSetHandler;
-import com.zky.util.jdbc.JDBCUtils;
-import com.zky.zhyw.smtj.StatManageServlet;
-
-public class StatWltjManageServlet extends DispatchServlet {
- private StudentPullulate p=new StudentPullulate();
- Connection conn = null;
- PreparedStatement pstmt,pstmt1=null;
- @Override
- public void defaultMethod(HttpServletRequest request,
- HttpServletResponse response) throws Exception {
- }
-
- public void showPropertys(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String useId=request.getParameter("useId");
- String sql="select a.net_id,a.net_staffid,date_format(a.net_date,'%Y-%m-%d') as net_date,a.NET_Security,a.Terminal,a.NET_RECOVERDEPARTID,b.netname,tf.FRAMEWORKNAME,ta.AREADEF,td.DEPARTNAME" +
- " from tm_dtl_property_net a left join tm_dtl_property_netinfo b on a.NET_ID=b.NET_ID left join tab_framework tf on a.FRAMEWORK_ID=tf.FRAMEWORKID " +
- " left join tab_area ta on a.AREA_ID=ta.AREAID left join tab_department td on a.NET_RECOVERDEPARTID=td.DEPARTID where b.net_id=?";
- StringBuffer sql1=new StringBuffer("SELECT b.id,b.net_brand,b.net_ip,net_no,net_name,property_sn,remark,netname from tm_dtl_property_netinfo b where b.net_id=?");
- try {
- conn=DbConn.getConn();
- HashFmlBuf useBuf=(HashFmlBuf)JDBCUtils.query(conn, sql,new Object[]{useId},new HashFmlBufResultSetHandler());
- request.setAttribute("useBuf",useBuf);
- HashFmlBuf useInfo=(HashFmlBuf)JDBCUtils.query(conn, sql1.toString(),new Object[]{useId},new HashFmlBufResultSetHandler());
- request.setAttribute("useInfo",useInfo);
- request.getRequestDispatcher("/zhyw/smtj/wltj/showNetProperty.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * @author cxz
- * @param request
- * @param response
- * @throws SQLException
- */
- public void queryPropertyNetId(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String useId=request.getParameter("useId");
- String sql="select a.NET_ID,a.NET_DEPARTID,a.NET_STAFFID,a.NET_DATE,c.FRAMEWORKNAME,b.AREADEF,a.NET_SECURITY,a.TERMINAL ,d.DEPARTNAME " +
- "from tm_dtl_property_net a left join tab_area b on a.AREA_ID=b.AREAID left join tab_framework c on a.FRAMEWORK_ID=c.FRAMEWORKID left join tab_department d on a.NET_RECOVERDEPARTID=d.DEPARTID where a.net_id=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf useBuf=(HashFmlBuf)JDBCUtils.query(conn, sql,new Object[]{useId},new HashFmlBufResultSetHandler());
- request.setAttribute("useBuf",useBuf);
- request.getRequestDispatcher("/zhyw/smsb/smwl/propertyNetAddUpdate.jsp?operate=UpdatepropertyUseAdd").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 预览设备信息
- * @author cxz
- * @param request
- * @param response
- * @throws SQLException
- */
- public void backPropertyInfo1(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String operatedepartidvalue=request.getParameter("school");
- try {
- HttpSession session = request.getSession();
- session.setAttribute("operatedepartidvalue", operatedepartidvalue);
- queryPropertyNetPage(request, response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 关闭当前的页面
- * @author cxz
- * @param request
- * @param response
- * @throws SQLException
- */
- public void backPropertyInfo(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String operatedepartidvalue=request.getParameter("school");
-
- try {
- HttpSession session = request.getSession();
- session.setAttribute("operatedepartidvalue", operatedepartidvalue);
- request.getRequestDispatcher("/zhyw/smsb/smwl/propertyNetManage.jsp").forward(request, response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void queryPropertynetInfo(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String loginname=login.getEmpname();
- String operateuseId=request.getParameter("operateuseId");
- StringBuffer querySql=new StringBuffer("select a.ID,a.NET_ID,a.NET_BRAND,a.NET_IP,a.NET_NO,a.NET_NAME,a.PROPERTY_SN,a.REMARK,a.NetSMName from tm_dtl_property_netinfo a where 1=1 and a.netname=?");
- try {
- conn=DbConn.getConn();
- PageQuery pageQuery=new PageQuery(conn,querySql.toString(),new Object[]{loginname},new HashFmlBufResultSetHandler(),request);
- HashFmlBuf InfoBuf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("InfoBuf",InfoBuf);
- request.setAttribute("operateuseId", operateuseId);
- request.getRequestDispatcher("/zhyw/smsb/smwl/propertyNetInfoAdd.jsp").forward(request, response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- *
- * @author cxz
- * @param request
- * @param response
- * @throws SQLException
- */
- public void queryPropertyNetPage(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String school=request.getParameter("school");
- String qj=request.getParameter("qj");
- String sj=request.getParameter("sj");
- StringBuffer querySql=new StringBuffer("SELECT a.NET_ID,d.DEPARTNAME,a.NET_STAFFID,a.NET_DATE,c.FRAMEWORKNAME,b.AREADEF,a.NET_SECURITY,a.TERMINAL,a.NET_RECOVERDEPARTID from tm_dtl_property_net a " +
- "left join tab_area b on a.AREA_ID=b.AREAID left join tab_framework c on a.FRAMEWORK_ID=c.FRAMEWORKID " +
- "left join tab_department d on a.NET_DEPARTID=d.DEPARTID where 1=1");
- if(!Common.isNull(school))
- {
- querySql.append(" and a.NET_DEPARTID='").append(school).append("'");
- }
- if(!Common.isNull(sj))
- {
- querySql.append(" and c.framework_id='").append(sj).append("'");
- }
- if(!Common.isNull(qj))
- {
- querySql.append(" and b.area_id='").append(qj).append("'");
- }
- try {
- conn=DbConn.getConn();
- PageQuery pageQuery=new PageQuery(conn,querySql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf useBuf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("useBuf",useBuf);
- request.getRequestDispatcher("/zhyw/smsb/smwl/propertyNetManage.jsp").forward(request, response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void showPropertyDetail(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String useId=request.getParameter("useId");
- StringBuffer sql1=new StringBuffer("select a.id,a.use_id,a.property_brand,a.property_mac,a.property_imei,a.property_type,a.property_no,a.property_name,a.property_soff,a.property_soffwe,a.property_sn from tm_dtl_property_info a where a.use_id=? ");
- try {
- conn=DbConn.getConn();
- HashFmlBuf useInfo=(HashFmlBuf)JDBCUtils.query(conn, sql1.toString(),new Object[]{useId},new HashFmlBufResultSetHandler());
- request.setAttribute("useInfo",useInfo);
- request.getRequestDispatcher("/zhyw/smsb/sbdj/showPropertyDetail.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- //变更管理
- public void PropertyUseEditDetail(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String useId=request.getParameter("useId");
- StringBuffer sql1=new StringBuffer("select a.id,a.use_id,a.property_brand,a.property_mac,a.property_type,a.property_no,a.property_name,a.property_soff,a.property_soffwe,a.property_sn from tm_dtl_property_info a where a.use_id=?");
- try {
- conn=DbConn.getConn();
- HashFmlBuf useInfo=(HashFmlBuf)JDBCUtils.query(conn, sql1.toString(),new Object[]{useId},new HashFmlBufResultSetHandler());
- request.setAttribute("useInfo",useInfo);
- request.getRequestDispatcher("/zhyw/smsb/sbdj/propertyUseEditDetail.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 显示资产维护明细信息
- * @param request
- * @param response
- * @throws SQLException
- */
- public void PropertyUseEditChange(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String Id = request.getParameter("Id");
- String sql="select * from tm_dtl_property_info a left join tm_dtl_property_use b on a.use_id=b.use_id where a.id=?";
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sql,new Object[]{Id},
- new HashFmlBufResultSetHandler());
- request.setAttribute("by_PropertyBy",buf);
- request.getRequestDispatcher("/zhyw/smsb/sbdj/propertyUseEditDetailInfo.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("根据编号查询资产记录失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 报废依据填写
- * @param request
- * @param response
- * @throws SQLException
- */
- public void PropertyUseEditDestory(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String Id = request.getParameter("Id");
- String sql="select * from tm_dtl_property_info a left join tm_dtl_property_use b on a.use_id=b.use_id where a.id=?";
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sql,new Object[]{Id},
- new HashFmlBufResultSetHandler());
- request.setAttribute("by_PropertyBy",buf);
- request.getRequestDispatcher("/zhyw/smsb/sbdj/propertyUseEditDetailDestory.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("根据编号查询资产记录失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 资产变更保存
- * @param request
- * @param response
- * @throws SQLException
- * @throws IOException
- * @throws UnsupportedEncodingException
- */
- public void PropertyUseEditChangeSave(HttpServletRequest request,HttpServletResponse response) throws SQLException, UnsupportedEncodingException, IOException, NumberFormatException
- {
- String Id=request.getParameter("usedetailid");
- String useDepart=request.getParameter("useDepart");
- String useStaff=request.getParameter("useStaff");
- String reverdepart=request.getParameter("reverdepart");
- String reverstaff=request.getParameter("reverstaff");
- String useDepartvalue=null;
- String useStaffvalue=null;
- if(useDepart.equals("")){
- useDepartvalue=reverdepart;
- }else if(!useDepart.equals("")){
- useDepartvalue=useDepart;
- }
- if(useStaff.equals("")){
- useStaffvalue=reverstaff;
- }else if(!useStaff.equals("")){
- useStaffvalue=useStaff;
- }
- String sql="update tm_dtl_property_use a set a.recover_departid=?,a.recover_staffid=? where a.use_id=?";
- PreparedStatement pstmt=null;
- try {
- conn=DbConn.getConn();
- pstmt=conn.prepareStatement(sql);
- pstmt.setString(1,useDepartvalue);
- pstmt.setString(2,useStaffvalue);
- pstmt.setString(3,Id);
- pstmt.execute();
- conn.commit();
- StatManageServlet startdetail=new StatManageServlet();
- startdetail.querySmsbStatDetail(request, response);
- } catch (Exception e) {
- String errorinfo="";
- if (e.getMessage().startsWith("ORA-00001")) {
- errorinfo = "资产变更失败,相关流水号已经存在!";
- } else {
- errorinfo = "资产变更失败!"+ e.toString();
- }
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+Common.toGb(errorinfo)));
- e.printStackTrace();
- e.printStackTrace();
- }
- finally
- {
- if(pstmt!=null)
- {
- pstmt.close();
- }
- if(pstmt1!=null)
- {
- pstmt1.close();
- }
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 资产报废依据
- * @param request
- * @param response
- * @throws SQLException
- * @throws IOException
- * @throws UnsupportedEncodingException
- */
- public void PropertyUseEditDestorySave(HttpServletRequest request,HttpServletResponse response) throws SQLException, UnsupportedEncodingException, IOException, NumberFormatException
- {
- String Id=request.getParameter("usedetailid");
- String propertysdstory=request.getParameter("propertysdstory");
- String sql="update tm_dtl_property_info a set a.PROPERTYSDSTORY=? where a.id=?";
- PreparedStatement pstmt=null;
- try {
- conn=DbConn.getConn();
- pstmt=conn.prepareStatement(sql);
- pstmt.setString(1,propertysdstory);
- pstmt.setString(2,Id);
- pstmt.execute();
- conn.commit();
- StatManageServlet startdetail=new StatManageServlet();
- startdetail.querySmsbStatDetail(request, response);
- } catch (Exception e) {
- String errorinfo="";
- if (e.getMessage().startsWith("ORA-00001")) {
- errorinfo = "资产报废失败,相关流水号已经存在!";
- } else {
- errorinfo = "资产报废失败!"+ e.toString();
- }
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+Common.toGb(errorinfo)));
- e.printStackTrace();
- e.printStackTrace();
- }
- finally
- {
- if(pstmt!=null)
- {
- pstmt.close();
- }
- if(pstmt1!=null)
- {
- pstmt1.close();
- }
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /***
- * 涉密网络统计---导出
- * @author cxz
- * @param request
- * @param response
- * @throws Exception
- */
- public void exportExcelsmsbnet(HttpServletRequest request,HttpServletResponse response) throws Exception
- {
- String useId = request.getParameter("useId");
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String netSecret = request.getParameter("netSecret");
- StringBuffer sql = new StringBuffer("select a.net_id,dd.frameworkname,cc.areadef,a.NET_STAFFID,a.NET_DATE,a.NET_RECOVERDEPARTID,td.DEPARTNAME,tdd.DEPARTNAME as RECOVERNAME," +
- "b.ID,b.NET_BRAND,b.NET_IP,b.NET_NO,b.part as yaohaipart,b.NET_NAME,b.PROPERTY_SN,b.netManager,b.NetSMName,b.Airtight,b.REMARK," +
- "a.part,a.NET_Security,a.Terminal from tm_dtl_property_net a" +
- " left join tm_dtl_property_netinfo b on a.NET_ID=b.NET_ID " +
- " left join tab_area cc on cc.areaid=a.area_id " +
- " left join tab_department td on a.NET_DEPARTID=td.DEPARTID" +
- " left join tab_department tdd on a.NET_RECOVERDEPARTID=tdd.DEPARTID" +
- " left join tab_framework dd on dd.frameworkid=a.framework_id where 1=1 ");
- if (!Common.isNull(sj) ) {
- sql.append(" and a.framework_id='").append(sj).append("'");
- }
- if (!Common.isNull(qj) ) {
- sql.append(" and a.area_id='").append(qj).append("'");
- }
- if ( !Common.isNull(pcs) ) {
- sql.append(" and a.NET_RECOVERDEPARTID='").append(pcs).append("'");
- }
- if (!Common.isNull(netSecret)) {
- sql.append(" and a.NET_Security='").append(netSecret).append("'");
- }
- Connection conn = null;
- List sbs = new ArrayList();
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- PropertyInfo pro=null;
- if(buf!=null)
- {
- for(int i=0;i importPropertyNetInfoData(String fileName) throws FileNotFoundException, IOException, ParseException
- {
- List PropertynetInfoData=new ArrayList();
- PropertyInfo PropertyInfo;
- //获取上传的文件
- //创建工作簿
- HSSFWorkbook workBook=new HSSFWorkbook(new FileInputStream(fileName));
- //得到工作表,因为本项目将所有学生信息导出后放在一个工作表中,所以获取第一张工作表即可
- HSSFSheet sheet=workBook.getSheetAt(0);
- //迭代数据行集合,第一行(0)为标题行所以从1开始
- HSSFRow hssfRow;
- for(int j=1;j<=sheet.getLastRowNum();j++)
- {
- PropertyInfo Info=new PropertyInfo();
- //获取数据行中具体的一行数据行
- hssfRow=sheet.getRow(j);
- //获取数据行中每个数据列的信息,并填入实体
- //序号
- if(hssfRow.getCell(0)!=null||!hssfRow.getCell(0).toString().trim().equals(""))
- {
- Info.setId(hssfRow.getCell(0).toString().trim());
- }
- //所属市州
- if(hssfRow.getCell(1)!=null||!hssfRow.getCell(1).toString().trim().equals(""))
- {
- Info.setFramework_id(hssfRow.getCell(1).toString().trim());
- }
- //所属区县
- if(hssfRow.getCell(2)!=null||!hssfRow.getCell(2).toString().trim().equals(""))
- {
- Info.setArea_id(hssfRow.getCell(2).toString().trim());
- }
-
- //"登记单位"
- if(hssfRow.getCell(3)!=null||!hssfRow.getCell(3).toString().trim().equals(""))
- {
- Info.setDestory_departid(hssfRow.getCell(3).toString().trim());
- }
- //,"登记人"
- if(hssfRow.getCell(4)!=null||!hssfRow.getCell(4).toString().trim().equals(""))
- {
- Info.setUseEmpName(hssfRow.getCell(4).toString().trim());
- }
- //登记时间",
- if(hssfRow.getCell(5)!=null||!hssfRow.getCell(5).toString().trim().equals(""))
- {
- Info.setUseDate(hssfRow.getCell(5).toString().trim());
- }
- ////"使用单位
- if(hssfRow.getCell(6)!=null||!hssfRow.getCell(6).toString().trim().equals(""))
- {
- Info.setUseDepartName(hssfRow.getCell(6).toString().trim());
- }
- ////下属部门
- if(hssfRow.getCell(7)!=null||!hssfRow.getCell(7).toString().trim().equals(""))
- {
- Info.setPart(hssfRow.getCell(7).toString().trim());
- }
-
- //责任人
- if(hssfRow.getCell(8)!=null||!hssfRow.getCell(8).toString().trim().equals(""))
- {
- Info.setPecover_infoname(hssfRow.getCell(8).toString().trim());
- }
- //网络编号
- if(hssfRow.getCell(9)!=null||!hssfRow.getCell(9).toString().trim().equals(""))
- {
- Info.setProvideId(hssfRow.getCell(9).toString().trim());
- }
- //网络名称
- if(hssfRow.getCell(10)!=null||!hssfRow.getCell(10).toString().trim().equals(""))
- {
- Info.setPropertyName(hssfRow.getCell(10).toString().trim());
- }
- //品牌
- if(hssfRow.getCell(11)!=null||!hssfRow.getCell(11).toString().trim().equals(""))
- {
- Info.setPropertyBrand(hssfRow.getCell(11).toString().trim());
- }
- //型号
- if(hssfRow.getCell(12)!=null||!hssfRow.getCell(12).toString().trim().equals(""))
- {
- Info.setPropertyNo(hssfRow.getCell(12).toString().trim());
- }
- //SN号
- if(hssfRow.getCell(13)!=null||!hssfRow.getCell(13).toString().trim().equals(""))
- {
- Info.setPropertyMac(hssfRow.getCell(13).toString().trim());
- }
- //IP地址
- if(hssfRow.getCell(14)!=null||!hssfRow.getCell(14).toString().trim().equals(""))
- {
- Info.setPropertySn(hssfRow.getCell(14).toString().trim());
- }
- //涉密网络名称
- if(hssfRow.getCell(15)!=null||!hssfRow.getCell(15).toString().trim().equals(""))
- {
- Info.setProperty_netw(hssfRow.getCell(15).toString().trim());
- }
- //密级
- if(hssfRow.getCell(16)!=null||!hssfRow.getCell(16).toString().trim().equals(""))
- {
- Info.setPropertyType(hssfRow.getCell(16).toString().trim());
- }
- //是否为要害部门
- if(hssfRow.getCell(17)!=null||!hssfRow.getCell(17).toString().trim().equals(""))
- {
- Info.setProperty_soff(hssfRow.getCell(17).toString().trim());
- }
- //是否为要害部门
- if(hssfRow.getCell(18)!=null||!hssfRow.getCell(18).toString().trim().equals(""))
- {
- Info.setDestory_state(hssfRow.getCell(18).toString().trim());
- }
- if(hssfRow.getCell(19)!=null||!hssfRow.getCell(19).toString().trim().equals(""))
- {
- Info.setYesnosoftwerefour(hssfRow.getCell(19).toString().trim());
- }
- if(hssfRow.getCell(20)!=null||!hssfRow.getCell(20).toString().trim().equals(""))
- {
- Info.setDestory_date(hssfRow.getCell(20).toString().trim());
- }
- PropertynetInfoData.add(Info);
- }
- return PropertynetInfoData;
- }
-
- /**
- * 涉密网络统计
- * @author cxz
- * @param PropertyInfoData:excel表中遍历并填充的实体集合
- * @throws Exception
- */
- public static void insertPropertyNetData(List PropertynetInfoData,HttpServletRequest request,HttpServletResponse response) throws Exception
- {
- Login login=(Login)request.getSession().getAttribute("login");
- Connection conn = null;
- PropertyInfo InfoData;
- //查询数据库中如果存在相应的数据就不插入数据,如果不存在相关的数据就插入date_format('20501231','%Y-%m-%d %H:%i:%s')
- String sqldata="select a.frameworkname,a.areadef,RECOVERNAME,date_format(a.exedate,'%Y-%m-%d') as EXTENT_TIME,netid from tm_dtl_property_tempnet a";
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sqldata.toString(),new HashFmlBufResultSetHandler());
- request.setAttribute("buf",buf);
- //网络数据导入
- String sql="insert into tm_dtl_property_tempnet(frameworkname,areadef,DEPARTNAME,NET_STAFFID,NET_DATE,RECOVERNAME,part,netManager,netid,NET_NAME,NET_BRAND,NET_NO,PROPERTY_SN,NET_IP,NetSMName,Airtight,yaohaipart,TERMINAL,REMARK,exedate ) " +
- "values(?,?,?,?,date_format(?,'%Y-%m-%d'),?,?,?,?,?,?,?,?,?,?,?,?,?,?,date_format(?,'%Y-%m-%d'))";
- PreparedStatement pstmt=null;
- try {
- for(Iterator iterator=PropertynetInfoData.iterator();iterator.hasNext();)
- {
- InfoData=(PropertyInfo)iterator.next();
- conn = DbConn.getConn();
- for (int i = 0; i < buf.getRowCount(); i++) {
- String frameworkId=buf.fget("frameworkname", i);
- String AREAID=buf.fget("areadef",i);
- String RECOVER=buf.fget("RECOVERNAME", i);
- String netid=buf.fget("netid", i);
- String EXTENTTIME=buf.fget("EXTENT_TIME", i);
- if(frameworkId.equals(InfoData.getFramework_id())
- && AREAID.equals(InfoData.getArea_id())
- && RECOVER.equals(InfoData.getUseDepartName())
- && netid.equals(InfoData.getProvideId())
- && EXTENTTIME.equals(InfoData.getDestory_date())){
- response.sendRedirect(Common.GbConvertIso("/zhyw/smtj/wltj/ImportExcelNetDataError.jsp"));
- return;
- }
- }
- pstmt=conn.prepareStatement(sql);
-
- pstmt.setString(1,InfoData.getFramework_id()); //所属市州
- pstmt.setString(2,InfoData.getArea_id()); //所属区县
- pstmt.setString(3,InfoData.getDestory_departid()); //登记单位
- pstmt.setString(4,InfoData.getUseEmpName()); //登记单位
- pstmt.setString(5,InfoData.getUseDate()); //资产名称
- pstmt.setString(6,InfoData.getUseDepartName()); //使用单位
- pstmt.setString(7,InfoData.getPart()); //使用单位
- pstmt.setString(8,InfoData.getPecover_infoname()); //使用单位
- pstmt.setString(9,InfoData.getProvideId()); //使用单位
- pstmt.setString(10,InfoData.getPropertyName()); //使用单位
- pstmt.setString(11,InfoData.getPropertyBrand()); //使用单位
- pstmt.setString(12,InfoData.getPropertyNo()); //使用单位
- pstmt.setString(13,InfoData.getPropertyMac()); //使用单位
- pstmt.setString(14,InfoData.getPropertySn()); //使用单位
- pstmt.setString(15,InfoData.getProperty_netw()); //使用单位
- pstmt.setString(16,InfoData.getPropertyType()); //使用单位
- pstmt.setString(17,InfoData.getProperty_soff()); //使用单位
- pstmt.setString(18,InfoData.getDestory_state()); //使用单位
- pstmt.setString(19,InfoData.getYesnosoftwerefour()); //使用单位
- pstmt.setString(20,InfoData.getDestory_date()); //使用单位
- pstmt.execute();
- conn.commit();
-
- }
- StringBuffer sql1 = new StringBuffer("select a.id,a.frameworkname,a.areadef,a.DEPARTNAME,a.NET_STAFFID,a.TERMINAL,a.NET_DATE,a.RECOVERNAME,a.part,a.netManager,a.netid,a.NET_NAME,a.NET_BRAND,a.NET_NO,a.PROPERTY_SN,a.NET_IP,a.NetSMName,a.Airtight,a.yaohaipart,a.REMARK,a.exedate from tm_dtl_property_tempnet a where 1=1 ");
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql1.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTjALL_info1=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTjALL_info1",SmsbTjALL_info1);
- request.getRequestDispatcher("/zhyw/smtj/wltj/StatNet.jsp").forward(request,response);
-
- } catch (SQLException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /***
- * 涉密网络统计 (数据绑定)
- * @author cxz
- * @param sbData
- * @return
- * @throws ParseException
- */
- public InputStream getSbNetData(List sbnetData) throws ParseException
- {
- HSSFWorkbook workBook=new HSSFWorkbook();
- String[] title={"序号","所属市州","所属区县","登记单位","登记人","登记时间","使用单位","下属部门","使用人","网络编号","网络名称","品牌","型号","SN号","IP地址","涉密网络名称","密级","是否为要害部门","涉密网络终端","备注信息","导出时间"};
- int i=0;
- int k=1;
- HSSFSheet tableSheet=workBook.createSheet("涉密网络表单");
- HSSFRow row=tableSheet.createRow((short)0);
- HSSFFont titleFont=workBook.createFont();
- //创建标题栏样式
- HSSFCellStyle titleStyle=workBook.createCellStyle();
- //设置标题栏字体颜色
- titleFont.setColor(HSSFColor.BLUE.index);
- titleFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
- //设置标题栏字体样式
- titleStyle.setFont(titleFont);
- titleStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT);
- //创建状态异常的数据行字体
- HSSFFont contentFont=workBook.createFont();
- //创建状态异常的数据行样式
- HSSFCellStyle contentStyle=workBook.createCellStyle();
- //设置状态异常的数据行字体颜色
- contentFont.setColor(HSSFColor.RED.index);
- //为状态异常的数据行样式设置字体
- contentStyle.setFont(contentFont);
- tableSheet.setColumnWidth(0, 1000);
- tableSheet.autoSizeColumn((short)1);
- tableSheet.autoSizeColumn((short)2);
- tableSheet.autoSizeColumn((short)3);
- tableSheet.autoSizeColumn((short)4);
- tableSheet.autoSizeColumn((short)5);
- tableSheet.autoSizeColumn((short)6);
- tableSheet.autoSizeColumn((short)7);
- tableSheet.setColumnWidth(8, 5000);
- tableSheet.setColumnWidth(9, 5000);
- tableSheet.setColumnWidth(10, 5000);
- tableSheet.setColumnWidth(11, 5000);
- tableSheet.setColumnWidth(12, 5000);
- tableSheet.setColumnWidth(13, 5000);
- tableSheet.setColumnWidth(14, 5000);
- tableSheet.setColumnWidth(15, 5000);
- tableSheet.setColumnWidth(16, 5000);
- tableSheet.setColumnWidth(17, 5000);
- tableSheet.setColumnWidth(18, 5000);
- tableSheet.setColumnWidth(19, 5000);
- tableSheet.setColumnWidth(20, 5000);
- for(String s:title)
- {
- HSSFCell cell=row.createCell(i);
- cell.setCellValue(s);
- cell.setCellStyle(titleStyle);
- i++;
- }
- //迭代数据信息,填入数据行
- for(Iterator iterator=sbnetData.iterator();iterator.hasNext();)
- {
- PropertyInfo Info=(PropertyInfo)iterator.next();
- HSSFRow hssfRow=tableSheet.createRow((short)k);
- hssfRow.createCell(0).setCellValue(Info.getIdd());//序号
- hssfRow.createCell(1).setCellValue(Info.getFramework_id());//所属市州",
- hssfRow.createCell(2).setCellValue(Info.getArea_id());//"所属区县",
- hssfRow.createCell(3).setCellValue(Info.getDestory_departid());//"登记单位"
- hssfRow.createCell(4).setCellValue(Info.getUseEmpName());//,"登记人"
- hssfRow.createCell(5).setCellValue(Info.getUseDate());//登记时间",
- hssfRow.createCell(6).setCellValue(Info.getUseDepartName());//"使用单位
- hssfRow.createCell(7).setCellValue(Info.getPart());//下属部门
- hssfRow.createCell(8).setCellValue(Info.getPecover_infoname());//责任人
- hssfRow.createCell(9).setCellValue(Info.getProvideId());//网络编号
- hssfRow.createCell(10).setCellValue(Info.getPropertyName());//网络名称
- hssfRow.createCell(11).setCellValue(Info.getPropertyBrand());//品牌
- hssfRow.createCell(12).setCellValue(Info.getPropertyNo());//型号
- hssfRow.createCell(13).setCellValue(Info.getPropertyMac());//SN号
- hssfRow.createCell(14).setCellValue(Info.getPropertySn());//IP地址
- hssfRow.createCell(15).setCellValue(Info.getProperty_netw());//涉密网络名称
- hssfRow.createCell(16).setCellValue(Info.getPropertyType());//密级
- hssfRow.createCell(17).setCellValue(Info.getProperty_soff());//是否为要害部门
- hssfRow.createCell(18).setCellValue(Info.getDestory_state());//是否为要害部门
- hssfRow.createCell(19).setCellValue(Info.getYesnosoftwerefour());//备注
- hssfRow.createCell(20).setCellValue(MyUtils.getDateString());//导出时间
- k++;
- }
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- try {
- workBook.write(os);
- } catch (IOException e) {
- e.printStackTrace();
- }
- byte[] content = os.toByteArray();
- InputStream is = new ByteArrayInputStream(content);
- return is;
- }
- /**
- * 涉密网络统计--查询
- * @author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querynetSmsbAllStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String netSecret = request.getParameter("netSecret");
- String protyname = request.getParameter("protyname");
- String protynamevalue=null;
- if(protyname.equals("其它")){
- if(!protyname.equals("服务器")&&!protyname.equals("路由器")&&!protyname.equals("防火墙")&&!protyname.equals("网关")){
- protynamevalue="";
- }else{
- protynamevalue=protyname;
- }
- }else{
- protynamevalue=protyname;
- }
- StringBuffer sql = new StringBuffer("select a.net_id,dd.frameworkname,cc.areadef,a.NET_Security,a.Terminal,a.NET_RECOVERDEPARTID,b.net_name,dept.DEPARTNAME,count(a.NET_RECOVERDEPARTID) as ddddd from tm_dtl_property_net a " +
- "left join tm_dtl_property_netinfo b on a.NET_ID=b.NET_ID " +
- "left join tab_area cc on cc.areaid=a.area_id "+
- "left join tab_framework dd on dd.frameworkid=a.framework_id left join tab_department dept on a.NET_RECOVERDEPARTID=dept.DEPARTID where 1=1 ");
- if (!Common.isNull(sj) ) {
- sql.append(" and a.framework_id='").append(sj).append("'");
- }
- if (!Common.isNull(qj) ) {
- sql.append(" and a.area_id='").append(qj).append("'");
- }
- if ( !Common.isNull(pcs) ) {
- sql.append(" and a.NET_RECOVERDEPARTID='").append(pcs).append("'");
- }
- if (!Common.isNull(netSecret)) {
- sql.append(" and a.NET_Security='").append(netSecret).append("'");
- }
- if (!Common.isNull(protynamevalue)) {
- sql.append(" and b.NET_NAME='").append(protynamevalue).append("'");
- }
- sql.append("group by a.FRAMEWORK_ID,a.AREA_ID,a.NET_Security,a.Terminal,a.NET_RECOVERDEPARTID,b.net_name");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTjALL_info=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTjALL_info",SmsbTjALL_info);
- request.getRequestDispatcher("/zhyw/smtj/wltj/StatNet.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("网络统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 涉密网络统计--查询
- * @author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querynetSmsbAllStatall(HttpServletRequest request, HttpServletResponse response) throws IOException {
- StringBuffer sql = new StringBuffer("select a.net_id,dd.frameworkname,cc.areadef,a.NET_Security,a.Terminal,a.NET_RECOVERDEPARTID,b.net_name,dept.DEPARTNAME,count(a.NET_RECOVERDEPARTID) as ddddd from tm_dtl_property_net a " +
- "left join tm_dtl_property_netinfo b on a.NET_ID=b.NET_ID " +
- "left join tab_area cc on cc.areaid=a.area_id "+
- "left join tab_framework dd on dd.frameworkid=a.framework_id left join tab_department dept on a.NET_RECOVERDEPARTID=dept.DEPARTID where 1=1 ");
- sql.append("group by a.FRAMEWORK_ID,a.AREA_ID,a.NET_Security,a.Terminal,a.NET_RECOVERDEPARTID,b.net_name,a.NET_ID,dd.FRAMEWORKNAME,cc.AREADEF,dept.DEPARTNAME");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTjALL_info=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTjALL_info",SmsbTjALL_info);
- request.getRequestDispatcher("/zhyw/smtj/wltj/StatNet.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员培训统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 网络信息预览
- * @param request
- * @param response
- * @throws SQLException
- */
- public void showInfoProperty(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String useId=request.getParameter("InfoId");
- String sql="select * from tm_dtl_property_netinfo where id=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf infoBuf=(HashFmlBuf)JDBCUtils.query(conn, sql,new Object[]{useId},new HashFmlBufResultSetHandler());
- request.setAttribute("infoBuf",infoBuf);
- request.getRequestDispatcher("/zhyw/smsb/smwl/propertyInfoAddDetail.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void showProperty(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String useId=request.getParameter("useId");
- String sql="select a.net_id,a.net_staffid,date_format(a.net_date,'%Y-%m-%d %H:%i') as net_date,a.NET_Security,a.Terminal,a.NET_RECOVERDEPARTID,b.netname " +
- "from tm_dtl_property_net a left join tm_dtl_property_netinfo b on a.NET_ID=b.NET_ID where b.net_id=?";
- StringBuffer sql1=new StringBuffer("SELECT b.id,b.net_brand,b.net_ip,net_no,net_name,property_sn,remark,netname from tm_dtl_property_netinfo b where b.net_id=?");
- try {
- conn=DbConn.getConn();
- HashFmlBuf useBuf=(HashFmlBuf)JDBCUtils.query(conn, sql,new Object[]{useId},new HashFmlBufResultSetHandler());
- request.setAttribute("useBuf",useBuf);
- HashFmlBuf useInfo=(HashFmlBuf)JDBCUtils.query(conn, sql1.toString(),new Object[]{useId},new HashFmlBufResultSetHandler());
- request.setAttribute("useInfo",useInfo);
- request.getRequestDispatcher("/zhyw/smsb/smwl/showNetProperty.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
-
- /**
- * 批量删除资产信息
- * @author cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void deletePropertyNetInfo(HttpServletRequest request, HttpServletResponse response) throws IOException {
- Login login = (Login) request.getSession().getAttribute("login");
- String[] Infos = request.getParameterValues("Infos");
- String sql = "DELETE FROM tm_dtl_property_netinfo WHERE id=? ";
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = DbConn.getConn();
- conn.setAutoCommit(false);
- prep = conn.prepareStatement(sql);
- for (int i=0; i0){
- //情况1:正常,浏览器按utf-8方式查看
- response.setCharacterEncoding("UTF-8");
- //情况2:正常,浏览器按简体中文方式查看
- response.setContentType("text/html; charset=UTF-8 ");
- out.write("");
- out.close();
- }else{
- conn.commit();
- queryPropertyNetPage(request, response);
- }
- queryPropertyNetPage(request, response);
- } catch (Exception e) {
- if (conn != null) {
- try {
- conn.rollback();
- } catch (SQLException e1) {
- e1.printStackTrace();
- }
- }
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员删除失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (prep!= null) {
- prep.close();
- }
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 涉密网络统计--查询
- * @author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmsbeWLStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String protyname = request.getParameter("tmatype");
- String frameworkname=null;
- String areadef=null;
- StringBuffer sql1=new StringBuffer("select a.frameworkid,a.frameworkname from tab_framework a where a.frameworkid='"+sj+"'");
- StringBuffer sql2=new StringBuffer("select b.areaid,b.areadef from tab_area b where b.areaid='"+qj+"'");
- StringBuffer sql = new StringBuffer("select a.id,a.frameworkname,a.areadef,a.DEPARTNAME,a.NET_STAFFID,a.TERMINAL,a.NET_DATE,a.RECOVERNAME,a.part,a.netManager,a.netid,a.NET_NAME,a.NET_BRAND,a.NET_NO,a.PROPERTY_SN,a.NET_IP,a.NetSMName,a.Airtight,a.yaohaipart,a.REMARK,a.exedate from tm_dtl_property_tempnet a where 1=1 ");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sql1.toString(),new HashFmlBufResultSetHandler());
- HashFmlBuf buf2 = (HashFmlBuf)JDBCUtils.query(conn,sql2.toString(),new HashFmlBufResultSetHandler());
- for (int i = 0; i < buf.getRowCount(); i++) {
- frameworkname=buf.fget("frameworkname", i);
- }
- for (int i = 0; i < buf2.getRowCount(); i++) {
- areadef=buf2.fget("areadef", i);
- }
- if (!Common.isNull(sj) ) {
- sql.append(" and a.frameworkname='").append(frameworkname).append("'");
- }
- if (!Common.isNull(qj) ) {
- sql.append(" and a.areadef='").append(areadef).append("'");
- }
- if ( !Common.isNull(pcs) ) {
- sql.append(" and a.RECOVERNAME='").append(pcs).append("'");
- }
- if (!Common.isNull(protyname)) {
- sql.append(" and a.NetSMName='").append(protyname).append("'");
- }
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTjALL_info1=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTjALL_info1",SmsbTjALL_info1);
- request.getRequestDispatcher("/zhyw/smtj/wltj/StatNet.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("涉密网络终端统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 根据Id查询到相应的记录行
- * @param request
- * @param response
- * @throws IOException
- */
- public void showPropertyTmaId(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String InfoId= request.getParameter("InfoId");
- StringBuffer sql = new StringBuffer("select a.id,a.frameworkname,a.areadef,a.DEPARTNAME,a.NET_STAFFID,a.TERMINAL,a.NET_DATE,a.RECOVERNAME,a.part,a.netManager,a.netid,a.NET_NAME,a.NET_BRAND,a.NET_NO,a.PROPERTY_SN,a.NET_IP,a.NetSMName,a.Airtight,a.yaohaipart,a.REMARK,a.exedate from tm_dtl_property_tempnet a where 1=1 and id=? ");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- HashFmlBuf by_propertyTmaId = (HashFmlBuf)JDBCUtils.query(conn,sql.toString(),new Object[]{InfoId},new HashFmlBufResultSetHandler());
- request.setAttribute("by_propertyTmaId",by_propertyTmaId);
- request.getRequestDispatcher("/zhyw/smtj/wltj/showNetProperty1.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("根据编号查询网络记录失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
-}
diff --git a/src/main/java/com/zky/zhyw/smtj/zctj/StatZctjManageServlet.java b/src/main/java/com/zky/zhyw/smtj/zctj/StatZctjManageServlet.java
deleted file mode 100644
index 2e7aed7..0000000
--- a/src/main/java/com/zky/zhyw/smtj/zctj/StatZctjManageServlet.java
+++ /dev/null
@@ -1,1347 +0,0 @@
-package com.zky.zhyw.smtj.zctj;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URLEncoder;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.apache.log4j.Logger;
-import org.apache.poi.hssf.usermodel.HSSFCell;
-import org.apache.poi.hssf.usermodel.HSSFCellStyle;
-import org.apache.poi.hssf.usermodel.HSSFFont;
-import org.apache.poi.hssf.usermodel.HSSFRow;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.hssf.util.HSSFColor;
-import com.zky.pojo.MyUtils;
-import com.zky.pojo.PropertyInfo;
-import com.zky.pub.Common;
-import com.zky.pub.DbConn;
-import com.zky.pub.DispatchServlet;
-import com.zky.pub.HashFmlBuf;
-import com.zky.util.PageQuery;
-import com.zky.util.jdbc.HashFmlBufResultSetHandler;
-import com.zky.util.jdbc.JDBCUtils;
-
-/**
- * @author cxz
- * 统计管理
- */
-public class StatZctjManageServlet extends DispatchServlet {
- private static final long serialVersionUID = 1L;
- private static final Logger log = Logger.getLogger(StatZctjManageServlet.class);
- /**
- * 涉密资产统计--查询
- * @author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmallStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- Connection conn = null;
- try {
- StringBuffer sql = new StringBuffer("select a.frameworkid,a.areaid,a.departid,a.empid,a.empname,a.empstate,a.empjob,a.empschool,b.use_staffid,b.use_departid,b.property_name,b.property_no,b.property_num,c.file_name,c.file_num,c.file_secret,c.file_secretyj,c.instancy_extent,c.provide_count,c.target_departid FROM tab_employee a,tm_dtl_property_use b,tm_dtl_file_provide c ");
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmryTj_info_all=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmryTj_info_all",SmryTj_info_all);
- request.getRequestDispatcher("/zhyw/smtj/StatSmsb.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员培训统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密资产统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmsbStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String useId = request.getParameter("useId");
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String protyname = request.getParameter("protyname");
- String protynamevalue=null;
- if(protyname.equals("其它")){
- protynamevalue="";
- }else{
- protynamevalue=protyname;
- }
- StringBuffer sql = new StringBuffer("select bb.area_id,aa.property_name,bb.use_id,bb.recover_departid,dd.frameworkname,bb.USE_STAFFID,bb.RECOVER_STAFFID," +
- "date_format(bb.USE_DATE,'%Y-%m-%d %H:%i') as USE_DATE,date_format(bb.RECOVER_DATE,'%Y-%m-%d %H:%i') as RECOVER_DATE," +
- "cc.areadef,bb.framework_id,bb.area_id ,count(bb.RECOVER_DEPARTID) as ddddd " +
- "from tm_dtl_property_use bb left join tm_dtl_property_info aa on aa.use_id=bb.use_id " +
- "left join tab_area cc on cc.areaid=bb.area_id left join tab_framework dd on dd.frameworkid=bb.framework_id where 1=1");
- if (!Common.isNull(sj) ) {
- sql.append(" and bb.framework_id='").append(sj).append("'");
- }
- if (!Common.isNull(qj) ) {
- sql.append(" and bb.area_id='").append(qj).append("'");
- }
- if ( !Common.isNull(pcs) ) {
- sql.append(" and aa.recover_departid like'%").append(pcs).append("%'");
- }
- if (!Common.isNull(protynamevalue)) {
- sql.append(" and aa.property_name='").append(protynamevalue).append("'");
- }
- sql.append("group by bb.recover_departid,dd.frameworkname,cc.areadef,aa.property_name,bb.area_id,bb.framework_id,bb.USE_STAFFID,bb.RECOVER_STAFFID,bb.USE_DATE,bb.RECOVER_DATE");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTjALL_info=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTjALL_info",SmsbTjALL_info);
- request.getRequestDispatcher("/zhyw/smtj/zctj/StatSmsb.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("涉密资产统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密资产统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmsbStatDetail(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String protyname = request.getParameter("protyname");
- StringBuffer sql=
- new StringBuffer("select a.use_id,a.use_departid,a.RECOVER_DEPARTID,bb.property_name,date_format(a.USE_DATE,'%Y-%m-%d %H:%i') as USE_DATE," +
- "a.RECOVER_STAFFID,a.framework_id,a.use_staffid,c.frameworkname,d.areadef from tm_dtl_property_use a " +
- "left join tm_dtl_property_info bb on a.use_id=bb.use_id "+
- "left join tab_framework c on a.framework_id=c.frameworkid " +
- "left join tab_area d on d.areaid=a.area_id where 1=1 ");
- if (!Common.isNull(sj)) {
- sql.append("and a.framework_id='").append(sj).append("'");
- }
- if ( !Common.isNull(qj) ) {
- sql.append("and a.area_id='").append(qj).append("'");
- }
- if(!Common.isNull(protyname)){
- sql.append("and bb.property_name='").append(protyname).append("'");
- }
- if (!Common.isNull(pcs) ) {
- sql.append("and a.RECOVER_DEPARTID='").append(pcs).append("'");
- }
- sql.append("group by a.use_id");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTj_info=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTj_info",SmsbTj_info);
- request.getRequestDispatcher("/zhyw/smsb/sbdj/propertyUseEdit.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("涉密资产统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密资产统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmsbAllStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String protyname = request.getParameter("protyname");
- String protynamevalue=null;
- if(protyname.equals("其它")){
- protynamevalue="";
- }else{
- protynamevalue=protyname;
- }
- StringBuffer sql = new StringBuffer("select aa.property_name,bb.use_id,bb.recover_departid,dd.frameworkname,bb.USE_STAFFID,bb.RECOVER_STAFFID," +
- "date_format(bb.USE_DATE,'%Y-%m-%d %H:%i') as USE_DATE,date_format(bb.RECOVER_DATE,'%Y-%m-%d %H:%i') as RECOVER_DATE," +
- "cc.areadef,bb.framework_id,bb.area_id ,dept.DEPARTNAME,count(bb.RECOVER_DEPARTID) as ddddd " +
- "from tm_dtl_property_use bb left join tm_dtl_property_info aa on aa.use_id=bb.use_id " +
- " left join tab_area cc on cc.areaid=bb.area_id " +
- " left join tab_framework dd on dd.frameworkid=bb.framework_id left join tab_department dept on bb.RECOVER_DEPARTID=dept.DEPARTID where 1=1");
- if (!Common.isNull(sj) ) {
- sql.append(" and bb.framework_id='").append(sj).append("'");
- }
- if (!Common.isNull(qj) ) {
- sql.append(" and bb.area_id='").append(qj).append("'");
- }
- if ( !Common.isNull(pcs) ) {
- sql.append(" and bb.RECOVER_DEPARTID like'%").append(pcs).append("%'");
- }
- if (!Common.isNull(protynamevalue)) {
- sql.append(" and aa.property_name='").append(protynamevalue).append("'");
- }
- sql.append(" group by bb.RECOVER_DEPARTID");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTjALL_info=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTjALL_info",SmsbTjALL_info);
- request.getRequestDispatcher("/zhyw/smtj/zctj/StatSmsb.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("涉密网络终端统计失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密资产统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querydaoruSmsbAllStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- request.setCharacterEncoding("utf-8");
- response.setContentType("text/html;charset=UTF-8");
- String sj = request.getParameter("sjj");
- String qj = request.getParameter("qjj");
- String name = request.getParameter("name");
- String filesj=new String(sj.getBytes("ISO-8859-1"),"UTF-8");
- String fileqj=new String(qj.getBytes("ISO-8859-1"),"UTF-8");
- String filename=new String(name.getBytes("ISO-8859-1"),"UTF-8");
- StringBuffer sql = new StringBuffer("select a.id,a.framework_id,a.area_id,a.DEPARTNAME,a.property_num,a.USE_STAFFID,date_format(a.USE_DATE,'%Y-%m-%d')as USE_DATE,a.RECOVERNAME,a.part," +
- "a.recover_departid,a.provideId,a.property_name,a.property_brand,a.Propertyno,a.PROPERTY_MAC,a.getPropertySn,a.PROPERTY_NETW," +
- "a.PROPERTY_TYPE,a.PROPERTY_SOFF,a.YESNO,a.Airtight,a.partyaohai,date_format(a.EXTENT_TIME,'%Y-%m-%d')as EXTENT_TIME,REMARK from tm_dtl_property_temp a where 1=1 ");
- if (!Common.isNull(sj) ) {
- sql.append(" and a.framework_id='").append(filesj).append("'");
- }
- if (!Common.isNull(qj)) {
- sql.append(" and a.area_id='").append(fileqj).append("'");
- }
- if (!Common.isNull(name)) {
- sql.append(" and a.property_name='").append(filename).append("'");
- }
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTjALL_info=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTjALL_info",SmsbTjALL_info);
- request.getRequestDispatcher("/zhyw/smtj/zctj/showProperty2.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("涉密网络终端统计失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密资产统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmsbAllStats(HttpServletRequest request, HttpServletResponse response) throws IOException {
- StringBuffer sql = new StringBuffer("select aa.property_name,bb.use_id,bb.recover_departid,dd.frameworkname,bb.USE_STAFFID,bb.RECOVER_STAFFID," +
- "date_format(bb.USE_DATE,'%Y-%m-%d %H:%i') as USE_DATE,date_format(bb.RECOVER_DATE,'%Y-%m-%d %H:%i') as RECOVER_DATE," +
- "cc.areadef,bb.framework_id,bb.area_id ,dept.DEPARTNAME,count(bb.RECOVER_DEPARTID) as ddddd " +
- "from tm_dtl_property_use bb left join tm_dtl_property_info aa on aa.use_id=bb.use_id " +
- " left join tab_area cc on cc.areaid=bb.area_id " +
- " left join tab_framework dd on dd.frameworkid=bb.framework_id left join tab_department dept on bb.RECOVER_DEPARTID=dept.DEPARTID where 1=1");
- sql.append(" group by bb.RECOVER_DEPARTID,aa.PROPERTY_NAME,bb.USE_ID,dd.FRAMEWORKNAME,bb.USE_STAFFID,bb.RECOVER_STAFFID," +
- "bb.USE_DATE,bb.RECOVER_DATE,cc.AREADEF,bb.FRAMEWORK_ID,bb.AREA_ID,dept.DEPARTNAME");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTjALL_info=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTjALL_info",SmsbTjALL_info);
- request.getRequestDispatcher("/zhyw/smtj/zctj/StatSmsb.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("涉密网络终端统计失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密资产统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmsbeEXStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String protyname = request.getParameter("protyname");
- String frameworkname=null;
- String areadef=null;
- StringBuffer sql1=new StringBuffer("select a.frameworkid,a.frameworkname from tab_framework a where a.frameworkid='"+sj+"'");
- StringBuffer sql2=new StringBuffer("select b.areaid,b.areadef from tab_area b where b.areaid='"+qj+"'");
- StringBuffer sql= new StringBuffer("select a.TEMPID,a.RECOVERNAME,a.ID,a.FRAMEWORK_ID,a.DEPARTNAME,a.AREA_ID,a.RECOVER_DEPARTID,a.PROPERTY_NAME,date_format(a.EXTENT_TIME,'%Y-%m-%d') as EXTENT_TIME,a.recover_staffid,a.ProvideId,a.property_brand,a.PropertyNo,a.Remark,a.Property_soffwe" +
- " from tm_dtl_property_temp a where 1=1");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sql1.toString(),new HashFmlBufResultSetHandler());
- HashFmlBuf buf2 = (HashFmlBuf)JDBCUtils.query(conn,sql2.toString(),new HashFmlBufResultSetHandler());
- for (int i = 0; i < buf.getRowCount(); i++) {
- frameworkname=buf.fget("frameworkname", i);
- }
- for (int i = 0; i < buf2.getRowCount(); i++) {
- areadef=buf2.fget("areadef", i);
- }
- if (!Common.isNull(sj) ) {
- sql.append(" and a.FRAMEWORK_ID='").append(frameworkname).append("'");
- }
- if (!Common.isNull(qj) ) {
- sql.append(" and a.AREA_ID='").append(areadef).append("'");
- }
- if ( !Common.isNull(pcs) ) {
- sql.append(" and a.RECOVERNAME like'%").append(pcs).append("%'");
- }
- if (!Common.isNull(protyname)) {
- sql.append(" and a.property_name='").append(protyname).append("'");
- }
- sql.append(" order by a.extent_time desc");
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTjALL_info1=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTjALL_info1",SmsbTjALL_info1);
- request.getRequestDispatcher("/zhyw/smtj/zctj/StatSmsb.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员培训统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密资产统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void showSmsbeEXStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String tempid= request.getParameter("tempid");
- String sql="select a.id,a.framework_id,a.area_id,a.DEPARTNAME,a.USE_STAFFID,date_format(a.USE_DATE,'%Y-%m-%d')as USE_DATE,a.RECOVERNAME,a.part,a.recover_departid,a.provideId,a.property_name,a.property_brand,a.Propertyno,a.PROPERTY_MAC,a.getPropertySn,a.PROPERTY_NETW," +
- "a.PROPERTY_TYPE,a.PROPERTY_SOFF,a.YESNO,a.Airtight,a.partyaohai,date_format(a.EXTENT_TIME,'%Y-%m-%d')as EXTENT_TIME,REMARK from tm_dtl_property_temp a where 1=1 and a.TEMPID=?";
- Connection conn = null;
- conn = DbConn.getConn();
- try {
- HashFmlBuf pageQuery=(HashFmlBuf)JDBCUtils.query(conn, sql,new Object[]{tempid},new HashFmlBufResultSetHandler());
- request.setAttribute("SmryTj_info",pageQuery);
- request.getRequestDispatcher("/zhyw/smtj/zctj/showProperty1.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员培训统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密资产统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmsbeEXAllStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String protyname = request.getParameter("protyname");
- String protynamevalue=null;
- if(protyname.equals("其它")){
- protynamevalue="";
- }else{
- protynamevalue=protyname;
- }
- String frameworkname=null;
- String areadef=null;
- StringBuffer sql1=new StringBuffer("select a.frameworkid,a.frameworkname from tab_framework a where a.frameworkid='"+sj+"'");
- StringBuffer sql2=new StringBuffer("select b.areaid,b.areadef from tab_area b where b.areaid='"+qj+"'");
- StringBuffer sql= new StringBuffer("select a.AREA_ID,a.FRAMEWORK_ID,count(a.PROPERTY_NAME) as total,a.PROPERTY_NAME,a.RECOVERNAME from tm_dtl_property_temp a where 1=1 ");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sql1.toString(),new HashFmlBufResultSetHandler());
- HashFmlBuf buf2 = (HashFmlBuf)JDBCUtils.query(conn,sql2.toString(),new HashFmlBufResultSetHandler());
- for (int i = 0; i < buf.getRowCount(); i++) {
- frameworkname=buf.fget("frameworkname", i);
- }
- for (int i = 0; i < buf2.getRowCount(); i++) {
- areadef=buf2.fget("areadef", i);
- }
- if (!Common.isNull(sj) ) {
- sql.append(" and a.framework_id='").append(frameworkname).append("'");
- }
- if (!Common.isNull(qj) ) {
- sql.append(" and a.area_id='").append(areadef).append("'");
- }
- if ( !Common.isNull(pcs) ) {
- sql.append(" and a.RECOVERNAME like'%").append(pcs).append("%'");
- }
- if (!Common.isNull(protynamevalue)) {
- sql.append(" and a.PROPERTY_NAME='").append(protynamevalue).append("'");
- }
- sql.append("group by a.FRAMEWORK_ID,a.AREA_ID, a.RECOVERNAME,a.PROPERTY_NAME");
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTjALL_info2=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTjALL_info2",SmsbTjALL_info2);
- request.getRequestDispatcher("/zhyw/smtj/zctj/StatSmsb.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员培训统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密资产统计--查询
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmsbeEXNetStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String protyname = request.getParameter("protyname");
- String frameworkname=null;
- String areadef=null;
- StringBuffer sql1=new StringBuffer("select a.frameworkid,a.frameworkname from tab_framework a where a.frameworkid='"+sj+"'");
- StringBuffer sql2=new StringBuffer("select b.areaid,b.areadef from tab_area b where b.areaid='"+qj+"'");
- StringBuffer sql= new StringBuffer("select a.ID,a.FRAMEWORK_ID,a.AREA_ID,a.RECOVER_DEPARTID,a.NET_NAME,a.SERCENT,a.FINALLYNUM,a.PROPERTY_NUM,date_format(a.extent_time,'%Y-%m-%d %H:%i:%s') as extent_time from tm_dtl_property_tempnet a where 1=1 ");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sql1.toString(),new HashFmlBufResultSetHandler());
- HashFmlBuf buf2 = (HashFmlBuf)JDBCUtils.query(conn,sql2.toString(),new HashFmlBufResultSetHandler());
- for (int i = 0; i < buf.getRowCount(); i++) {
- frameworkname=buf.fget("frameworkname", i);
- }
- for (int i = 0; i < buf2.getRowCount(); i++) {
- areadef=buf2.fget("areadef", i);
- }
- if (!Common.isNull(sj) ) {
- sql.append(" and a.framework_id='").append(frameworkname).append("'");
- }
- if (!Common.isNull(qj) ) {
- sql.append(" and a.area_id='").append(areadef).append("'");
- }
- if ( !Common.isNull(pcs) ) {
- sql.append(" and a.recover_departid like'%").append(pcs).append("%'");
- }
- if (!Common.isNull(protyname)) {
- sql.append(" and a.net_name='").append(protyname).append("'");
- }
- sql.append(" order by a.extent_time desc");
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTjALL_info1=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTjALL_info1",SmsbTjALL_info1);
- request.getRequestDispatcher("/zhyw/smtj/StatNet.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("涉密网络统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- *涉密资产统计--汇总
- *author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmsbeEXNetALLStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String protyname = request.getParameter("protyname");
- String protynamevalue=null;
- if(protyname.equals("其它")){
- if(!protyname.equals("服务器")&&!protyname.equals("路由器")&&!protyname.equals("防火墙")&&!protyname.equals("网关")){
- protynamevalue="";
- }else{
- protynamevalue=protyname;
- }
- }else{
- protynamevalue=protyname;
- }
- String frameworkname=null;
- String areadef=null;
- StringBuffer sql1=new StringBuffer("select a.frameworkid,a.frameworkname from tab_framework a where a.frameworkid='"+sj+"'");
- StringBuffer sql2=new StringBuffer("select b.areaid,b.areadef from tab_area b where b.areaid='"+qj+"'");
- StringBuffer sql= new StringBuffer("select a.recover_departid,a.FRAMEWORK_ID,sum(a.PROPERTY_NUM) as total,a.NET_NAME,a.PROPERTY_NUM,a.area_id,date_format(a.extent_time,'%Y-%m-%d %H:%i:%s') as extent_time from tm_dtl_property_tempnet a where 1=1 ");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sql1.toString(),new HashFmlBufResultSetHandler());
- HashFmlBuf buf2 = (HashFmlBuf)JDBCUtils.query(conn,sql2.toString(),new HashFmlBufResultSetHandler());
- for (int i = 0; i < buf.getRowCount(); i++) {
- frameworkname=buf.fget("frameworkname", i);
- }
- for (int i = 0; i < buf2.getRowCount(); i++) {
- areadef=buf2.fget("areadef", i);
- }
- if (!Common.isNull(sj) ) {
- sql.append(" and a.framework_id='").append(frameworkname).append("'");
- }
- if (!Common.isNull(qj) ) {
- sql.append(" and a.area_id='").append(areadef).append("'");
- }
- if ( !Common.isNull(pcs) ) {
- sql.append(" and a.recover_departid like'%").append(pcs).append("%'");
- }
- if (!Common.isNull(protynamevalue)) {
- sql.append(" and a.NET_NAME='").append(protynamevalue).append("'");
- }
- sql.append("group by a.NET_NAME,a.FRAMEWORK_ID order by a.extent_time desc");
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTjALL_info2=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTjALL_info2",SmsbTjALL_info2);
- request.getRequestDispatcher("/zhyw/smtj/StatNet.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员培训统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /***
- * 导出涉密资产
- * @param request
- * @param response
- * @throws Exception
- */
- public void exportExcelsmsb(HttpServletRequest request,HttpServletResponse response) throws Exception
- {
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String protyname = request.getParameter("protyname");
- StringBuffer sql = new StringBuffer("select dd.FRAMEWORKNAME,cc.AREADEF,tt.DEPARTNAME,bb.USE_STAFFID,date_format(bb.USE_DATE,'%Y-%m-%d') as USE_DATE,td.DEPARTNAME as RECOVERNAME,bb.RECOVER_STAFFID,bb.part," +
- " aa.ID,aa.PROPERTY_NAME,aa.PROPERTY_BRAND,aa.PROPERTY_NO,aa.PROPERTY_SN,aa.PROPERTY_MAC,aa.PROPERTY_NETW,aa.PROPERTY_TYPE,aa.PROPERTY_SOFF," +
- " aa.YESNO,aa.YESNOSOFTWEREONE,aa.YESNOSOFTWERETWO,aa.YESNOSOFTWERETHREE,aa.YESNOSOFTWEREFOUR,aa.Airtight,aa.Part as partyaohai,aa.REMARK" +
- " from tm_dtl_property_use bb left join tm_dtl_property_info aa on aa.use_id=bb.use_id " +
- " left join tab_area cc on cc.areaid=bb.area_id " +
- " left join tab_department td on bb.RECOVER_DEPARTID=td.DEPARTID" +
- " left join tab_department tt on bb.USE_DEPARTID=tt.DEPARTID" +
- " left join tab_framework dd on dd.frameworkid=bb.framework_id where 1=1");
- if (!Common.isNull(sj) ) {
- sql.append(" and bb.framework_id='").append(sj).append("'");
- }
- if (!Common.isNull(qj) ) {
- sql.append(" and bb.area_id='").append(qj).append("'");
- }
- if ( !Common.isNull(pcs) ) {
- sql.append(" and bb.recover_departid='").append(pcs).append("'");
- }
- if (!Common.isNull(protyname)) {
- sql.append(" and aa.property_name='").append(protyname).append("'");
- }
- Connection conn = null;
- List sbs = new ArrayList();
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100000);
- PropertyInfo pro=null;
- if(buf!=null)
- {
- for(int i=0;i sbs = new ArrayList();
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100000);
- PropertyInfo pro=null;
- if(buf!=null)
- {
- for(int i=0;i sbData) throws ParseException
- {
- HSSFWorkbook workBook=new HSSFWorkbook();
- String[] title={"序号","所属市州","所属区县","登记单位","登记人员","登记时间","使用单位","下属部门","使用人员","资产编号"," 资产名称"," 品牌", "型号"," SN号 ","MAC地址","计算机类型","网络状态","硬盘序列号","是否安装防护软件","密级","是否为要害部门","备注","导出时间"};
- int i=0;
- int k=1;
- HSSFSheet tableSheet=workBook.createSheet("涉密资产统计表单");
- HSSFRow row=tableSheet.createRow((short)0);
- //创建标题栏单元格字体
- HSSFFont titleFont=workBook.createFont();
- //创建标题栏样式
- HSSFCellStyle titleStyle=workBook.createCellStyle();
- //设置标题栏字体颜色
- titleFont.setColor(HSSFColor.BLUE.index);
- titleFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
- //设置标题栏字体样式
- titleStyle.setFont(titleFont);
- titleStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT);
- //创建状态异常的数据行字体
- HSSFFont contentFont=workBook.createFont();
- //创建状态异常的数据行样式
- HSSFCellStyle contentStyle=workBook.createCellStyle();
- //设置状态异常的数据行字体颜色
- contentFont.setColor(HSSFColor.RED.index);
- //为状态异常的数据行样式设置字体
- contentStyle.setFont(contentFont);
- tableSheet.setColumnWidth(0, 1000);
- tableSheet.autoSizeColumn((short)1);
- tableSheet.autoSizeColumn((short)2);
- tableSheet.setColumnWidth(8000,3);
- tableSheet.autoSizeColumn((short)4);
- tableSheet.autoSizeColumn((short)5);
- tableSheet.autoSizeColumn((short)6);
- tableSheet.setColumnWidth(7, 4000);
- tableSheet.setColumnWidth(8, 4000);
- tableSheet.setColumnWidth(9, 4000);
- tableSheet.setColumnWidth(10, 4000);
- tableSheet.setColumnWidth(11, 4000);
- tableSheet.setColumnWidth(12, 4000);
- tableSheet.setColumnWidth(13, 5000);
- tableSheet.setColumnWidth(14, 4000);
- tableSheet.setColumnWidth(15, 4000);
- tableSheet.setColumnWidth(16, 4000);
- tableSheet.setColumnWidth(17, 4000);
- tableSheet.setColumnWidth(18, 4000);
- tableSheet.setColumnWidth(19, 4000);
- tableSheet.setColumnWidth(20, 4000);
- tableSheet.setColumnWidth(21, 4000);
- tableSheet.setColumnWidth(22, 4000);
- for(String s:title)
- {
- HSSFCell cell=row.createCell(i);
- cell.setCellValue(s);
- cell.setCellStyle(titleStyle);
- i++;
- }
- //迭代数据信息,填入数据行
- for(Iterator iterator=sbData.iterator();iterator.hasNext();)
- {
- PropertyInfo Info=(PropertyInfo)iterator.next();
- HSSFRow hssfRow=tableSheet.createRow((short)k);
- hssfRow.setHeight((short)310);
- hssfRow.createCell(0).setCellValue(Info.getIdd());
- hssfRow.createCell(1).setCellValue(Info.getFramework_id());
- hssfRow.createCell(2).setCellValue(Info.getArea_id());
- hssfRow.createCell(3).setCellValue(Info.getDestory_departid());
- hssfRow.createCell(4).setCellValue(Info.getUseEmpName());
- hssfRow.createCell(5).setCellValue(Info.getUseDate());
- hssfRow.createCell(6).setCellValue(Info.getUseDepartName());
- hssfRow.createCell(7).setCellValue(Info.getPart());
- hssfRow.createCell(8).setCellValue(Info.getPecover_infoname());
- hssfRow.createCell(9).setCellValue(Info.getProvideId());
- hssfRow.createCell(10).setCellValue(Info.getPropertyName());
- if (Info.getPropertyBrand().equals("1")) {
- hssfRow.createCell(11).setCellValue("lenovo(联想)");
- } else if(Info.getPropertyBrand().equals("2")) {
- hssfRow.createCell(11).setCellValue("ASUS(华硕)");
- } else if(Info.getPropertyBrand().equals("3")) {
- hssfRow.createCell(11).setCellValue("HP(惠普)");
- }else if(Info.getPropertyBrand().equals("4")) {
- hssfRow.createCell(11).setCellValue("DELL(戴尔)");
- }else if(Info.getPropertyBrand().equals("5")) {
- hssfRow.createCell(11).setCellValue("Acer(宏基)");
- }else if(Info.getPropertyBrand().equals("6")) {
- hssfRow.createCell(11).setCellValue("Toshiba(东芝)");
- }else if(Info.getPropertyBrand().equals("7")) {
- hssfRow.createCell(11).setCellValue("SONY(索尼)");
- }else if(Info.getPropertyBrand().equals("8")) {
- hssfRow.createCell(11).setCellValue("Samsung(三星)");
- }else if(Info.getPropertyBrand().equals("9")) {
- hssfRow.createCell(11).setCellValue("ThinkPad(联想)");
- }else if(Info.getPropertyBrand().equals("10")) {
- hssfRow.createCell(11).setCellValue("清华同方");
- }else if(Info.getPropertyBrand().equals("11")) {
- hssfRow.createCell(11).setCellValue("Alienware");
- }else if(Info.getPropertyBrand().equals("12")) {
- hssfRow.createCell(11).setCellValue("Apple(苹果)");
- }else if(Info.getPropertyBrand().equals("13")) {
- hssfRow.createCell(11).setCellValue("FUJITSU(富士通)");
- }else if(Info.getPropertyBrand().equals("14")) {
- hssfRow.createCell(11).setCellValue("GIGABYTE(技嘉)");
- }else if(Info.getPropertyBrand().equals("15")) {
- hssfRow.createCell(11).setCellValue("HEDY(七喜)");
- }else if(Info.getPropertyBrand().equals("16")) {
- hssfRow.createCell(11).setCellValue("BenQ(明基)");
- }else if(Info.getPropertyBrand().equals("17")) {
- hssfRow.createCell(11).setCellValue("Founder(方正)");
- }else if(Info.getPropertyBrand().equals("18")) {
- hssfRow.createCell(11).setCellValue("LG");
- }else if(Info.getPropertyBrand().equals("19")) {
- hssfRow.createCell(11).setCellValue("Great Wall(长城)");
- }else if(Info.getPropertyBrand().equals("20")) {
- hssfRow.createCell(11).setCellValue("Intel");
- }else if(Info.getPropertyBrand().equals("21")) {
- hssfRow.createCell(11).setCellValue("典籍");
- }else if(Info.getPropertyBrand().equals("22")) {
- hssfRow.createCell(11).setCellValue("DELUX(多彩)");
- }else{
- hssfRow.createCell(11).setCellValue("其他");
- }
- hssfRow.createCell(12).setCellValue(Info.getPropertyNo());
- hssfRow.createCell(13).setCellValue(Info.getPropertySn());
- hssfRow.createCell(14).setCellValue(Info.getPropertyMac());
- hssfRow.createCell(15).setCellValue(Info.getPropertyType());
- hssfRow.createCell(16).setCellValue(Info.getProperty_netw());
- hssfRow.createCell(17).setCellValue(Info.getProperty_soff());
- if(Info.getYesno().equals("是")){
- hssfRow.createCell(18).setCellValue(Info.getYesnosoftwerefour()+"/"+Info.getYesnosoftwereone()+"/"+Info.getYesnosoftwerethree()+"/"+Info.getYesnosoftweretwo());
- }else{
- hssfRow.createCell(18).setCellValue("未安装防护软件");
- }
- hssfRow.createCell(19).setCellValue(Info.getAirtight());
- hssfRow.createCell(20).setCellValue(Info.getPartyaohai());
- hssfRow.createCell(21).setCellValue(Info.getRemark());
- hssfRow.createCell(22).setCellValue(Info.getRecover_date());
- k++;
- }
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- try {
- workBook.write(os);
- } catch (IOException e) {
- e.printStackTrace();
- }
- byte[] content = os.toByteArray();
- InputStream is = new ByteArrayInputStream(content);
- return is;
- }
- /***
- * 涉密资产登记(数据导出)
- * @author cxz
- * @param sbData
- * @return
- * @throws ParseException
- */
- public InputStream getSbDatas(List sbData) throws ParseException
- {
- HSSFWorkbook workBook=new HSSFWorkbook();
- String[] title={"序号","所属市州","使用单位","使用人","资产名称","资产数量","导出时间"};
- int i=0;
- int k=1;
- HSSFSheet tableSheet=workBook.createSheet("资产表单");
- HSSFRow row=tableSheet.createRow((short)0);
- //创建标题栏单元格字体
- HSSFFont titleFont=workBook.createFont();
- //创建标题栏样式
- HSSFCellStyle titleStyle=workBook.createCellStyle();
- //设置标题栏字体颜色
- titleFont.setColor(HSSFColor.BLUE.index);
- titleFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
- //设置标题栏字体样式
- titleStyle.setFont(titleFont);
- titleStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT);
- //创建状态异常的数据行字体
- HSSFFont contentFont=workBook.createFont();
- //创建状态异常的数据行样式
- HSSFCellStyle contentStyle=workBook.createCellStyle();
- //设置状态异常的数据行字体颜色
- contentFont.setColor(HSSFColor.RED.index);
- //为状态异常的数据行样式设置字体
- contentStyle.setFont(contentFont);
- tableSheet.setColumnWidth(0, 1000);
- tableSheet.autoSizeColumn((short)1);
- tableSheet.autoSizeColumn((short)2);
- tableSheet.autoSizeColumn((short)3);
- tableSheet.autoSizeColumn((short)4);
- tableSheet.autoSizeColumn((short)5);
- tableSheet.setColumnWidth(6, 5000);
- for(String s:title)
- {
- HSSFCell cell=row.createCell(i);
- cell.setCellValue(s);
- cell.setCellStyle(titleStyle);
- i++;
- }
- //迭代数据信息,填入数据行
- for(Iterator iterator=sbData.iterator();iterator.hasNext();)
- {
- PropertyInfo Info=(PropertyInfo)iterator.next();
- HSSFRow hssfRow=tableSheet.createRow((short)k);
- hssfRow.createCell(0).setCellValue(Info.getIdd());
- hssfRow.createCell(1).setCellValue(Info.getFramework_id());
- hssfRow.createCell(2).setCellValue(Info.getRecover_departid());
- hssfRow.createCell(3).setCellValue(Info.getRecover_staffid());
- hssfRow.createCell(4).setCellValue(Info.getPropertyName());
- hssfRow.createCell(5).setCellValue(Info.getPropertyNo());
- hssfRow.createCell(6).setCellValue(Info.getRecover_date());
- k++;
- }
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- try {
- workBook.write(os);
- } catch (IOException e) {
- e.printStackTrace();
- }
- byte[] content = os.toByteArray();
- InputStream is = new ByteArrayInputStream(content);
- return is;
- }
-
- /**
- * @author cxz
- * @param fileName:需要导入的excel文件名称
- * 方法描述:迭代需要导入的excel文件数据行,将所有数据行数据填入集合,批量插入中使用
- */
- public static List importPropertyInfoData(String fileName) throws FileNotFoundException, IOException, ParseException
- {
- List PropertyInfoData=new ArrayList();
- //获取上传的文件
- //创建工作簿
- HSSFWorkbook workBook=new HSSFWorkbook(new FileInputStream(fileName));
- //得到工作表,因为本项目将所有学生信息导出后放在一个工作表中,所以获取第一张工作表即可
- HSSFSheet sheet=workBook.getSheetAt(0);
- //迭代数据行集合,第一行(0)为标题行所以从1开始
- HSSFRow hssfRow;
- for(int j=1;j<=sheet.getLastRowNum();j++)
- {
- PropertyInfo Info=new PropertyInfo();
- //获取数据行中具体的一行数据行
- hssfRow=sheet.getRow(j);
- //获取数据行中每个数据列的信息,并填入实体
- //序号
- if(hssfRow.getCell(0)!=null||!hssfRow.getCell(0).toString().trim().equals(""))
- {
- Info.setId(hssfRow.getCell(0).toString().trim());
- }
- //所属市州
- if(hssfRow.getCell(1)!=null||!hssfRow.getCell(1).toString().trim().equals(""))
- {
- Info.setFramework_id(hssfRow.getCell(1).toString().trim());
- }
- //所属区县
- if(hssfRow.getCell(2)!=null||!hssfRow.getCell(2).toString().trim().equals(""))
- {
- Info.setArea_id(hssfRow.getCell(2).toString().trim());
- }
- if(hssfRow.getCell(3)!=null||!hssfRow.getCell(3).toString().trim().equals(""))
- {
- Info.setDestory_departid(hssfRow.getCell(3).toString().trim());
- }
- if(hssfRow.getCell(4)!=null||!hssfRow.getCell(4).toString().trim().equals(""))
- {
- Info.setUseEmpName(hssfRow.getCell(4).toString().trim());
- }
- if(hssfRow.getCell(5)!=null||!hssfRow.getCell(5).toString().trim().equals(""))
- {
- Info.setUseDate(hssfRow.getCell(5).toString().trim());
- }
- if(hssfRow.getCell(6)!=null||!hssfRow.getCell(6).toString().trim().equals(""))
- {
- Info.setUseDepartName(hssfRow.getCell(6).toString().trim());
- }
- if(hssfRow.getCell(7)!=null||!hssfRow.getCell(7).toString().trim().equals(""))
- {
- Info.setPart(hssfRow.getCell(7).toString().trim());
- }
- if(hssfRow.getCell(8)!=null||!hssfRow.getCell(8).toString().trim().equals(""))
- {
- Info.setPecover_infoname(hssfRow.getCell(8).toString().trim());
- }
- if(hssfRow.getCell(9)!=null||!hssfRow.getCell(9).toString().trim().equals(""))
- {
- Info.setProvideId(hssfRow.getCell(9).toString().trim());
- }
- if(hssfRow.getCell(10)!=null||!hssfRow.getCell(10).toString().trim().equals(""))
- {
- Info.setPropertyName(hssfRow.getCell(10).toString().trim());
- }
- if(hssfRow.getCell(11)!=null||!hssfRow.getCell(11).toString().trim().equals(""))
- {
- Info.setPropertyBrand(hssfRow.getCell(11).toString().trim());
- }
- if(hssfRow.getCell(12)!=null||!hssfRow.getCell(12).toString().trim().equals(""))
- {
- Info.setPropertyNo(hssfRow.getCell(12).toString().trim());
- }
- if(hssfRow.getCell(13)!=null||!hssfRow.getCell(13).toString().trim().equals(""))
- {
- Info.setPropertyMac(hssfRow.getCell(13).toString().trim());
- }
- if(hssfRow.getCell(14)!=null||!hssfRow.getCell(14).toString().trim().equals(""))
- {
- Info.setPropertySn(hssfRow.getCell(14).toString().trim());
- }
- if(hssfRow.getCell(15)!=null||!hssfRow.getCell(15).toString().trim().equals(""))
- {
- Info.setProperty_netw(hssfRow.getCell(15).toString().trim());
- }
- if(hssfRow.getCell(16)!=null||!hssfRow.getCell(16).toString().trim().equals(""))
- {
- Info.setPropertyType(hssfRow.getCell(16).toString().trim());
- }
- if(hssfRow.getCell(17)!=null||!hssfRow.getCell(17).toString().trim().equals(""))
- {
- Info.setProperty_soff(hssfRow.getCell(17).toString().trim());
- }
- if(hssfRow.getCell(18)!=null||!hssfRow.getCell(18).toString().trim().equals(""))
- {
- Info.setYesno(hssfRow.getCell(18).toString().trim());
- }
- if(hssfRow.getCell(19)!=null||!hssfRow.getCell(19).toString().trim().equals(""))
- {
- Info.setAirtight(hssfRow.getCell(19).toString().trim());
- }
- if(hssfRow.getCell(20)!=null||!hssfRow.getCell(20).toString().trim().equals(""))
- {
- Info.setPartyaohai(hssfRow.getCell(20).toString().trim());
- }
- if(hssfRow.getCell(21)!=null||!hssfRow.getCell(21).toString().trim().equals(""))
- {
- Info.setRemark(hssfRow.getCell(21).toString().trim());
- }
- if(hssfRow.getCell(22)!=null||!hssfRow.getCell(22).toString().trim().equals(""))
- {
- Info.setRecover_date(hssfRow.getCell(22).toString().trim());
- }
- PropertyInfoData.add(Info);
- }
- return PropertyInfoData;
- }
- /**
- * @author cxz
- * @param PropertyInfoData:excel表中遍历并填充的实体集合
- * @throws SQLException
- */
- public static void insertPropertyData(List PropertyInfoData,HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- Connection conn = null;
- PropertyInfo InfoData = null;
- //查询数据库中如果存在相应的数据就不插入数据,如果不存在相关的数据就插入date_format('20501231','%Y-%m-%d %H:%i:%s')
- String sqldata="select a.FRAMEWORK_ID,a.AREA_ID,a.RECOVER_DEPARTID,a.RECOVERNAME,a.provideId,date_format(a.EXTENT_TIME,'%Y-%m-%d %H:%i:%s') as EXTENT_TIME from tm_dtl_property_temp a";
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sqldata.toString(),new HashFmlBufResultSetHandler());
- request.setAttribute("buf",buf);
- String sql="insert into tm_dtl_property_temp(id,framework_id,area_id,DEPARTNAME,USE_STAFFID,USE_DATE,RECOVERNAME,part,recover_departid,provideId,property_name,property_brand,Propertyno,PROPERTY_MAC,getPropertySn,PROPERTY_NETW," +
- " PROPERTY_TYPE,PROPERTY_SOFF,YESNO,Airtight,partyaohai,REMARK,EXTENT_TIME,property_num) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,date_format(?,'%Y-%m-%d'),date_format(?,'%Y-%m-%d'))";
- PreparedStatement pstmt=null;
- try {
- for(Iterator iterator=PropertyInfoData.iterator();iterator.hasNext();)
- {
- InfoData=(PropertyInfo)iterator.next();
- conn = DbConn.getConn();
- for (int i = 0; i < buf.getRowCount(); i++) {
- String frameworkId=buf.fget("FRAMEWORK_ID", i);
- String AREAID=buf.fget("AREA_ID",i);
- String RECOVER=buf.fget("RECOVERNAME", i);
- String EXTENTTIME=buf.fget("provideId", i);
- if(frameworkId.equals(InfoData.getFramework_id())
- && AREAID.equals(InfoData.getArea_id())
- && RECOVER.equals(InfoData.getUseDepartName())
- && EXTENTTIME.equals(InfoData.getProvideId())){
- response.sendRedirect(Common.GbConvertIso("/zhyw/smtj/zctj/ImportExcelDataError.jsp"));
- return;
- }
- }
- pstmt=conn.prepareStatement(sql);
- pstmt.setString(1,MyUtils.getDate22String()); //登记编号
- pstmt.setString(2,InfoData.getFramework_id()); //所属市州
- pstmt.setString(3,InfoData.getArea_id()); //所属区县
- pstmt.setString(4,InfoData.getDestory_departid()); //登记单位
- pstmt.setString(5,InfoData.getUseEmpName()); //登记单位
- pstmt.setString(6,InfoData.getUseDate()); //资产名称
- pstmt.setString(7,InfoData.getUseDepartName()); //使用单位
- pstmt.setString(8,InfoData.getPart()); //使用单位
- pstmt.setString(9,InfoData.getPecover_infoname()); //使用单位
- pstmt.setString(10,InfoData.getProvideId()); //使用单位
- pstmt.setString(11,InfoData.getPropertyName()); //使用单位
- pstmt.setString(12,InfoData.getPropertyBrand()); //使用单位
- pstmt.setString(13,InfoData.getPropertyNo()); //使用单位
- pstmt.setString(14,InfoData.getPropertyMac()); //使用单位
- pstmt.setString(15,InfoData.getPropertySn()); //使用单位
- pstmt.setString(16,InfoData.getProperty_netw()); //使用单位
- pstmt.setString(17,InfoData.getPropertyType()); //使用单位
- pstmt.setString(18,InfoData.getProperty_soff()); //使用单位
- pstmt.setString(19,InfoData.getYesno()); //使用单位
- pstmt.setString(20,InfoData.getAirtight()); //使用单位
- pstmt.setString(21,InfoData.getPartyaohai()); //使用单位
- pstmt.setString(22,InfoData.getRemark()); //使用单位
- pstmt.setString(23,InfoData.getRecover_date()); //使用单位
- pstmt.setString(24,MyUtils.getDateString()); //使用单位
- pstmt.execute();
- conn.commit();
- }
- StatZctjManageServlet ss =new StatZctjManageServlet();
- ss.querySmsbeEXStat(request, response);
- } catch (SQLException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void deleteProperty(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String[] Infos = request.getParameterValues("Infos");
- String sql = "DELETE FROM tm_dtl_property_temp WHERE id=? ";
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = DbConn.getConn();
- prep = conn.prepareStatement(sql);
- for (int i=0; i sbs = new ArrayList();
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- PropertyInfo pro=null;
- if(buf!=null)
- {
- for(int i=0;i importPropertyNetInfoData(String fileName) throws FileNotFoundException, IOException, ParseException
- {
- List PropertynetInfoData=new ArrayList();
- PropertyInfo PropertyInfo;
- //获取上传的文件
- //创建工作簿
- HSSFWorkbook workBook=new HSSFWorkbook(new FileInputStream(fileName));
- //得到工作表,因为本项目将所有学生信息导出后放在一个工作表中,所以获取第一张工作表即可
- HSSFSheet sheet=workBook.getSheetAt(0);
- //迭代数据行集合,第一行(0)为标题行所以从1开始
- HSSFRow hssfRow;
- for(int j=1;j<=sheet.getLastRowNum();j++)
- {
- PropertyInfo Info=new PropertyInfo();
- //获取数据行中具体的一行数据行
- hssfRow=sheet.getRow(j);
- //获取数据行中每个数据列的信息,并填入实体
- //序号
- if(hssfRow.getCell(0)!=null||!hssfRow.getCell(0).toString().trim().equals(""))
- {
- Info.setId(hssfRow.getCell(0).toString().trim());
- }
- //所属市州
- if(hssfRow.getCell(1)!=null||!hssfRow.getCell(1).toString().trim().equals(""))
- {
- Info.setFramework_id(hssfRow.getCell(1).toString().trim());
- }
- //所属区县
- if(hssfRow.getCell(2)!=null||!hssfRow.getCell(2).toString().trim().equals(""))
- {
- Info.setArea_id(hssfRow.getCell(2).toString().trim());
- }
- //使用单位
- if(hssfRow.getCell(3)!=null||!hssfRow.getCell(3).toString().trim().equals(""))
- {
- Info.setRecover_departid(hssfRow.getCell(3).toString().trim());
- }
- //密级
- if(hssfRow.getCell(4)!=null||!hssfRow.getCell(4).toString().trim().equals(""))
- {
- String Secret="";
- if(hssfRow.getCell(4).toString().trim().equals("秘密"))
- {
- Secret="1";
- }
- else if(hssfRow.getCell(4).toString().trim().equals("机密"))
- {
- Secret="2";
- }
- else if(hssfRow.getCell(4).toString().trim().equals("绝密"))
- {
- Secret="3";
- }
- Info.setSercent(Secret);
- }
- //网络名称
- if(hssfRow.getCell(5)!=null||!hssfRow.getCell(5).toString().trim().equals(""))
- {
- Info.setNetName(hssfRow.getCell(5).toString().trim());
- }
- //网络终端
- if(hssfRow.getCell(6)!=null||!hssfRow.getCell(6).toString().trim().equals(""))
- {
- Info.setFinallyNum(hssfRow.getCell(6).toString().trim());
- }
- //网络设备数量
- if(hssfRow.getCell(7)!=null||!hssfRow.getCell(7).toString().trim().equals(""))
- {
- Info.setNetNum(hssfRow.getCell(7).toString().trim());
- }
- //登记时间
- if(hssfRow.getCell(8)!=null||!hssfRow.getCell(8).toString().trim().equals(""))
- {
- Info.setUseDate(hssfRow.getCell(8).toString().trim());
- }
- //导入时间
- if(hssfRow.getCell(9)!=null||!hssfRow.getCell(9).toString().trim().equals(""))
- {
- Info.setProvideDate(hssfRow.getCell(9).toString().trim());
- }
- PropertynetInfoData.add(Info);
- }
- return PropertynetInfoData;
- }
-
- /**
- * 涉密网络统计
- * @author cxz
- * @param PropertyInfoData:excel表中遍历并填充的实体集合
- * @throws SQLException
- */
- public static void insertPropertyNetData(List PropertynetInfoData,HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- Connection conn = null;
- PropertyInfo InfoData;
- //查询数据库中如果存在相应的数据就不插入数据,如果不存在相关的数据就插入date_format('20501231','%Y-%m-%d %H:%i:%s')
- String sqldata="select a.FRAMEWORK_ID,a.AREA_ID,a.RECOVER_DEPARTID,date_format(a.EXTENT_TIME,'%Y-%m-%d %H:%i:%s') as EXTENT_TIME from tm_dtl_property_tempnet a";
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sqldata.toString(),new HashFmlBufResultSetHandler());
- request.setAttribute("buf",buf);
- //网络数据导入
- String sql="insert into tm_dtl_property_tempnet(ID,FRAMEWORK_ID,AREA_ID,RECOVER_DEPARTID,NET_NAME,SERCENT,FINALLYNUM,PROPERTY_NUM,EXTENT_TIME ) values(?,?,?,?,?,?,?,?,date_format(?,'%Y-%m-%d %H:%i:%s'))";
- PreparedStatement pstmt=null;
- try {
- for(Iterator iterator=PropertynetInfoData.iterator();iterator.hasNext();)
- {
- InfoData=(PropertyInfo)iterator.next();
- conn = DbConn.getConn();
- for (int i = 0; i < buf.getRowCount(); i++) {
- String frameworkId=buf.fget("FRAMEWORK_ID", i);
- String AREAID=buf.fget("AREA_ID",i);
- String RECOVER=buf.fget("RECOVER_DEPARTID", i);
- String EXTENTTIME=buf.fget("EXTENT_TIME", i);
- if(frameworkId.equals(InfoData.getFramework_id())
- && AREAID.equals(InfoData.getArea_id())
- && RECOVER.equals(InfoData.getRecover_departid())
- && EXTENTTIME.equals(InfoData.getProvideDate())){
- response.sendRedirect(Common.GbConvertIso("/zhyw/smtj/ImportExcelNetDataError.jsp"));
- return;
- }
- }
- pstmt=conn.prepareStatement(sql);
- pstmt.setString(1,MyUtils.getDate22String());//登记编号
- pstmt.setString(2,InfoData.getFramework_id()); //所属市州
- pstmt.setString(3,InfoData.getArea_id());//所属区县
- pstmt.setString(4,InfoData.getRecover_departid());//登记单位
- pstmt.setString(5,InfoData.getNetName());//登记单位
- pstmt.setString(6,InfoData.getSercent()); //密级
- pstmt.setString(7,InfoData.getFinallyNum()); //终端数
- pstmt.setString(8,InfoData.getNetNum()); //终端数量
- pstmt.setString(9,InfoData.getProvideDate()); //导入时间
- pstmt.execute();
- conn.commit();
- }
- StatManageServlet ss =new StatManageServlet();
- ss.querySmsbeEXNetStat(request, response);
- } catch (SQLException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /***
- * 涉密网络统计 (数据绑定)
- * @author cxz
- * @param sbData
- * @return
- * @throws ParseException
- */
- public InputStream getSbNetData(List sbnetData) throws ParseException
- {
- HSSFWorkbook workBook=new HSSFWorkbook();
- String[] title={"序号","所属市州","所属区县","使用单位","密级","网络名称","终端个数","网络设备数量","登记时间","导出时间"};
- int i=0;
- int k=1;
- HSSFSheet tableSheet=workBook.createSheet("涉密网络表单");
- HSSFRow row=tableSheet.createRow((short)0);
- HSSFFont titleFont=workBook.createFont();
- //创建标题栏样式
- HSSFCellStyle titleStyle=workBook.createCellStyle();
- //设置标题栏字体颜色
- titleFont.setColor(HSSFColor.BLUE.index);
- titleFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
- //设置标题栏字体样式
- titleStyle.setFont(titleFont);
- titleStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT);
- //创建状态异常的数据行字体
- HSSFFont contentFont=workBook.createFont();
- //创建状态异常的数据行样式
- HSSFCellStyle contentStyle=workBook.createCellStyle();
- //设置状态异常的数据行字体颜色
- contentFont.setColor(HSSFColor.RED.index);
- //为状态异常的数据行样式设置字体
- contentStyle.setFont(contentFont);
- tableSheet.setColumnWidth(0, 1000);
- tableSheet.autoSizeColumn((short)1);
- tableSheet.autoSizeColumn((short)2);
- tableSheet.autoSizeColumn((short)3);
- tableSheet.autoSizeColumn((short)4);
- tableSheet.autoSizeColumn((short)5);
- tableSheet.autoSizeColumn((short)6);
- tableSheet.autoSizeColumn((short)7);
- tableSheet.setColumnWidth(8, 5000);
- tableSheet.setColumnWidth(9, 5000);
- for(String s:title)
- {
- HSSFCell cell=row.createCell(i);
- cell.setCellValue(s);
- cell.setCellStyle(titleStyle);
- i++;
- }
- //迭代数据信息,填入数据行
- for(Iterator iterator=sbnetData.iterator();iterator.hasNext();)
- {
- PropertyInfo Info=(PropertyInfo)iterator.next();
- String Secret=Info.getSercent();
- if (Secret.equals("1")) {
- Secret = "秘密";
- }
- else if(Secret.equals("2"))
- {
- Secret = "机密";
- }
- else if(Secret.equals("3")) {
- Secret = "绝密";
- }
- HSSFRow hssfRow=tableSheet.createRow((short)k);
- hssfRow.createCell(0).setCellValue(Info.getIdd());
- hssfRow.createCell(1).setCellValue(Info.getFramework_id());
- hssfRow.createCell(2).setCellValue(Info.getArea_id());
- hssfRow.createCell(3).setCellValue(Info.getRecover_departid());
- hssfRow.createCell(4).setCellValue(Secret);
- hssfRow.createCell(5).setCellValue(Info.getNetName());
- hssfRow.createCell(6).setCellValue(Info.getFinallyNum());
- hssfRow.createCell(7).setCellValue(Info.getNetNum());
- hssfRow.createCell(8).setCellValue(Info.getNetData());
- hssfRow.createCell(9).setCellValue(Info.getRecover_date());
- k++;
- }
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- try {
- workBook.write(os);
- } catch (IOException e) {
- e.printStackTrace();
- }
- byte[] content = os.toByteArray();
- InputStream is = new ByteArrayInputStream(content);
- return is;
- }
- /**
- * 涉密网络统计--查询
- * @author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querytmaSmsbAllStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String useId = request.getParameter("useId");
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String netType = request.getParameter("tmatype");
- String netTypeValue=null;
- if(netType.equals("--请选择类型--")){
- netTypeValue="";
- }else{
- netTypeValue=netType;
- }
- StringBuffer sql = new StringBuffer("SELECT a.framework_id,a.area_id,a.TMA_ID,c.DEPARTNAME,a.TMA_STAFFID,a.TMA_DATE,td.DEPARTNAME as recover_deparname,d.FRAMEWORKNAME,b.AREADEF, " +
- "a.TMA_SECURITY,a.TERMINAL,a.TMA_RECOVERDEPARTID,a.TMANAME,a.TMATYPE,a.ISASSESSMENT,a.ISAPPROVAL, " +
- "a.USEYEAR,a.ISBUILD,a.REMARK,a.PART,a.TMA_MANAGER from tm_dtl_property_tma a " +
- " left join tab_area b on a.AREA_ID=b.AREAID " +
- " left join tab_department c on a.TMA_DEPARTID=c.DEPARTID" +
- " left join tab_department td on a.TMA_RECOVERDEPARTID=td.DEPARTID " +
- " left join tab_framework d on a.FRAMEWORK_ID=d.FRAMEWORKID where 1=1");
- if (!Common.isNull(sj) ) {
- sql.append(" and a.framework_id='").append(sj).append("'");
- }
- if (!Common.isNull(qj) ) {
- sql.append(" and a.area_id='").append(qj).append("'");
- }
- if ( !Common.isNull(pcs) ) {
- sql.append(" and a.TMA_RECOVERDEPARTID='").append(pcs).append("'");
- }
- if (!Common.isNull(netTypeValue)) {
- sql.append(" and a.TMATYPE='").append(netTypeValue).append("'");
- }
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTmaTjALL_info=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTmaTjALL_info",SmsbTmaTjALL_info);
- request.getRequestDispatcher("/zhyw/smtj/zdtj/StatTma.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("涉密网络终端统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 涉密网络统计--查询
- * @author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querytmaSmsbAllStats(HttpServletRequest request, HttpServletResponse response) throws IOException {
- StringBuffer sql = new StringBuffer("SELECT a.framework_id,a.area_id,a.TMA_ID,c.DEPARTNAME,a.TMA_STAFFID,a.TMA_DATE,td.DEPARTNAME as recover_deparname,d.FRAMEWORKNAME,b.AREADEF, " +
- "a.TMA_SECURITY,a.TERMINAL,a.TMA_RECOVERDEPARTID,a.TMANAME,a.TMATYPE,a.ISASSESSMENT,a.ISAPPROVAL, " +
- "a.USEYEAR,a.ISBUILD,a.REMARK,a.PART,a.TMA_MANAGER from tm_dtl_property_tma a " +
- " left join tab_area b on a.AREA_ID=b.AREAID " +
- " left join tab_department c on a.TMA_DEPARTID=c.DEPARTID" +
- " left join tab_department td on a.TMA_RECOVERDEPARTID=td.DEPARTID " +
- " left join tab_framework d on a.FRAMEWORK_ID=d.FRAMEWORKID where 1=1");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTmaTjALL_info=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTmaTjALL_info",SmsbTmaTjALL_info);
- request.getRequestDispatcher("/zhyw/smtj/zdtj/StatTma.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("涉密网络终端统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 网络信息预览
- * @param request
- * @param response
- * @throws SQLException
- */
- public void showInfoProperty(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String useId=request.getParameter("InfoId");
- String sql="select * from tm_dtl_property_netinfo where id=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf infoBuf=(HashFmlBuf)JDBCUtils.query(conn, sql,new Object[]{useId},new HashFmlBufResultSetHandler());
- request.setAttribute("infoBuf",infoBuf);
- request.getRequestDispatcher("/zhyw/smsb/smwl/propertyInfoAddDetail.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void showProperty(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String useId=request.getParameter("useId");
- String sql="select a.net_id,a.net_staffid,date_format(a.net_date,'%Y-%m-%d %H:%i') as net_date,a.NET_Security,a.Terminal,a.NET_RECOVERDEPARTID,b.netname " +
- "from tm_dtl_property_net a left join tm_dtl_property_netinfo b on a.NET_ID=b.NET_ID where b.net_id=?";
- StringBuffer sql1=new StringBuffer("SELECT b.id,b.net_brand,b.net_ip,net_no,net_name,property_sn,remark,netname from tm_dtl_property_netinfo b where b.net_id=?");
- try {
- conn=DbConn.getConn();
- HashFmlBuf useBuf=(HashFmlBuf)JDBCUtils.query(conn, sql,new Object[]{useId},new HashFmlBufResultSetHandler());
- request.setAttribute("useBuf",useBuf);
- HashFmlBuf useInfo=(HashFmlBuf)JDBCUtils.query(conn, sql1.toString(),new Object[]{useId},new HashFmlBufResultSetHandler());
- request.setAttribute("useInfo",useInfo);
- request.getRequestDispatcher("/zhyw/smsb/smwl/showNetProperty.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
-
- /**
- * 批量删除资产信息
- * @author cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void deletePropertyNetInfo(HttpServletRequest request, HttpServletResponse response) throws IOException {
- Login login = (Login) request.getSession().getAttribute("login");
- String[] Infos = request.getParameterValues("Infos");
- String sql = "DELETE FROM tm_dtl_property_netinfo WHERE id=? ";
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = DbConn.getConn();
- conn.setAutoCommit(false);
- prep = conn.prepareStatement(sql);
- for (int i=0; i0){
- //情况1:正常,浏览器按utf-8方式查看
- response.setCharacterEncoding("UTF-8");
- //情况2:正常,浏览器按简体中文方式查看
- response.setContentType("text/html; charset=UTF-8 ");
- out.write("");
- out.close();
- }else{
- conn.commit();
- queryPropertyNetPage(request, response);
- }
- queryPropertyNetPage(request, response);
- } catch (Exception e) {
- if (conn != null) {
- try {
- conn.rollback();
- } catch (SQLException e1) {
- e1.printStackTrace();
- }
- }
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("人员删除失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (prep!= null) {
- prep.close();
- }
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 根据Id查询到相应的记录行
- * @param request
- * @param response
- * @throws IOException
- */
- public void showPropertyTmaId(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String InfoId= request.getParameter("InfoId");
- StringBuffer sql=new StringBuffer("SELECT tma.TMA_ID,d.DEPARTNAME,td.DEPARTNAME as recover_deparname,tma.TMA_STAFFID,tma.TMA_DATE,c.FRAMEWORKNAME,b.AREADEF,tma.TMA_SECURITY," +
- "tma.TERMINAL,tma.TMA_RECOVERDEPARTID,tma.PART,TMA_MANAGER,tma.ISASSESSMENT,tma.ISAPPROVAL," +
- "tma.ISBUILD,tma.TMANAME,tma.TMATYPE,tma.USEYEAR,REMARK from tm_dtl_property_tma tma " +
- " left join tab_area b on tma.AREA_ID=b.AREAID " +
- " left join tab_framework c on tma.FRAMEWORK_ID=c.FRAMEWORKID" +
- " left join tab_department td on tma.TMA_RECOVERDEPARTID=td.DEPARTID " +
- " left join tab_department d on tma.TMA_DEPARTID=d.DEPARTID where tma.TMA_ID=?");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- HashFmlBuf by_propertyTmaId = (HashFmlBuf)JDBCUtils.query(conn,sql.toString(),new Object[]{InfoId},new HashFmlBufResultSetHandler());
- request.setAttribute("by_propertyTmaId",by_propertyTmaId);
- request.getRequestDispatcher("/zhyw/smtj/zdtj/showPropertyTma.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("根据编号查询网络记录失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 返回终端统计页面
- * @param request
- * @param response
- * @throws Exception
- */
- public void importBack(HttpServletRequest request, HttpServletResponse response) throws Exception {
-
- Connection conn = null;
- StringBuffer sql = new StringBuffer("SELECT a.framework_id,a.area_id,a.TMA_ID,c.DEPARTNAME,a.TMA_STAFFID,a.TMA_DATE,td.DEPARTNAME as recover_deparname,d.FRAMEWORKNAME,b.AREADEF, " +
- "a.TMA_SECURITY,a.TERMINAL,a.TMA_RECOVERDEPARTID,a.TMANAME,a.TMATYPE,a.ISASSESSMENT,a.ISAPPROVAL, " +
- "a.USEYEAR,a.ISBUILD,a.REMARK,a.PART,a.TMA_MANAGER from tm_dtl_property_tma a " +
- " left join tab_area b on a.AREA_ID=b.AREAID " +
- " left join tab_department c on a.TMA_DEPARTID=c.DEPARTID" +
- " left join tab_department td on a.TMA_RECOVERDEPARTID=td.DEPARTID " +
- " left join tab_framework d on a.FRAMEWORK_ID=d.FRAMEWORKID where 1=1");
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTmaTjALL_info=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTmaTjALL_info",SmsbTmaTjALL_info);
- request.getRequestDispatcher("/zhyw/smtj/zdtj/StatTma.jsp").forward(request,response);
- }
- /***
- * 导出涉密终端
- * @param request
- * @param response
- * @throws Exception
- */
- public void exportExcelsmsbzd(HttpServletRequest request,HttpServletResponse response) throws Exception
- {
- String useId = request.getParameter("useId");
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String netType = request.getParameter("tmatype");
- String netTypeValue=null;
- if(netType.equals("--请选择类型--")){
- netTypeValue="";
- }else{
- netTypeValue=netType;
- }
- StringBuffer sql = new StringBuffer("SELECT a.framework_id,a.area_id,a.TMA_ID,c.DEPARTNAME,a.TMA_STAFFID,a.TMA_DATE,td.DEPARTNAME as recover_deparname,d.FRAMEWORKNAME,b.AREADEF, " +
- "a.TMA_SECURITY,a.TERMINAL,a.TMA_RECOVERDEPARTID,a.TMANAME,a.TMATYPE,a.ISASSESSMENT,a.ISAPPROVAL, " +
- "a.USEYEAR,a.ISBUILD,a.REMARK,a.PART,a.TMA_MANAGER from tm_dtl_property_tma a " +
- " left join tab_area b on a.AREA_ID=b.AREAID " +
- " left join tab_department c on a.TMA_DEPARTID=c.DEPARTID" +
- " left join tab_department td on a.TMA_RECOVERDEPARTID=td.DEPARTID " +
- " left join tab_framework d on a.FRAMEWORK_ID=d.FRAMEWORKID where 1=1");
- if (!Common.isNull(sj) ) {
- sql.append(" and a.framework_id='").append(sj).append("'");
- }
- if (!Common.isNull(qj) ) {
- sql.append(" and a.area_id='").append(qj).append("'");
- }
- if (!Common.isNull(pcs) ) {
- sql.append(" and a.TMA_RECOVERDEPARTID= '").append(pcs).append("'");
- }
- if (!Common.isNull(netTypeValue)) {
- sql.append(" and a.TMATYPE='").append(netTypeValue).append("'");
- }
- Connection conn = null;
- List sbs = new ArrayList();
- try {
- conn = DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100000);
- PropertyInfo pro=null;
- if(buf!=null)
- {
- for(int i=0;i sbData) throws ParseException
- {
- HSSFWorkbook workBook=new HSSFWorkbook();
- String[] title={"序号","所属市州","所属区县","登记单位","登记人员","登记时间","使用单位","下属部门","使用人员","终端编号"," 终端网络名称"," 网络类型", "网络终端"," 密级 ","投入使用年份","是否通过测评 ","是否通过审批 ","是否在建 ","备注信息"};
- int i=0;
- int k=1;
- HSSFSheet tableSheet=workBook.createSheet("涉密资产统计表单");
- HSSFRow row=tableSheet.createRow((short)0);
- //创建标题栏单元格字体
- HSSFFont titleFont=workBook.createFont();
- //创建标题栏样式
- HSSFCellStyle titleStyle=workBook.createCellStyle();
- //设置标题栏字体颜色
- titleFont.setColor(HSSFColor.BLUE.index);
- titleFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
- //设置标题栏字体样式
- titleStyle.setFont(titleFont);
- titleStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT);
- //创建状态异常的数据行字体
- HSSFFont contentFont=workBook.createFont();
- //创建状态异常的数据行样式
- HSSFCellStyle contentStyle=workBook.createCellStyle();
- //设置状态异常的数据行字体颜色
- contentFont.setColor(HSSFColor.RED.index);
- //为状态异常的数据行样式设置字体
- contentStyle.setFont(contentFont);
- tableSheet.setColumnWidth(0, 1000);
- tableSheet.setColumnWidth(1,3000);
- tableSheet.setColumnWidth(2,3000);
- tableSheet.setColumnWidth(3,9000);
- tableSheet.setColumnWidth(4,3000);
- tableSheet.setColumnWidth(5, 6000);
- tableSheet.setColumnWidth(6, 9000);
- tableSheet.setColumnWidth(7, 4000);
- tableSheet.setColumnWidth(8, 4000);
- tableSheet.setColumnWidth(9, 7000);
- tableSheet.setColumnWidth(10, 4000);
- tableSheet.setColumnWidth(11, 4000);
- tableSheet.setColumnWidth(12, 3000);
- tableSheet.setColumnWidth(13, 3000);
- tableSheet.setColumnWidth(14, 4000);
- tableSheet.setColumnWidth(15, 4000);
- tableSheet.setColumnWidth(16, 4000);
- tableSheet.setColumnWidth(17, 4000);
- tableSheet.setColumnWidth(18, 4000);
-
- for(String s:title)
- {
- HSSFCell cell=row.createCell(i);
- cell.setCellValue(s);
- cell.setCellStyle(titleStyle);
- i++;
- }
- //迭代数据信息,填入数据行
- for(Iterator iterator=sbData.iterator();iterator.hasNext();)
- {
- PropertyInfo Info=(PropertyInfo)iterator.next();
- HSSFRow hssfRow=tableSheet.createRow((short)k);
- hssfRow.setHeight((short)310);
- hssfRow.createCell(0).setCellValue(Info.getIdd());
- hssfRow.createCell(1).setCellValue(Info.getFramework_id());
- hssfRow.createCell(2).setCellValue(Info.getArea_id());
- hssfRow.createCell(3).setCellValue(Info.getDestory_departid());
- hssfRow.createCell(4).setCellValue(Info.getUseEmpName());
- hssfRow.createCell(5).setCellValue(Info.getUseDate());
- hssfRow.createCell(6).setCellValue(Info.getUseDepartName());
- hssfRow.createCell(7).setCellValue(Info.getPart());
- hssfRow.createCell(8).setCellValue(Info.getPecover_infoname());
- hssfRow.createCell(9).setCellValue(Info.getProvideId());
- hssfRow.createCell(10).setCellValue(Info.getPropertyName());
- hssfRow.createCell(11).setCellValue(Info.getPropertyBrand());
- hssfRow.createCell(12).setCellValue(Info.getPropertyNo());
-
- if (Info.getPropertyMac().equals("1")) {
- hssfRow.createCell(13).setCellValue("秘密");
- }
- else if(Info.getPropertyMac().equals("2"))
- {
- hssfRow.createCell(13).setCellValue("机密");
- }
- else if(Info.getPropertyMac().equals("3")) {
- hssfRow.createCell(13).setCellValue("绝密");
- }
- hssfRow.createCell(14).setCellValue(Info.getPropertySn());
- hssfRow.createCell(15).setCellValue(Info.getPropertyType());
- hssfRow.createCell(16).setCellValue(Info.getProperty_netw());
- hssfRow.createCell(17).setCellValue(Info.getProperty_soff());
- hssfRow.createCell(18).setCellValue(Info.getYesno());
- k++;
- }
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- try {
- workBook.write(os);
- } catch (IOException e) {
- e.printStackTrace();
- }
- byte[] content = os.toByteArray();
- InputStream is = new ByteArrayInputStream(content);
- return is;
- }
- /**
- * 涉密网络导入
- * @author cxz
- * @param fileName:需要导入的excel文件名称
- * 方法描述:迭代需要导入的excel文件数据行,将所有数据行数据填入集合,批量插入中使用
- */
- public static List importPropertyzdInfoData(String fileName) throws FileNotFoundException, IOException, ParseException
- {
- List PropertynetInfoData=new ArrayList();
- PropertyInfo PropertyInfo;
- //获取上传的文件
- //创建工作簿
- HSSFWorkbook workBook=new HSSFWorkbook(new FileInputStream(fileName));
- //得到工作表,因为本项目将所有学生信息导出后放在一个工作表中,所以获取第一张工作表即可
- HSSFSheet sheet=workBook.getSheetAt(0);
- //迭代数据行集合,第一行(0)为标题行所以从1开始
- HSSFRow hssfRow;
- for(int j=1;j<=sheet.getLastRowNum();j++)
- {
- PropertyInfo Info=new PropertyInfo();
- //获取数据行中具体的一行数据行
- hssfRow=sheet.getRow(j);
- //获取数据行中每个数据列的信息,并填入实体
- //序号
-
- if(hssfRow.getCell(0)!=null||!hssfRow.getCell(0).toString().trim().equals(""))
- {
- Info.setId(hssfRow.getCell(0).toString().trim());
- }
- //所属市州
- if(hssfRow.getCell(1)!=null||!hssfRow.getCell(1).toString().trim().equals(""))
- {
- Info.setFramework_id(hssfRow.getCell(1).toString().trim());
- }
- //所属区县
- if(hssfRow.getCell(2)!=null||!hssfRow.getCell(2).toString().trim().equals(""))
- {
- Info.setArea_id(hssfRow.getCell(2).toString().trim());
- }
- if(hssfRow.getCell(3)!=null||!hssfRow.getCell(3).toString().trim().equals(""))
- {
- Info.setDestory_departid(hssfRow.getCell(3).toString().trim());
- }
- if(hssfRow.getCell(4)!=null||!hssfRow.getCell(4).toString().trim().equals(""))
- {
- Info.setUseEmpName(hssfRow.getCell(4).toString().trim());
- }
- if(hssfRow.getCell(5)!=null||!hssfRow.getCell(5).toString().trim().equals(""))
- {
- Info.setUseDate(hssfRow.getCell(5).toString().trim());
- }
- if(hssfRow.getCell(6)!=null||!hssfRow.getCell(6).toString().trim().equals(""))
- {
- Info.setUseDepartName(hssfRow.getCell(6).toString().trim());
- }
- if(hssfRow.getCell(7)!=null||!hssfRow.getCell(7).toString().trim().equals(""))
- {
- Info.setPart(hssfRow.getCell(7).toString().trim());
- }
- if(hssfRow.getCell(8)!=null||!hssfRow.getCell(8).toString().trim().equals(""))
- {
- Info.setPecover_infoname(hssfRow.getCell(8).toString().trim());
- }
- if(hssfRow.getCell(9)!=null||!hssfRow.getCell(9).toString().trim().equals(""))
- {
- Info.setProvideId(hssfRow.getCell(9).toString().trim());
- }
- if(hssfRow.getCell(10)!=null||!hssfRow.getCell(10).toString().trim().equals(""))
- {
- Info.setPropertyName(hssfRow.getCell(10).toString().trim());
- }
- if(hssfRow.getCell(11)!=null||!hssfRow.getCell(11).toString().trim().equals(""))
- {
- Info.setPropertyBrand(hssfRow.getCell(11).toString().trim());
- }
- if(hssfRow.getCell(12)!=null||!hssfRow.getCell(12).toString().trim().equals(""))
- {
- Info.setPropertyNo(hssfRow.getCell(12).toString().trim());
- }
- if(hssfRow.getCell(13)!=null||!hssfRow.getCell(13).toString().trim().equals(""))
- {
- Info.setPropertyMac(hssfRow.getCell(13).toString().trim());
- }
- if(hssfRow.getCell(14)!=null||!hssfRow.getCell(14).toString().trim().equals(""))
- {
- Info.setPropertySn(hssfRow.getCell(14).toString().trim());
- }
- if(hssfRow.getCell(15)!=null||!hssfRow.getCell(15).toString().trim().equals(""))
- {
- Info.setPropertyType(hssfRow.getCell(15).toString().trim());
- }
- if(hssfRow.getCell(16)!=null||!hssfRow.getCell(16).toString().trim().equals(""))
- {
- Info.setProperty_netw(hssfRow.getCell(17).toString().trim());
- }
- if(hssfRow.getCell(17)!=null||!hssfRow.getCell(17).toString().trim().equals(""))
- {
- Info.setProperty_soff(hssfRow.getCell(17).toString().trim());
- }
- if(hssfRow.getCell(18)!=null||!hssfRow.getCell(18).toString().trim().equals(""))
- {
- Info.setYesno(hssfRow.getCell(18).toString().trim());
- }
- PropertynetInfoData.add(Info);
- }
- return PropertynetInfoData;
- }
- /**
- * 涉密网络统计
- * @author cxz
- * @param PropertyInfoData:excel表中遍历并填充的实体集合
- * @throws Exception
- */
- public static void insertPropertyzdData(List PropertynetInfoData,HttpServletRequest request,HttpServletResponse response) throws Exception
- {
- Login login=(Login)request.getSession().getAttribute("login");
- Connection conn = null;
- PropertyInfo InfoData;
- //查询数据库中如果存在相应的数据就不插入数据,如果不存在相关的数据就插入date_format('20501231','%Y-%m-%d %H:%i:%s')
- String sqldata="select a.FRAMEWORK_ID,a.AREA_ID,a.TMA_RECOVERDEPARTID,a.TMA_ID,date_format(a.TMA_DATE,'%Y-%m-%d') as EXTENT_TIME from tm_dtl_property_tmainfo a";
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sqldata.toString(),new HashFmlBufResultSetHandler());
- request.setAttribute("buf",buf);
- //网络数据导入
- String sql="insert into tm_dtl_property_tmainfo(FRAMEWORK_ID,AREA_ID,TMA_DEPARTID,TMA_STAFFID,TMA_DATE,TMA_RECOVERDEPARTID,part,TMA_MANAGER,TMA_ID,TMANAME,TMATYPE,TERMINAL,TMA_SECURITY,USEYEAR,ISASSESSMENT,ISAPPROVAL,ISBUILD,REMARK) values(?,?,?,?,date_format(?,'%Y-%m-%d'),?,?,?,?,?,?,?,?,?,?,?,?,?)";
- PreparedStatement pstmt=null;
- try {
- for(Iterator iterator=PropertynetInfoData.iterator();iterator.hasNext();)
- {
- InfoData=(PropertyInfo)iterator.next();
- conn = DbConn.getConn();
- for (int i = 0; i < buf.getRowCount(); i++) {
- String frameworkId=buf.fget("FRAMEWORK_ID", i);
- String AREAID=buf.fget("AREA_ID",i);
- String RECOVER=buf.fget("TMA_RECOVERDEPARTID", i);
- String TMAID=buf.fget("TMA_ID", i);
- if(frameworkId.equals(InfoData.getFramework_id())
- && AREAID.equals(InfoData.getArea_id())
- && TMAID.equals(InfoData.getProvideId())
- && RECOVER.equals(InfoData.getUseDepartName())){
- response.sendRedirect(Common.GbConvertIso("/zhyw/smtj/zdtj/ImportExcelTmaDataError.jsp"));
- return;
- }
- }
- pstmt=conn.prepareStatement(sql);
- pstmt.setString(1,InfoData.getFramework_id()); //所属市州
- pstmt.setString(2,InfoData.getArea_id()); //所属区县
- pstmt.setString(3,InfoData.getDestory_departid()); //登记单位
- pstmt.setString(4,InfoData.getUseEmpName()); //登记单位
- pstmt.setString(5,InfoData.getUseDate()); //资产名称
- pstmt.setString(6,InfoData.getUseDepartName()); //使用单位
- pstmt.setString(7,InfoData.getPart()); //使用单位
- pstmt.setString(8,InfoData.getPecover_infoname()); //使用单位
- pstmt.setString(9,InfoData.getProvideId()); //使用单位
- pstmt.setString(10,InfoData.getPropertyName()); //使用单位
- pstmt.setString(11,InfoData.getPropertyBrand()); //使用单位
- pstmt.setString(12,InfoData.getPropertyNo()); //使用单位
- pstmt.setString(13,InfoData.getPropertyMac()); //使用单位
- pstmt.setString(14,InfoData.getPropertySn()); //使用单位
- pstmt.setString(15,InfoData.getProperty_netw()); //使用单位
- pstmt.setString(16,InfoData.getPropertyType()); //使用单位
- pstmt.setString(17,InfoData.getProperty_soff()); //使用单位
- pstmt.setString(18,InfoData.getYesno()); //使用单位
- pstmt.execute();
- conn.commit();
-
- }
- StatZdtjManageServlet ss=new StatZdtjManageServlet();
- ss.querySmsbeEXStat(request, response);
- } catch (SQLException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 涉密网络统计--查询
- * @author:cxz
- * @param request
- * @param response
- * @throws IOException
- */
- public void querySmsbeEXStat(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String sj = request.getParameter("sj");
- String qj = request.getParameter("qj");
- String pcs = request.getParameter("pcs");
- String protyname = request.getParameter("protyname");
- String frameworkname=null;
- String areadef=null;
- StringBuffer sql1=new StringBuffer("select a.frameworkid,a.frameworkname from tab_framework a where a.frameworkid='"+sj+"'");
- StringBuffer sql2=new StringBuffer("select b.areaid,b.areadef from tab_area b where b.areaid='"+qj+"'");
- StringBuffer sql = new StringBuffer("SELECT a.framework_id,a.area_id,a.TMA_ID,a.TMA_STAFFID,a.TMA_DATE," +
- "a.TMA_SECURITY,a.TERMINAL,a.TMA_DEPARTID,a.TMA_RECOVERDEPARTID,a.TMANAME,a.TMATYPE,a.ISASSESSMENT,a.ISAPPROVAL, " +
- "a.USEYEAR,a.ISBUILD,a.REMARK,a.PART,a.TMA_MANAGER from tm_dtl_property_tmainfo a where 1=1 ");
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn,sql1.toString(),new HashFmlBufResultSetHandler());
- HashFmlBuf buf2 = (HashFmlBuf)JDBCUtils.query(conn,sql2.toString(),new HashFmlBufResultSetHandler());
- for (int i = 0; i < buf.getRowCount(); i++) {
- frameworkname=buf.fget("frameworkname", i);
- }
- for (int i = 0; i < buf2.getRowCount(); i++) {
- areadef=buf2.fget("areadef", i);
- }
- if (!Common.isNull(sj) ) {
- sql.append(" and a.FRAMEWORK_ID='").append(frameworkname).append("'");
- }
- if (!Common.isNull(qj) ) {
- sql.append(" and a.AREA_ID='").append(areadef).append("'");
- }
- if ( !Common.isNull(pcs) ) {
- sql.append(" and a.TMA_RECOVERDEPARTID='").append(pcs).append("'");
- }
- if (!Common.isNull(protyname)) {
- sql.append(" and a.property_name='").append(protyname).append("'");
- }
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf SmsbTjALL_info1=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("SmsbTjALL_info1",SmsbTjALL_info1);
- request.getRequestDispatcher("/zhyw/smtj/zdtj/StatTma.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("涉密网络终端统计查询失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
-}
diff --git a/src/main/java/com/zky/zhyw/smwj/CreateFileIdUtils.java b/src/main/java/com/zky/zhyw/smwj/CreateFileIdUtils.java
deleted file mode 100644
index cab24dc..0000000
--- a/src/main/java/com/zky/zhyw/smwj/CreateFileIdUtils.java
+++ /dev/null
@@ -1,1091 +0,0 @@
-package com.zky.zhyw.smwj;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import com.zky.manager.Login;
-import com.zky.pub.DbConn;
-import com.zky.pub.HashFmlBuf;
-import com.zky.util.jdbc.HashFmlBufResultSetHandler;
-import com.zky.util.jdbc.JDBCUtils;
-
-public class CreateFileIdUtils {
-public static Connection conn=null;
-
-/**
- * 创建机构编号
- * @param request
- * @param response
- * @param useDate
- * @return
- * @throws SQLException
- */
-public static String createDepartId(HttpServletRequest request,HttpServletResponse response) throws SQLException
-{
- String departId="";
- Login login=(Login)request.getSession().getAttribute("login");
- try {
- conn=DbConn.getConn();//093010 0000
- String queryDepartId="select max(substr(departid,7,4)) departId from tab_department";
- String queryFrameworkId="select frameworkid from tab_framework";
- String queryAreaId="select areaid from tab_department where departid=?";
- HashFmlBuf departBuf=(HashFmlBuf)JDBCUtils.query(conn,queryDepartId,new HashFmlBufResultSetHandler());
- HashFmlBuf frameworkBuf=(HashFmlBuf)JDBCUtils.query(conn, queryFrameworkId,new HashFmlBufResultSetHandler());
- HashFmlBuf areaBuf=(HashFmlBuf)JDBCUtils.query(conn, queryAreaId,new Object[]{login.getDepartid()},new HashFmlBufResultSetHandler());
- String framework=frameworkBuf.fget("frameworkid",0);
- String area=areaBuf.fget("areaid",0);
- String departInfo=departBuf.fget("departId",0);
- String departids="";
- int departno=0;
- int departnos=0;
- if(departInfo.equals(""))
- {
- departInfo="0000";
- }
- departno=Integer.parseInt(departInfo)+1;
- if(departno<1000){
-
- if(departno<100)
- {
- departids="00"+departno;
- } else if(departno<10){
- departids="00"+departno;
- }else
- {
- departids="0"+departno;
- }
- }else{
- departids=departno+"";
- }
- departId=framework+area+departids; //0930 10 101
- return departId;
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
-}
-public static String createFileId(HttpServletRequest request,HttpServletResponse response,String departId) throws SQLException
-{
- String useId="";
- String queryUseId="select max(substr(file_id,15,4)) fileId from tm_dtl_file_provide where provide_departid=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf useBuf=(HashFmlBuf)JDBCUtils.query(conn,queryUseId,new Object[]{departId},new HashFmlBufResultSetHandler());
- System.out.println("---count---"+useBuf.getRowCount());
- int useids=0;
- Calendar c=Calendar.getInstance();
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy");
- SimpleDateFormat sdf1=new SimpleDateFormat("MM");
- SimpleDateFormat sdf2=new SimpleDateFormat("dd");
- SimpleDateFormat sdf3=new SimpleDateFormat("HH");
- SimpleDateFormat sdf4=new SimpleDateFormat("mm");
- SimpleDateFormat sdf5=new SimpleDateFormat("ss");
- String year=sdf.format(c.getTime());
- String mouth=sdf1.format(c.getTime());
- String day=sdf2.format(c.getTime());
- String hour=sdf3.format(c.getTime());
- String min=sdf4.format(c.getTime());
- String sec=sdf5.format(c.getTime());
- String useIds="";
- String useIdInfo=useBuf.fget("fileId",0);
- System.out.println("---useIdInfo---"+useIdInfo);
- //20121218091247010
- if(useIdInfo.trim().equals(""))
- {
- useIdInfo="000";
- }
- useids=(Integer.parseInt(useIdInfo))+1;
- if(useids<100)
- {
- if(useids<10)
- {
- useIds="00"+useids;
- }
- else
- {
- useIds="0"+useids;
- }
- }
- else
- {
- useIds=useids+"";
- }
- //useId=departId+yearInfo+mouth+useIds;
- useId=year+mouth+day+hour+min+sec+useIds;
- return useId;
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
-}
-public static String createFileId1(HttpServletRequest request,HttpServletResponse response,String departId) throws SQLException
-{
- String useId="";
- String queryUseId="select max(substr(file_id,9,3)) fileId from tm_dtl_file_provide where provide_departid=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf useBuf=(HashFmlBuf)JDBCUtils.query(conn,queryUseId,new Object[]{departId},new HashFmlBufResultSetHandler());
- System.out.println("---count---"+useBuf.getRowCount());
- int useids=0;
- Calendar c=Calendar.getInstance();
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy");
- String year=sdf.format(c.getTime());
- String yearInfo=year.substring(2,4);
- String useIds="";
- String useIdInfo=useBuf.fget("fileId",0);
- System.out.println("---useIdInfo---"+useIdInfo);
- if(useIdInfo.trim().equals(""))
- {
- useIdInfo="000";
- }
- useids=(Integer.parseInt(useIdInfo))+1;
- if(useids<100)
- {
- if(useids<10)
- {
- useIds="00"+useids;
- }
- else
- {
- useIds="0"+useids;
- }
- }
- else
- {
- useIds=useids+"";
- }
- useId=departId+useIds;
- System.out.println("---useid---"+useId);
- return useId;
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
-}
-/**
- * 创建文件登记编号
- * @param request
- * @param response
- * @param useDate
- * @return
- * @throws SQLException
- */
-public static String createFileId(HttpServletRequest request,HttpServletResponse response) throws SQLException
-{
- String useId="";
- String queryUseId="select file_Id from tm_dtl_file_provide";
- try {
- conn=DbConn.getConn();
- HashFmlBuf useBuf=(HashFmlBuf)JDBCUtils.query(conn,queryUseId,new HashFmlBufResultSetHandler());
- System.out.println("---count---"+useBuf.getRowCount());
- int useids=0;
- Calendar c=Calendar.getInstance();
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy");
- String year=sdf.format(c.getTime());
- String yearInfo=year.substring(2,4);
- String useIds="";
- String useIdInfo=useBuf.fget("file_Id",0);
- System.out.println("---useIdInfo---"+useIdInfo);
- if(useIdInfo==null)
- {
- useIdInfo="000";
- }
- System.out.println(useIdInfo);
- useids=(Integer.parseInt(useIdInfo))+1;
- System.out.println("sssssss"+useids);
- if(useids<100)
- {
- if(useids<10)
- {
- useIds="00"+useids;
- }
- else
- {
- useIds="0"+useids;
- }
- }
- else
- {
- useIds=useids+"";
- }
- useId=useIds;
- System.out.println("---useid---"+useId);
- return useId;
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
-}
-/**
- * 创建文件发放编号信息
- * @param request
- * @param respose
- * @param departId
- * @return
- * @throws SQLException
- */
-public static String getFileProvideId(HttpServletRequest request,HttpServletResponse response,String departId) throws SQLException
-{
- String provideId="";
- String queryProvideId="select max(substr(provide_id,12,3)) provideId from tm_dtl_file_provide where provide_departid=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf provideBuf=(HashFmlBuf)JDBCUtils.query(conn,queryProvideId,new Object[]{departId},new HashFmlBufResultSetHandler());
- int provideids=0;
- Calendar c=Calendar.getInstance();
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy");
- String year=sdf.format(c.getTime());
- String yearInfo=year.substring(2,4);
- String useIds="";
- String provideIdInfo=provideBuf.fget("provideId",0);
- if(provideIdInfo.toString().trim().equals(""))
- {
- provideIdInfo="000";
- }
- provideids=(Integer.parseInt(provideIdInfo))+1;
- if(provideids<100)
- {
- if(provideids<10)
- {
- provideId="00"+provideids;
- }
- else
- {
- provideId="0"+provideids;
- }
- }
- else
- {
- provideId=provideids+"";
- }
- return provideids+"";
-
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
-}
-/**
- * 创建文件发放编号信息
- * @param request
- * @param respose
- * @param departId
- * @return
- * @throws SQLException
- */
-public static String createFileProvideId(HttpServletRequest request,HttpServletResponse response,String departId) throws SQLException
-{
- String provideId="";
- String queryProvideId="select max(substr(provide_id,12,3)) provideId from tm_dtl_file_provide where provide_departid=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf provideBuf=(HashFmlBuf)JDBCUtils.query(conn,queryProvideId,new Object[]{departId},new HashFmlBufResultSetHandler());
- int provideids=0;
- Calendar c=Calendar.getInstance();
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy");
- String year=sdf.format(c.getTime());
- String yearInfo=year.substring(2,4);
- String useIds="";
- String provideIdInfo=provideBuf.fget("provideId",0);
- if(provideIdInfo.toString().trim().equals(""))
- {
- provideIdInfo="000";
- }
- provideids=(Integer.parseInt(provideIdInfo))+1;
- if(provideids<100)
- {
- if(provideids<10)
- {
- provideId="00"+provideids;
- }
- else
- {
- provideId="0"+provideids;
- }
- }
- else
- {
- provideId=provideids+"";
- }
- provideId=yearInfo+departId+"1"+provideId;
- return provideId;
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
-}
-/**
- * 创建文件回收编号
- * @param request
- * @param response
- * @param departId
- * @return
- * @throws SQLException
- */
-public static String getRecoverId(HttpServletRequest request,HttpServletResponse response,String departId) throws SQLException
-{
- String recoverId="";
- String queryRecoverId="select max(substr(recover_id,12,3)) recoverId from tm_dtl_file_recover where recover_departid=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf provideBuf=(HashFmlBuf)JDBCUtils.query(conn,queryRecoverId,new Object[]{departId},new HashFmlBufResultSetHandler());
- int recoverids=0;
- Calendar c=Calendar.getInstance();
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy");
- String year=sdf.format(c.getTime());
- String yearInfo=year.substring(2,4);
- String useIds="";
- String provideIdInfo=provideBuf.fget("recoverId",0);
- if(provideIdInfo.toString().trim().equals(""))
- {
- provideIdInfo="000";
- }
- recoverids=(Integer.parseInt(provideIdInfo))+1;
- if(recoverids<100)
- {
- if(recoverids<10)
- {
- recoverId="00"+recoverids;
- }
- else
- {
- recoverId="0"+recoverids;
- }
- }
- else
- {
- recoverId=recoverids+"";
- }
-
- return recoverids+"";
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
-}
-/**
- * 创建文件回收编号
- * @param request
- * @param response
- * @param departId
- * @return
- * @throws SQLException
- */
-public static String createRecoverId(HttpServletRequest request,HttpServletResponse response,String departId) throws SQLException
-{
- String recoverId="";
- String queryRecoverId="select max(substr(recover_id,12,3)) recoverId from tm_dtl_file_recover where recover_departid=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf provideBuf=(HashFmlBuf)JDBCUtils.query(conn,queryRecoverId,new Object[]{departId},new HashFmlBufResultSetHandler());
- int recoverids=0;
- Calendar c=Calendar.getInstance();
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy");
- String year=sdf.format(c.getTime());
- String yearInfo=year.substring(2,4);
- String useIds="";
- String provideIdInfo=provideBuf.fget("recoverId",0);
- if(provideIdInfo.toString().trim().equals(""))
- {
- provideIdInfo="000";
- }
- recoverids=(Integer.parseInt(provideIdInfo))+1;
- if(recoverids<100)
- {
- if(recoverids<10)
- {
- recoverId="00"+recoverids;
- }
- else
- {
- recoverId="0"+recoverids;
- }
- }
- else
- {
- recoverId=recoverids+"";
- }
- recoverId=yearInfo+departId+"2"+recoverId;
- return recoverId;
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
-}
-/**
- *创建文件借阅编号
- * @param request
- * @param response
- * @param departId
- * @return
- * @throws SQLException
- */
-public static String getFileBorrowId(HttpServletRequest request,HttpServletResponse response,String departId) throws SQLException
-{
- String maintainId="";
- String queryMaintainId="select max(substr(borrow_id,12,3)) borrowId from tm_dtl_file_borrow where borrow_departid=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf maintainBuf=(HashFmlBuf)JDBCUtils.query(conn,queryMaintainId,new Object[]{departId},new HashFmlBufResultSetHandler());
- int maintainids=0;
- Calendar c=Calendar.getInstance();
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy");
- String year=sdf.format(c.getTime());
- String yearInfo=year.substring(2,4);
- String useIds="";
- String maintainIdInfo=maintainBuf.fget("borrowId",0);
- if(maintainIdInfo.toString().trim().equals(""))
- {
- maintainIdInfo="000";
- }
- maintainids=(Integer.parseInt(maintainIdInfo))+1;
- if(maintainids<100)
- {
- if(maintainids<10)
- {
- maintainId="00"+maintainids;
- }
- else
- {
- maintainId="0"+maintainids;
- }
- }
- else
- {
- maintainId=maintainids+"";
- }
-
- return maintainids+"";
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
-}
-/**
- *创建文件借阅编号
- * @param request
- * @param response
- * @param departId
- * @return
- * @throws SQLException
- */
-public static String createFileBorrowId(HttpServletRequest request,HttpServletResponse response,String departId) throws SQLException
-{
- String maintainId="";
- String queryMaintainId="select max(substr(borrow_id,12,3)) borrowId from tm_dtl_file_borrow where borrow_departid=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf maintainBuf=(HashFmlBuf)JDBCUtils.query(conn,queryMaintainId,new Object[]{departId},new HashFmlBufResultSetHandler());
- int maintainids=0;
- Calendar c=Calendar.getInstance();
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy");
- String year=sdf.format(c.getTime());
- String yearInfo=year.substring(2,4);
- String useIds="";
- String maintainIdInfo=maintainBuf.fget("borrowId",0);
- if(maintainIdInfo.toString().trim().equals(""))
- {
- maintainIdInfo="000";
- }
- maintainids=(Integer.parseInt(maintainIdInfo))+1;
- if(maintainids<100)
- {
- if(maintainids<10)
- {
- maintainId="00"+maintainids;
- }
- else
- {
- maintainId="0"+maintainids;
- }
- }
- else
- {
- maintainId=maintainids+"";
- }
- maintainId=yearInfo+departId+"3"+maintainId;
- return maintainId;
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
-}
-/**
- * 创建文件提取编号
- * @param request
- * @param response
- * @param departId
- * @return
- * @throws SQLException
- */
-public static String getFileExtractId(HttpServletRequest request,HttpServletResponse response,String departId) throws SQLException
-{
- String scrapId="";
- String queryScrapId="select max(substr(extract_id,12,3)) extractId from tm_dtl_file_extract where extract_departid=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf scrapBuf=(HashFmlBuf)JDBCUtils.query(conn,queryScrapId,new Object[]{departId},new HashFmlBufResultSetHandler());
- int scrapids=0;
- Calendar c=Calendar.getInstance();
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy");
- String year=sdf.format(c.getTime());
- String yearInfo=year.substring(2,4);
- String scrapIds="";
- String scrapIdInfo=scrapBuf.fget("extractId",0);
- if(scrapIdInfo.toString().trim().equals(""))
- {
- scrapIdInfo="000";
- }
- scrapids=(Integer.parseInt(scrapIdInfo))+1;
- if(scrapids<100)
- {
- if(scrapids<10)
- {
- scrapId="00"+scrapids;
- }
- else
- {
- scrapId="0"+scrapids;
- }
- }
- else
- {
- scrapId=scrapids+"";
- }
-
- return scrapids+"";
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
-}
-/**
- * 创建文件提取编号
- * @param request
- * @param response
- * @param departId
- * @return
- * @throws SQLException
- */
-public static String createFileExtractId(HttpServletRequest request,HttpServletResponse response,String departId) throws SQLException
-{
- String scrapId="";
- String queryScrapId="select max(substr(extract_id,12,3)) extractId from tm_dtl_file_extract where extract_departid=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf scrapBuf=(HashFmlBuf)JDBCUtils.query(conn,queryScrapId,new Object[]{departId},new HashFmlBufResultSetHandler());
- int scrapids=0;
- Calendar c=Calendar.getInstance();
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy");
- String year=sdf.format(c.getTime());
- String yearInfo=year.substring(2,4);
- String scrapIds="";
- String scrapIdInfo=scrapBuf.fget("extractId",0);
- if(scrapIdInfo.toString().trim().equals(""))
- {
- scrapIdInfo="000";
- }
- scrapids=(Integer.parseInt(scrapIdInfo))+1;
- if(scrapids<100)
- {
- if(scrapids<10)
- {
- scrapId="00"+scrapids;
- }
- else
- {
- scrapId="0"+scrapids;
- }
- }
- else
- {
- scrapId=scrapids+"";
- }
- scrapId=yearInfo+departId+"4"+scrapId;
- return scrapId;
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
-}
-/**
- * 创建文件报废编号
- * @param request
- * @param response
- * @param departId
- * @return
- * @throws SQLException
- */
-public static String getFileDestoryId(HttpServletRequest request,HttpServletResponse response,String departId) throws SQLException
-{
- String scrapId="";
- String queryDestoryId="select max(substr(destory_id,12,3)) destoryId from tm_dtl_file_destory where destory_departid=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf scrapBuf=(HashFmlBuf)JDBCUtils.query(conn,queryDestoryId,new Object[]{departId},new HashFmlBufResultSetHandler());
- int scrapids=0;
- Calendar c=Calendar.getInstance();
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy");
- String year=sdf.format(c.getTime());
- String yearInfo=year.substring(2,4);
- String scrapIds="";
- String scrapIdInfo=scrapBuf.fget("destoryId",0);
- if(scrapIdInfo.toString().trim().equals(""))
- {
- scrapIdInfo="000";
- }
- scrapids=(Integer.parseInt(scrapIdInfo))+1;
- if(scrapids<100)
- {
- if(scrapids<10)
- {
- scrapId="00"+scrapids;
- }
- else
- {
- scrapId="0"+scrapids;
- }
- }
- else
- {
- scrapId=scrapids+"";
- }
- //scrapId=yearInfo+departId+"6"+scrapId;
- return scrapids+"";
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
-}
-/**
- * 创建文件报废编号
- * @param request
- * @param response
- * @param departId
- * @return
- * @throws SQLException
- */
-public static String createFileDestoryId(HttpServletRequest request,HttpServletResponse response,String departId) throws SQLException
-{
- String scrapId="";
- String queryDestoryId="select max(substr(destory_id,12,3)) destoryId from tm_dtl_file_destory where destory_departid=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf scrapBuf=(HashFmlBuf)JDBCUtils.query(conn,queryDestoryId,new Object[]{departId},new HashFmlBufResultSetHandler());
- int scrapids=0;
- Calendar c=Calendar.getInstance();
- SimpleDateFormat sdf=new SimpleDateFormat("yyyy");
- String year=sdf.format(c.getTime());
- String yearInfo=year.substring(2,4);
- String scrapIds="";
- String scrapIdInfo=scrapBuf.fget("destoryId",0);
- if(scrapIdInfo.toString().trim().equals(""))
- {
- scrapIdInfo="000";
- }
- scrapids=(Integer.parseInt(scrapIdInfo))+1;
- if(scrapids<100)
- {
- if(scrapids<10)
- {
- scrapId="00"+scrapids;
- }
- else
- {
- scrapId="0"+scrapids;
- }
- }
- else
- {
- scrapId=scrapids+"";
- }
- scrapId=yearInfo+departId+"6"+scrapId;
- return scrapId;
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
-}
-/**
- * 创建文件操作编号
- * @param request
- * @param response
- * @param departId
- * @return
- * @throws SQLException
- */
-public static String getFileOpreateId(HttpServletRequest request,HttpServletResponse response,String departId) throws SQLException
-{
- String scrapId="";
- String queryScrapId="select max(substr(operate_id,12,3)) operateId from tr_file_operate";
- try {
- conn=DbConn.getConn();
- HashFmlBuf scrapBuf=(HashFmlBuf)JDBCUtils.query(conn,queryScrapId,new HashFmlBufResultSetHandler());
- int scrapids=0;
- Calendar c=Calendar.getInstance();
- SimpleDateFormat sdf=new SimpleDateFormat("%Y-%m-%d");
- String year=sdf.format(c.getTime());
- String yearInfo=year.substring(2,4);
- String monthInfo=year.substring(5,7);
- String dayInfo=year.substring(8,10);
- String scrapIds="";
- String scrapIdInfo=scrapBuf.fget("operateId",0);
- if(scrapIdInfo.toString().trim().equals(""))
- {
- scrapIdInfo="000";
- }
- scrapids=(Integer.parseInt(scrapIdInfo))+1;
- if(scrapids<100)
- {
- if(scrapids<10)
- {
- scrapId="00"+scrapids;
- }
- else
- {
- scrapId="0"+scrapids;
- }
- }
- else
- {
- scrapId=scrapids+"";
- }
- //scrapId=yearInfo+monthInfo+dayInfo+"7"+departId;
- return scrapids+"";
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
-}
-/**
- * 创建文件操作编号
- * @param request
- * @param response
- * @param departId
- * @return
- * @throws SQLException
- */
-public static String createFileOpreateId(HttpServletRequest request,HttpServletResponse response,String departId) throws SQLException
-{
- String scrapId="";
- String queryScrapId="select max(substr(operate_id,12,3)) operateId from tr_file_operate";
- try {
- conn=DbConn.getConn();
- HashFmlBuf scrapBuf=(HashFmlBuf)JDBCUtils.query(conn,queryScrapId,new HashFmlBufResultSetHandler());
- int scrapids=0;
- Calendar c=Calendar.getInstance();
- SimpleDateFormat sdf=new SimpleDateFormat("%Y-%m-%d");
- String year=sdf.format(c.getTime());
- String yearInfo=year.substring(2,4);
- String monthInfo=year.substring(5,7);
- String dayInfo=year.substring(8,10);
- String scrapIds="";
- String scrapIdInfo=scrapBuf.fget("operateId",0);
- if(scrapIdInfo.toString().trim().equals(""))
- {
- scrapIdInfo="000";
- }
- scrapids=(Integer.parseInt(scrapIdInfo))+1;
- if(scrapids<100)
- {
- if(scrapids<10)
- {
- scrapId="00"+scrapids;
- }
- else
- {
- scrapId="0"+scrapids;
- }
- }
- else
- {
- scrapId=scrapids+"";
- }
- scrapId=yearInfo+monthInfo+dayInfo+"7"+departId;
- return scrapId;
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
-}
-/**
- * 创建文件接收编号
- * @param request
- * @param response
- * @param departId
- * @return
- * @throws SQLException
- */
-public static String getFileReceiveId(HttpServletRequest request,HttpServletResponse response,String departId) throws SQLException
-{
- String receiveId="";
- String queryReceiveId="select max(substr(receive_id,12,3)) receiveId from tm_dtl_file_receive where receive_departid=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf scrapBuf=(HashFmlBuf)JDBCUtils.query(conn,queryReceiveId,new Object[]{departId},new HashFmlBufResultSetHandler());
- int scrapids=0;
- Calendar c=Calendar.getInstance();
- SimpleDateFormat sdf=new SimpleDateFormat("%Y-%m-%d");
- String year=sdf.format(c.getTime());
- String yearInfo=year.substring(2,4);
- String monthInfo=year.substring(5,7);
- String dayInfo=year.substring(8,10);
-// String scrapIds="";
- String scrapIdInfo=scrapBuf.fget("receiveId",0);
- if(scrapIdInfo.toString().trim().equals(""))
- {
- scrapIdInfo="000";
- }
- scrapids=(Integer.parseInt(scrapIdInfo))+1;
- if(scrapids<100)
- {
- if(scrapids<10)
- {
- receiveId="00"+scrapids;
- }
- else
- {
- receiveId="0"+scrapids;
- }
- }
- else
- {
- receiveId=scrapids+"";
- }
-
- return scrapids+"";
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
-
- return "";
-}
-/**
- * 创建文件接收编号
- * @param request
- * @param response
- * @param departId
- * @return
- * @throws SQLException
- */
-public static String createFileReceiveId(HttpServletRequest request,HttpServletResponse response,String departId) throws SQLException
-{
- String receiveId="";
- String queryReceiveId="select max(substr(receive_id,12,3)) receiveId from tm_dtl_file_receive where receive_departid=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf scrapBuf=(HashFmlBuf)JDBCUtils.query(conn,queryReceiveId,new Object[]{departId},new HashFmlBufResultSetHandler());
- int scrapids=0;
- Calendar c=Calendar.getInstance();
- SimpleDateFormat sdf=new SimpleDateFormat("%Y-%m-%d");
- String year=sdf.format(c.getTime());
- String yearInfo=year.substring(2,4);
- String monthInfo=year.substring(5,7);
- String dayInfo=year.substring(8,10);
-// String scrapIds="";
- String scrapIdInfo=scrapBuf.fget("receiveId",0);
- if(scrapIdInfo.toString().trim().equals(""))
- {
- scrapIdInfo="000";
- }
- scrapids=(Integer.parseInt(scrapIdInfo))+1;
- if(scrapids<100)
- {
- if(scrapids<10)
- {
- receiveId="00"+scrapids;
- }
- else
- {
- receiveId="0"+scrapids;
- }
- }
- else
- {
- receiveId=scrapids+"";
- }
- receiveId=yearInfo+departId+"5"+receiveId;
- System.out.println("----receiveId---"+receiveId);
- return receiveId;
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
-
- return "";
-}
-/**
- * 根据文件编号获得文件名称
- * @param fileId
- * @return
- * @throws SQLException
- */
-public static String getFileName(String fileId) throws SQLException
-{
- String sql="select f.file_name from tm_dtl_file_provide f where f.provide_id=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf fileBuf=(HashFmlBuf)JDBCUtils.query(conn,sql,new Object[]{fileId},new HashFmlBufResultSetHandler());
- return fileBuf.fget("file_name",0);
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
-}
-}
diff --git a/src/main/java/com/zky/zhyw/smwj/FileDestoryManageServlet.java b/src/main/java/com/zky/zhyw/smwj/FileDestoryManageServlet.java
deleted file mode 100644
index 04cf65e..0000000
--- a/src/main/java/com/zky/zhyw/smwj/FileDestoryManageServlet.java
+++ /dev/null
@@ -1,310 +0,0 @@
-package com.zky.zhyw.smwj;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import com.zky.manager.Login;
-import com.zky.manager.Operate;
-import com.zky.manager.StudentPullulate;
-import com.zky.pub.Common;
-import com.zky.pub.DbConn;
-import com.zky.pub.DispatchServlet;
-import com.zky.pub.HashFmlBuf;
-import com.zky.util.PageQuery;
-import com.zky.util.jdbc.HashFmlBufResultSetHandler;
-import com.zky.util.jdbc.JDBCUtils;
-public class FileDestoryManageServlet extends DispatchServlet {
-StudentPullulate p=new StudentPullulate();
-Connection conn;
-PreparedStatement pstmt,pstmt1;
- @Override
- public void defaultMethod(HttpServletRequest request,
- HttpServletResponse response) throws Exception {
- }
- /**
- * 通过区县读取部门
- * @param request
- * @param response
- * @throws Exception
- */
- public void readAridSchoolManage(HttpServletRequest request,
- HttpServletResponse response)throws Exception{
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid");
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf holdDeptBuf=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf manageDeptBuf=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("writeDepartment",bufschool);
- request.setAttribute("holdDeptBuf",holdDeptBuf);
- request.setAttribute("manageDeptBuf",manageDeptBuf);
- request.setAttribute("areaid", areaId);
- request.getRequestDispatcher("/zhyw/smwj/wjxh/fileDestoryManage.jsp").forward(request, response);
- }
- //根据部门查询人员
- public void readEmployeeByDepartmentManage(HttpServletRequest request, HttpServletResponse response)throws Exception{
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid"); //获取区县id
- String schoolId=request.getParameter("schoolid"); //获取部门id
- request.setAttribute("areaid", areaId);
- request.setAttribute("schoolid", schoolId);
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("writeDepartment",bufschool);
- HashFmlBuf bufEmployee=p.readEmployees(request, response);
- request.setAttribute("bufEmployee",bufEmployee);
- request.getRequestDispatcher("/zhyw/smwj/wjxh/fileDestoryManage.jsp").forward(request, response);
- }
- /**
- * 添加文件销毁记录信息
- * @param request
- * @param response
- * @throws SQLException
- * @throws IOException
- * @throws UnsupportedEncodingException
- */
- public void addFileDestory(HttpServletRequest request,HttpServletResponse response) throws SQLException, UnsupportedEncodingException, IOException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String fileTitle=request.getParameter("fileTitle");
- String DestoryNum=request.getParameter("DestoryNum");
- String BmDate=request.getParameter("BmDate");
- String FileSecrt=request.getParameter("FileSecrt");
- String Filenum=request.getParameter("Filenum");
- String fileSecrety=request.getParameter("fileSecrety");
- String DestoryAddress=request.getParameter("DestoryAddress");
- String remark=request.getParameter("remark");
- String receiveId = request.getParameter("receiveId");
- String sql="insert into tm_dtl_file_destory(DESTORY_ADDRESS,DESTORY_COUNT,DESTORY_FILENAME,REMARK,DESTORY_DEPARTID,DESTORY_STAFFID,DESTORY_DATE,RECEIVE_ID)" +
- "values(?,?,?,?,?,?,now(),?)";
- try {
- conn=DbConn.getConn();
- pstmt=conn.prepareStatement(sql);
- pstmt.setString(1,DestoryAddress);
- pstmt.setString(2,DestoryNum);
- pstmt.setString(3,fileTitle);
- pstmt.setString(4,remark);
- pstmt.setString(5,login.getDepartname());
- pstmt.setString(6,login.getEmpname());
- pstmt.setString(7,receiveId);
- pstmt.execute();
- String sql1="update tm_file_recelve e set e.DESTORY_STATE='1' where e.receive_Id=?";
- pstmt1=conn.prepareStatement(sql1);
- pstmt1.setString(1,receiveId);
- pstmt1.execute();
- //oracle数据库手动提交,mysql中 自动提交autoCommit();
- conn.commit();
- Operate oper=new Operate();
- oper.operatesmwjxhLog(request);
- queryFileDestory(request, response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(pstmt!=null)
- {
- pstmt.close();
- }
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 查询最新操作的文件接收记录
- * @param request
- * @param response
- * @throws SQLException
- */
- public void queryFileDestory(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String sj=request.getParameter("sj");
- String qj=request.getParameter("qj");
- String destoryState=request.getParameter("destoryState");
- StringBuffer sql=new StringBuffer("SELECT f.AREAID,f.FRAMEWORKID,a.AREADEF,b.FRAMEWORKNAME,r.file_id,f.file_name,f.file_num,date_format(f.provide_date,'%Y-%m-%d') as provide_date," +
- "d.departname,c.destory_departid,c.destory_staffid,date_format(c.destory_date,'%Y-%m-%d') as destory_date,r.EXTRACT_STATE,r.EXTRACT_DEPARTID,r.EXTRACT_STAFFID,date_format(r.EXTRACT_DATE,'%Y-%m-%d') as EXTRACT_DATE,r.receive_id " +
- ",r.DESTORY_STATE FROM tm_file_recelve r LEFT JOIN tm_dtl_file_provide f ON r.file_id=f.file_id " +
- " LEFT JOIN tm_dtl_file_destory c ON c.receive_id=r.receive_id " +
- " LEFT JOIN tab_department d ON d.departid=f.provide_departid " +
- " LEFT JOIN tab_area a on a.AREAID=f.AREAID left join tab_framework b on b.FRAMEWORKID=f.FRAMEWORKID"+
- " where 1=1 and r.EXTRACT_STATE='1'");
- if(!Common.isNull(sj))
- {
- sql.append(" and f.FRAMEWORKID='").append(sj).append("'");
- }
- if(!Common.isNull(qj))
- {
- sql.append(" and f.AREAID='").append(qj).append("'");
- }
- if(!Common.isNull(destoryState))
- {
- sql.append(" and r.DESTORY_STATE='").append(destoryState).append("'");
- }
- try {
- conn=DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf destoryBuf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("destoryBuf",destoryBuf);
- Operate oper=new Operate();
- oper.operatesmwjxhcxLog(request);
- request.getRequestDispatcher("/zhyw/smwj/wjxh/fileDestoryManage.jsp").forward(request, response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 文件销毁
- * @param request
- * @param response
- * @throws SQLException
- */
- public void addDestory(HttpServletRequest request, HttpServletResponse response) throws IOException {
- Login login=(Login)request.getSession().getAttribute("login");
- String receiveId = request.getParameter("receiveId");
- String sql="SELECT r.receive_Id, r.file_id,f.file_name,f.file_num,date_format(f.provide_date,'%Y-%m-%d') as provide_date," +
- "r.EXTRACT_STATE,f.RELEASE_SECRETID,f.FILE_SECRET,f.FILE_SECRETYJ,f.PROVIDE_COUNT,r.EXTRACT_DEPARTID,r.EXTRACT_STAFFID,date_format(r.EXTRACT_DATE,'%Y-%m-%d') as EXTRACT_DATE,r.receive_id " +
- ",r.DESTORY_STATE FROM tm_file_recelve r LEFT JOIN tm_dtl_file_provide f ON r.file_id=f.file_id " +
- "where r.receive_Id=?";
- PreparedStatement pstmt=null;
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- HashFmlBuf destoryInfo=(HashFmlBuf)JDBCUtils.query(conn, sql.toString(),new Object[]{receiveId},new HashFmlBufResultSetHandler());
- request.setAttribute("destoryInfo",destoryInfo);
- request.getRequestDispatcher("/zhyw/smwj/wjxh/fileDestoryAdd.jsp").forward(request,response);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("接收文件失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 显示文件销毁明细信息
- * @param request
- * @param response
- * @throws SQLException
- * @throws IOException
- * @throws ServletException
- */
- public void showFileDestory(HttpServletRequest request,HttpServletResponse response) throws SQLException, ServletException, IOException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String destroyDepart=login.getDepartid();
- String provideId=request.getParameter("provideId");
- StringBuffer sql=new StringBuffer("SELECT date_format(c.destory_date,'%Y-%m-%d %H:%i') as destory_date, c.destory_staffid, f.instancy_extent, f.file_name,f.file_num,f.file_secret,f.file_secretyj,f.provide_count,f.file_id,d.departname,e.empname,date_format(f.provide_date,'%Y-%m-%d') as provide_date,fram.FRAMEWORKNAME,a.AREADEF FROM tm_file_recelve r " +
- "LEFT JOIN tm_dtl_file_provide f ON r.file_id=f.file_id LEFT JOIN tab_department d ON d.departid=r.EXTRACT_DEPARTID" +
- " LEFT JOIN tab_employee e ON e.empname=r.RECEIVE_STAFFID " +
- "LEFT JOIN tm_dtl_file_destory c ON c.receive_id=r.receive_id LEFT JOIN tab_framework fram on fram.FRAMEWORKID=f.FRAMEWORKID LEFT JOIN tab_area a on a.AREAID=f.AREAID " +
- "WHERE r.file_id=?");
- try {
- conn=DbConn.getConn();
- HashFmlBuf provideBuf=(HashFmlBuf)JDBCUtils.query(conn, sql.toString(),new Object[]{provideId},new HashFmlBufResultSetHandler());
- request.setAttribute("provideBuf",provideBuf);
- request.getRequestDispatcher("/zhyw/smwj/wjxh/showFileDestory.jsp").forward(request, response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- //返回销毁文件
- public void backFileDestory(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- try {
- StringBuffer sql=new StringBuffer("SELECT r.file_id,f.file_name,f.file_num,date_format(f.provide_date,'%Y-%m-%d') as provide_date," +
- "d.departname,c.destory_departid,c.destory_staffid,date_format(c.destory_date,'%Y-%m-%d') as destory_date,r.EXTRACT_STATE,r.EXTRACT_DEPARTID,r.EXTRACT_STAFFID,date_format(r.EXTRACT_DATE,'%Y-%m-%d') as EXTRACT_DATE,r.receive_id " +
- ",r.DESTORY_STATE FROM tm_file_recelve r LEFT JOIN tm_dtl_file_provide f ON r.file_id=f.file_id " +
- "LEFT JOIN tm_dtl_file_destory c ON c.receive_id=r.receive_id " +
- "LEFT JOIN tab_department d ON d.departid=f.provide_departid " +
- "where 1=1 and r.EXTRACT_STATE='1'");
- conn=DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf destoryBuf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("destoryBuf",destoryBuf);
- Operate oper=new Operate();
- oper.operatesmwjxhcxLog(request);
- request.getRequestDispatcher("/zhyw/smwj/wjxh/fileDestoryManage.jsp").forward(request, response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 单个删除销毁文件的一行记录
- * @param request
- * @param response
- * @throws IOException
- */
- public void deleteDestoryFileRow(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String receiveId=request.getParameter("receiveId");
- System.out.println("ss"+receiveId);
- String sql = "DELETE FROM tm_dtl_file_destory WHERE RECEIVE_ID=? ";
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = DbConn.getConn();
- conn.setAutoCommit(false);
- prep = conn.prepareStatement(sql);
- prep.setString(1,receiveId);
- prep.addBatch();
- prep.executeBatch();
- conn.commit();
- queryFileDestory(request, response);
- } catch (Exception e) {
- if (conn != null) {
- try {
- conn.rollback();
- } catch (SQLException e1) {
- e1.printStackTrace();
- }
- }
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("删除销毁文件信息失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (prep!= null) {
- prep.close();
- }
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
-}
-
diff --git a/src/main/java/com/zky/zhyw/smwj/FileExtractManageServlet.java b/src/main/java/com/zky/zhyw/smwj/FileExtractManageServlet.java
deleted file mode 100644
index a136163..0000000
--- a/src/main/java/com/zky/zhyw/smwj/FileExtractManageServlet.java
+++ /dev/null
@@ -1,426 +0,0 @@
-package com.zky.zhyw.smwj;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import com.zky.manager.Login;
-import com.zky.manager.Operate;
-import com.zky.manager.StudentPullulate;
-import com.zky.pub.Common;
-import com.zky.pub.DbConn;
-import com.zky.pub.DispatchServlet;
-import com.zky.pub.HashFmlBuf;
-import com.zky.util.PageQuery;
-import com.zky.util.jdbc.HashFmlBufResultSetHandler;
-import com.zky.util.jdbc.JDBCUtils;
-
-public class FileExtractManageServlet extends DispatchServlet {
- Connection conn;
- PreparedStatement pstmt,pstmt1;
- StudentPullulate p=new StudentPullulate();
- @Override
- public void defaultMethod(HttpServletRequest request,
- HttpServletResponse response) throws Exception {
- }
- /**
- * 通过区县读取部门
- * @param request
- * @param response
- * @throws Exception
- */
- public void readAridSchool(HttpServletRequest request,
- HttpServletResponse response)throws Exception{
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid");
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf holdDeptBuf=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf manageDeptBuf=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("writeDepartment",bufschool);
- request.setAttribute("holdDeptBuf",holdDeptBuf);
- request.setAttribute("manageDeptBuf",manageDeptBuf);
- request.setAttribute("areaid", areaId);
- //request.getRequestDispatcher("/zhyw/smsb/sbff/propertyProvideAdd.jsp").forward(request, response);
- toAddExtract(request, response);
- }
- /**
- * 通过部门读取员工信息
- * @param request
- * @param response
- * @throws Exception
- */
- public void readEmployeeByDepartment(HttpServletRequest request, HttpServletResponse response)throws Exception{
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid"); //获取区县id
- String schoolId=request.getParameter("schoolid"); //获取部门id
- request.setAttribute("areaid",areaId);
- request.setAttribute("schoolid",schoolId);
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf holdDeptBuf=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf manageDeptBuf=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("writeDepartment",bufschool);
- request.setAttribute("holdDeptBuf",holdDeptBuf);
- request.setAttribute("manageDeptBuf",manageDeptBuf);
- //System.out.println("employee--------"+bufschool.getRowCount());
- HashFmlBuf bufEmployee=p.readEmployees(request, response);
- HashFmlBuf holdEmpBuf=p.readEmployees(request, response);
- HashFmlBuf manageEmpBuf=p.readEmployees(request, response);
- request.setAttribute("bufEmployee",bufEmployee);
- request.setAttribute("holdEmpBuf",holdEmpBuf);
- request.setAttribute("manageEmpBuf",manageEmpBuf);
- toAddExtract(request, response);
-
- }
- /**
- * 转至文件接收页面
- * @param request
- * @param response
- * @throws SQLException
- */
- public void toAddExtract(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String provideId=request.getParameter("provideId");
- String querySql="select d.departid,d.departname from tab_department d left join tr_file_operate o on d.departid=o.receive_departid where o.operate_id=?";
-
- String sql="select p.provide_id,p.file_id,p.provide_count,p.provide_departid,p.provide_staffid,p.provide_date," +
- "p.provide_level,p.instancy_extent,p.target_departid,p.alliance_file,p.remark,p.file_secret,p.release_secretid,p.file_title,p.file_name,p.file_purpose,p.remark,p.file_describe," +
- "o.provide_state,o.operate_id,o.extract_state,o.hold_departid,o.hold_staffid,d.departname,e.empname,r.release_year from tm_dtl_file_provide p " +
- "left join tr_file_operate o on p.provide_id=o.provide_id left join tab_department d on o.hold_departid=d.departid left join tab_employee e on o.hold_staffid=e.empid " +
- "left join tab_release_secret r on p.release_secretid=r.release_id where o.operate_id=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf receiveBuf=(HashFmlBuf)JDBCUtils.query(conn,sql,new Object[]{provideId},new HashFmlBufResultSetHandler());
- HashFmlBuf departBuf=(HashFmlBuf)JDBCUtils.query(conn,querySql,new Object[]{provideId},new HashFmlBufResultSetHandler());
- System.out.println("count------"+receiveBuf.getRowCount());
- request.setAttribute("extractBuf",receiveBuf);
- request.setAttribute("writeDepartment",departBuf);
-
- request.getRequestDispatcher("/zhyw/smwj/wjtq/fileExtractAdd.jsp").forward(request, response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 涉密文件登记信息审核
- * @param request
- * @param response
- * @throws SQLException
- */
- public void examineFile(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- Login login = (Login) request.getSession().getAttribute("login");
- String sql = "update tab_file f set f.file_state='1',f.update_date=now(),f.update_staffid = ?,f.update_departid=?,f.examine_departid=?,f.examine_staffid=?,f.examine_date=now() where f.file_id=?";
- String fileId=request.getParameter("fileId");
- try {
- conn=DbConn.getConn();
- pstmt=conn.prepareStatement(sql);
- pstmt.setString(1,login.getEmpid());
- pstmt.setString(2,login.getDepartid());
- pstmt.setString(3,login.getDepartid());
- pstmt.setString(4,login.getEmpid());
- pstmt.setString(5,fileId);
- pstmt.execute();
- //oracle数据库手动提交,mysql中 自动提交autoCommit();
- conn.commit();
- response.sendRedirect("/zhyw/smwj/wjdj/fileManage.jsp");
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(pstmt!=null)
- {
- pstmt.close();
- }
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
-
-
- /**
- * 通过区县读取部门
- * @param request
- * @param response
- * @throws Exception
- */
- public void readAridSchoolManage(HttpServletRequest request,
- HttpServletResponse response)throws Exception{
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid");
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf holdDeptBuf=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf manageDeptBuf=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("writeDepartment",bufschool);
- request.setAttribute("holdDeptBuf",holdDeptBuf);
- request.setAttribute("manageDeptBuf",manageDeptBuf);
- request.setAttribute("areaid", areaId);
- request.getRequestDispatcher("/zhyw/smwj/wjtq/fileExtractManage.jsp").forward(request, response);
- }
- //根据部门查询员工
- public void readEmployeeByDepartmentManage(HttpServletRequest request, HttpServletResponse response)throws Exception{
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid"); //获取区县id
- String schoolId=request.getParameter("schoolid"); //获取部门id
- request.setAttribute("areaid", areaId);
- request.setAttribute("schoolid", schoolId);
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("writeDepartment",bufschool);
- //System.out.println("employee--------"+bufschool.getRowCount());
- HashFmlBuf bufEmployee=p.readEmployees(request, response);
- request.setAttribute("bufEmployee",bufEmployee);
- request.getRequestDispatcher("/zhyw/smwj/wjtq/fileExtractManage.jsp").forward(request, response);
- }
- /**
- * 查询最新操作的文件接收记录
- * @param request
- * @param response
- * @throws SQLException
- */
- public void queryFileExtract(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String receiveDepart=login.getDepartid();
- String extractstate=request.getParameter("extractstate");
- StringBuffer sql=new StringBuffer("SELECT r.file_id,f.file_name,f.file_num,date_format(f.provide_date,'%Y-%m-%d') as provide_date," +
- "d.departname,e.empname,r.EXTRACT_STATE,r.EXTRACT_DEPARTID,r.EXTRACT_STAFFID,date_format(r.EXTRACT_DATE,'%Y-%m-%d') as EXTRACT_DATE,r.receive_id " +
- "FROM tm_file_recelve r LEFT JOIN tm_dtl_file_provide f ON r.file_id=f.file_id " +
- "LEFT JOIN tab_department d ON d.departid=f.provide_departid " +
- "LEFT JOIN tab_employee e ON e.empid=f.provide_staffid " +
- "where r.receive_departid=? and 1=1 and r.RECEIVE_STATE=1");
- if(!Common.isNull(extractstate))
- {
- sql.append(" and r.EXTRACT_STATE='").append(extractstate).append("'");
- }
- try {
- conn=DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new Object[]{receiveDepart},new HashFmlBufResultSetHandler(),request);
- HashFmlBuf extractBuf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("extractBuf",extractBuf);
- Operate oper=new Operate();
- oper.operatesmwjtqcxLog(request);
- request.getRequestDispatcher("/zhyw/smwj/wjtq/fileExtractManage.jsp").forward(request, response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void addFileExtract(HttpServletRequest request,HttpServletResponse response) throws SQLException, UnsupportedEncodingException, IOException
- {
- String operateId=request.getParameter("operateId");
- //String provideId=request.getParameter("provideId");
- Login login=(Login)request.getSession().getAttribute("login");
- String extractDepartid=request.getParameter("schoolid");
- String extractStaffid=request.getParameter("writeempid");
- String extractCount=request.getParameter("extractCount");
- String destoryType=request.getParameter("destoryType");
- String receiveDepartid=request.getParameter("school");
- String receiveStaffid=request.getParameter("emp");
- String remark=request.getParameter("remark");
- String provideId=request.getParameter("provideId");
- String countSql="select receive_file_count from tm_dtl_file_receive where provide_id=? and receive_departid=?";
-
- String updateSql="update tr_file_operate set extract_state='1',extract_departid=?,extract_staffid=?,extract_date=now(),hold_departid=?,hold_staffid=?,hold_date=now() where operate_id=?";
- String sql="insert into tm_dtl_file_extract(extract_id,provide_id,extract_departid,extract_staffid,extract_date," +
- "receive_departid,receive_staffid,receive_date,remark,update_departid,update_staffid,update_date,destory_type,extract_count)" +
- " values(?,?,?,?,now(),?,?,now(),?,?,?,now(),?,?)";
- try {
- conn=DbConn.getConn();
- HashFmlBuf countBuf=(HashFmlBuf)JDBCUtils.query(conn,countSql,new Object[]{provideId,receiveDepartid},new HashFmlBufResultSetHandler());
- if(Integer.parseInt(extractCount)<=Integer.parseInt(countBuf.fget("receive_file_count",0)))
- {
- pstmt=conn.prepareStatement(sql);
- pstmt.setString(1,CreateFileIdUtils.createFileExtractId(request,response,extractDepartid));
- pstmt.setString(2,provideId);
- pstmt.setString(3,extractDepartid);
- pstmt.setString(4,extractStaffid);
- pstmt.setString(5,receiveDepartid);
- pstmt.setString(6,receiveStaffid);
- pstmt.setString(7,remark);
- pstmt.setString(8,login.getDepartid());
- pstmt.setString(9,login.getEmpid());
- pstmt.setString(10,destoryType);
- pstmt.setInt(11,Integer.parseInt(extractCount));
- pstmt.execute();
- pstmt1=conn.prepareStatement(updateSql);
- pstmt1.setString(1,extractDepartid);
- pstmt1.setString(2,extractStaffid);
- pstmt1.setString(3,extractDepartid);
- pstmt1.setString(4,extractStaffid);
- pstmt1.setString(5,operateId);
- pstmt1.execute();
- //oracle数据库手动提交,mysql中 自动提交autoCommit();
- conn.commit();
- request.setAttribute("provideId",provideId);
- queryFileExtract(request, response);
- }
- else
- {
- request.getRequestDispatcher("/zhyw/smwj/wjtq/errorInfo.jsp").forward(request,response);
- }
- } catch (Exception e) {
- String errorinfo="";
- if (e.getMessage().startsWith("ORA-00001")) {
- errorinfo = "文件提取失败,相关流水号已经存在!";
- } else {
- errorinfo = "文件提取失败!"+ e.toString();
- }
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+Common.toGb(errorinfo)));
- e.printStackTrace();
- }
- finally
- {
- if(pstmt1!=null)
- {
- pstmt1.close();
- }
- if(pstmt!=null)
- {
- pstmt.close();
- }
- if(conn!=null)
- {
- conn.close();
- }
- }
-
- }
- /**
- * 文件提取
- * @param request
- * @param response
- * @throws SQLException
- */
- public void ExtractId(HttpServletRequest request, HttpServletResponse response) throws IOException {
- Login login=(Login)request.getSession().getAttribute("login");
- String receiveId = request.getParameter("receiveId");
- String sql="update tm_file_recelve e set e.EXTRACT_STATE='1',e.EXTRACT_DEPARTID=?,e.EXTRACT_STAFFID=?,e.EXTRACT_DATE=now() where e.receive_Id=?";
- PreparedStatement pstmt=null;
- Connection conn = null;
- try {
- conn = DbConn.getConn();
- pstmt=conn.prepareStatement(sql);
- pstmt.setString(1,login.getDepartname());
- pstmt.setString(2,login.getEmpname());
- pstmt.setString(3,receiveId);
- pstmt.execute();
- //oracle数据库手动提交,mysql中 自动提交autoCommit();
- conn.commit();
- queryFileExtract(request, response);
- Operate oper=new Operate();
- oper.operatesmwjtqtgLog(request);
- } catch (Exception e) {
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("接收文件失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 显示文件提取明细信息
- * @param request
- * @param response
- * @throws SQLException
- * @throws IOException
- * @throws ServletException
- */
- public void showFileExtract(HttpServletRequest request,HttpServletResponse response) throws SQLException, ServletException, IOException
- {
- String provideId=request.getParameter("provideId");
- StringBuffer sql=new StringBuffer("SELECT f.instancy_extent, f.file_name,f.file_num,f.file_secret,f.file_secretyj,fram.FRAMEWORKNAME,a.AREADEF," +
- "f.provide_count,f.file_id,d.DEPARTNAME,e.EMPNAME," +
- "date_format(f.provide_date,'%Y-%m-%d') as provide_date ,date_format(r.extract_date,'%Y-%m-%d %H:%i') as extract_date FROM tm_file_recelve r " +
- "LEFT JOIN tm_dtl_file_provide f ON r.file_id=f.file_id " +
- "LEFT JOIN tab_department d ON d.DEPARTNAME=r.EXTRACT_DEPARTID" +
- " LEFT JOIN tab_employee e ON e.EMPNAME=r.EXTRACT_STAFFID LEFT JOIN tab_framework fram on fram.FRAMEWORKID=f.FRAMEWORKID LEFT JOIN tab_area a on a.AREAID=f.AREAID " +
- "WHERE r.file_id=?");
- try {
- conn=DbConn.getConn();
- HashFmlBuf provideBuf=(HashFmlBuf)JDBCUtils.query(conn, sql.toString(),new Object[]{provideId},new HashFmlBufResultSetHandler());
- request.setAttribute("provideBuf",provideBuf);
- request.getRequestDispatcher("/zhyw/smwj/wjtq/showFileExtract.jsp").forward(request, response);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 单个删除提取文件的一行记录
- * @param request
- * @param response
- * @throws IOException
- */
- public void deleteExtractFileRow(HttpServletRequest request, HttpServletResponse response) throws IOException {
- String receiveId=request.getParameter("receiveId");
- System.out.println("从sd卡哈vsiu"+receiveId);
- String sql = "DELETE FROM tm_file_recelve WHERE RECEIVE_ID=? ";
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = DbConn.getConn();
- conn.setAutoCommit(false);
- prep = conn.prepareStatement(sql);
- prep.setString(1,receiveId);
- prep.addBatch();
- prep.executeBatch();
- conn.commit();
- queryFileExtract(request, response);
- } catch (Exception e) {
- if (conn != null) {
- try {
- conn.rollback();
- } catch (SQLException e1) {
- e1.printStackTrace();
- }
- }
- e.printStackTrace();
- response.sendRedirect(Common.GbConvertIso("/error.jsp?errorinfo="+URLEncoder.encode("删除提取文件信息失败!","GB2312") + e.toString()));
- } finally {
- try {
- if (prep!= null) {
- prep.close();
- }
- if (conn!= null) {
- conn.close();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
-}
-
diff --git a/src/main/java/com/zky/zhyw/smwj/FileProvideManageServlet.java b/src/main/java/com/zky/zhyw/smwj/FileProvideManageServlet.java
deleted file mode 100644
index a635620..0000000
--- a/src/main/java/com/zky/zhyw/smwj/FileProvideManageServlet.java
+++ /dev/null
@@ -1,652 +0,0 @@
-package com.zky.zhyw.smwj;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.apache.poi.hssf.usermodel.HSSFRow;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import com.zky.manager.Login;
-import com.zky.manager.Operate;
-import com.zky.manager.StudentPullulate;
-import com.zky.pojo.FileInfo;
-import com.zky.pub.Common;
-import com.zky.pub.DbConn;
-import com.zky.pub.DispatchServlet;
-import com.zky.pub.HashFmlBuf;
-import com.zky.util.PageQuery;
-import com.zky.util.jdbc.HashFmlBufResultSetHandler;
-import com.zky.util.jdbc.JDBCUtils;
-
-public class FileProvideManageServlet extends DispatchServlet {
-Connection conn,conn1;
-PreparedStatement pstmt,pstmt1,pstmt2;
-StudentPullulate p=new StudentPullulate();
- @Override
- public void defaultMethod(HttpServletRequest request,
- HttpServletResponse response) throws Exception {
- }
- /**
- *添加文件发放信息
- * @param request
- * @param response
- * @throws SQLException
- * @throws IOException
- * @throws UnsupportedEncodingException
- */
- public void addFileProvide(HttpServletRequest request,HttpServletResponse response) throws SQLException, UnsupportedEncodingException, IOException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String fileId="";
- String fileName=request.getParameter("fileName");
- String provideCount=request.getParameter("provideCount");
- String provideStaffid=request.getParameter("writeempid");
- String targetDepartid=request.getParameter("borrowScope");
- String provideLevel=request.getParameter("provideLevel");
- String instancyExtent=request.getParameter("instancyExtent");
- String allianceFile=request.getParameter("allianceFile");
- String fileNum=request.getParameter("fileNum");
- String remark=request.getParameter("remark");
- String fileSecret=request.getParameter("fileSecret");
- String releaseSecretId=request.getParameter("releaseInfo");
- String fileSecrety=request.getParameter("fileSecrety");
- String sql="insert into tm_dtl_file_provide(file_id,file_name,provide_count,provide_departid,provide_staffid,provide_date,"+
- "target_departid,provide_level,instancy_extent,alliance_file,remark,file_secret,release_secretid,update_departid,update_staffid,update_date,FILE_NUM,FILE_SECRETYJ,FRAMEWORKID,AREAID)"+
- "values(?,?,?,?,?,now(),?,?,?,?,?,?,?,?,?,now(),?,?,?,?)";
- try {
- conn=DbConn.getConn();
- pstmt=conn.prepareStatement(sql);
- fileId=CreateFileIdUtils.createFileId(request, response, login.getDepartid());
- pstmt.setString(1,fileId);
- pstmt.setString(2,fileName);
- pstmt.setInt(3,Integer.parseInt(provideCount));
- pstmt.setString(4,login.getDepartid());
- pstmt.setString(5,provideStaffid);
- pstmt.setString(6,targetDepartid);
- pstmt.setString(7,provideLevel);
- pstmt.setString(8,instancyExtent);
- pstmt.setString(9,allianceFile);
- pstmt.setString(10,remark);
- pstmt.setString(11,fileSecret);
- pstmt.setString(12,releaseSecretId);
- pstmt.setString(13,login.getDepartid());
- pstmt.setString(14,login.getEmpid());
- pstmt.setString(15,fileNum);
- pstmt.setString(16,fileSecrety);
- System.out.println("-=-=-="+login.getCompanyid());
- System.out.println("============="+login.getAreaid());
- pstmt.setString(17,login.getCompanyid());
- pstmt.setString(18,login.getAreaid());
- String[] temp=request.getParameterValues("borrowScope");
- for(int i=0;i importFileInfoData(String fileName) throws FileNotFoundException, IOException, ParseException
- {
- SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy/MM/dd"); //日期格式转化
- List FileInfoData=new ArrayList();
- FileInfo FileInfo;
- //获取上传的文件s
- //创建工作簿
- HSSFWorkbook workBook=new HSSFWorkbook(new FileInputStream(fileName));
- //得到工作表,因为本项目将所有学生信息导出后放在一个工作表中,所以获取第一张工作表即可
- HSSFSheet sheet=workBook.getSheetAt(0);
- //迭代数据行集合,第一行(0)为标题行所以从1开始
- HSSFRow hssfRow;
- for(int j=1;j<=sheet.getLastRowNum();j++)
- {
- FileInfo=new FileInfo();
- //获取数据行中具体的一行数据行
- hssfRow=sheet.getRow(j);
- //获取数据行中每个数据列的信息,并填入实体
- if(hssfRow.getCell(0)!=null||!hssfRow.getCell(0).toString().trim().equals(""))
- {
- FileInfo.setFileName(hssfRow.getCell(0).toString().trim());
- }
- //文件数量
- if(hssfRow.getCell(1)!=null||!hssfRow.getCell(1).toString().trim().equals(""))
- {
- FileInfo.setProvideCount(hssfRow.getCell(1).toString().trim());
- }
- //文号
- if(hssfRow.getCell(2)!=null||!hssfRow.getCell(2).toString().trim().equals(""))
- {
- FileInfo.setFileNum(hssfRow.getCell(2).toString().trim());
- }
- //发文时间
- if(hssfRow.getCell(3)!=null||!hssfRow.getCell(3).toString().trim().equals("")||hssfRow.getCell(3).toString().trim().length()==10)
- {
- FileInfo.setProvideDate(hssfRow.getCell(3).toString().trim());
- }
- //文件密级
- if(hssfRow.getCell(4)!=null||!hssfRow.getCell(4).toString().trim().equals(""))
- {
- String fileSecret="";
- if(hssfRow.getCell(4).toString().trim().equals("秘密"))
- {
- fileSecret="1";
- }
- else if(hssfRow.getCell(4).toString().trim().equals("机密"))
- {
- fileSecret="2";
- }
- else if(hssfRow.getCell(4).toString().trim().equals("绝密"))
- {
- fileSecret="3";
- }
- FileInfo.setFileSecret(fileSecret);
- }
- //紧急程度
- if(hssfRow.getCell(5)!=null||!hssfRow.getCell(5).toString().trim().equals(""))
- {
- String instancyExtent="";
- if(hssfRow.getCell(5).toString().trim().equals("普通"))
- {
- instancyExtent="0";
- }
- else if(hssfRow.getCell(5).toString().trim().equals("急件"))
- {
- instancyExtent="1";
- }
- else if(hssfRow.getCell(5).toString().trim().equals("加急"))
- {
- instancyExtent="2";
- }
- FileInfo.setInstancyExtent(instancyExtent);
- }
- //保密期
- if(hssfRow.getCell(6)!=null||!hssfRow.getCell(6).toString().trim().equals("")||hssfRow.getCell(6).toString().trim().length()==10)
- {
- FileInfo.setReleaseSecretid(hssfRow.getCell(6).toString().trim());
- }
- //定密依据
- if(hssfRow.getCell(7)!=null||!hssfRow.getCell(7).toString().trim().equals("")||hssfRow.getCell(7).toString().trim().length()==10)
- {
- FileInfo.setFileSecretyj(hssfRow.getCell(7).toString().trim());
- }
- //收文部门编号
- if(hssfRow.getCell(8)!=null||!hssfRow.getCell(8).toString().trim().equals("")||hssfRow.getCell(8).toString().trim().length()==10)
- {
- FileInfo.setTargetDepartid(hssfRow.getCell(8).toString().trim());
- }
- //将属性填充完毕的学生实体填入集合
- FileInfoData.add(FileInfo);
- }
- return FileInfoData;
- }
-
- /**
- * @author cxz
- * @param studentData:excel表中遍历并填充的实体集合
- * @param employeeId:创建员工编号
- * @param departId:创建学校
- * @throws SQLException
- */
- public static void insertFileData(List fileInfoData,String employeeId,HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- Connection conn = null;
- FileInfo fileInfo;
- // String sql="insert into tm_dtl_file_provide(file_id,file_name,provide_count,file_num,provide_date,provide_departid) values(?,?,?,?,to_date(?,'yyyy-mm-dd'),?)";
- String sql="insert into tm_dtl_file_provide(file_id,file_name,provide_count,file_num,provide_date,provide_departid,FILE_SECRET,INSTANCY_EXTENT,RELEASE_SECRETID,PROVIDE_STAFFID,file_secretyj,frameworkid,areaid,target_departid) values(?,?,?,?,to_date(?,'yyyy-mm-dd'),?,?,?,?,?,?,?,?,?)";
- String sql1="insert into tm_file_recelve (RECEIVE_ID,RECEIVE_DEPARTID,FILE_ID,RECEIVE_STATE)values(SEQ_cn.nextval,?,?,'0')";
- PreparedStatement pstmt=null;
- PreparedStatement pstmt1=null;
- conn = DbConn.getConn();
- try {
- String provideDepartid=login.getDepartid();
- for(Iterator iterator=fileInfoData.iterator();iterator.hasNext();)
- {
- fileInfo=(FileInfo)iterator.next();
- String fileId=CreateFileIdUtils.createFileId(request, response, provideDepartid);
- String filenamedepar=fileInfo.getTargetDepartid();
- String sql2="select a.departid from tab_department a where a.departname='"+filenamedepar+"'";
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn, sql2.toString(),
- new HashFmlBufResultSetHandler());
- request.setAttribute("depart_info",buf);
- pstmt=conn.prepareStatement(sql);
- pstmt.setString(1,fileId);
- pstmt.setString(2,fileInfo.getFileName());
- pstmt.setString(3,fileInfo.getProvideCount());
- pstmt.setString(4,fileInfo.getFileNum());
- pstmt.setString(5,fileInfo.getProvideDate());
- pstmt.setString(6,provideDepartid);
- pstmt.setString(7,fileInfo.getFileSecret());
- pstmt.setString(8,fileInfo.getInstancyExtent());
- pstmt.setString(9,fileInfo.getReleaseSecretid());
- pstmt.setString(10,login.getEmpname());
- pstmt.setString(11,fileInfo.getFileSecretyj());
- pstmt.setString(12,login.getCompanyid());
- pstmt.setString(13,login.getAreaid());
- pstmt.setString(14,buf.fget("departid", 0));
- pstmt.execute();
- pstmt1=conn.prepareStatement(sql1);
- pstmt1.setString(1,buf.fget("departid", 0));
- pstmt1.setString(2,fileId);
- pstmt1.execute();
- conn.commit();
- }
- FileProvideManageServlet provide=new FileProvideManageServlet();
- provide.queryFileProvide(request, response);
- Operate oper=new Operate();
- oper.operatesmwjdrLog(request);
- } catch (SQLException e) {
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 删除下发文件
- * @param request
- * @param response
- * @throws IOException
- */
- public void deletePropertyNetUse(HttpServletRequest request, HttpServletResponse response) throws IOException {
- Login login = (Login) request.getSession().getAttribute("login");
- String[] Infos = request.getParameterValues("Infos");
- String sql = "DELETE FROM tm_dtl_file_provide WHERE FILE_ID=? ";
- String sql1 = "DELETE FROM tm_file_recelve WHERE FILE_ID=? ";
- Connection conn = null;
- PreparedStatement prep = null;
- PreparedStatement prep1=null;
- try {
- conn = DbConn.getConn();
- conn.setAutoCommit(false);
- prep = conn.prepareStatement(sql);
- prep1=conn.prepareStatement(sql1);
- for (int i=0; i 0) {
- request.setAttribute("filesInfo",buf);
- }
-
- request.getRequestDispatcher("/zhyw/smwj/wjdj/fileManage.jsp").forward(request, response);
- } catch (Exception e) {
- // TODO: handle exception
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 查询文件登记信息
- * @param request
- * @param response
- * @throws SQLException
- */
- public void queryPage(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid");
- String departId=request.getParameter("schoolid");
- String employeeId=request.getParameter("writeempid");
- String fileSecret=request.getParameter("filesecret");
- String fileState=request.getParameter("filestate");
- String fileId=request.getParameter("fileId");
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf holdDeptBuf=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf manageDeptBuf=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("writeDepartment",bufschool);
- request.setAttribute("holdDeptBuf",holdDeptBuf);
- request.setAttribute("manageDeptBuf",manageDeptBuf);
- HashFmlBuf bufEmployee=p.readEmployees(request, response);
- HashFmlBuf holdEmpBuf=p.readEmployees(request, response);
- HashFmlBuf manageEmpBuf=p.readEmployees(request, response);
- request.setAttribute("bufEmployee",bufEmployee);
- request.setAttribute("holdEmpBuf",holdEmpBuf);
- request.setAttribute("manageEmpBuf",manageEmpBuf);
- StringBuffer sql=new StringBuffer("select f.file_id,f.file_name,f.file_purpose," +
- "f.write_date,f.file_title,f.file_describe,f.remark," +
- "f.create_staffid,f.create_date,f.create_departid,f.update_staffid,f.update_date,f.update_departid," +
- "f.file_state,f.write_departid,d.departid,d.departname,e.empid,e.empname from tab_file f left join tab_department d " +
- "on f.write_departid=d.departid left join tab_employee e on f.write_staffid=e.empid where 1=1");
- if(!Common.isNull(fileId))
- {
- sql.append(" and f.file_id like '%").append(fileId).append("%'");
- }
- if(!Common.isNull(areaId))
- {
- sql.append(" and d.areaid='"+areaId+"'");
- }
- if(!Common.isNull(departId))
- {
- sql.append(" and f.write_departid='"+departId+"'");
- }
- if(!Common.isNull(employeeId))
- {
- sql.append(" and f.write_staffid='"+employeeId+"'");
- }
-
- if(!Common.isNull(fileState))
- {
- sql.append(" and f.file_state='"+fileState+"'");
- }
- try {
- conn=DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf buf=(HashFmlBuf)pageQuery.query(100);
- if (buf != null && buf.getRowCount() > 0) {
- request.setAttribute("filesInfo",buf);
- }
-
- request.getRequestDispatcher("/zhyw/smwj/wjdj/fileManage.jsp").forward(request, response);
- } catch (Exception e) {
- // TODO: handle exception
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- /**
- * 查询显示文件登记明细信息
- * @param request
- * @param response
- */
- public void showFileInfo(HttpServletRequest request,HttpServletResponse response)
- {
- String fileId=request.getParameter("fileId");
- String sql="select f.file_id,f.file_name,f.file_purpose,f.write_date,f.file_title,f.file_describe," +
- "f.remark,f.write_departid,f.file_state,d.departid,d.departname,e.empid,e.empname" +
- " from tab_file f left join tab_department d on f.write_departid=d.departid left join tab_employee e on " +
- "f.write_staffid=e.empid where f.file_id=?";
- HashFmlBuf buf=null;
- Connection conn=null;
- try{
- conn=DbConn.getConn();
- buf=(HashFmlBuf)JDBCUtils.query(conn, sql,new Object[]{fileId},new HashFmlBufResultSetHandler());
- request.setAttribute("fileInfo",buf);
-
- request.getRequestDispatcher("/zhyw/smwj/wjdj/showFile.jsp").forward(request, response);
- }catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- try {
- if(conn!=null)
- {
- conn.close();
- }
- } catch (SQLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- }
-}
diff --git a/src/main/java/com/zky/zhyw/smwj/QueryUtils.java b/src/main/java/com/zky/zhyw/smwj/QueryUtils.java
deleted file mode 100644
index 77a6306..0000000
--- a/src/main/java/com/zky/zhyw/smwj/QueryUtils.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package com.zky.zhyw.smwj;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import com.zky.pub.DbConn;
-import com.zky.pub.HashFmlBuf;
-import com.zky.util.jdbc.HashFmlBufResultSetHandler;
-import com.zky.util.jdbc.JDBCUtils;
-
-public class QueryUtils {
-public static Connection conn;
-public static String queryDepartname(String departid) throws SQLException
-{
- String sql="select departname from tab_department where departid=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf deptBuf=(HashFmlBuf)JDBCUtils.query(conn,sql,new Object[]{departid},new HashFmlBufResultSetHandler());
- return deptBuf.fget("departname",0);
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
-}
-public static String queryEmpName(String empid) throws SQLException
-{
- String sql="select empname from tab_employee where empid=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf buf=(HashFmlBuf)JDBCUtils.query(conn, sql,new Object[]{empid},new HashFmlBufResultSetHandler());
- return buf.fget("empname",0);
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
-}
-public static String queryDateCode(String code,String type) throws SQLException
-{
- String sql="select dataname from td_s_static where data_code=? and type_code=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf codeBuf=(HashFmlBuf)JDBCUtils.query(conn,sql,new Object[]{code,type},new HashFmlBufResultSetHandler());
- return codeBuf.fget("dataname",0);
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- return "";
-}
-}
diff --git a/src/main/java/com/zky/zhyw/tmq/ReleaseSecretManageServlet.java b/src/main/java/com/zky/zhyw/tmq/ReleaseSecretManageServlet.java
deleted file mode 100644
index eec70d6..0000000
--- a/src/main/java/com/zky/zhyw/tmq/ReleaseSecretManageServlet.java
+++ /dev/null
@@ -1,194 +0,0 @@
-package com.zky.zhyw.tmq;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import com.zky.manager.Login;
-import com.zky.manager.StudentPullulate;
-import com.zky.pub.Common;
-import com.zky.pub.DbConn;
-import com.zky.pub.DispatchServlet;
-import com.zky.pub.HashFmlBuf;
-import com.zky.util.PageQuery;
-import com.zky.util.jdbc.HashFmlBufResultSetHandler;
-import com.zky.util.jdbc.JDBCUtils;
-
-public class ReleaseSecretManageServlet extends DispatchServlet {
- Connection conn = null;
- PreparedStatement pstmt=null;
- StudentPullulate p=new StudentPullulate();
- @Override
- public void defaultMethod(HttpServletRequest request,
- HttpServletResponse response) throws Exception {
- // TODO Auto-generated method stub
-
- }
- /**
- * 通过区县读取部门
- * @param request
- * @param response
- * @throws Exception
- */
- public void readAridSchoolManage(HttpServletRequest request,
- HttpServletResponse response)throws Exception{
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid");
-
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf holdDeptBuf=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf manageDeptBuf=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("writeDepartment",bufschool);
- request.setAttribute("holdDeptBuf",holdDeptBuf);
- request.setAttribute("manageDeptBuf",manageDeptBuf);
-
- request.setAttribute("areaid", areaId);
-
- request.getRequestDispatcher("/zhyw/tmq/releaseManage.jsp").forward(request, response);
-
- }
-
-
-
-
-
-
- //根据部门查询员工
- public void readEmployeeByDepartmentManage(HttpServletRequest request, HttpServletResponse response)throws Exception{
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid"); //获取区县id
- String schoolId=request.getParameter("schoolid"); //获取部门id
- request.setAttribute("areaid", areaId);
- request.setAttribute("schoolid", schoolId);
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
-
- request.setAttribute("writeDepartment",bufschool);
-
- //System.out.println("employee--------"+bufschool.getRowCount());
- HashFmlBuf bufEmployee=p.readEmployees(request, response);
-
- request.setAttribute("bufEmployee",bufEmployee);
-
- request.getRequestDispatcher("/zhyw/tmq/releaseManage.jsp").forward(request, response);
- }
- public void addReleaseSecret(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String releaseId=request.getParameter("releaseid");
- String releaseNumber=request.getParameter("releasenumber");
- String remark=request.getParameter("remark");
- String queryId="select r.release_id from tab_release_secret r where r.release_id=?";
- HashFmlBuf releaseBuf=null;
- String sql="insert into tab_release_secret(release_id,release_year,remark,create_departid,create_staffid,create_date) " +
- "values(?,?,?,?,?,now())";
- try
- {
- conn=DbConn.getConn();
- releaseBuf=(HashFmlBuf)JDBCUtils.query(conn, queryId,new Object[]{releaseId},new HashFmlBufResultSetHandler());
- if(releaseBuf.getRowCount()==0)
- {
- pstmt=conn.prepareStatement(sql);
- pstmt.setString(1,releaseId);
- pstmt.setString(2,releaseNumber);
- pstmt.setString(3,remark);
- pstmt.setString(4,login.getDepartid());
- pstmt.setString(5,login.getEmpid());
- pstmt.execute();
- //oracle数据库手动提交,mysql中 自动提交autoCommit();
- conn.commit();
- request.setAttribute("releaseId",releaseId);
- queryRelease(request,response);
- }
- else
- {
- request.setAttribute("releaseId",releaseId);
- request.getRequestDispatcher("").forward(request,response);
- }
- }
- catch (Exception e)
- {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(pstmt!=null)
- {
- pstmt.close();
- }
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void queryRelease(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String releaseId=request.getParameter("releaseid");
- StringBuffer sql=new StringBuffer("select r.release_id,r.release_year,r.create_departid," +
- "r.create_staffid,r.create_date,d.departname,e.empname from tab_release_secret r left join tab_department d on r.create_departid=d.departid " +
- "left join tab_employee e on r.create_staffid=e.empid where 1=1");
- if(!Common.isNull(releaseId))
- {
- sql.append(" and r.release_id='"+releaseId+"'");
- }
- try
- {
- conn=DbConn.getConn();
- HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn, sql.toString(),
- new HashFmlBufResultSetHandler());
- request.setAttribute("release_info",buf);
- request.getRequestDispatcher("/zhyw/tmq/releaseManage.jsp").forward(request,response);
- } catch (Exception e) {
- // TODO: handle exception
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void queryReleasePage(HttpServletRequest request,HttpServletResponse response)
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String areaId=request.getParameter("areaid");
- String departId=request.getParameter("schoolid");
- String employeeId=request.getParameter("writeempid");
- String fileSecret=request.getParameter("filesecret");
- String fileState=request.getParameter("filestate");
- String instancyExtent=request.getParameter("instancyExtent");
- HashFmlBuf bufschool=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf holdDeptBuf=p.readSchoolByAreaId(areaId,login);
- HashFmlBuf manageDeptBuf=p.readSchoolByAreaId(areaId,login);
- request.setAttribute("writeDepartment",bufschool);
- request.setAttribute("holdDeptBuf",holdDeptBuf);
- request.setAttribute("manageDeptBuf",manageDeptBuf);
- HashFmlBuf bufEmployee=p.readEmployees(request, response);
- HashFmlBuf holdEmpBuf=p.readEmployees(request, response);
- HashFmlBuf manageEmpBuf=p.readEmployees(request, response);
- request.setAttribute("bufEmployee",bufEmployee);
- request.setAttribute("holdEmpBuf",holdEmpBuf);
- request.setAttribute("manageEmpBuf",manageEmpBuf);
- String releaseId=request.getParameter("releaseid");
-
- StringBuffer sql=new StringBuffer("select r.release_id,r.release_year,r.create_departid," +
- "r.create_staffid,r.create_date,d.departname,e.empname from tab_release_secret r left join tab_department d on r.create_departid=d.departid " +
- "left join tab_employee e on r.create_staffid=e.empid");
-
- try {
- conn=DbConn.getConn();
- PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf releaseBuf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("release_info",releaseBuf);
- request.getRequestDispatcher("/zhyw/tmq/releaseManage.jsp").forward(request,response);
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- }
-}
diff --git a/src/main/java/com/zky/zhyw/wxs/IndentureManageServlet.java b/src/main/java/com/zky/zhyw/wxs/IndentureManageServlet.java
deleted file mode 100644
index 3329757..0000000
--- a/src/main/java/com/zky/zhyw/wxs/IndentureManageServlet.java
+++ /dev/null
@@ -1,347 +0,0 @@
-package com.zky.zhyw.wxs;
-
-import java.io.IOException;
-import java.net.URLEncoder;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import cn.org.bjca.utils.Base64;
-import com.zky.bjca.SM4;
-import com.zky.manager.Login;
-import com.zky.pub.Common;
-import com.zky.pub.DbConn;
-import com.zky.pub.DispatchServlet;
-import com.zky.pub.HashFmlBuf;
-import com.zky.util.PageQuery;
-import com.zky.util.jdbc.HashFmlBufResultSetHandler;
-import com.zky.util.jdbc.JDBCUtils;
-
-public class IndentureManageServlet extends DispatchServlet {
-Connection conn;
-PreparedStatement pstmt ,pstmt1 ;
- @Override
- public void defaultMethod(HttpServletRequest request,
- HttpServletResponse response) throws Exception {
- // TODO Auto-generated method stub
-
- }
- public void addIndenture(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String indentureId=request.getParameter("indentureId");
- String indentureName=request.getParameter("indentureName");
- String indentureAddress=request.getParameter("indentureAddress");
- String indenturePhone=request.getParameter("indenturePhone");
- String indentureMobile=request.getParameter("indentureMobile");
- String indentureLinkman=request.getParameter("indentureLinkman");
- String linkmanPhone=request.getParameter("linkmanPhone");
- String linkmanMobile=request.getParameter("linkmanMobile");
- String remark=request.getParameter("remark");
- String sql="insert into td_indenture(indenture_id,indenture_name,indenture_address,indenture_phone," +
- "indenture_mobile,indenture_linkman,linkman_phone,linkman_mobile,indenture_state,remark,create_departid,create_staffid,create_date)" +
- " values(?,?,?,?,?,?,?,?,?,?,?,?,now())";
- try {
- conn=DbConn.getConn();
- pstmt=conn.prepareStatement(sql);
- pstmt.setString(1,indentureId);
- pstmt.setString(2, Base64.toBase64String(SM4.SM4Encrypt(indentureName)));
- pstmt.setString(3,indentureAddress);
- pstmt.setString(4,indenturePhone);
- pstmt.setString(5,indentureMobile);
- pstmt.setString(6,indentureLinkman);
- pstmt.setString(7,linkmanPhone);
- pstmt.setString(8,linkmanMobile);
- pstmt.setString(9,"1");
- pstmt.setString(10,remark);
- pstmt.setString(11,login.getDepartid());
- pstmt.setString(12,login.getEmpid());
- pstmt.execute();
- conn.commit();
- request.setAttribute("indentureId",indentureId);
- StringBuffer sql1=new StringBuffer("select i.indenture_id,i.indenture_name,i.indenture_address,i.indenture_phone,i.indenture_mobile," +
- "i.indenture_linkman,i.linkman_phone,i.linkman_mobile,i.indenture_state from td_indenture i where 1=1");
- HashFmlBuf buf=(HashFmlBuf)JDBCUtils.query(conn, sql1.toString(),new HashFmlBufResultSetHandler());
- request.setAttribute("indenture_buf",buf);
- request.getRequestDispatcher("/zhyw/wxs/indentureManage.jsp").forward(request,response);
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(pstmt!=null)
- {
- pstmt.close();
- }
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void queryIndenture(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String indentureId=request.getParameter("indentureId");
- String indentureName=request.getParameter("indentureName");
- String indentureLinkman=request.getParameter("indentureLinkman");
- String indentureState=request.getParameter("indentureState");
- StringBuffer sql=new StringBuffer("select i.indenture_id,i.indenture_name,i.indenture_address,i.indenture_phone," +
- "i.indenture_mobile,i.indenture_linkman,i.linkman_phone,i.linkman_mobile,i.indenture_state from td_indenture i where 1=1");
- if(!Common.isNull(indentureId))
- {
- sql.append(" and i.indenture_id='").append(indentureId).append("'");
- }
- else if(!Common.isNull(indentureName))
- {
- sql.append(" and i.indenture_name='%").append(indentureName).append("%'");
- }
- else if(!Common.isNull(indentureLinkman))
- {
- sql.append(" and i.indenture_linkman='%").append(indentureLinkman).append("%'");
- }
- else if(!Common.isNull(indentureState))
- {
- sql.append(" and i.indenture_state='").append(indentureState).append("'");
- }
- try {
- conn=DbConn.getConn();
- PageQuery pageQuery=new PageQuery(conn, sql.toString(),new HashFmlBufResultSetHandler(),request);
- HashFmlBuf indentureBuf=(HashFmlBuf)pageQuery.query(100);
- request.setAttribute("indenture_buf",indentureBuf);
- request.getRequestDispatcher("/zhyw/wxs/indentureManage.jsp").forward(request,response);
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
-
- public void toEditIndenture(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String indentureId=request.getParameter("indentureId");
- String sql="select i.indenture_id,i.indenture_name,i.indenture_address,i.indenture_phone,i.indenture_mobile," +
- "i.indenture_linkman,i.linkman_phone,i.linkman_mobile,i.indenture_state,i.remark from td_indenture i where i.indenture_id=?";
- HashFmlBuf buf=null;
- try {
- conn=DbConn.getConn();
- buf=(HashFmlBuf)JDBCUtils.query(conn,sql,new Object[]{indentureId},new HashFmlBufResultSetHandler());
- request.setAttribute("indenture_buf",buf);
- request.getRequestDispatcher("/zhyw/wxs/indentureUpdate.jsp").forward(request, response);
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void updateIndenture(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String indentureId=request.getParameter("indentureId");
- String indentureName=request.getParameter("indentureName");
- String indenturePhone=request.getParameter("indenturePhone");
- String indentureMobile=request.getParameter("indentureMobile");
- String indentureLinkman=request.getParameter("indentureLinkman");
- String linkmanPhone=request.getParameter("linkmanPhone");
- String linkmanMobile=request.getParameter("linkmanMobile");
- String remark=request.getParameter("remark");
- String indentureAddress=request.getParameter("indentureAddress");
- String updateSql="update td_indenture i set i.indenture_name=?,i.indenture_address=?,i.indenture_phone=?," +
- "i.indenture_mobile=?,i.indenture_linkman=?,i.linkman_phone=?,i.linkman_mobile=?,i.remark=?,i.update_departid=?," +
- "i.update_staffid=?,i.update_date=now() where i.indenture_id=?";
- try {
- conn=DbConn.getConn();
- pstmt=conn.prepareStatement(updateSql);
- pstmt.setString(1,indentureName);
- pstmt.setString(2,indentureAddress);
- pstmt.setString(3,indenturePhone);
- pstmt.setString(4,indentureMobile);
- pstmt.setString(5,indentureLinkman);
- pstmt.setString(6,linkmanPhone);
- pstmt.setString(7,linkmanMobile);
- pstmt.setString(8,remark);
- pstmt.setString(9,login.getDepartid());
- pstmt.setString(10,login.getEmpid());
- pstmt.setString(11,indentureId);
- pstmt.execute();
- conn.commit();
- StringBuffer sql1=new StringBuffer("select i.indenture_id,i.indenture_name,i.indenture_address,i.indenture_phone,i.indenture_mobile," +
- "i.indenture_linkman,i.linkman_phone,i.linkman_mobile,i.indenture_state from td_indenture i where 1=1");
- HashFmlBuf buf=(HashFmlBuf)JDBCUtils.query(conn, sql1.toString(),new HashFmlBufResultSetHandler());
- request.setAttribute("indenture_buf",buf);
- request.getRequestDispatcher("/zhyw/wxs/indentureManage.jsp").forward(request,response);
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(pstmt!=null)
- {
- pstmt.close();
- }
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void queryIndentureInfo(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String indentureId=request.getParameter("indentureId");
- String indentureName=request.getParameter("indentureName");
- String indentureState=request.getParameter("indentureState");
- String indentureLinkman=request.getParameter("indentureLinkman");
- StringBuffer sql=new StringBuffer("select i.indenture_id,i.indenture_name,i.indenture_address,i.indenture_phone,i.indenture_mobile," +
- "i.indenture_linkman,i.linkman_phone,i.linkman_mobile,i.indenture_state from td_indenture i where 1=1");
- if(!Common.isNull(indentureId))
- {
- sql.append(" and i.indenture_id='").append(indentureId).append("'");
- }
- else
- {
- if(!Common.isNull(indentureName))
- {
- sql.append(" and i.indenture_name like '%").append(indentureName).append("%'");
- }
- else if(!Common.isNull(indentureLinkman))
- {
- sql.append(" and i.indenture_linkman like '%").append(indentureLinkman).append("%'");
- }
- }
- try {
- conn=DbConn.getConn();
- HashFmlBuf buf=(HashFmlBuf)JDBCUtils.query(conn, sql.toString(),new HashFmlBufResultSetHandler());
- request.setAttribute("indenture_buf",buf);
- request.getRequestDispatcher("/zhyw/wxs/indentureManage.jsp").forward(request,response);
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void showIndenture(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- String indentureId=request.getParameter("indentureId");
- String sql="select i.indenture_id,i.indenture_name,i.indenture_phone,i.indenture_mobile,i.indenture_address," +
- "i.indenture_linkman,i.linkman_phone,i.linkman_mobile,i.indenture_state,i.remark,i.create_departid,i.create_staffid," +
- "i.create_date,i.update_departid,i.update_staffid,i.update_date,d.departid,d.departname,e.empid,e.empname from td_indenture i" +
- " left join tab_department d on i.create_departid=d.departid left join tab_employee e on e.empid=i.create_staffid where i.indenture_id=?";
- try {
- conn=DbConn.getConn();
- HashFmlBuf buf=(HashFmlBuf)JDBCUtils.query(conn, sql,new Object[]{indentureId},new HashFmlBufResultSetHandler());
- request.setAttribute("indentureBuf",buf);
- request.getRequestDispatcher("/zhyw/wxs/showIndenture.jsp").forward(request,response);
- } catch (Exception e) {
- // TODO: handle exception
- e.printStackTrace();
- }
- finally
- {
- if(conn!=null)
- {
- conn.close();
- }
- }
- }
- public void updateIndentureState(HttpServletRequest request,HttpServletResponse response) throws SQLException
- {
- Login login=(Login)request.getSession().getAttribute("login");
- String[] Infos = request.getParameterValues("Infos");
- String sql="update td_indenture i set i.indenture_state='0',i.update_departid=?,i.update_staffid=?,i.update_date=now()" +
- " where i.indenture_id=?";
- Connection conn = null;
- PreparedStatement prep = null;
- try {
- conn = DbConn.getConn();
- conn.setAutoCommit(false);
- prep = conn.prepareStatement(sql);
- for (int i=0; i
-
-
-
-
-
-
-
-
-
-
+<%--
+ Created by IntelliJ IDEA.
+ User: 20918
+ Date: 2024-3-11
+ Time: 14:30
+ To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+
+ $Title$
+
+
+ $END$
+
+
diff --git a/web/print/print2.jsp b/web/print/print2.jsp
new file mode 100644
index 0000000..43253b2
--- /dev/null
+++ b/web/print/print2.jsp
@@ -0,0 +1,47 @@
+<%@page language="java" pageEncoding="utf-8" %>
+
+
+
+<%----%>
+<%-- --%>
+<%-- --%>
+<%-- --%>
+<%-- --%>
+<%--
--%>
+<%----%>
+
+
+