d412232f601d25608f683c0e2c487c7d83d8760b.svn-base 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. package com.sinosoft.am.team.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.team.dao.InTeamDao;
  10. import com.sinosoft.am.team.dao.OutTeamDao;
  11. import com.sinosoft.am.team.dao.TeamDao;
  12. import com.sinosoft.am.team.dao.TeamDaoJsc;
  13. @Path("/TeamService/")
  14. public class TeamService{
  15. /**
  16. * 队伍总汇总界面初始化调用地址
  17. * @param params
  18. * @return
  19. * @throws PersistenceException
  20. */
  21. @ProduceMime("application/json")
  22. @POST
  23. @Path("/getTeamInfo")
  24. public String getTeamInfo(String params) throws PersistenceException {
  25. String id=Utils.getParameter("id", params);
  26. //系统区分(内部队伍还是外部队伍)
  27. String sys=Utils.getParameter("sys", params);
  28. //队伍类型
  29. String treamType=Utils.getParameter("treamType", params);
  30. //队伍状态
  31. String treamSturts=Utils.getParameter("treamSturts", params);
  32. //所属单位
  33. String deptId=Utils.getParameter("deptId", params);
  34. TeamDao dao=new TeamDao();
  35. String json=dao.teamNumInit(id,sys,treamType,treamSturts,deptId);
  36. return json;
  37. }
  38. /**
  39. * 驾驶舱应急队伍人员统计
  40. * @param params
  41. * @return
  42. * @throws PersistenceException
  43. */
  44. @ProduceMime("application/json")
  45. @POST
  46. @Path("/getTeamInfoJsc")
  47. public String getTeamInfoJsc(String params) throws PersistenceException {
  48. String id=Utils.getParameter("id", params);
  49. //系统区分(内部队伍还是外部队伍)
  50. String sys=Utils.getParameter("sys", params);
  51. //队伍类型
  52. String treamType=Utils.getParameter("treamType", params);
  53. //队伍状态
  54. String treamSturts=Utils.getParameter("treamSturts", params);
  55. //所属单位
  56. String deptId=Utils.getParameter("deptId", params);
  57. TeamDaoJsc dao=new TeamDaoJsc();
  58. String json=dao.teamNumInit(id,sys,treamType,treamSturts,deptId);
  59. return json;
  60. }
  61. /**
  62. * 内部队伍界面初始化调用地址
  63. * @param params
  64. * @return
  65. * @throws PersistenceException
  66. */
  67. @ProduceMime("application/json")
  68. @POST
  69. @Path("/getInTeamInfo")
  70. public String getInTeamInfo(String params) throws PersistenceException {
  71. String id=com.sinosoft.lz.system.Utils.getParameter("id", params);
  72. InTeamDao dao=new InTeamDao();
  73. String json=dao.teamNumInit(id);
  74. return json;
  75. }
  76. /**
  77. * 外部队伍界面初始化调用地址
  78. * @param params
  79. * @return
  80. * @throws PersistenceException
  81. */
  82. @ProduceMime("application/json")
  83. @POST
  84. @Path("/getOutTeamInfo")
  85. public String getOutTeamInfo(String params) throws PersistenceException {
  86. String id=com.sinosoft.lz.system.Utils.getParameter("id", params);
  87. OutTeamDao dao=new OutTeamDao();
  88. String json=dao.teamNumInit(id);
  89. return json;
  90. }
  91. /**
  92. * 队伍状态
  93. * @param params
  94. * @return
  95. */
  96. @ProduceMime("application/json")
  97. @POST
  98. @Path("/TeamDiaoBo")
  99. public Msg TeamDiaoBo(String params){//发布 应急制度文件发布
  100. Msg m=new Msg();
  101. TeamDao dao=new TeamDao();
  102. String fd_id=Utils.getParameter("fd_id", params)==null?"":Utils.getParameter("fd_id", params);
  103. String num=Utils.getParameter("num", params)==null?"":Utils.getParameter("num", params);
  104. try {
  105. m=dao.getTeamDiaoBo(fd_id,num);
  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. @ProduceMime("application/json")
  115. @POST
  116. @Path("/getMove")
  117. public Msg getMove(String params) throws Exception{
  118. Msg m=new Msg();
  119. String tablename = Utils.getParameter("tableName", params) == null ? "" : Utils.getParameter(
  120. "tableName", params);
  121. String fd_id = Utils.getParameter("fd_id", params) == null ? "" : Utils.getParameter(
  122. "fd_id", params);
  123. String mv_id = Utils.getParameter("mv_id", params) == null ? "" : Utils.getParameter(
  124. "mv_id", params);
  125. String fd_sort = Utils.getParameter("fd_sort", params) == null ? "" : Utils.getParameter(
  126. "fd_sort", params);
  127. String mv_sort = Utils.getParameter("mv_sort", params) == null ? "" : Utils.getParameter(
  128. "mv_sort", params);
  129. if(!"".equals(fd_id)){
  130. TeamDao dao=new TeamDao();
  131. m=dao.getMove(tablename,fd_id,mv_id,fd_sort,mv_sort);
  132. }else{
  133. m.setSucsess(new Boolean(false).toString());
  134. m.setInfo(Parameter.CREATE_FAILURE);
  135. }
  136. return m;
  137. }
  138. }