123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- /**
- * Created by Tony on 2017/4/20.
- */
- var express = require("express");
- var apiRouter =express.Router();
- //var _rootDir = __dirname;
- import ViewsController from "../controllers/repository_views_controller";
- import RationRepositoryController from "../controllers/ration_repository_controller";
- import RationChapterTreeController from "../controllers/ration_section_tree_controller";
- import RationController from "../controllers/ration_controller";
- import RepositoryGljController from "../controllers/repository_glj_controller";
- import CoeListController from "../controllers/coe_controller";
- import SearchController from "../controllers/search_controller";
- let viewsController = new ViewsController();
- let rationRepositoryController = new RationRepositoryController();
- let rationChapterTreeController = new RationChapterTreeController();
- let rationController = new RationController();
- let coeListController = new CoeListController();
- let searchController = new SearchController();
- let repositoryGljController = new RepositoryGljController();
- /*
- var rationRepositoryController = require("../controllers/ration_repository_controller");
- var rationChapterTreeController = require("../controllers/ration_section_tree_controller");
- var rationController = require("../controllers/ration_controller");
- var repositoryGljController = require("../controllers/repository_glj_controller");
- var coeListController = require("../controllers/coe_controller");
- var searchController = require('../controllers/search_controller');
- */
- module.exports = function (app) {
- app.get('/rationRepository/main', viewsController.auth, viewsController.init, viewsController.redirectMain);
- app.get('/rationRepository/ration',viewsController.auth, viewsController.init, viewsController.redirectRation);
- app.get('/rationRepository/lmm', viewsController.auth, viewsController.init, viewsController.redirectGlj);
- app.get('/rationRepository/coeList', viewsController.auth, viewsController.init, viewsController.redirectCoeList);
- apiRouter.post("/getCompilationList", rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.getCompilationList);
- apiRouter.post("/getRationDisplayNames",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.getDisPlayRationLibs);
- apiRouter.post("/editRationLibs",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.updateRationRepositoryName);
- apiRouter.post("/addRationRepository",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.addRationRepository);
- apiRouter.post("/deleteRationLibs",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.deleteRationLib);
- apiRouter.post("/getRealLibName",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.getRealLibName);
- apiRouter.post("/getLibIDByName",rationRepositoryController.auth, rationRepositoryController.init, rationRepositoryController.getLibIDByName);
- apiRouter.post("/getRationTree",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.getRationChapterTree);
- apiRouter.post("/createNewNode",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.createNewNode);
- apiRouter.post("/updateNodes",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.updateNodes);
- apiRouter.post("/deleteNodes",rationChapterTreeController.auth, rationChapterTreeController.init, rationChapterTreeController.deleteNodes);
- apiRouter.post("/getRationItems",rationController.auth, rationController.init, rationController.getRationItemsBySection);
- apiRouter.post("/mixUpdateRationItems",rationController.auth, rationController.init, rationController.mixUpdateRationItems);
- apiRouter.post("/updateRationBasePrc",rationController.auth, rationController.init, rationController.updateRationBasePrc);
- apiRouter.post("/getRationGljIds",rationController.auth, rationController.init, rationController.getRationGljIds);
- apiRouter.post("/getRationsCodes",rationController.auth, rationController.init, rationController.getRationsCodes);
- apiRouter.post("/createNewGljTypeNode",repositoryGljController.auth, repositoryGljController.init, repositoryGljController.createNewGljTypeNode);
- apiRouter.post("/updateGljNodes",repositoryGljController.auth, repositoryGljController.init, repositoryGljController.updateGljNodes);
- apiRouter.post("/deleteGljNodes",repositoryGljController.auth, repositoryGljController.init, repositoryGljController.deleteGljNodes);
- apiRouter.post("/getGljDistType",repositoryGljController.auth, repositoryGljController.init, repositoryGljController.getGljDistType);
- apiRouter.post("/getGljTree",repositoryGljController.auth, repositoryGljController.init, repositoryGljController.getGljTree);
- apiRouter.post("/getGljItems",repositoryGljController.auth, repositoryGljController.init, repositoryGljController.getGljItems);
- apiRouter.post("/mixUpdateGljItems",repositoryGljController.auth, repositoryGljController.init, repositoryGljController.mixUpdateGljItems);
- apiRouter.post("/getGljItemsByIds",repositoryGljController.auth, repositoryGljController.init, repositoryGljController.getGljItemsByIds);
- apiRouter.post("/getGljItemsByCodes",repositoryGljController.auth, repositoryGljController.init, repositoryGljController.getGljItemsByCodes);
- apiRouter.post("/getCoeList",coeListController.auth, coeListController.init, coeListController.getCoeList);
- apiRouter.post("/saveCoeList",coeListController.auth, coeListController.init, coeListController.saveCoeList);
- apiRouter.post("/getCoeItemsByIDs",coeListController.auth, coeListController.init, coeListController.getCoeItemsByIDs);
- apiRouter.post('/getRationItem',searchController.auth, searchController.init, searchController.getRationItem);
- apiRouter.post('/findRation', searchController.auth, searchController.init, searchController.findRation);
- app.use("/rationRepository/api",apiRouter);
- }
- /*module.exports = function (app) {
- app.get('/rationRepository/main', function(req, res) {
- res.render('maintain/ration_repository/main.html',
- {
- userAccount: req.session.userAccount,
- userID: req.session.userID
- });
- });
- app.get('/rationRepository/ration', function(req, res) {
- res.render('maintain/ration_repository/dinge.html',
- {
- userAccount: req.session.userAccount,
- userID: req.session.userID
- });
- });
- app.get('/rationRepository/lmm', function(req, res) {
- res.render('maintain/ration_repository/gongliao.html',
- {
- userAccount: req.session.userAccount,
- userID: req.session.userID
- });
- });
- app.get('/rationRepository/coeList', function(req, res) {
- res.render('maintain/ration_repository/fuzhu.html',
- {
- userAccount: req.session.userAccount,
- userID: req.session.userID
- });
- });
- apiRouter.post("/getRationDisplayNames",rationRepositoryController.getDisPlayRationLibs);
- apiRouter.post("/editRationLibs",rationRepositoryController.updateRationRepositoryName);
- apiRouter.post("/addRationRepository",rationRepositoryController.addRationRepository);
- apiRouter.post("/deleteRationLibs",rationRepositoryController.deleteRationLib);
- apiRouter.post("/getRealLibName",rationRepositoryController.getRealLibName);
- apiRouter.post("/getLibIDByName",rationRepositoryController.getLibIDByName);
- apiRouter.post("/getRationTree",rationChapterTreeController.getRationChapterTree);
- apiRouter.post("/createNewNode",rationChapterTreeController.createNewNode);
- apiRouter.post("/updateNodes",rationChapterTreeController.updateNodes);
- apiRouter.post("/deleteNodes",rationChapterTreeController.deleteNodes);
- apiRouter.post("/getRationItems",rationController.getRationItemsBySection);
- apiRouter.post("/mixUpdateRationItems",rationController.mixUpdateRationItems);
- apiRouter.post("/updateRationBasePrc",rationController.updateRationBasePrc);
- apiRouter.post("/getRationGljIds",rationController.getRationGljIds);
- apiRouter.post("/getRationsCodes",rationController.getRationsCodes);
- apiRouter.post("/createNewGljTypeNode",repositoryGljController.createNewGljTypeNode);
- apiRouter.post("/updateGljNodes",repositoryGljController.updateGljNodes);
- apiRouter.post("/deleteGljNodes",repositoryGljController.deleteGljNodes);
- apiRouter.post("/getGljDistType",repositoryGljController.getGljDistType);
- apiRouter.post("/getGljTree",repositoryGljController.getGljTree);
- apiRouter.post("/getGljItems",repositoryGljController.getGljItems);
- apiRouter.post("/mixUpdateGljItems",repositoryGljController.mixUpdateGljItems);
- apiRouter.post("/getGljItemsByIds",repositoryGljController.getGljItemsByIds);
- apiRouter.post("/getGljItemsByCodes",repositoryGljController.getGljItemsByCodes);
- apiRouter.post("/getCoeList",coeListController.getCoeList);
- apiRouter.post("/saveCoeList",coeListController.saveCoeList);
- apiRouter.post("/getCoeItemsByIDs",coeListController.getCoeItemsByIDs);
- apiRouter.post('/getRationItem', searchController.getRationItem);
- apiRouter.post('/findRation', searchController.findRation);
- app.use("/rationRepository/api",apiRouter);
- }*/
|