Program.cs 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. using OASystem.Domain.Entities.Groups;
  2. using OASystem.Domain.Entities.PersonnelModule;
  3. using OASystem.Domain.Entities.Resource;
  4. using OASystem.Domain.Entities.System;
  5. using SqlSugar;
  6. var db = new SqlSugarClient(new ConnectionConfig()
  7. {
  8. ConnectionString = "server=132.232.92.186;uid=sa;pwd=Yjx@158291;database=OA2023DB;",
  9. DbType = DbType.SqlServer,
  10. IsAutoCloseConnection = true,
  11. InitKeyType = InitKeyType.Attribute
  12. });
  13. #region Aop
  14. //db.Aop.OnLogExecuting = (sql, pars) =>
  15. //{
  16. // Console.WriteLine(sql + "" + Db.Utilities.SerializeObject
  17. // (pars.ToDictionary(it => it.ParameterName, it => it.Value)));
  18. // Console.WriteLine();
  19. //};
  20. #endregion
  21. #region 对话框
  22. Console.WriteLine("是否确定同步数据库表结构?(同名数据表将会被备份,生产环境慎用,回车确认)");
  23. var str = Console.ReadKey();
  24. if (str.Key == ConsoleKey.Enter)
  25. {
  26. Console.WriteLine("同步中,请稍后...");
  27. }
  28. else
  29. {
  30. Console.WriteLine("\r\n输入错误,已退出...");
  31. return;
  32. }
  33. #endregion
  34. //同步数据表结构
  35. db.DbMaintenance.CreateDatabase();
  36. db.CodeFirst.SetStringDefaultLength(50).BackupTable().InitTables(new Type[]
  37. {
  38. //typeof(Sys_PageFunctionPermission)
  39. //,typeof(Sys_SystemMenuAndFunction)
  40. //,typeof(Sys_SystemMenuPermission)
  41. //,typeof(Sys_JobPostAuthority)
  42. //,typeof(Sys_UserAuthority)
  43. //typeof(Crm_CustomerCert),
  44. //typeof(Crm_CustomerCompany),
  45. //typeof(Crm_CustomerFile),
  46. //typeof(Crm_DeleClient)
  47. //typeof(Crm_VisaCustomerCompany),
  48. //typeof(Crm_VisaCustomerFamily),
  49. //typeof(Crm_VisaCustomerSchool)
  50. //typeof(Grp_AirInquiry),
  51. //typeof(Grp_AirPrice),
  52. //typeof(Grp_CreditCardPayment),
  53. //typeof(Grp_DeleFile),
  54. //typeof(Grp_DelegationInfo),
  55. //typeof(Grp_DelegationJoinCustomer),
  56. //typeof(Grp_DeleMeetingNeeds),
  57. //typeof(Grp_HotelReservations),
  58. //typeof(Grp_VisaProgress),
  59. //typeof(Grp_DeleClientNeeds),
  60. //typeof(Res_AirCompany),
  61. //typeof(Res_AirTicketAgent),
  62. //typeof(Res_HotelData),
  63. //typeof(Res_ThreeCode)
  64. //typeof(Res_ScenicSpotInfo),
  65. //typeof(Res_CarGuides),
  66. //typeof(Res_CarInfo),
  67. //typeof(Res_GuidesInfo)
  68. //typeof(Res_CarData),
  69. //typeof(Res_LocalGuideData)
  70. //typeof(Grp_ScheduleInfo),
  71. //typeof(Grp_ScheduleDetailInfo),
  72. //typeof(Grp_SchedulePersonInfo)
  73. //typeof(Sys_Message),
  74. //typeof(Sys_MessageReadAuth)
  75. //typeof(Crm_DeleClient)
  76. //typeof(Crm_NewClientData)
  77. //typeof(Crm_ClientDataAndUser),
  78. //typeof(Crm_ClientDataAndBusiness),
  79. //typeof(Res_ItemDetailInfo),
  80. //typeof(Res_ItemVendor)
  81. //typeof(Res_ItemTypeInfo)
  82. //typeof(Bus_ConfItemInfo)
  83. //typeof(Bus_ConfItemListInfo)
  84. //typeof(Res_CountryFeeCost)
  85. //typeof(Res_MemoInfo),
  86. //typeof(Fin_DailyFeePayment), // 财务 - 日付申请
  87. //typeof(Fin_DailyFeePaymentContent),// 财务 - 日付申请详细类
  88. //typeof(Grp_GroupsTaskAssignment),
  89. //typeof(Grp_AirTicketReservations),
  90. //typeof(Grp_GroupCostParameter),
  91. //typeof(Grp_TeamRate), // 团组汇率
  92. //typeof(Fin_ForeignReceivables), // 对外收款账单
  93. //typeof(Fin_ProceedsReceived), // 已收款项
  94. //typeof(Fin_OtherPrice), // 其他款项
  95. //typeof(Res_OfficialActivities) //公务出访
  96. //typeof(Res_AskData),//请示数据库
  97. //typeof(Grp_DelegationEnData),
  98. //typeof(Grp_EnterExitCost),
  99. //typeof(Grp_DayAndCost),
  100. //typeof(Grp_NationalTravelFee),
  101. //typeof(Air_TicketBlackCode),
  102. //typeof(Pm_WageSheet) //人事模块 工资表单
  103. //typeof(Grp_VisaProgressCustomer),
  104. //typeof(Grp_VisaProgressCustomerPicture)
  105. //typeof(Grp_CheckBoxs) //成本选中
  106. //typeof(Grp_GroupCost) //成本数据信息
  107. //typeof(Grp_CostTypeHotelNumber)//分段房间数量
  108. //typeof(Grp_VisaInfo)
  109. //typeof(Grp_CarTouristGuideGroundReservations),
  110. //typeof(Grp_CarTouristGuideGroundReservationsContent),//
  111. //typeof(Fin_PaymentRefundAndOtherMoney),
  112. //typeof(Grp_InsuranceCost),
  113. //typeof(Grp_TourClientList), //接团客户名单
  114. //typeof(Dis_Intercontinental), //洲
  115. //typeof(Dis_Country), //国家
  116. //typeof(Dis_City), //城市
  117. //typeof(Fin_GroupExtraCost), //超支费用
  118. //typeof(Pm_TaskAllocation), //任务分配
  119. //typeof(Pm_TaskRelevanceUser), //任务分配关联人员(完成者)
  120. //typeof(Pm_TaskJobRelevancy), //任务分配关联人员(完成者)
  121. //typeof(Crm_TableOperationRecord), //表操作记录
  122. //typeof(Grp_InvertedList), //倒推表
  123. //typeof(Grp_InvertedListVisaCountry), //倒推表签证国家
  124. //typeof(Grp_VisaFeeInfo), //签证费用info
  125. //typeof(Grp_HotelInquiry), //酒店询价
  126. //typeof(Grp_HotelReservationsContent), //酒店费用子表
  127. //typeof(Grp_VisitingClients), //拜访团组客户
  128. //typeof(Grp_ApprovalTravelDetails), //公务出访表
  129. //typeof(Sys_Countries), //洲
  130. //typeof(Sys_Continent), //国家
  131. //typeof(Sys_Cities), //城市
  132. //typeof(Grp_GroupModelFile),//团组文件
  133. //typeof(Grp_VisaCommission),//签证费用录入
  134. //typeof(Pm_GoodsReceive),//物品领用表
  135. //typeof(Pm_GoodsStorage),//物品入库表
  136. //typeof(Pm_GoodsInfo),//物品详细表
  137. //typeof(Grp_Opinionaire),//团组接待意见调查
  138. //typeof(Sys_ExchangeRateRecord),//团组接待意见调查
  139. //typeof(Res_TranslatorLibrary),//翻译人员库
  140. //typeof(Grp_OfficialDutyLinkTranslator),//公务信息关联翻译人员
  141. //typeof(Sys_DeviceToken),
  142. //typeof(Res_MediaSuppliers),//策划部供应商资料
  143. //typeof(Res_BasicInsuranceCost)//保险国家基础费用
  144. //typeof(Grp_EnterExitCostPermission),//团组 - 出入境费用 --> 操作权限
  145. //typeof(Grp_EnterExitCostDraftPermission)//团组 - 出入境费用 --> 操作权限-草稿
  146. typeof(Grp_RestaurantInfo)
  147. });
  148. Console.WriteLine("数据库结构同步完成!");