You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

953 lines
28 KiB
C#

using DSWeb.Common.DbContexts.Model;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Linq;
using System.Web;
namespace DSWeb.Common.DB
{
public class CommonDataContext : DbContext
{
public CommonDataContext() : base("DongShengDB")
{
Database.SetInitializer<CommonDataContext>(null);
}
public CommonDataContext(string conn) : base(conn)
{
Database.SetInitializer<CommonDataContext>(null);
}
public DbSet<MailSend> MailSend { get; set; }
public DbSet<MailSendSmtp> MailSendSmtp { get; set; }
public DbSet<MailSendTemplate> MailSendTemplates { get; set; }
public DbSet<MpConfigInfo> MpConfigs { get; set; }
public DbSet<MpConfigTemplate> MpConfigTemplates { get; set; }
public DbSet<MpConfigUser> MpConfigUsers { get; set; }
public DbSet<ParamSet> ParamSets { get; set; }
public DbSet<ContactPerson> ContactPersons { get; set; }
public DbSet<ConfigData> ConfigDatas { get; set; }
public DbSet<SysEnumValueEF> SysEnumValues { get; set; }
public DbSet<SysOpLog> SysOpLogs { get; set; }
public DbSet<SysOpRecord> SysOpRecords { get; set; }
public DbSet<User> Users { get; set; }
public DbSet<UserBaseinfo> UserBases { get; set; }
public DbSet<CompanyNew> CompanyNew { get; set; }
public DbSet<SysAccountConfig> AccountConfigs { get; set; }
public DbSet<InfoClient> InfoClients { get; set; }
public DbSet<INFO_CLIENT_CONTACT> InfoClientContacts { get; set; }
public DbSet<CodeLoadport> Loadports { get; set; }
public DbSet<CodeDisport> Disports { get; set; }
public DbSet<CodeVessel> Vessels { get; set; }
public DbSet<CodeVoyno> Voynos { get; set; }
public DbSet<CodeCtn> Ctns { get; set; }
public DbSet<CodeIssutype> Issutypes { get; set; }
public DbSet<CodeFrt> Frts { get; set; }
public DbSet<CodePackage> Packages { get; set; }
public DbSet<CodeService> Services { get; set; }
public DbSet<SysPrintInfo> SysPrintInfos { get; set; }
public DbSet<OpSeaeMbT> OpSeaeMbT { get; set; }
//public DbSet<InvoiceBuyer> InvoiceBuyer { get; set; }
//public DbSet<OP_SEAE_CLIENT> OPSEAEClients { get; set; }
public DbSet<CodeFtpset> FtpSet { get; set; }
public DbSet<CodeYardDataSet> YardDataSet { get; set; }
/// <summary>
/// 子系统网关配置
/// </summary>
public DbSet<SysGateway> SysGateway { get; set; }
#region edi相关
public DbSet<CodeCtnEdi> CodeCtnEdi { get; set; }
public DbSet<CodeCustEdi> CodeCustEdi { get; set; }
public DbSet<CodePkgsEdi> CodePkgsEdi { get; set; }
public DbSet<CodeServiceEdi> CodeServiceEdi { get; set; }
public DbSet<CodeVesselEdi> CodeVesselEdi { get; set; }
public DbSet<CodeDisportEdi> CodeDisportEdi { get; set; }
#endregion
//航线
public DbSet<CodeLanes> CodeLanes { get; set; }
#region 权限相关
public DbSet<UserAuthorityInfo> UserAuthorityInfo { get; set; }
public DbSet<UserAuthorityRange> UserAuthorityRanges { get; set; }
public DbSet<UserAction> user_action { get; set; }
public DbSet<action> action { get; set; }
#endregion
public DbSet<BackgroundTaskFtp> BackgroundTaskFtp { get; set; }
public DbSet<BackgroundTaskCommon> BackgroundTaskCommon { get; set; }
public DbSet<CodeBaoguanOutputCountry> CodeBaoguanOutputCountry { get; set; }
public DbSet<CodeBaoguanOutputPort> CodeBaoguanOutputPort { get; set; }
//公司参数
public DbSet<CompanyNewParamValue> ParamValues { get; set; }
public void SetValue(Object newObj, Object srcObj, bool dosave = false)
{
var t1s = srcObj.GetType().GetProperties();
var t2s = newObj.GetType().GetProperties();
foreach (var p in t1s)
{
foreach (var q in t2s)
{
if (q.Name == p.Name)
{// 这里有可能需要对属性的类型和值做一些判断和转换,大家自己根据自己的业务添加处理,估计不会很多
q.SetValue(newObj, p.GetValue(srcObj), null);
}
}
}
if (dosave)
SaveChanges();
}
public DbSet<CUST_AUTH> CUST_AUTH { get; set; }
public DbSet<User_Account> User_Account { get; set; }
public DbSet<User_Account_Detail> User_Account_Detail { get; set; }
public DbSet<TSysCountryCode> syscountrycode { get; set; }
}
[Table("tb_sys_Dictionary")]
public class Tb_SysDictionary
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long ID { get; set; }
public string Gid { get; set; }
/// <summary>
/// 排序
/// </summary>
public int IndexInt { get; set; }
/// <summary>
/// 分组 系统的sys
/// </summary>
public string GroupName { get; set; }
/// <summary>
/// 分组中的子键值
/// </summary>
public string Key { get; set; }
/// <summary>
/// 名称名字
/// </summary>
public string Title { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Memo { get; set; }
/// <summary>
/// 创建时间戳
/// </summary>
public long AddTime { get; set; }
/// <summary>
/// 状态 1 -100
/// </summary>
public short Status { get; set; }
}
[Table("tb_SysGateway")]
public class SysGateway
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long ID { get; set; }
public string Gid { get; set; }
/// <summary>
///子系统Key
/// </summary>
public string SysKey { get; set; }
/// <summary>
/// 子系统URl格式化模版
/// </summary>
public string Url { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Memo { get; set; }
public DateTime CreateTime { get; set; }
public short Status { get; set; }
}
[Table("Sys_OpRecord")]
public class SysOpRecord
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int ID { get; set; }
public string ModuleId { get; set; }
public string CateId { get; set; }
public DateTime OpTime { get; set; }
public string UserId { get; set; }
public string UserName { get; set; }
public string CompId { get; set; }
public string CompName { get; set; }
public string ReqAddr { get; set; }
public string ReqParam { get; set; }
public string RespData { get; set; }
public string IpAddr { get; set; }
public string WebBrowser { get; set; }
public string RelativeId { get; set; }
}
[Table("Sys_PrintInfo")]
public class SysPrintInfo
{
[Key]
public string GID { get; set; }
public string MODNAME { get; set; }
public string PRINTNAME { get; set; }
public string URL { get; set; }
public DateTime MODIFIEDTIME { get; set; }
public string CRC { get; set; }
}
#region code_开头系列
[Table("code_ctn")]
public class CodeCtn
{
[Key]
public string CTNID { get; set; }
public string CTNSIZE { get; set; }
public string CTNTYPE { get; set; }
public string CTN { get; set; }
public string EDICODE { get; set; }
public decimal? CTNWEIGHT { get; set; }
public string EEXPLAIN { get; set; }
public string CEXPLAIN { get; set; }
public string AFRCODE { get; set; }
public decimal? TEU { get; set; }
public decimal? DLIKGS { get; set; }
public string COSCO { get; set; }
public string EDICODE2 { get; set; }
public string EDICODE3 { get; set; }
public string EDICODE4 { get; set; }
public string CMACTN { get; set; }
public string CARGOSMARTCTN { get; set; }
}
/// <summary>
/// 付费方式
/// </summary>
[Table("code_frt")]
public class CodeFrt
{
[Key]
public string FEID { get; set; }
public string FRT { get; set; }
public string FRTCNAME { get; set; }
public string EDICODE { get; set; }
public string EDICODE_INTTRA_WEB { get; set; }
}
[Table("code_goods_inv")]
public class CodeGoodsInv
{
[Key]
public string GID { get; set; }
public string GOODCODE { get; set; }
public string GOODNAME { get; set; }
public string SPEC { get; set; }
public string UNIT { get; set; }
public string DESCRIP { get; set; }
public decimal? TAXRATE { get; set; }
public string TAXNO { get; set; }
public string TAXCLASS { get; set; }
public string TAXCLASSNAME { get; set; }
public string ISTAXPRICE { get; set; }
public string ISUSEPREF { get; set; }
public string ISDEF { get; set; }
public string ZTAXTYPE { get; set; }
public string DEFREMARK { get; set; }
public bool? ISSTOP { get; set; }
public string GoodsTypeGID { get; set; }
public string DEFCURR { get; set; }
public string CompId { get; set; }
public string CompName { get; set; }
public string CreateUser { get; set; }
public DateTime CreateTime { get; set; }
}
/// <summary>
/// 签单方式
/// </summary>
[Table("code_issutype")]
public class CodeIssutype
{
[Key]
public string GID { get; set; }
public string BLTYPE { get; set; }
}
/// <summary>
/// 包装
/// </summary>
[Table("code_package")]
public class CodePackage
{
[Key]
public string GID { get; set; }
public string PKGS { get; set; }
public string CEXPLAIN { get; set; }
public string EDICODE { get; set; }
public string AFRCODE { get; set; }
public string cosco { get; set; }
}
/// <summary>
/// 运输条款
/// </summary>
[Table("code_service")]
public class CodeService
{
[Key]
public string GID { get; set; }
public string SERVICE { get; set; }
}
[Table("code_vessel")]
public class CodeVessel
{
[Key]
public string VSID { get; set; }
public string VESSEL { get; set; }
public string CNAME { get; set; }
public string CARRIER { get; set; }
public string EDICODE { get; set; }
}
[Table("code_voyno")]
public class CodeVoyno
{
[Key]
public string VOID { get; set; }
public string VSID { get; set; }
public string VOYNO { get; set; }
public string PORTLOAD { get; set; }
public string PORTDISCHARGE { get; set; }
public DateTime? ETD { get; set; }
public DateTime? CLOSINGDATE { get; set; }
public DateTime? ETA { get; set; }
public string CORPID { get; set; }
public string YARDID { get; set; }
public string ENTREPORT { get; set; }
public string VESSEL { get; set; }
public DateTime? ATD { get; set; }
public string VOYNO_FORWARDER { get; set; }
public string FORWARDER { get; set; }
public string CARRIER { get; set; }
public DateTime? CLOSEDOCDATE { get; set; }
public DateTime? CLOSEVGMDATE { get; set; }
}
[Table("code_currency")]
public class CodeCurrency
{
[Key]
public string GID { get; set; }
public string CODENAME { get; set; }
public string NAME { get; set; }
public string DESCRIPTION { get; set; }
public decimal? DEFAULTRATE { get; set; }
public string CREATEUSER { get; set; }
public DateTime? CREATETIME { get; set; }
public string MODIFIEDUSER { get; set; }
public DateTime? MODIFIEDTIME { get; set; }
public string FINANCESOFTCODE { get; set; }
}
[Table("code_goods_inv_template")]
public class CodeGoodsInvTemplate
{
[Key]
public string GID { get; set; }
public string GOODCODE { get; set; }
public string GOODNAME { get; set; }
public string SPEC { get; set; }
public string UNIT { get; set; }
public string DESCRIP { get; set; }
public decimal? TAXRATE { get; set; }
public string TAXNO { get; set; }
public string TAXCLASS { get; set; }
public string TAXCLASSNAME { get; set; }
public string ISTAXPRICE { get; set; }
public string ISUSEPREF { get; set; }
public string ISDEF { get; set; }
public string ZTAXTYPE { get; set; }
public string DEFREMARK { get; set; }
public string TradeType { get; set; }
}
#region edi相关
//集装箱
[Table("code_ctn_edi")]
public class CodeCtnEdi
{
[Key]
public string GID { get; set; }
public string CTN { get; set; }
public string EDICODE { get; set; }
public string EDINAME { get; set; }
public string REMARK { get; set; }
public string CREATEUSER { get; set; }
public DateTime? CREATETIME { get; set; }
}
//往来单位
[Table("code_cust_edi")]
public class CodeCustEdi
{
[Key]
public string GID { get; set; }
public string CUST { get; set; }
public string EDICODE { get; set; }
public string EDINAME { get; set; }
public string REMARK { get; set; }
public string CREATEUSER { get; set; }
public DateTime? CREATETIME { get; set; }
public string PORTSIDE { get; set; }
public string SENDINFO { get; set; }
}
//包装
[Table("code_pkgs_edi")]
public class CodePkgsEdi
{
[Key]
public string GID { get; set; }
public string PKGS { get; set; }
public string EDICODE { get; set; }
public string EDINAME { get; set; }
public string REMARK { get; set; }
public string CREATEUSER { get; set; }
public DateTime? CREATETIME { get; set; }
}
//运输条款
[Table("code_service_edi")]
public class CodeServiceEdi
{
[Key]
public string GID { get; set; }
public string SERVICE { get; set; }
public string EDICODE { get; set; }
public string EDINAME { get; set; }
public string REMARK { get; set; }
public string CREATEUSER { get; set; }
public DateTime? CREATETIME { get; set; }
}
//船名
[Table("code_vessel_edi")]
public class CodeVesselEdi
{
[Key]
public string GID { get; set; }
public string VESSEL { get; set; }
public string EDICODE { get; set; }
public string EDINAME { get; set; }
public string REMARK { get; set; }
public string CREATEUSER { get; set; }
public DateTime? CREATETIME { get; set; }
}
//港口
[Table("code_disport_edi")]
public class CodeDisportEdi
{
[Key]
public string GID { get; set; }
public string PORTDISCHARGE { get; set; }
public string EDICODE { get; set; }
public string EDINAME { get; set; }
public string REMARK { get; set; }
public string CREATEUSER { get; set; }
public DateTime? CREATETIME { get; set; }
public string PORTID { get; set; }
}
#endregion
//ftp设置
[Table("code_ftpset")]
public class CodeFtpset
{
[Key]
public string GID { get; set; }
public string EDINAME { get; set; }
public string SERVERIP { get; set; }
public string FOLDERNAME { get; set; }
public string USERNAME { get; set; }
public string PASSWORD { get; set; }
public string CORPID { get; set; }
public string SENDCODE { get; set; }
public string RECEIVECODE { get; set; }
public string SENDNAME { get; set; }
public string SENDATTN { get; set; }
public string SENDTEL { get; set; }
public string SENDEMAIL { get; set; }
public string SENDCOMPANYCODE { get; set; }
public string SENDSUBCOMPANYCODE { get; set; }
public string CARRIERID { get; set; }
public string RECEIVEEMAIL { get; set; }
public string RECEIVESIEMAIL { get; set; }
public string RECEIVEOP { get; set; }
public string RECEIVESALE { get; set; }
public string RECEIVEDEPT { get; set; }
public string SHIPPERTEL { get; set; }
public string CONSIGNEETEL { get; set; }
public string NOTIFYPARTYTEL { get; set; }
public string ISUSETEL { get; set; }
public string CompId { get; set; }
public string CompName { get; set; }
}
//场站对应
[Table("code_yarddata_set")]
public class CodeYardDataSet
{
[Key]
public string GID { get; set; }
public string YARDCODE { get; set; }
public string YARD { get; set; }
public string LOGINNAME { get; set; }
public string PASSWORD { get; set; }
public string REMARK { get; set; }
public string COMPANYID { get; set; }
public string CREATEUSER { get; set; }
public DateTime? CREATETIME { get; set; }
public string YitongCode { get; set; }
public string YitongName { get; set; }
}
[Table("code_lanes")]
public class CodeLanes
{
[Key]
public string GID { get; set; }
public string LANEID { get; set; }
public string LANE { get; set; }
public string LANEEN { get; set; }
public string EDICODE { get; set; }
public string OP { get; set; }
public string DOC { get; set; }
}
#endregion
/// <summary>
/// 托单收发通模板
/// </summary>
[Table("op_seae_t_mb")]
public class OpSeaeMbT
{
[Key]
public string gid { get; set; }
public string mbname { get; set; }
public string mbtype { get; set; }
public string mbtext { get; set; }
public DateTime? createtime { get; set; }
public string userid { get; set; }
public string CompId { get; set; }
}
#region 权限相关
[Table("user_action")]
public class UserAction
{
[Key]
public string GID { get; set; }
public string ACTIONID { get; set; }
public string USERID { get; set; }
public string CREATEUSER { get; set; }
public DateTime CREATETIME { get; set; }
public string MODIFIEDUSER { get; set; }
public DateTime? MODIFIEDTIME { get; set; }
}
[Table("user_authority_range")]
public class UserAuthorityRange
{
[Key]
public string GID { get; set; }
public string USERID { get; set; }
public string AUTHORITYID { get; set; }
public int? VISIBLERANGE { get; set; }
public int? OPERATERANGE { get; set; }
public string CREATEUSER { get; set; }
public DateTime? CREATETIME { get; set; }
public string MODIFIEDUSER { get; set; }
public DateTime? MODIFIEDTIME { get; set; }
}
[Table("VW_User_Authority")]
public class VUserAuthority
{
[Key]
public string GID { get; set; }
public string USERID { get; set; }
public int VISIBLERANGE { get; set; }
public int OPERATERANGE { get; set; }
public bool? ISDELETE { get; set; }
public string DESCRIPTION { get; set; }
public string NAME { get; set; }
public string MODULEURL { get; set; }
public string AUTHORITYID { get; set; }
public bool? ISALL { get; set; }
public bool? ISCOMPANY { get; set; }
public bool? ISDEPT { get; set; }
public bool? ISPERSON { get; set; }
}
[Table("AuthUserVirtualModule")]
public class AuthUserVirtualModule
{
public const string RangePersonal = "Personal";
public const string RangeAll = "All";
[Key]
public string GId { get; set; }
public string ModuleId { get; set; }
public string UserId { get; set; }
public bool HasAuth { get; set; }
public string RangeViewValue { get; set; }
public string RangeOperateValue { get; set; }
}
[Table("AuthVirtualModule")]
public class AuthVirtualModule
{
[Key]
public string GId { get; set; }
public string ModuleName { get; set; }
public string ParentId { get; set; }
public string ModuleMap { get; set; }
public string RangeMap { get; set; }
public int Sort { get; set; }
}
[Table("user_authority_info")]
public class UserAuthorityInfo
{
[Key]
public string GID { get; set; }
public string NAME { get; set; }
public string DESCRIPTION { get; set; }
public string MODULEURL { get; set; }
public bool? ISALL { get; set; }
public bool? ISCOMPANY { get; set; }
public bool? ISDEPT { get; set; }
public bool? ISPERSON { get; set; }
public string CREATEUSER { get; set; }
public DateTime? CREATETIME { get; set; }
public string MODIFIEDUSER { get; set; }
public DateTime? MODIFIEDTIME { get; set; }
public bool? ISDELETE { get; set; }
}
[Table("action")]
public class action
{
[Key]
[MaxLength(36)]
public string GID { get; set; }
[MaxLength(50)]
public string NAME { get; set; }
[MaxLength(50)]
public string DESCRIPTION { get; set; }
[MaxLength(36)]
public string MODULEID { get; set; }
[MaxLength(36)]
public string CREATEUSER { get; set; }
public DateTime CREATETIME { get; set; }
[MaxLength(36)]
public string MODIFIEDUSER { get; set; }
public DateTime? MODIFIEDTIME { get; set; }
public int? STATE { get; set; }
public int? SORT { get; set; }
}
#endregion
//后台ftp任务
[Table("BackgroundTaskFtp")]
public class BackgroundTaskFtp
{
public BackgroundTaskFtp()
{
Status = StatusCreate;
CreateTime = DateTime.Now;
}
/// <summary>
/// 上传ftp
/// </summary>
public const string TypeFtpUpload = "FtpUpload";
/// <summary>
/// 新建
/// </summary>
public const string StatusCreate = "Create";
/// <summary>
/// 正在执行
/// </summary>
public const string StatusDoing = "Doing";
/// <summary>
/// 执行成功
/// </summary>
public const string StatusSuccess = "Success";
/// <summary>
/// 执行失败
/// </summary>
public const string StatusFail = "Fail";
[Key]
public string GID { get; set; }
public string Type { get; set; }
public string FtpHost { get; set; }
public string FtpUser { get; set; }
public string FtpPassword { get; set; }
public string FtpData { get; set; }
public DateTime CreateTime { get; set; }
public int TryCount { get; set; }
public DateTime? LastDo { get; set; }
public string Status { get; set; }
public string Remark { get; set; }
}
//后台任务(通用)
[Table("BackgroundTaskCommon")]
public class BackgroundTaskCommon
{
/// <summary>
/// 订舱自动放舱
/// </summary>
public const string TypeBookingFangCang = "BookingFangCang";
/// <summary>
/// 订舱BC
/// </summary>
public const string TypeBookingBC = "BookingBC";
/// <summary>
/// 回写SI状态
/// </summary>
public const string TypeBookingPostSiStatus = "PostSiStatus";
/// <summary>
/// HTTP Feedback
/// </summary>
public const string TypeHttpFeedback = "HttpFeedback";
/// <summary>
/// 下货纸
/// </summary>
public const string TypeBookingXiahuozhi = "Xiahuozhi";
/// <summary>
/// VGM核查
/// </summary>
public const string TypeVgmCheck = "VgmCheck";
/// <summary>
/// 重新比较BC、发送下货纸任务
/// </summary>
public const string TypeCompareBcRedo = "CompareBcRedo";
public const string StatusCreate = "Create";
public const string StatusDoing = "Doing";
public const string StatusSuccess = "Success";
public const string StatusFail = "Fail";
public BackgroundTaskCommon()
{
CreateTime = DateTime.Now;
Status = StatusCreate;
}
[Key]
public string GID { get; set; }
public string Type { get; set; }
public string ParamData { get; set; }
public string Status { get; set; }
public DateTime CreateTime { get; set; }
public int ExecuteCount { get; set; }
public DateTime? ExecuteTime { get; set; }
public string ResultData { get; set; }
}
[Table("CUST_AUTH")]
public class CUST_AUTH
{
[Key]
public string GID { get; set; }
public string USERID { get; set; }
public string SKEY { get; set; }
public int? BSTYPE { get; set; }
public DateTime CREATETIME { get; set; }
public string username { get; set; }
public string comname { get; set; }
public string Module { get; set; }
public string ModuleJson { get; set; }
public string IpBlackList { get; set; }
public string IpWhiteList { get; set; }
public int Status { get; set; }
}
/// <summary>
/// 报关输出国家匹配
/// </summary>
[Table("code_baoguan_output_country")]
public class CodeBaoguanOutputCountry
{
[MaxLength(20), Key]
public string Code { get; set; }
[MaxLength(100)]
public string CnName { get; set; }
[MaxLength(100)]
public string EnName { get; set; }
[MaxLength(20)]
public string CodeBaoGuan { get; set; }
[MaxLength(20)]
public string CodeBaoJian { get; set; }
}
/// <summary>
/// 报关输出港口匹配
/// </summary>
[Table("code_baoguan_output_port")]
public class CodeBaoguanOutputPort
{
[MaxLength(20), Key]
public string Code { get; set; }
[MaxLength(100)]
public string CnName { get; set; }
[MaxLength(100)]
public string EnName { get; set; }
[MaxLength(20)]
public string CodeBaoGuan { get; set; }
[MaxLength(20)]
public string CodeBaoJian { get; set; }
}
[Table("user_erp_code")]
public class UserErpCode
{
[MaxLength(40), Key, Column(Order = 0)]
public string UserId { get; set; }
[MaxLength(40), Key, Column(Order = 1)]
public string ErpType { get; set; }
[MaxLength(128)]
public string ErpCode { get; set; }
public DateTime CreateTime { get; set; }
[MaxLength(60)]
public string CreateUser { get; set; }
public DateTime? ModifyTime { get; set; }
[MaxLength(60)]
public string ModifyUser { get; set; }
}
}