eb7a4ad501cd0efa7744d987fae3822fdf7611c0.svn-base 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. package com.sinosoft.lz.system.positiontab.service;
  2. import java.util.ArrayList;
  3. import java.util.List;
  4. import java.util.Map;
  5. import javax.ws.rs.POST;
  6. import javax.ws.rs.Path;
  7. import javax.ws.rs.ProduceMime;
  8. import net.sf.json.JSONArray;
  9. import org.apache.log4j.Logger;
  10. import com.formaction.Utils;
  11. import com.persistence.service.JDBCHelper;
  12. import com.persistence.service.PersistenceFactory;
  13. import com.persistence.service.SysPersistence;
  14. import com.persistence.service.exception.PersistenceException;
  15. import com.sinosoft.common.vo.TreeNode;
  16. import com.sinosoft.common.vo.TreeNodes;
  17. import com.sinosoft.em.alert.report.manage.service.QueryReportProgrammeServiceImpl;
  18. import com.sinosoft.lz.system.positiontab.dao.PositionTabDao;
  19. import com.sysmodel.datamodel.xmlmodel.ModelFactory;
  20. import com.sysmodel.datamodel.xmlmodel.able.MdpDataSource;
  21. import com.sysmodel.datamodel.xmlmodel.able.SysModel;
  22. @Path("/PositionTabService/")
  23. public class PositionTabService{
  24. private final static Logger log = Logger.getLogger(QueryReportProgrammeServiceImpl.class);
  25. /**
  26. * 根据菜单id和用户id查询页签数据:
  27. *
  28. * @param node
  29. * @return
  30. */
  31. @ProduceMime("application/json")
  32. @POST
  33. @Path("/getTabById")
  34. public String getTabById(String params) {
  35. String menuId = Utils.getParameter("menuId", params) == null ? "" : Utils
  36. .getParameter("menuId", params);
  37. String userId = Utils.getParameter("userId", params) == null ? "" : Utils
  38. .getParameter("userId", params);
  39. String frmsrc = Utils.getParameter("frmsrc", params) == null ? "" : Utils
  40. .getParameter("frmsrc", params);
  41. PositionTabDao dao = new PositionTabDao();
  42. List<Map<String, String>> list = dao.getTabById(menuId,userId,frmsrc);
  43. return JSONArray.fromObject(list).toString();
  44. }
  45. /**
  46. * 根据菜单id和用户id查询页签数据:
  47. *
  48. * @param node
  49. * @return
  50. */
  51. @ProduceMime("application/json")
  52. @POST
  53. @Path("/addOrUpdateTab")
  54. public String addOrUpdateTab(String params) {
  55. String menuId = Utils.getParameter("menuId", params) == null ? "" : Utils
  56. .getParameter("menuId", params);
  57. String userId = Utils.getParameter("userId", params) == null ? "" : Utils
  58. .getParameter("userId", params);
  59. /* String yqparams = Utils.getParameter("yqparams", params) == null ? "" : Utils
  60. .getParameter("yqparams", params);*/
  61. String tabId = Utils.getParameter("tabId", params) == null ? "" : Utils
  62. .getParameter("tabId", params);
  63. PositionTabDao dao = new PositionTabDao();
  64. String result = "";
  65. try {
  66. result = dao.addOrUpdateTab(menuId,userId,tabId);
  67. } catch (Exception e) {
  68. // TODO Auto-generated catch block
  69. e.printStackTrace();
  70. }
  71. return result;
  72. }
  73. }