50a894bc05f2eb208ee0d0f5d26705bb56d27009.svn-base 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. package com.sinosoft.am.filemanger.laws.service;
  2. import javax.ws.rs.POST;
  3. import javax.ws.rs.Path;
  4. import javax.ws.rs.ProduceMime;
  5. import com.formaction.Parameter;
  6. import com.formaction.Utils;
  7. import com.formaction.vo.Msg;
  8. import com.persistence.service.exception.PersistenceException;
  9. import com.sinosoft.am.filemanger.laws.dao.LawsDao;
  10. import com.sinosoft.am.filemanger.laws.dao.TotalFile;
  11. @Path("/LawsService/")
  12. public class LawsService{
  13. /**
  14. * 汇总界面初始化调用地址
  15. * @param params
  16. * @return
  17. * @throws PersistenceException
  18. */
  19. @ProduceMime("application/json")
  20. @POST
  21. @Path("/getLaws")
  22. public String getLaws(String params) throws PersistenceException {
  23. String id=Utils.getParameter("id", params);
  24. String StartTime=Utils.getParameter("StartTime", params);
  25. String EndTime=Utils.getParameter("EndTime", params);
  26. String StartTime1=Utils.getParameter("StartTime1", params);
  27. String EndTime1=Utils.getParameter("EndTime1", params);
  28. String tempLevel=Utils.getParameter("tempLevel", params);
  29. String valueType=Utils.getParameter("valueType", params);
  30. String deptId = Utils.getParameter("deptId", params);
  31. LawsDao dao = new LawsDao();
  32. String json=dao.NumInit(id,StartTime,EndTime,StartTime1,EndTime1,tempLevel,valueType,deptId);
  33. return json;
  34. }
  35. //制度文件总的汇总
  36. @ProduceMime("application/json")
  37. @POST
  38. @Path("/getTotalFile")
  39. public String getTotalFile(String params) throws PersistenceException {
  40. String id=Utils.getParameter("id", params);
  41. String StartTime=Utils.getParameter("StartTime", params);
  42. String EndTime=Utils.getParameter("EndTime", params);
  43. TotalFile dao = new TotalFile();
  44. String json=dao.getPlanInfo(id,StartTime,EndTime);
  45. return json;
  46. }
  47. /**
  48. * 发布
  49. * @param params
  50. * @return
  51. */
  52. @ProduceMime("application/json")
  53. @POST
  54. @Path("/LawsFabu")
  55. public Msg LawsFabu(String params){//发布 应急制度文件发布
  56. Msg m=new Msg();
  57. LawsDao dao = new LawsDao();
  58. // String comp_id=Utils.getParameter("comp_id", params)==null?"":Utils.getParameter("comp_id", params);
  59. String fd_id=Utils.getParameter("fd_id", params)==null?"":Utils.getParameter("fd_id", params);
  60. try {
  61. m=dao.getLawsFabu(fd_id);
  62. } catch (ClassNotFoundException e) {
  63. m.setSucsess(new Boolean(false).toString());
  64. m.setInfo(Parameter.OPER_SUCSESS);
  65. e.printStackTrace();
  66. }
  67. return m;
  68. }
  69. /**
  70. * 撤销发布
  71. * @param params
  72. * @return
  73. */
  74. @ProduceMime("application/json")
  75. @POST
  76. @Path("/noLawsFabu")
  77. public Msg noLawsFabu(String params){//发布 应急制度文件发布
  78. Msg m=new Msg();
  79. LawsDao dao = new LawsDao();
  80. // String comp_id=Utils.getParameter("comp_id", params)==null?"":Utils.getParameter("comp_id", params);
  81. String fd_id=Utils.getParameter("fd_id", params)==null?"":Utils.getParameter("fd_id", params);
  82. try {
  83. m=dao.getnoLawsFabu(fd_id);
  84. } catch (ClassNotFoundException e) {
  85. m.setSucsess(new Boolean(false).toString());
  86. m.setInfo(Parameter.OPER_SUCSESS);
  87. e.printStackTrace();
  88. }
  89. return m;
  90. }
  91. /**
  92. * 共享
  93. * @param params
  94. * @return
  95. */
  96. @ProduceMime("application/json")
  97. @POST
  98. @Path("/LawsShare")
  99. public Msg LawsShare(String params){//发布 应急制度文件发布
  100. Msg m=new Msg();
  101. LawsDao dao = new LawsDao();
  102. // String comp_id=Utils.getParameter("comp_id", params)==null?"":Utils.getParameter("comp_id", params);
  103. String fd_id=Utils.getParameter("fd_id", params)==null?"":Utils.getParameter("fd_id", params);
  104. try {
  105. m=dao.getLawsShare(fd_id);
  106. } catch (ClassNotFoundException e) {
  107. m.setSucsess(new Boolean(false).toString());
  108. m.setInfo(Parameter.OPER_SUCSESS);
  109. e.printStackTrace();
  110. }
  111. return m;
  112. }
  113. /**
  114. * 撤销共享
  115. * @param params
  116. * @return
  117. */
  118. @ProduceMime("application/json")
  119. @POST
  120. @Path("/noLawsShare")
  121. public Msg noLawsShare(String params){//发布 应急制度文件发布
  122. Msg m=new Msg();
  123. LawsDao dao = new LawsDao();
  124. // String comp_id=Utils.getParameter("comp_id", params)==null?"":Utils.getParameter("comp_id", params);
  125. String fd_id=Utils.getParameter("fd_id", params)==null?"":Utils.getParameter("fd_id", params);
  126. try {
  127. m=dao.getnoLawsShare(fd_id);
  128. } catch (ClassNotFoundException e) {
  129. m.setSucsess(new Boolean(false).toString());
  130. m.setInfo(Parameter.OPER_SUCSESS);
  131. e.printStackTrace();
  132. }
  133. return m;
  134. }
  135. /**
  136. * 修改录入人联系方式
  137. * @param params
  138. * @return
  139. */
  140. @ProduceMime("application/json")
  141. @POST
  142. @Path("/LawsUser")
  143. public Msg LawsUser(String params){//发布 应急制度文件发布
  144. Msg m=new Msg();
  145. LawsDao dao = new LawsDao();
  146. String user_id = Utils.getParameter("userid", params)==null?"":Utils.getParameter("userid", params);
  147. String phone = Utils.getParameter("phone", params)==null?"":Utils.getParameter("phone", params);
  148. try {
  149. m=dao.getLawsUser(user_id,phone);
  150. } catch (ClassNotFoundException e) {
  151. m.setSucsess(new Boolean(false).toString());
  152. m.setInfo(Parameter.OPER_SUCSESS);
  153. e.printStackTrace();
  154. }
  155. return m;
  156. }
  157. }