ration_rep_routes.js 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /**
  2. * Created by Tony on 2017/4/20.
  3. */
  4. var express = require("express");
  5. var apiRouter =express.Router();
  6. //var _rootDir = __dirname;
  7. import ViewsController from "../controllers/repository_views_controller";
  8. import RationRepositoryController from "../controllers/ration_repository_controller";
  9. import RationChapterTreeController from "../controllers/ration_section_tree_controller";
  10. import RationController from "../controllers/ration_controller";
  11. import RepositoryGljController from "../controllers/repository_glj_controller";
  12. import CoeListController from "../controllers/coe_controller";
  13. import SearchController from "../controllers/search_controller";
  14. let viewsController = new ViewsController();
  15. let rationRepositoryController = new RationRepositoryController();
  16. let rationChapterTreeController = new RationChapterTreeController();
  17. let rationController = new RationController();
  18. let coeListController = new CoeListController();
  19. let searchController = new SearchController();
  20. let repositoryGljController = new RepositoryGljController();
  21. /*
  22. var rationRepositoryController = require("../controllers/ration_repository_controller");
  23. var rationChapterTreeController = require("../controllers/ration_section_tree_controller");
  24. var rationController = require("../controllers/ration_controller");
  25. var repositoryGljController = require("../controllers/repository_glj_controller");
  26. var coeListController = require("../controllers/coe_controller");
  27. var searchController = require('../controllers/search_controller');
  28. */
  29. module.exports = function (app) {
  30. app.get('/rationRepository/main', viewsController.auth, viewsController.init, viewsController.redirectMain);
  31. app.get('/rationRepository/ration',viewsController.auth, viewsController.init, viewsController.redirectRation);
  32. app.get('/rationRepository/lmm', viewsController.auth, viewsController.init, viewsController.redirectGlj);
  33. app.get('/rationRepository/coeList', viewsController.auth, viewsController.init, viewsController.redirectCoeList);
  34. apiRouter.post("/getCompilationList", rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.getCompilationList);
  35. apiRouter.post("/getRationDisplayNames",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.getDisPlayRationLibs);
  36. apiRouter.post("/editRationLibs",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.updateRationRepositoryName);
  37. apiRouter.post("/addRationRepository",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.addRationRepository);
  38. apiRouter.post("/deleteRationLibs",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.deleteRationLib);
  39. apiRouter.post("/getRealLibName",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.getRealLibName);
  40. apiRouter.post("/getLibIDByName",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.getLibIDByName);
  41. apiRouter.post("/getRationTree",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.getRationChapterTree);
  42. apiRouter.post("/createNewNode",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.createNewNode);
  43. apiRouter.post("/updateNodes",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.updateNodes);
  44. apiRouter.post("/deleteNodes",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.deleteNodes);
  45. apiRouter.post("/getRationItems",rationController.auth, rationController.init, rationController.getRationItemsBySection);
  46. apiRouter.post("/mixUpdateRationItems",rationController.auth, rationController.init, rationController.mixUpdateRationItems);
  47. apiRouter.post("/updateRationBasePrc",rationController.auth, rationController.init, rationController.updateRationBasePrc);
  48. apiRouter.post("/getRationGljIds",rationController.auth, rationController.init, rationController.getRationGljIds);
  49. apiRouter.post("/getRationsCodes",rationController.auth, rationController.init, rationController.getRationsCodes);
  50. apiRouter.post("/createNewGljTypeNode",repositoryGljController.auth, repositoryGljController.init, repositoryGljController.createNewGljTypeNode);
  51. apiRouter.post("/updateGljNodes",repositoryGljController.auth, repositoryGljController.init, repositoryGljController.updateGljNodes);
  52. apiRouter.post("/deleteGljNodes",repositoryGljController.auth, repositoryGljController.init, repositoryGljController.deleteGljNodes);
  53. apiRouter.post("/getGljDistType",repositoryGljController.auth, repositoryGljController.init, repositoryGljController.getGljDistType);
  54. apiRouter.post("/getGljTree",repositoryGljController.auth, repositoryGljController.init, repositoryGljController.getGljTree);
  55. apiRouter.post("/getGljItems",repositoryGljController.auth, repositoryGljController.init, repositoryGljController.getGljItems);
  56. apiRouter.post("/mixUpdateGljItems",repositoryGljController.auth, repositoryGljController.init, repositoryGljController.mixUpdateGljItems);
  57. apiRouter.post("/getGljItemsByIds",repositoryGljController.auth, repositoryGljController.init, repositoryGljController.getGljItemsByIds);
  58. apiRouter.post("/getGljItemsByCodes",repositoryGljController.auth, repositoryGljController.init, repositoryGljController.getGljItemsByCodes);
  59. apiRouter.post("/getCoeList",coeListController.auth, coeListController.init, coeListController.getCoeList);
  60. apiRouter.post("/saveCoeList",coeListController.auth, coeListController.init, coeListController.saveCoeList);
  61. apiRouter.post("/getCoeItemsByIDs",coeListController.auth, coeListController.init, coeListController.getCoeItemsByIDs);
  62. apiRouter.post('/getRationItem',searchController.auth, searchController.init, searchController.getRationItem);
  63. apiRouter.post('/findRation', searchController.auth, searchController.init, searchController.findRation);
  64. app.use("/rationRepository/api",apiRouter);
  65. }
  66. /*module.exports = function (app) {
  67. app.get('/rationRepository/main', function(req, res) {
  68. res.render('maintain/ration_repository/main.html',
  69. {
  70. userAccount: req.session.userAccount,
  71. userID: req.session.userID
  72. });
  73. });
  74. app.get('/rationRepository/ration', function(req, res) {
  75. res.render('maintain/ration_repository/dinge.html',
  76. {
  77. userAccount: req.session.userAccount,
  78. userID: req.session.userID
  79. });
  80. });
  81. app.get('/rationRepository/lmm', function(req, res) {
  82. res.render('maintain/ration_repository/gongliao.html',
  83. {
  84. userAccount: req.session.userAccount,
  85. userID: req.session.userID
  86. });
  87. });
  88. app.get('/rationRepository/coeList', function(req, res) {
  89. res.render('maintain/ration_repository/fuzhu.html',
  90. {
  91. userAccount: req.session.userAccount,
  92. userID: req.session.userID
  93. });
  94. });
  95. apiRouter.post("/getRationDisplayNames",rationRepositoryController.getDisPlayRationLibs);
  96. apiRouter.post("/editRationLibs",rationRepositoryController.updateRationRepositoryName);
  97. apiRouter.post("/addRationRepository",rationRepositoryController.addRationRepository);
  98. apiRouter.post("/deleteRationLibs",rationRepositoryController.deleteRationLib);
  99. apiRouter.post("/getRealLibName",rationRepositoryController.getRealLibName);
  100. apiRouter.post("/getLibIDByName",rationRepositoryController.getLibIDByName);
  101. apiRouter.post("/getRationTree",rationChapterTreeController.getRationChapterTree);
  102. apiRouter.post("/createNewNode",rationChapterTreeController.createNewNode);
  103. apiRouter.post("/updateNodes",rationChapterTreeController.updateNodes);
  104. apiRouter.post("/deleteNodes",rationChapterTreeController.deleteNodes);
  105. apiRouter.post("/getRationItems",rationController.getRationItemsBySection);
  106. apiRouter.post("/mixUpdateRationItems",rationController.mixUpdateRationItems);
  107. apiRouter.post("/updateRationBasePrc",rationController.updateRationBasePrc);
  108. apiRouter.post("/getRationGljIds",rationController.getRationGljIds);
  109. apiRouter.post("/getRationsCodes",rationController.getRationsCodes);
  110. apiRouter.post("/createNewGljTypeNode",repositoryGljController.createNewGljTypeNode);
  111. apiRouter.post("/updateGljNodes",repositoryGljController.updateGljNodes);
  112. apiRouter.post("/deleteGljNodes",repositoryGljController.deleteGljNodes);
  113. apiRouter.post("/getGljDistType",repositoryGljController.getGljDistType);
  114. apiRouter.post("/getGljTree",repositoryGljController.getGljTree);
  115. apiRouter.post("/getGljItems",repositoryGljController.getGljItems);
  116. apiRouter.post("/mixUpdateGljItems",repositoryGljController.mixUpdateGljItems);
  117. apiRouter.post("/getGljItemsByIds",repositoryGljController.getGljItemsByIds);
  118. apiRouter.post("/getGljItemsByCodes",repositoryGljController.getGljItemsByCodes);
  119. apiRouter.post("/getCoeList",coeListController.getCoeList);
  120. apiRouter.post("/saveCoeList",coeListController.saveCoeList);
  121. apiRouter.post("/getCoeItemsByIDs",coeListController.getCoeItemsByIDs);
  122. apiRouter.post('/getRationItem', searchController.getRationItem);
  123. apiRouter.post('/findRation', searchController.findRation);
  124. app.use("/rationRepository/api",apiRouter);
  125. }*/