|  | @@ -31,6 +31,8 @@ import economicFacade from "../../economic_lib/facade/economic_facade";
 | 
	
		
			
				|  |  |  import overHeightFacade from "../../over_height_lib/facade/over_height_facade";
 | 
	
		
			
				|  |  |  import progressiveFacade from "../../progressive_interval_lib/facade/progressive_facade";
 | 
	
		
			
				|  |  |  import {default as category, List as categoryList} from "../../common/const/category_const.js";
 | 
	
		
			
				|  |  | +import locationList from  "../../common/const/locationList";
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  let config = require("../../../config/config.js");
 | 
	
		
			
				|  |  |  const fs = require('fs');
 | 
	
		
			
				|  |  |  let _ = require('lodash');
 | 
	
	
		
			
				|  | @@ -76,6 +78,7 @@ class CompilationController extends BaseController {
 | 
	
		
			
				|  |  |              id: id,
 | 
	
		
			
				|  |  |              compilationList: compilationList,
 | 
	
		
			
				|  |  |              categoryList: categoryList,
 | 
	
		
			
				|  |  | +            locationList:locationList,
 | 
	
		
			
				|  |  |              selectedCompilation: selectedCompilation,
 | 
	
		
			
				|  |  |              layout: 'users/views/layout/layout',
 | 
	
		
			
				|  |  |              LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
 | 
	
	
		
			
				|  | @@ -801,6 +804,54 @@ class CompilationController extends BaseController {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +     /**
 | 
	
		
			
				|  |  | +     * 更改编办默认工程所在工
 | 
	
		
			
				|  |  | +     *
 | 
	
		
			
				|  |  | +     * @param request
 | 
	
		
			
				|  |  | +     * @param response
 | 
	
		
			
				|  |  | +     * @return {Promise.<void>}
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +      async changeLocation(request, response) {
 | 
	
		
			
				|  |  | +        let compilationId = request.body.id;
 | 
	
		
			
				|  |  | +        let location = request.body.location;
 | 
	
		
			
				|  |  | +        try {
 | 
	
		
			
				|  |  | +            let compilationModel = new CompilationModel();
 | 
	
		
			
				|  |  | +            let result = await compilationModel.updateLocation(compilationId, location);
 | 
	
		
			
				|  |  | +            if (result) {
 | 
	
		
			
				|  |  | +                response.json({error: 0, message: '', data: null});
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  | +                response.json({error: 1, message: '更新数据错误', data: null});
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        } catch(error) {
 | 
	
		
			
				|  |  | +            response.json({error: 1, message: '更新数据错误', data: null});
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +     /**
 | 
	
		
			
				|  |  | +     * 更改编办默认工程所在工
 | 
	
		
			
				|  |  | +     *
 | 
	
		
			
				|  |  | +     * @param request
 | 
	
		
			
				|  |  | +     * @param response
 | 
	
		
			
				|  |  | +     * @return {Promise.<void>}
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +      async changeFreeUse(request, response) {
 | 
	
		
			
				|  |  | +        let compilationId = request.body.id;
 | 
	
		
			
				|  |  | +        let freeUse = request.body.freeUse;
 | 
	
		
			
				|  |  | +        try {
 | 
	
		
			
				|  |  | +            let compilationModel = new CompilationModel();
 | 
	
		
			
				|  |  | +            let result = await compilationModel.updateFreeUse(compilationId, freeUse);
 | 
	
		
			
				|  |  | +            if (result) {
 | 
	
		
			
				|  |  | +                response.json({error: 0, message: '', data: null});
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  | +                response.json({error: 1, message: '更新数据错误', data: null});
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        } catch(error) {
 | 
	
		
			
				|  |  | +            response.json({error: 1, message: '更新数据错误', data: null});
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  export default CompilationController;
 |