projects.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * Created by Zhong on 2018/3/22.
  3. */
  4. /*项目*/
  5. const mongoose = require('mongoose');
  6. const Schema = mongoose.Schema;
  7. const deleteSchema = require('../all_schemas/delete_schema');
  8. const collectionName = 'projects';
  9. const shareSchema = new Schema({
  10. userID: String, //userID
  11. allowCopy: {type: Boolean, default: false},
  12. allowCooperate: {type: Boolean, default: false},
  13. shareDate: String,
  14. }, {versionKey: false, _id: false});
  15. const ProjectSchema = new Schema({
  16. "isTwoLevel": { type: Boolean, default: false },
  17. "ID": {type: Number, index: true},
  18. "ParentID": Number,
  19. "NextSiblingID": Number,
  20. "userID": {type:String,index: true},
  21. "importedByInterface": {type: Boolean, default: false},
  22. "code": {type: String, default: ''},
  23. chapterCode: String,
  24. sectionCode: String,
  25. unit: String,
  26. "name": String,
  27. "projType": String,
  28. "recentDateTime": Date,
  29. "createDateTime": Date,
  30. "compilation": String,
  31. "deleteInfo": deleteSchema,
  32. 'fullFolder': Array,
  33. //"shareInfo": [shareSchema],
  34. "property": {
  35. type: Schema.Types.Mixed,
  36. default: {}
  37. },
  38. "summaryFees":{
  39. totalFee: String,
  40. estimateFee: String,
  41. safetyFee: String,
  42. chargeFee: String
  43. },
  44. "changeMark":String,// 更新标记 feeRate:费率文件发生了改变,unitFile 单件文件发生了改变
  45. "remark":String, // 备注
  46. "fileVer": String, // 创建时程序版本号
  47. "lastFileVer": String, // 最新打开并计算时的程序版本号
  48. "compareID":Number
  49. });
  50. mongoose.model(collectionName, ProjectSchema, collectionName);