| 
					
				 | 
			
			
				@@ -8,100 +8,107 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // import mongoose from "mongoose"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 let mongoose = require("mongoose"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 let Schema = mongoose.Schema; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-let collectionName = 'compilation'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-let childrenSchema = new Schema({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    id:String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+let collectionName = "compilation"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+let childrenSchema = new Schema( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    id: String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 计价名称 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     name: String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 是否启用 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     enable: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        type: Boolean, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        default: false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      type: Boolean, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      default: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     type: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        type: Number 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      type: Number, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    fileTypes:[Number]//创建项目时可用文件类型 估算,概算,预算 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-},{_id: false}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    fileTypes: [Number], //创建项目时可用文件类型 估算,概算,预算 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  { _id: false } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 let modelSchema = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // 是否发布 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    is_release: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        type: Boolean, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        default: false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // 自增id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    id: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        type: Number 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // 建议估算 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    suggestion_valuation: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        type: [childrenSchema], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        default: [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // 可行性估算 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    feasibility_valuation: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        type: [childrenSchema], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        default: [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // 概算 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    rough_valuation: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        type: [childrenSchema], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        default: [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // 预算 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    bill_valuation: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        type: [childrenSchema], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        default: [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // 工程量清单 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    ration_valuation: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        type: [childrenSchema], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        default: [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //估算 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    estimation_valuation: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        type: [childrenSchema], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        default: [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // 名称 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    name: String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // 创建时间 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    create_time: Number, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // 创建者id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    creator: String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //描述 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    description: String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //代码覆盖路径 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    overWriteUrl:String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //例题建设项目ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    example: Array, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // 版本号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    edition: String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // 序号(用于排序) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    serialNumber: Number, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // 发布时间 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    release_time: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        type: Number, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        default: 0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //价格属性 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    priceProperties: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        type: Array, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        default: [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //消耗量属性 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    consumeAmtProperties: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        type: Array, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        default: [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // cld 办事处id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    categoryID: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        type: Number, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        default: 12 // 总部id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    defaultLocation:String,//默认工程所在地 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    type:String,//编办类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    freeUse:Boolean 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // 是否发布 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  is_release: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    type: Boolean, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    default: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // 自增id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  id: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    type: Number, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // 建议估算 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  suggestion_valuation: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    type: [childrenSchema], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    default: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // 可行性估算 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  feasibility_valuation: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    type: [childrenSchema], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    default: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // 概算 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  rough_valuation: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    type: [childrenSchema], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    default: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // 预算 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  bill_valuation: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    type: [childrenSchema], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    default: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // 工程量清单 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  ration_valuation: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    type: [childrenSchema], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    default: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  //估算 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  estimation_valuation: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    type: [childrenSchema], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    default: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // 名称 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  name: String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // 创建时间 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  create_time: Number, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // 创建者id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  creator: String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  //描述 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  description: String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  //代码覆盖路径 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  overWriteUrl: String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  //例题建设项目ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  example: Array, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // 版本号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  edition: String, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // 序号(用于排序) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  serialNumber: Number, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // 发布时间 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  release_time: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    type: Number, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    default: 0, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  //价格属性 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  priceProperties: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    type: Array, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    default: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  //消耗量属性 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  consumeAmtProperties: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    type: Array, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    default: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // cld 办事处id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  categoryID: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    type: Number, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    default: 12, // 总部id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  defaultLocation: String, //默认工程所在地 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  type: String, //编办类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  freeUse: Boolean, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  customMade: Boolean, // 定制编办 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false, collection: collectionName})); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+mongoose.model( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  collectionName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  new Schema(modelSchema, { versionKey: false, collection: collectionName }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+); 
			 |