projects.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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": { type: Number, index: true},
  19. "NextSiblingID": Number,
  20. "userID": {type:String,index: true},
  21. "importedByInterface": {type: Boolean, default: false},
  22. "code": {type: String, default: ''},
  23. "name": String,
  24. "projType": String,
  25. "recentDateTime": Date,
  26. "createDateTime": Date,
  27. "compilation": String,
  28. "deleteInfo": deleteSchema,
  29. 'fullFolder': Array,
  30. //"shareInfo": [shareSchema],
  31. "property": {
  32. type: Schema.Types.Mixed,
  33. default: {}
  34. },
  35. "summaryFees":{
  36. totalFee: String,
  37. estimateFee: String,
  38. safetyFee: String,
  39. chargeFee: String
  40. },
  41. "changeMark":String,// 更新标记 feeRate:费率文件发生了改变,unitFile 单件文件发生了改变
  42. "remark":String, // 备注
  43. "fileVer": String, // 创建时程序版本号
  44. "lastFileVer": String, // 最新打开并计算时的程序版本号
  45. "compareID":Number
  46. });
  47. mongoose.model(collectionName, ProjectSchema, collectionName);