Program.cs 7.4 KB

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