ration_rep_routes.js 6.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. import GljController from "../../std_glj_lib/controllers/gljController";
  15. let viewsController = new ViewsController();
  16. let rationRepositoryController = new RationRepositoryController();
  17. let rationChapterTreeController = new RationChapterTreeController();
  18. let rationController = new RationController();
  19. let coeListController = new CoeListController();
  20. let searchController = new SearchController();
  21. let repositoryGljController = new RepositoryGljController();
  22. let gljController = new GljController();
  23. module.exports = function (app) {
  24. app.get('/rationRepository/main', viewsController.auth, viewsController.init, viewsController.redirectMain);
  25. app.get('/rationRepository/ration',viewsController.auth, viewsController.init, viewsController.redirectRation);
  26. app.get('/rationRepository/lmm', viewsController.auth, viewsController.init, viewsController.redirectGlj);
  27. app.get('/rationRepository/coeList', viewsController.auth, viewsController.init, viewsController.redirectCoeList);
  28. apiRouter.post("/getCompilationList", rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.getCompilationList);
  29. apiRouter.post("/getRationLib",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.getRationLib);
  30. apiRouter.post("/getRationDisplayNames",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.getDisPlayRationLibs);
  31. apiRouter.post("/editRationLibs",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.updateRationRepositoryName);
  32. apiRouter.post("/addRationRepository",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.addRationRepository);
  33. apiRouter.post("/deleteRationLibs",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.deleteRationLib);
  34. apiRouter.post("/getRealLibName",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.getRealLibName);
  35. apiRouter.post("/getLibIDByName",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.getLibIDByName);
  36. apiRouter.post("/getRationTree",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.getRationChapterTree);
  37. apiRouter.post("/createNewNode",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.createNewNode);
  38. apiRouter.post("/updateNodes",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.updateNodes);
  39. apiRouter.post("/deleteNodes",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.deleteNodes);
  40. apiRouter.post("/updateExplanation",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.updateExplanation);
  41. apiRouter.post("/updateRuleText",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.updateRuleText);
  42. apiRouter.post("/updateSituation",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.updateSituation);
  43. apiRouter.post("/updateAnnoSituation",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.updateAnnoSituation);
  44. apiRouter.post("/getRationItems",rationController.auth, rationController.init, rationController.getRationItemsBySection);
  45. apiRouter.post("/mixUpdateRationItems",rationController.auth, rationController.init, rationController.mixUpdateRationItems);
  46. apiRouter.post("/updateRationBasePrc",rationController.auth, rationController.init, rationController.updateRationBasePrc);
  47. apiRouter.post("/getRationGljIds",rationController.auth, rationController.init, rationController.getRationGljIds);
  48. apiRouter.post("/getRationsCodes",rationController.auth, rationController.init, rationController.getRationsCodes);
  49. apiRouter.post("/updateJobContent",rationController.auth, rationController.init, rationController.updateJobContent);
  50. apiRouter.post("/updateAnnotation",rationController.auth, rationController.init, rationController.updateAnnotation);
  51. apiRouter.post("/createNewGljTypeNode",repositoryGljController.auth, gljController.init, gljController.createNewGljTypeNode);
  52. apiRouter.post("/updateGljNodes",repositoryGljController.auth, gljController.init, gljController.updateGljNodes);
  53. apiRouter.post("/deleteGljNodes",repositoryGljController.auth, gljController.init, gljController.deleteGljNodes);
  54. apiRouter.post("/getGljDistType",repositoryGljController.auth, gljController.init, gljController.getGljDistType);
  55. apiRouter.post("/getGljTree",repositoryGljController.auth, gljController.init, gljController.getGljTree);
  56. apiRouter.post("/getGljItems",repositoryGljController.auth, gljController.init, gljController.getGljItems);
  57. apiRouter.post("/mixUpdateGljItems",repositoryGljController.auth, gljController.init, gljController.mixUpdateGljItems);
  58. apiRouter.post("/getGljItemsByIds",repositoryGljController.auth, gljController.init, gljController.getGljItemsByIds);
  59. apiRouter.post("/getGljItemsByCodes",repositoryGljController.auth, gljController.init, gljController.getGljItemsByCodes);
  60. apiRouter.post("/getCoeList",coeListController.auth, coeListController.init, coeListController.getCoeList);
  61. apiRouter.post("/saveCoeList",coeListController.auth, coeListController.init, coeListController.saveCoeList);
  62. apiRouter.post("/getCoeItemsByIDs",coeListController.auth, coeListController.init, coeListController.getCoeItemsByIDs);
  63. apiRouter.post("/getCoeItemsByNos",coeListController.auth, coeListController.init, coeListController.getCoeItemsByNos);
  64. apiRouter.post('/getRationItem',searchController.auth, searchController.init, searchController.getRationItem);
  65. apiRouter.post('/findRation', searchController.auth, searchController.init, searchController.findRation);
  66. // 导入导出定额库相关
  67. apiRouter.post('/upload', rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.uploadSourceData);
  68. app.use("/rationRepository/api",apiRouter);
  69. }