039d38bab5fabe91ee7d7ee99d08b0629b26ba5a.svn-base 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. /**
  2. * @author GEL
  3. *
  4. */
  5. package com.sinosoft.em.alert.getNext;
  6. import java.io.UnsupportedEncodingException;
  7. import java.sql.Connection;
  8. import java.sql.PreparedStatement;
  9. import java.sql.ResultSet;
  10. import java.sql.SQLException;
  11. import javax.ws.rs.POST;
  12. import javax.ws.rs.Path;
  13. import javax.ws.rs.ProduceMime;
  14. import com.persistence.DbConnection;
  15. import com.sinosoft.lz.system.Utils;
  16. @Path("/getNextRoleService/")
  17. public class getNextRoleService{
  18. @POST
  19. @ProduceMime("application/json")
  20. @Path("/getNextRole/")
  21. public String getNextRole(String params){
  22. getNextRoleDao gnrDao = new getNextRoleDao();
  23. return gnrDao.getNextRoles(params);
  24. }
  25. @POST
  26. @ProduceMime("application/json")
  27. @Path("/getNextRole1/")
  28. public String getNextRole1(String params){//通知单直接发布选择允许无附件直接发布的领导人
  29. getNextRoleDao gnrDao = new getNextRoleDao();
  30. return gnrDao.getNextRoles1(params);
  31. }
  32. @ProduceMime("application/text")
  33. @POST
  34. @Path("/getNotesNum")
  35. public int getNotesNum(String params){//通知单主页面——解除
  36. try {
  37. // params = java.net.URLDecoder.decode(params, "UTF-8");
  38. // params = new String(params.getBytes("ISO8859-1"), "UTF-8");
  39. params = java.net.URLDecoder.decode(java.net.URLDecoder.decode(params, "utf-8"), "utf-8");
  40. } catch (UnsupportedEncodingException e1) {
  41. // TODO Auto-generated catch block
  42. e1.printStackTrace();
  43. }
  44. String alertNumb = Utils.getParameter("EARLY_WARNING_ID", params) == null ? "" : Utils.getParameter("EARLY_WARNING_ID", params);
  45. String writerDept = Utils.getParameter("WRITE_DEPT", params) == null ? "" : Utils.getParameter("WRITE_DEPT", params);
  46. String is_alert = Utils.getParameter("is_alert", params) == null ? "" : Utils.getParameter("is_alert", params);
  47. String sqlSql = "select count(1) from ECM_EM_PUBLISH_ALERT_NOTICE where EARLY_WARNING_ID=? and EARLY_WARNING_PROPERTY='51' and WRITE_DEPT=? and IS_DEL='0' and is_send<'6' and is_alert=?";
  48. DbConnection dbConn = new DbConnection();
  49. Connection conn = null;
  50. PreparedStatement pstm = null;
  51. ResultSet rs = null;
  52. int notesNumb = 0;
  53. try {
  54. conn = dbConn.getConnection();
  55. pstm = conn.prepareStatement(sqlSql);
  56. pstm.setString(1, alertNumb);
  57. pstm.setString(2, writerDept);
  58. pstm.setString(3, is_alert);
  59. rs = pstm.executeQuery();
  60. while(rs.next()){
  61. notesNumb = rs.getInt("count(1)");
  62. }
  63. }catch(Exception e){
  64. e.printStackTrace();
  65. }finally{
  66. try {
  67. rs.close();
  68. pstm.close();
  69. conn.close();
  70. } catch (SQLException e) {
  71. e.printStackTrace();
  72. }
  73. }
  74. return notesNumb;
  75. }
  76. @ProduceMime("application/text")
  77. @POST
  78. @Path("/getNotesNum_alertToResp")
  79. public int getNotesNum_alertToResp(String params){//通知单主页面——解除
  80. String fdobjectId = Utils.getParameter("FD_OBJECTID", params) == null ? "" : Utils.getParameter("FD_OBJECTID", params);
  81. String sqlSql = "select count(1) from ECM_EM_PUBLISH_ALERT_NOTICE where IS_LAST_ID=? and IS_DEL='0'";
  82. DbConnection dbConn = new DbConnection();
  83. Connection conn = null;
  84. PreparedStatement pstm = null;
  85. ResultSet rs = null;
  86. int notesNumb = 0;
  87. try {
  88. conn = dbConn.getConnection();
  89. pstm = conn.prepareStatement(sqlSql);
  90. pstm.setString(1, fdobjectId);
  91. rs = pstm.executeQuery();
  92. while(rs.next()){
  93. notesNumb = rs.getInt("count(1)");
  94. }
  95. }catch(Exception e){
  96. e.printStackTrace();
  97. }finally{
  98. try {
  99. rs.close();
  100. pstm.close();
  101. conn.close();
  102. } catch (SQLException e) {
  103. e.printStackTrace();
  104. }
  105. }
  106. return notesNumb;
  107. }
  108. @ProduceMime("application/text")
  109. @POST
  110. @Path("/getParentCorpId")
  111. public String getParentCorpId(String params){//通知单主页面——解除
  112. String corpId = Utils.getParameter("CORP_ID", params) == null ? "" : Utils.getParameter("CORP_ID", params);
  113. String sqlSql = "select CORP_ID from SYS_DEPARTMENT where DEPT_ID in( select PARENT_ID from SYS_DEPARTMENT where DEPT_ID=? )";
  114. DbConnection dbConn = new DbConnection();
  115. Connection conn = null;
  116. PreparedStatement pstm = null;
  117. ResultSet rs = null;
  118. String parentCorpId = "";
  119. try {
  120. conn = dbConn.getConnection();
  121. pstm = conn.prepareStatement(sqlSql);
  122. pstm.setString(1, corpId);
  123. // pstm.setString(2, corpId);
  124. rs = pstm.executeQuery();
  125. while(rs.next()){
  126. parentCorpId = rs.getString("CORP_ID");
  127. }
  128. }catch(Exception e){
  129. e.printStackTrace();
  130. }finally{
  131. try {
  132. rs.close();
  133. pstm.close();
  134. conn.close();
  135. } catch (SQLException e) {
  136. e.printStackTrace();
  137. }
  138. }
  139. return parentCorpId;
  140. }
  141. @ProduceMime("application/text")
  142. @POST
  143. @Path("/getExplain")
  144. public String getExplain(String params){//通知单详情页面查询回退信息
  145. String Fd_ObjectId = Utils.getParameter("fdObjectId", params) == null ? "" : Utils.getParameter("fdObjectId", params);
  146. String sqlSql = "select EXPLAIN from ECM_EM_TREATED_HUMAN where BUSINESS_ID=? and STATUES='2' and is_del='0'";
  147. DbConnection dbConn = new DbConnection();
  148. Connection conn = null;
  149. PreparedStatement pstm = null;
  150. ResultSet rs = null;
  151. StringBuffer sb = new StringBuffer();
  152. try {
  153. conn = dbConn.getConnection();
  154. pstm = conn.prepareStatement(sqlSql);
  155. pstm.setString(1, Fd_ObjectId);
  156. rs = pstm.executeQuery();
  157. while(rs.next()){
  158. sb.append(rs.getString("EXPLAIN"));
  159. }
  160. }catch(Exception e){
  161. e.printStackTrace();
  162. }finally{
  163. try {
  164. rs.close();
  165. pstm.close();
  166. conn.close();
  167. } catch (SQLException e) {
  168. e.printStackTrace();
  169. }
  170. }
  171. return sb.toString();
  172. }
  173. }