diff --git a/DSWeb.Common/App.config b/DSWeb.Common/App.config new file mode 100644 index 0000000..266e19d --- /dev/null +++ b/DSWeb.Common/App.config @@ -0,0 +1,14 @@ + + + + +
+ + + + + + + \ No newline at end of file diff --git a/DSWeb.Common/DB/Comm.cs b/DSWeb.Common/DB/Comm.cs new file mode 100644 index 0000000..00ac325 --- /dev/null +++ b/DSWeb.Common/DB/Comm.cs @@ -0,0 +1,2484 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text.RegularExpressions; +using System.Web; + +namespace DSWeb.Common.DB +{ + [Table("sys_param_set")] + public class sys_param_set_md + { + [Key] + public string GID { get; set; } + public string PARAMNAME { get; set; } + public string PARAMDESCRIPTION { get; set; } + public string PARAMVALUE { get; set; } + public string MODIFIEDUSER { get; set; } + public DateTime? MODIFIEDTIME { get; set; } + public string PARAMTYPE { get; set; } + public string FIELDTYPE { get; set; } + //public string COMPANYID { get; set; } + //public string PARAMVALUE2 { get; set; } + //public string PARAMVALUE3 { get; set; } + //public string PARAMVALUE4 { get; set; } + } + + [Table("sys_parameter_value")] + + public class sys_parameter_value_md + { + [Key] + public string GID { get; set; } + public string PARAMNAME { get; set; } + public string PARAMVALUE { 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; } + public string DELETEUSER { get; set; } + public DateTime? DELETETIME { get; set; } + public int SORT { get; set; } + public string PARAMDESCRIPTION { get; set; } + public string PARAMTYPE { get; set; } + public string DISPVALUE { get; set; } + } + + [Table("info_client")] + public class info_client_md + { + [Key] + public string GID { get; set; } + public string CODENAME { get; set; } + public string SHORTNAME { get; set; } + public string DESCRIPTION { get; set; } + public string NAME { get; set; } + public string EnFullName { get; set; } + public int? STATUS { get; set; } + public string ADDR { get; set; } + public string EMAIL { get; set; } + public string WEB { get; set; } + public string TEL { get; set; } + public string FAX { get; set; } + public string CHIEF { get; set; } + public string SALE { get; set; } + public string OP { get; set; } + public string DOC { get; set; } + + + public bool? ISCARRIER { get; set; } + public bool? ISBOOKING { get; set; } + public bool? ISYARD { get; set; } + public bool? ISTRUCK { get; set; } + public bool? ISCONTROLLER { get; set; } + public bool? ISCUSTOM { get; set; } + public bool? ISAGENT { get; set; } + public bool? ISAGENTCN { get; set; } + public bool? ISEXPRESS { get; set; } + public bool? ISAIRLINES { get; set; } + public bool? ISSHIPPER { get; set; } + public bool? ISCONSIGNEE { get; set; } + public bool? ISNOTIFYPARTY { get; set; } + public bool? ISWAREHOUSE { get; set; } + public string COUNTRY { get; set; } + public string PROVINCE { get; set; } + public string CITY { get; set; } + public string CORPID { get; set; } + public string BLCONTENT { get; set; } + public bool? ISSTOP { get; set; } + public string BillRises1 { get; set; } + public string BillRises2 { get; set; } + public string USDBillRises { get; set; } + public string RMBBillRises { get; set; } + public string RMBBank { get; set; } + public string RMBAccount { get; set; } + public string RMBOnlineNO { get; set; } + public string USDBank { get; set; } + public string USDAccount { get; set; } + public string USDOnlineNO { get; set; } + public string CustomAttributes1 { get; set; } + public string CustomAttributes2 { get; set; } + public decimal? USDMaxAmountCredit { get; set; } + public decimal? RMBMaxAmountCredit { get; set; } + public decimal? MaxAmountCredit { get; set; } + public string STLNAME { get; set; } + public string OPNAME { get; set; } + public DateTime? OPTIME { get; set; } + public string REMARK { get; set; } + public decimal? USDExchangeRate { get; set; } + public string STLDATE { get; set; } + public string STLFIRSTHALFDATE { get; set; } + public string STLMIDDLEDATE { get; set; } + public string STLDATEPJ { get; set; } + public string LEVEL { get; set; } + public string LOGINNAME { get; set; } + public string LOGINPASSWORD { get; set; } + public string QQ { get; set; } + public string MSN { get; set; } + public string MODIFIEDUSER { get; set; } + public DateTime? MODIFIEDTIME { get; set; } + public bool? ISWHARF { get; set; } + public bool? ISSHIPPINGAGENT { get; set; } + public string FARCODE { get; set; } + public string FAPCODE { get; set; } + public bool? ISINSURE { get; set; } + public bool? ISLEASING { get; set; } + public bool? ISTRADINGAGENCY { get; set; } + public bool? ISOTHER { get; set; } + public string OTHERS { get; set; } + public string UNITPRICE { get; set; } + public string REGISTRATIONNO { get; set; } + public string ORDERNO { get; set; } + public bool? ISENTERP { get; set; } + public string TAXNO { get; set; } + + public string EDICODE { get; set; } + public string EDICODE2 { get; set; } + public string EDICODE3 { get; set; } + public string ORGANIZATIONCODE { get; set; } + public string PCORPNAME { get; set; } + public string InspectionNo { get; set; } + public bool? ISSHIPAGENCY { get; set; } + public byte? blstatus { get; set; } + public bool? ISSP { get; set; } + public string FEEFRT { get; set; } + public int? RCVMode { get; set; } + public string BSSOURCE { get; set; } + + public string INVBANK { get; set; } + + public string INVADDRTEL { get; set; } + public string SALECORPID { get; set; } + + public decimal? TICHENG { get; set; } + public decimal? FENCHENG { get; set; } + + } + + [Table("Info_Client_ACCDATE")] + public partial class Info_Client_ACCDATE_mb + { + [Key] + public string GID { get; set; } + + public byte? ACCDAYS { get; set; } + + public byte? ACCMONTH { get; set; } + + public string ACCSTARTDATE { get; set; } + + public string ACCTYPE { get; set; } + public decimal? ALLOWAMOUNT { get; set; } + + public DateTime? BGNDATE { get; set; } + + public string BSSOURCE { get; set; } + + public decimal? COMMISSIONRATE { get; set; } + + public string CONTRACTGID { get; set; } + + public DateTime? ENDDATE { get; set; } + + public string LINKGID { get; set; } + + public string MODIFIEDTIME { get; set; } + + public string MODIFIEDUSER { get; set; } + + public string OPLBNAME { get; set; } + + public string REMARK { get; set; } + public string SALE { get; set; } + + + #region 外键 => 导航属性,ManyToMany + + #endregion + } + + + [Table("info_client_bank")] + public partial class info_client_bank_mb + { + [Key] + public string GID { get; set; } + public string LINKID { get; set; } + public string CODENAME { get; set; } + public string CURRENCY { get; set; } + public string BANKNAME { get; set; } + public string ACCOUNT { get; set; } + public string SUBJECTCODE { get; set; } + public string REMARK { get; set; } + public string FINANCESOFTCODE { get; set; } + public string CREATEUSER { get; set; } + public DateTime? CREATETIME { get; set; } + public string ACCOUNTNAME { get; set; } + public string SWIFT { get; set; } + public string BANKAGENTNAME { get; set; } + public string BANKACNO { get; set; } + public string COUNTRYID { get; set; } + public string BANKADDR { get; set; } + public string ISINVDEF { get; set; } + + } + + [Table("v_op_bs")] + public partial class v_op_bs_mb + { + + [Key] + public string BSNO { get; set; } + public string ACCDATE { get; set; } + public string AGENTID { get; set; } + public string APPLYNO { get; set; } + public DateTime? ATD { get; set; } + public int? BillFeeStatus { get; set; } + public DateTime? BILLFEESTATUSTIME { get; set; } + public string BLFRT { get; set; } + public string BLISSUESTATUS { get; set; } + public string BLTYPE { get; set; } + + public string BOOKNO { get; set; } + + + public string BSCUSTOMNO { get; set; } + + public string BSSOURCE { get; set; } + + public string BSSOURCEDETAIL { get; set; } + + + public int? BSSTATUS { get; set; } + + + public string BSTYPE { get; set; } + + + public string CARGOID { get; set; } + + + public string CARRIER { get; set; } + + + public decimal? CBM { get; set; } + + + public DateTime? CLOSINGDATE { get; set; } + + + public int? CNTR1 { get; set; } + + + public int? CNTR10 { get; set; } + + + public int? CNTR2 { get; set; } + + + public int? CNTR3 { get; set; } + + + public int? CNTR4 { get; set; } + + + public int? CNTR5 { get; set; } + + + public int? CNTR6 { get; set; } + + + public int? CNTR7 { get; set; } + + + public int? CNTR8 { get; set; } + + + public int? CNTR9 { get; set; } + + + public string CNTRSEALNO { get; set; } + + + public string CNTRTOTAL { get; set; } + + + public string CONTRACTNO { get; set; } + + + public string CORPID { get; set; } + + + public DateTime? CREATETIME { get; set; } + + + public string CUSTNO { get; set; } + + + public DateTime? CUSTOMDATE { get; set; } + + + public string CUSTOMERNAME { get; set; } + + + public string CUSTOMNO { get; set; } + + + public string CUSTOMSER { get; set; } + + + public int? CUSTOMSNUM { get; set; } + public string CUSTSERVICE { get; set; } + + public string DCLASS { get; set; } + + + public DateTime? DELIVERYDATE { get; set; } + + + public string DESTINATION { get; set; } + + + public string DESTINATIONID { get; set; } + + + public string DOC { get; set; } + + + public string ENTERP { get; set; } + + + public DateTime? ETA { get; set; } + + + public DateTime? ETD { get; set; } + public decimal? FEEKGS { get; set; } + + + public int? FEESTATUS { get; set; } + + + public string FORWARDER { get; set; } + + public string FRCUSTSERVICE { get; set; } + + + public string GOODSNAME { get; set; } + + + public string HBLNO { get; set; } + + + public string INPUTBY { get; set; } + + + public DateTime? INSPECTIONDATE { get; set; } + + + public string INSPECTIONNO { get; set; } + + + public string INVNO { get; set; } + + + public int? ISCANCEL { get; set; } + + + public string ISPRINTPR { get; set; } + + + public string ISSUETYPE { get; set; } + + + public int? ISVOU { get; set; } + + + public decimal? KGS { get; set; } + + + public string KINDPKGS { get; set; } + + + public string LANE { get; set; } + + + public string MASTERNO { get; set; } + + + public string MBLNO { get; set; } + + + public decimal? NETWEIGHT { get; set; } + + + public string NUMBERPLATE { get; set; } + + + public string OP { get; set; } + + + public DateTime? OPDATE { get; set; } + + + public string OPERATOR { get; set; } + + + public string OPLB { get; set; } + + + public string OPLBNAME { get; set; } + + + public string ORDERNO { get; set; } + + + public int? OTCNTR { get; set; } + + + public decimal? PKGS { get; set; } + + + public string PLACERECEIPT { get; set; } + + + public string PORTDISCHARGE { get; set; } + + + public string PORTLOAD { get; set; } + + + public string REMARK { get; set; } + + + public string REMARK2 { get; set; } + + + public string SALE { get; set; } + + + public string SALECORPID { get; set; } + + + public string SALEDEPT { get; set; } + + + public string SERVICE { get; set; } + + + public string SERVICECONTRACTNO { get; set; } + + + public DateTime? STLDATE { get; set; } + + + public string STLNAME { get; set; } + + + public int? TEU { get; set; } + + + public string TRADETERM { get; set; } + + + public string TRADETYPE { get; set; } + + + public string TRUCKER { get; set; } + + + public string VESSEL { get; set; } + + + public string VOUNO { get; set; } + + + public string VOYNO { get; set; } + + + public string YARD { get; set; } + + + #region 外键 => 导航属性,ManyToMany + + #endregion + } + + + [Table("v_op_bill")] + public partial class v_op_bill_mb + { + + [Key] + public string BSNO { get; set; } + public string MASTERNO { get; set; } + public string PARENTID { get; set; } + public string OPTYPE { get; set; } + public string OPLB { get; set; } + public string OPLBNAME { get; set; } + public string BSTYPE { get; set; } + public string CUSTOMERNAME { get; set; } + public string CUSTNO { get; set; } + public string ORDERNO { get; set; } + public string MBLNO { get; set; } + public string HBLNO { get; set; } + public string ETD { get; set; } + public DateTime? ETA { get; set; } + public DateTime? STLDATE { get; set; } + public string STLNAME { get; set; } + public string VESSEL { get; set; } + public string VOYNO { get; set; } + public string INPUTBY { get; set; } + public DateTime? CREATETIME { get; set; } + public int? BSSTATUS { get; set; } + public string SALE { get; set; } + public string OP { get; set; } + public string DOC { get; set; } + public string CUSTSERVICE { get; set; } + public string PORTLOAD { get; set; } + public string PORTDISCHARGE { get; set; } + public string CUSTOMNO { get; set; } + public string ACCDATE { get; set; } + public string CARRIER { get; set; } + public string BSSOURCE { get; set; } + public string BSSOURCEDETAIL { get; set; } + public string LANE { get; set; } + public string FORWARDER { get; set; } + public decimal? NETWEIGHT { get; set; } + public decimal? KGS { get; set; } + public int? TEU { get; set; } + public string CNTRTOTAL { get; set; } + public string CORPID { get; set; } + public int? CNTR1 { get; set; } + public int? CNTR2 { get; set; } + public int? CNTR3 { get; set; } + public int? CNTR4 { get; set; } + public int? CNTR5 { get; set; } + public int? CNTR6 { get; set; } + public int? CNTR7 { get; set; } + public int? CNTR8 { get; set; } + public int? CNTR9 { get; set; } + public int? CNTR10 { get; set; } + public int? OTCNTR { get; set; } + public string TRADETYPE { get; set; } + public string GOODSNAME { get; set; } + public int? FEESTATUS { get; set; } + public DateTime? OPDATE { get; set; } + public DateTime? CUSTOMDATE { get; set; } + public string ENTERP { get; set; } + public decimal? PKGS { get; set; } + public decimal? CBM { get; set; } + public string BLFRT { get; set; } + public string SALEDEPT { get; set; } + public int? CUSTOMSNUM { get; set; } + public string INVNO { get; set; } + public string BSCUSTOMNO { get; set; } + public DateTime? INSPECTIONDATE { get; set; } + public string INSPECTIONNO { get; set; } + public string CONTRACTNO { get; set; } + public string BOOKNO { get; set; } + public string AGENTID { get; set; } + public string ISPRINTPR { get; set; } + public string NUMBERPLATE { get; set; } + public decimal? FEEKGS { get; set; } + public string OPERATOR { get; set; } + public string SERVICECONTRACTNO { get; set; } + public string BLTYPE { get; set; } + public int? ISCANCEL { get; set; } + public string APPLYNO { get; set; } + public string ISSUETYPE { get; set; } + public string BLISSUESTATUS { get; set; } + public string REMARK { get; set; } + public string TRADETERM { get; set; } + public string REASON { get; set; } + public string PLACERECEIPT { get; set; } + public string DESTINATION { get; set; } + public string CNTRSEALNO { get; set; } + public int? BillFeeStatus { get; set; } + public int? ISVOU { get; set; } + public string VOUNO { get; set; } + public string SALECORPID { get; set; } + public string YARD { get; set; } + public DateTime? DELIVERYDATE { get; set; } + public string FRCUSTSERVICE { get; set; } + public string SERVICE { get; set; } + public string REMARK2 { get; set; } + public DateTime? BILLFEESTATUSTIME { get; set; } + public string TRUCKER { get; set; } + public string CUSTOMSER { get; set; } + public DateTime? CLOSINGDATE { get; set; } + public string KINDPKGS { get; set; } + public string CARGOID { get; set; } + public string DCLASS { get; set; } + public DateTime? ATD { get; set; } + public string ALLBILLNO { get; set; } + + } + + [Table("code_fee")] + + public class code_fee_md { + [Key] + public string GID { get; set; } + + public string FEECODE { get; set; } + public string NAME { get; set; } + public string DESCRIPTION { get; set; } + public string DEFAULTCURR { get; set; } + public bool? ISSEA { get; set; } + public bool? ISAIR { get; set; } + public int? DEFAULTUNIT { get; set; } + public int? DEFAULTDEBIT { get; set; } + public int? DEFAULTCREDIT { get; set; } + public string CREATEUSER { get; set; } + public DateTime? CREATETIME { get; set; } + public string MODIFIEDUSER { get; set; } + public DateTime? MODIFIEDTIME { get; set; } + public string FEETYPE { get; set; } + public bool? ISTRUCKING { get; set; } + public bool? ISTRUCKINGFIXED { get; set; } + public bool? ISWMS { get; set; } + public string FEEGROUP { get; set; } + public string FEEFRT { get; set; } + public bool? ISADVANCEDPAY { get; set; } + public decimal? TAXRATE { get; set; } + public string DUITYPE { get; set; } + + + } + + + + [Table("CODE_CTN")] + public partial class CODE_CTN_md + { + [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; } + + #region 外键 => 导航属性,ManyToMany + + #endregion + } + + [Table("op_other")] + + public class op_other_md + { + [Key] + public string BSNO { get; set; } + public string OPLB { get; set; } + public string OPLBNAME { get; set; } + public bool? BSSTATUS { get; set; } + public bool? FEESTATUS { get; set; } + public string CUSTNO { get; set; } + public string MBLNO { get; set; } + public string HBLNO { get; set; } + public string CONTRACTNO { get; set; } + public string CUSTOMERNAME { get; set; } + public DateTime? BSDATE { get; set; } + public string ACCDATE { get; set; } + public string BSSOURCE { get; set; } + public string BSSOURCEDETAIL { get; set; } + public string OP { get; set; } + public string CUSTSERVICE { get; set; } + public string SALE { get; set; } + public string CORPID { get; set; } + public string TRANSTYPE { get; set; } + public string VESSEL { get; set; } + public string VOYNO { get; set; } + public DateTime? ETD { get; set; } + public string PORTLOAD { get; set; } + public string PORTDISCHARGE { get; set; } + public string TRADETYPE { get; set; } + public string GOODSNAME { get; set; } + public decimal? KGS { get; set; } + public decimal? NETWEIGHT { get; set; } + public int? PKGS { get; set; } + public string KINDPKGS { get; set; } + public decimal? CBM { get; set; } + public bool? ISVOU { get; set; } + public string VOUNO { get; set; } + public string REMARK { get; set; } + public string CREATEUSER { get; set; } + public DateTime? CREATETIME { get; set; } + public string MODIFIEDUSER { get; set; } + public DateTime? MODIFIEDTIME { get; set; } + public string orderno { get; set; } + public string STLNAME { get; set; } + public DateTime? STLDATE { get; set; } + public string CTNALL { get; set; } + public int? CTNNUM { get; set; } + public string IsService1 { get; set; } + public string IsService2 { get; set; } + public string IsService3 { get; set; } + public string IsService4 { get; set; } + public string IsService5 { get; set; } + public string IsService6 { get; set; } + public string IsService7 { get; set; } + public string IsService8 { get; set; } + public string IsService9 { get; set; } + public string IsService10 { get; set; } + public string IsServiceFee1 { get; set; } + public string IsServiceFee2 { get; set; } + public string IsServiceFee3 { get; set; } + public string IsServiceFee4 { get; set; } + public string IsServiceFee5 { get; set; } + public string IsServiceFee6 { get; set; } + public string IsServiceFee7 { get; set; } + public string IsServiceFee8 { get; set; } + public string IsServiceFee9 { get; set; } + public string IsServiceFee10 { get; set; } + public string IsService11 { get; set; } + public string IsService12 { get; set; } + public string IsServiceFee11 { get; set; } + public string IsServiceFee12 { get; set; } + public string ENTERP { get; set; } + public string IsService13 { get; set; } + public string IsService14 { get; set; } + public string IsService15 { get; set; } + public string IsService16 { get; set; } + public string IsServiceFee13 { get; set; } + public string IsServiceFee14 { get; set; } + public string IsServiceFee15 { get; set; } + public string IsServiceFee16 { get; set; } + public string BOOKNO { get; set; } + public string ISPRINTPR { get; set; } + public int BillFeeStatus { get; set; } + public string OPERATOR { get; set; } + public string SALECORPID { get; set; } + public string FRCUSTSERVICE { get; set; } + public DateTime? CLOSINGDATE { get; set; } + public DateTime? CLOSEDOCDATE { get; set; } + public string SALEDEPT { get; set; } + public string CUSTOMSER { get; set; } + public string WAREHOUSE { get; set; } + public string COUNTRYOFORIGIN { get; set; } + public DateTime? BILLFEESTATUSTIME { get; set; } + public byte? STLMODE { get; set; } + public string TRUCKNO { get; set; } + } + + [Table("ch_fee")] + public partial class ch_fee_md + { + + [Key] + public string GID { get; set; } + public string BSNO { get; set; } + public int? FEETYPE { get; set; } = 0; + public string FEENAME { get; set; } + public string FEEDESCRIPTION { get; set; } = ""; + public string CUSTOMERTYPE { get; set; } = ""; + public string CUSTOMERNAME { get; set; } = ""; + public string UNIT { get; set; } = ""; + public decimal? UNITPRICE { get; set; } = 0; + public decimal? QUANTITY { get; set; } = 0; + public decimal? AMOUNT { get; set; } = 0; + public string CURRENCY { get; set; } = ""; + public decimal? EXCHANGERATE { get; set; } = 0; + public string REASON { get; set; } = ""; + public string REMARK { get; set; } = ""; + public decimal? COMMISSIONRATE { get; set; } = 0; + public decimal? SETTLEMENT { get; set; } = 0; + public decimal? INVOICE { get; set; } = 0; + public decimal? ORDERAMOUNT { get; set; } = 0; + public decimal? ORDERINVOICE { get; set; } = 0; + public DateTime? SUBMITDATE { get; set; } + public string AUDITOPERATOR { get; set; } = ""; + public DateTime? AUDITDATE { get; set; } + public string ENTEROPERATOR { get; set; } = ""; + public DateTime? ENTERDATE { get; set; } + public string DEBITNO { get; set; } = ""; + public bool? ISDEBIT { get; set; } = false; + public bool? ISOPEN { get; set; } = false; + public bool? ISADVANCEDPAY { get; set; } = false; + public int? SORT { get; set; } = 0; + public bool? ISINVOICE { get; set; } = false; + public int? FEESTATUS { get; set; } = 1; + public string FEEFRT { get; set; } = ""; + public bool? ISCRMORDERFEE { get; set; } = false; + public int? AUDITSTATUS { get; set; } = 0; + public string INVOICENUM { get; set; } = ""; + public string CHEQUENUM { get; set; } = ""; + public string WMSOUTBSNO { get; set; } = ""; + public int? LINENUM { get; set; } = 0; + public decimal? TAXRATE { get; set; } = 0; + public decimal? NOTAXAMOUNT { get; set; } = 0; + public decimal? ACCTAXRATE { get; set; } = 0; + public bool? ISVOU { get; set; } = false; + public string VOUCHERNO { get; set; } = ""; + public string ACCDATE { get; set; } = ""; + public string BXGID { get; set; } = ""; + public decimal? TAX { get; set; } = 0; + public string F_NO { get; set; } = ""; + public decimal? ORDERSETTLEMENT { get; set; } = 0; + public decimal? TAXUNITPRICE { get; set; } = 0; + public decimal? ORDERINVSETTLEMENT { get; set; } = 0; + public string MODIFIEDUSER { get; set; } = ""; + public DateTime? MODIFIEDTIME { get; set; } + public string VOUALLNO { get; set; } = ""; + public string SALESNO { get; set; } = ""; + public string CARGO_GID { get; set; } = ""; + public string JKGID { get; set; } = ""; + public decimal? PREAMOUNT { get; set; } = 0; + public string INPUTMODE { get; set; } = ""; + public string DELIVERYNO { get; set; } = ""; + public string LOCALCURR { get; set; } = ""; + public string MANAGER { get; set; } = ""; + public bool? ISACC { get; set; } = false; + public string PaymentGID { get; set; } = ""; + public string STATEMENTNO { get; set; } = ""; + public string SALECORP { get; set; } = ""; + public bool? CUSTDUI { get; set; } = false; + + /// + /// 用于向大简云发送开票请求后 记录费用与链接的关系 + /// + public string INVLINKGID { get; set; } = ""; + } + + public partial class ch_fee_md + { + + private static List _codefeelist { get; set; } + + public void setTax(List codefeelist) + { + if (TAXRATE != null) + { + //那就还使用原有的税率 + } + else + { + if (string.IsNullOrWhiteSpace(FEENAME)) + { + TAXRATE = 0; + + } + else + { + //var codefee = codefeelist.First(x => x.NAME == FEENAME); + //if (codefee == null) TAXRATE = 0; + //else + //{ + // if (TAXRATE == null) TAXRATE = (decimal)codefeelist.First(x => x.NAME == FEENAME).TAXRATE; + //} + + if (codefeelist.Exists(x => x.NAME == FEENAME)) + { + decimal? taxrate = codefeelist.First(x => x.NAME == FEENAME).TAXRATE; + + if (TAXRATE == null) + { + if (taxrate == null) TAXRATE = 0; + else + TAXRATE = taxrate; + } + } + else + { + TAXRATE = 0; + } + } + } + var taxrateb = 1 + TAXRATE / 100; + NOTAXAMOUNT = AMOUNT / taxrateb; + TAX = AMOUNT - NOTAXAMOUNT; + if (QUANTITY > 0) + { + UNITPRICE = NOTAXAMOUNT / QUANTITY; + TAXUNITPRICE = AMOUNT / QUANTITY; + } + else + { + UNITPRICE = NOTAXAMOUNT; + TAXUNITPRICE = AMOUNT; + } + //20210416 将acctaxrate用taxrate填充 + ACCTAXRATE = TAXRATE; + } + + public ch_fee_md() { } + + public ch_fee_md(string bsno) + { + GID = Guid.NewGuid().ToString(); + BSNO = bsno; + } + + public ch_fee_md(code_fee_md codefee) + { + GID = Guid.NewGuid().ToString(); + FEENAME = codefee.NAME; + + clear(); + + TAXRATE = codefee.TAXRATE; + if (codefee.TAXRATE == null) + { + TAXRATE = 0.0m; + } + } + + public void clear() + { + TAXRATE = 0.0m; + QUANTITY = 0.0m; + TAXUNITPRICE = 0.0m; + UNITPRICE = 0.0m; + + AMOUNT = 0.0m; + NOTAXAMOUNT = 0.0m; + + + SETTLEMENT = 0; + ORDERAMOUNT = 0; + ORDERINVOICE = 0; + ORDERINVSETTLEMENT = 0; + ORDERSETTLEMENT = 0; + INVOICE = 0; + + } + + public static ch_fee_md getChfeeHelper(string userid) + { + + //var today = DateTime.Now.AddDays(0).ToString("yyyy-MM-dd "); + + var result = new ch_fee_md(); + result.GID = Guid.NewGuid().ToString(); + result.SETTLEMENT = 0; + result.ORDERAMOUNT = 0; + result.ORDERINVOICE = 0; + result.ORDERINVSETTLEMENT = 0; + result.ORDERSETTLEMENT = 0; + result.INVOICE = 0; + result.CURRENCY = "RMB"; + result.EXCHANGERATE = 1; + result.ENTERDATE = DateTime.Now; + result.ENTEROPERATOR = userid; + result.FEESTATUS = 1; + result.TAXRATE = 0; + + result.ISADVANCEDPAY = false; + result.ISINVOICE = false; + result.ISCRMORDERFEE = false; + + result.INPUTMODE = "月结"; + + return result; + } + + + public bool CanChange() + { + + if ( + SETTLEMENT == 0 && + ORDERAMOUNT == 0 && + ORDERINVOICE == 0 && + ORDERINVSETTLEMENT == 0 && + ORDERSETTLEMENT == 0 && + INVOICE == 0 && + !(ISDEBIT == null ? false : (bool)ISDEBIT) + ) return true; + + return false; + } + } + + + [Table("v_fee_do_settlement")] + public partial class v_fee_do_settlement_md + { + [Key] + public string FEEID { get; set; } + public decimal? AMOUNT { get; set; } + public string BILLNO { get; set; } + public string BSNO { get; set; } + public int? CATEGORY { get; set; } + public string CURRENCY { get; set; } + public string CUSTOMERNAME { get; set; } + public decimal? DOAMOUNT { get; set; } + public decimal? EXCHANGERATE { get; set; } + public string FEENAME { get; set; } + public int? FEETYPE { get; set; } + public string MBLNO { get; set; } + public decimal? ORIGAMOUNT { get; set; } + public string ORIGCURRENCY { get; set; } + public decimal? ORIGEXCHANGERATE { get; set; } + public decimal? ORIGSTLAMOUNT { get; set; } + public DateTime? SETTLETIME { get; set; } + + + #region 外键 => 导航属性,ManyToMany + + #endregion + } + + [Table("v_ch_fee_settlementinfo")] + public partial class v_ch_fee_settlementinfo_md + { + [Key] + public string GID { get; set; } = ""; + //public byte[] _MASK_FROM_V2 { get; set; } + public string ACCDATE { get; set; } = ""; + public decimal? ACCTAXRATE { get; set; } = 0; + public decimal? AMOUNT { get; set; } = 0; + public DateTime? AUDITDATE { get; set; } + public string AUDITOPERATOR { get; set; } = ""; + public int? AUDITSTATUS { get; set; } = 0; + public string BSNO { get; set; } = ""; + public string BXGID { get; set; } = ""; + public string CARGO_GID { get; set; } = ""; + public string CHEQUENUM { get; set; } = ""; + public decimal? COMMISSIONRATE { get; set; } = 0; + public string CURRENCY { get; set; } = ""; + public bool? CUSTDUI { get; set; } + public string CUSTOMERNAME { get; set; } = ""; + public string CUSTOMERTYPE { get; set; } = ""; + public string DEBITNO { get; set; } = ""; + public string DELIVERYNO { get; set; } = ""; + public DateTime? ENTERDATE { get; set; } + public string ENTEROPERATOR { get; set; } = ""; + public decimal? EXCHANGERATE { get; set; } = 0; + public string F_NO { get; set; } = ""; + public string FEEDESCRIPTION { get; set; } = ""; + public string FEEFRT { get; set; } = ""; + public string FEENAME { get; set; } = ""; + public int? FEESTATUS { get; set; } = 1; + public int? FEETYPE { get; set; } + + public string INPUTMODE { get; set; } = ""; + public decimal? INVOICE { get; set; } = 0; + public string INVOICENUM { get; set; } = ""; + public bool? ISACC { get; set; } = false; + public bool? ISADVANCEDPAY { get; set; } = false; + public bool? ISCRMORDERFEE { get; set; } = false; + public bool? ISDEBIT { get; set; } = false; + public bool? ISDJY { get; set; } = false; + public bool? ISINVOICE { get; set; } = false; + public bool? ISOPEN { get; set; } = false; + public bool? ISVOU { get; set; } = false; + public string JKGID { get; set; } = ""; + public int? LINENUM { get; set; } = 0; + public string LOCALCURR { get; set; } = ""; + public string MANAGER { get; set; } = ""; + public DateTime? MODIFIEDTIME { get; set; } + public string MODIFIEDUSER { get; set; } = ""; + public decimal? NOTAXAMOUNT { get; set; } = 0; + public decimal? ORDERAMOUNT { get; set; } = 0; + public decimal? ORDERINVOICE { get; set; } = 0; + public decimal? ORDERINVSETTLEMENT { get; set; } = 0; + public decimal? ORDERSETTLEMENT { get; set; } = 0; + public string PaymentGID { get; set; } = ""; + public decimal? PREAMOUNT { get; set; } + public decimal? QUANTITY { get; set; } + public string REASON { get; set; } = ""; + public string REMARK { get; set; } = ""; + public string SALECORP { get; set; } = ""; + public string SALESNO { get; set; } = ""; + public decimal? SETTLEAMOUNT { get; set; } + public decimal? SETTLEMENT { get; set; } + public DateTime? SETTLETIME { get; set; } + public int? SORT { get; set; } = 0; + public string STATEMENTNO { get; set; } = ""; + public DateTime? SUBMITDATE { get; set; } + public decimal? TAX { get; set; } + public decimal? TAXRATE { get; set; } + public decimal? TAXUNITPRICE { get; set; } + public string UNIT { get; set; } = ""; + public decimal? UNITPRICE { get; set; } + public string VOUALLNO { get; set; } = ""; + public string VOUCHERNO { get; set; } = ""; + public string WMSOUTBSNO { get; set; } = ""; + + + #region 外键 => 导航属性,ManyToMany + + #endregion + } + + [Table("ch_fee_payapplication")] + + public partial class ch_fee_payapplication_md { + [Key] + public string GID { get; set; } + public string BILLNO { get; set; } + public int? BILLSTATUS { get; set; } + public string CUSTOMERNAME { get; set; } + public string CHEQUEPAYABLE { get; set; } + public int? SETTLETYPE { get; set; } + public DateTime? PAYABLETIME { get; set; } + public decimal? AMOUNTRMB { get; set; } + public decimal? RATE { get; set; } + public decimal? AMOUNTUSD { get; set; } + public decimal? SETTLERMB { get; set; } + public decimal? SETTLEUSD { get; set; } + public decimal? SETTLERATE { get; set; } + public string APPLICANT { get; set; } + public DateTime? APPLYTIME { get; set; } + public DateTime? ENTERTIME { get; set; } + public string SETTLEUSER { get; set; } + public DateTime? SETTLETIME { get; set; } + public string AUDITUSER { get; set; } + public DateTime? AUDITTIME { get; set; } + public string REMARK { get; set; } + public bool? ISDELETE { get; set; } + public string DELETEUSER { get; set; } + public DateTime? DELETETIME { get; set; } + public string COMPANYID { get; set; } + public bool? ISAPP { get; set; } + public string PAYAPPID { get; set; } + public string CHEQUENUMREMARK { get; set; } + public string CURR { get; set; } + public string INVNO { get; set; } + public DateTime? INVDATE { get; set; } + public string CUSTACCOUNTGID { get; set; } + public string PAYACCOUNTGID { get; set; } + public string BS_CUSTOMERNAME { get; set; } + public string PAYBANK { get; set; } + public string PORTDISCHARGE { get; set; } + public decimal? PREAMOUNTRMB { get; set; } + public decimal? PREAMOUNTUSD { get; set; } + public string PAYTYPE { get; set; } + public string ISPRINT { get; set; } + public decimal? AMOUNTOT { get; set; } + public decimal? SETTLEOT { get; set; } + public decimal? PREAMOUNTOT { get; set; } + public int? WXPUSH { get; set; } + public string AUDITREMARK { get; set; } + public string REASON { get; set; } + public decimal? STLRATE { get; set; } + public decimal? STLAMOUNT { get; set; } + public string STLCURR { get; set; } + public string SALECORPID { get; set; } + public string WORKBILLNO { get; set; } + public int? PRINTCOUNT { get; set; } + public bool? ISREVINV { get; set; } + public DateTime? PRINTTIME { get; set; } + } + + [Table("company")] + public class company_md + { + [Key] + public string GID { get; set; } + public string CODENAME { get; set; } + public string NAME { get; set; } + public string FULLNAME { get; set; } + + public string ENNAME { get; set; } + public string ADDRESS { get; set; } + public string ENADDRESS { get; set; } + public string POSTCODE { get; set; } + public string OFFICEPHONE { get; set; } + public string FAX { get; set; } + public string EMAIL { get; set; } + public string WEBSITEURL { get; set; } + public string LICENSECODE { get; set; } + public string TAXCODE { get; set; } + public byte[] LOGO { get; set; } + public string CREATEUSER { get; set; } + public DateTime? CREATETIME { get; set; } + public string MODIFIEDUSER { get; set; } + public DateTime? MODIFIEDTIME { get; set; } + public bool? ISDELETED { get; set; } + public bool? ISDISABLE { get; set; } + public string PARENTID { get; set; } + public string BILLRISES { get; set; } + public string CHEQUEPAYABLE { get; set; } + public string PRTHEADXML1 { get; set; } + public string PRTHEADXML2 { get; set; } + public string PRTHEADXML3 { get; set; } + public string PRTHEADXML4 { get; set; } + public string PRTHEADXML5 { get; set; } + public string BANKSHEAD { get; set; } + public string GPSUser { get; set; } + public string GPSPassWord { get; set; } + public string ORGANIZATIONCODE { get; set; } + public string DBNAME { get; set; } + public string FTPURL { get; set; } + public string LOCALCURR { get; set; } + public string WORKFLOWMSG { get; set; } + public int? openCustom { get; set; } + public int? isDelegate { get; set; } + public int? allowOpenMark2 { get; set; } + public string TRADE_CODE { get; set; } + public string UNIT { get; set; } + public string VGMCODE { get; set; } + public string bxid { get; set; } + public DateTime? CLOSEETDDAY { get; set; } + + } + + + [Table("ch_fee_invoice")] + public partial class ch_fee_invoice_md + { + [Key] + public string GID { get; set; } + public string ACCOUNT { get; set; } + public string ACTUALCUSTOMERNAME { get; set; } + public decimal? AMOUNT { get; set; } + public string AMOUNTCAPITAL { get; set; } + public string AMOUNTLIST { get; set; } + + public string APPLICANT { get; set; } + + public DateTime? APPLYTIME { get; set; } + + public string BANK { get; set; } + + public string BILLNO { get; set; } + + public int? BILLSTATUS { get; set; } + + public string BSNO { get; set; } + + public string CHECKER { get; set; } + + public string COMPANYID { get; set; } + + public DateTime? CREATETIME { get; set; } + + public string CREATEUSER { get; set; } + public string CURRENCY { get; set; } + + public string CUSTADDR { get; set; } + public string CUSTADDRTEL { get; set; } + public string CUSTBANK { get; set; } + public string CUSTOMERNAME { get; set; } + + + public string CUSTRATENO { get; set; } + + public string CUSTTEL { get; set; } + + public string DELETEOPERATOR { get; set; } + + public DateTime? DELETETIME { get; set; } + + public string DZSTATUS { get; set; } + + public string EINVOICESTATE { get; set; } + + public DateTime? ETD { get; set; } + + public decimal? EXCHANGERATE { get; set; } + + public string FEEAMOUNT { get; set; } + + public string FEEITEM { get; set; } + + public decimal? INVAMOUNT { get; set; } + + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long INVID { get; set; } + + public string INVITERFACE { get; set; } + + public int? INVOICECATEGORY { get; set; } + + public string INVOICECODE { get; set; } + + public string INVOICECUSTNAME { get; set; } + + public string INVOICEINFOURL { get; set; } + + public string INVOICELINE { get; set; } + + + public DateTime? INVOICEMAKETIME { get; set; } + + public string INVOICENO { get; set; } + + public string INVOICEPDFURL { get; set; } + + public string INVOICESERIALNUM { get; set; } + + public int? INVOICETYPE { get; set; } + + public bool? ISDELETE { get; set; } + + public bool? ISNEEDFEE { get; set; } + + public bool? ISNEEDPRINT { get; set; } + + public string LICENSECODE { get; set; } + + public string MBLNO { get; set; } + + public DateTime? OPERATETIME { get; set; } + + + public string OPERATOR { get; set; } + + + public decimal? OTCURRAMOUNT { get; set; } + + public string PAYEE { get; set; } + + + public string POD { get; set; } + + + public string POL { get; set; } + + + public decimal? PRINTAMOUNT { get; set; } + + + public string PRINTCAPITAL { get; set; } + + + public string PRINTTITLE { get; set; } + + public string PTORRED { get; set; } + + + public string PUSHEMAIL { get; set; } + + + public string PUSHMOBILE { get; set; } + + + public string PUSHMODE { get; set; } + + + public string RECVCURR { get; set; } + + + public string REDCODE { get; set; } + + + public string REDNUM { get; set; } + + + public string REMARK { get; set; } + + + public string SALECORPID { get; set; } + + + public bool? SETRED { get; set; } + + + public string TAXCODE { get; set; } + + + public string VESSELVOYAGE { get; set; } + + public string VOUCHERNO { get; set; } + + public string VOUNO { get; set; } + + + #region 外键 => 导航属性,ManyToMany + + #endregion + } + + [Table("ch_fee_invoicedetail")] + public partial class ch_fee_invoicedetail_md + { + [Key] + + public string GID { get; set; } + + + public decimal? AMOUNT { get; set; } + + + //public string DZGID { get; set; } + + + public string GOODCODE { get; set; } + + + public string GOODSNAME { get; set; } + + + public string PID { get; set; } + + + public decimal? PKGS { get; set; } + + + public decimal? PRICE { get; set; } + + + public string Remark { get; set; } + + + public decimal SerialNo { get; set; } + + + public string SPEC { get; set; } + + + public decimal? TAX { get; set; } + + + public decimal? TAXPRICE { get; set; } + + + public decimal? TAXRATE { get; set; } + + + public string UNIT { get; set; } + + + #region 外键 => 导航属性,ManyToMany + + #endregion + } + + [Table("ch_fee_do")] + public partial class ch_fee_do_md + { + + [Key] + public string GID { get; set; } + + + public decimal? AMOUNT { get; set; } + + + public string BILLNO { get; set; } + + + public int? BILLSTATUS { get; set; } + + + public string BSNO { get; set; } + + + public int? BSTYPE { get; set; } + + + public int? CATEGORY { get; set; } + + + public string COMPANYID { get; set; } + + + public DateTime? CREATETIME { get; set; } + + + public string CURRENCY { get; set; } + + + public string CUSTOMERNAME { get; set; } + + + public DateTime? DELETETIME { get; set; } + + + public string DELETEUSER { get; set; } + + + public decimal? DOAMOUNT { get; set; } + + + public decimal? EXCHANGERATE { get; set; } + + + public string FEEID { get; set; } + + + public string FEENAME { get; set; } + + + public int? FEETYPE { get; set; } + + + public string HBLNO { get; set; } + + + public string INVOICESETTLENO { get; set; } + + + public bool? ISDELETED { get; set; } + + + public string MBLNO { get; set; } + + + public decimal? ORIGAMOUNT { get; set; } + + + public string ORIGCURRENCY { get; set; } + + + public decimal? ORIGSTLAMOUNT { get; set; } + + + public string REMARK { get; set; } + + + #region 外键 => 导航属性,ManyToMany + + #endregion + } + + + [Table("VW_user")] + public partial class VW_user_md + { + [Key] + + public string CODENAME { get; set; } + + + public string COMPANYID { get; set; } + + + public string companyname { get; set; } + + + public string deptgid { get; set; } + + + public string DEPTNAME { get; set; } + + + public string DEPTNO { get; set; } + + + public string EMAIL1 { get; set; } + + + public string mailsign { get; set; } + + + //public string Role_Id { get; set; } + + + public string SHOWNAME { get; set; } + + + public string USERID { get; set; } + + + //public string WeChatAccount { get; set; } + + + #region 外键 => 导航属性,ManyToMany + + #endregion + } + + + [Table("code_goods_inv")] + public partial class code_goods_inv_md + { + [Key] + public string GID { get; set; } + + + public string DEFCURR { get; set; } + + + public string DEFREMARK { get; set; } + + + public string DESCRIP { get; set; } + + + public string GOODCODE { get; set; } + + + public string GOODNAME { get; set; } + + + public string GoodsTypeGID { get; set; } + + + public string ISDEF { get; set; } + + + public bool? ISSTOP { get; set; } + + + public string ISTAXPRICE { get; set; } + + + public string ISUSEPREF { get; set; } + + + public string SPEC { get; set; } + + + public string TAXCLASS { get; set; } + + + public string TAXCLASSNAME { get; set; } + + + public string TAXNO { get; set; } + + + public decimal? TAXRATE { get; set; } + + + public string UNIT { get; set; } + + + public string ZTAXTYPE { get; set; } + + + #region 外键 => 导航属性,ManyToMany + + #endregion + } + + + [Table("Receipt_Doc")] + public partial class Receipt_Doc_md + { + [Key] + public string GID { get; set; } + + + public string R_GID { get; set; } + + + public string BSNO { get; set; } + + + public string URL { get; set; } + + + public string Driect_URL { get; set; } + + + public string MODIFIEDUSER { get; set; } + public DateTime? MODIFIEDTIME { get; set; } + + public string RECEIPTTYPE { get; set; } + + + public string documentAttachedCode { get; set; } + + public string documentAttachedNo { get; set; } + public bool? ISPUBLIC { get; set; } + + public Receipt_Doc_md() + { + GID = Guid.NewGuid().ToString(); + ISPUBLIC = true; + } + + public Receipt_Doc_md(string _BSNO) + { + GID = Guid.NewGuid().ToString(); + ISPUBLIC = true; + BSNO = _BSNO; + } + + public void SetFile(string url, string driect_url) { + URL = url; + Driect_URL = driect_url; + } + public void SetFile(string userid,string docname,string url, string driect_url) + { + URL = url; + Driect_URL = driect_url; + RECEIPTTYPE = docname; + SetModify(userid); + } + + public void SetModify(string userid) + { + MODIFIEDUSER = userid; + MODIFIEDTIME = DateTime.Now; + } + + #region 外键 => 导航属性,ManyToMany + + #endregion + } + + [Table("wms_settlement_list")] + public partial class wms_settlement_list_md { + [Key] + public string GID { get; set; } + public string DUINO { get; set; } + public string CUSTOMERNAME { get; set; } + public DateTime? STARTBILLINGDATE { get; set; } + public DateTime? ENDBILLINGDATE { get; set; } + public string REMARK { get; set; } + public string CORPID { get; set; } + public string CREATEUSER { get; set; } + public DateTime? CREATETIME { get; set; } + public bool? ISMAKEOUT { get; set; } + public string MAKEOUTUSER { get; set; } + public DateTime? MAKEOUTTIME { get; set; } + public bool? ISDELETE { get; set; } + public string DELETEUSER { get; set; } + public DateTime? DELETETIME { get; set; } + public bool? ISLOCK { get; set; } + public string LOCKUSER { get; set; } + public DateTime? LOCKTIME { get; set; } + } + + [Table("wms_settlement_detail")] + public partial class wms_settlement_detail_md + { + [Key] + public string GID { get; set; } + public string DUIGID { get; set; } + public string DUINO { get; set; } + public string BLNO { get; set; } + public string CONTRACTNO { get; set; } + public string WMSNO { get; set; } + public string OUTBSNO { get; set; } + public string CUSTOMERNAME { get; set; } + public string STORAGENAME { get; set; } + public string GOODSNAME { get; set; } + public string GOODSMODEL { get; set; } + public string GOODSSTANDARD { get; set; } + public string GOODSGRADE { get; set; } + public DateTime? WMSDATE { get; set; } + public DateTime? DODATE { get; set; } + public int? WMSDAYS { get; set; } + public DateTime? STARTBILLINGDATE_OUT { get; set; } + public DateTime? ENDBILLINGDATE_OUT { get; set; } + public decimal? GOODSOUTFEE { get; set; } + public decimal? GOODSPACK { get; set; } + public decimal? GOODSPACKACTUAL { get; set; } + public decimal? GOODSPACKPFSL { get; set; } + public decimal? GOODSPACKSTOCK { get; set; } + public decimal? GOODSRKSL { get; set; } + public decimal? GOODSRKSLACTUAL { get; set; } + public decimal? GOODSPFSL { get; set; } + /// + /// 库存量 + /// + public decimal? GOODSSTOCK { get; set; } + public string CHARGEUNIT { get; set; } + public string REMARK_OUT { get; set; } + public int? FEETYPE { get; set; } + public int? FEEGRADE { get; set; } + public int? FEESCALE { get; set; } + public decimal? FEEPRICE { get; set; } + public DateTime? STARTBILLINGDATE { get; set; } + public DateTime? ENDBILLINGDATE { get; set; } + public int? FEEDAYS { get; set; } + public decimal? OUTFEE { get; set; } + public decimal? ARFEE { get; set; } + public string CREATEUSER { get; set; } + public DateTime? CREATETIME { get; set; } + public bool? ISMAKEOUT { get; set; } + public string MAKEOUTUSER { get; set; } + public DateTime? MAKEOUTTIME { get; set; } + public string CORPID { get; set; } + public int? LINENUM { get; set; } + public string GID_LINK { get; set; } + public bool? ISDELETE { get; set; } + public string DELETEUSER { get; set; } + public DateTime? DELETETIME { get; set; } + public string CUSTOMNO { get; set; } + public bool? ISLOCK { get; set; } + public string LOCKUSER { get; set; } + public DateTime? LOCKTIME { get; set; } + + + } + + [Table("OP_STATUS")] + public partial class op_status_md { + + /* private string _ST_ID;//惟一编号 + private string _BSNO;//业务编号 + private string _STATUS;//业务状态 + private string _ISCOMP;//是否完成 + private DateTime _COMPTIME;//完成时间 + private string _COMPOP;//完成人 + private string _REMARK;//备注 + private string _INPUTBY;//录入人 + private string _ORDNO;//顺序号 + private string _STATUS_OPSEAE;//对应op_seae状态字段*/ + [Key] + public string ST_ID { get; set; } + public string BSNO { get; set; } + public string STATUS { get; set; } + public bool? ISCOMP { get; set; } + public DateTime? COMPTIME { get; set; } + public string COMPOP { get; set; } + public string REMARK { get; set; } + public string INPUTBY { get; set; } + public DateTime? INPUTTIME { get; set; } + public int? ORDNO { get; set; } + public string STATUS_OPSEAE { get; set; } + public string STTYPE { get; set; } + public string ISOPEN { get; set; } + public DateTime? OPTIME { get; set; } + + + } + + + [Table("code_cust_edi")] + public partial class code_cust_edi_md + { + [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; } + } + + [Table("code_issutype_edi")] + public partial class code_issutype_edi_md + { + [Key] + public string GID { get; set; } + public string BLTYPE { 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_country")] + public partial class code_country_md + + { + [Key] + public string GID { get; set; } + public string COUNTRYID { get; set; } + public string COUNTRY { get; set; } + public string CAPITAL { get; set; } + public string CHAU { get; set; } + public string EXPLAIN { get; set; } + public string COUNTRYID_3 { get; set; } + + public byte? Tariff { get; set; } + public byte? Tonnagetax { get; set; } + public string COUNTRYENAME { get; set; } + + public string getCnName() { + return COUNTRY.Replace(getEnName(), "").Replace("()", ""); + } + public string getEnName() + { + var firstNumberBetweenBrackets = COUNTRY.Split('(', ')')[1]; + return firstNumberBetweenBrackets; + } + } + + [Table("wms")] + public partial class wms_md + { + [Key] + public string GID { get; set; } + public string WMSNO { get; set; } + public DateTime? WMSDATE { get; set; } + public string CUSTOMERNAME { get; set; } + public string WMSOP { get; set; } + public string STOREMAN { get; set; } + public string MODIFIEDUSER { get; set; } + public DateTime? MODIFIEDTIME { get; set; } + public bool? ISDELETE { get; set; } + public string DELETEUSER { get; set; } + public DateTime? DELETETIME { get; set; } + public string TRUCKNAME { get; set; } + public bool? ISLOCK { get; set; } + public string LOCKUSER { get; set; } + public DateTime? LOCKTIME { get; set; } + public decimal? GOODSPACK { get; set; } + public decimal? GOODSPACKSTOCK { get; set; } + public decimal? GOODSRKSL { get; set; } + public decimal? GOODSSTOCK { get; set; } + public decimal? ARFEE { get; set; } + public decimal? APFEE { get; set; } + public string ASSOCIATEDNO { get; set; } + public string BLNO { get; set; } + public int? FREESTORAGEPERIOD { get; set; } + public string CONTRACTNO { get; set; } + public string GOODSNAME { get; set; } + public string GOODSMODEL { get; set; } + public string CLIENTCODEOLD { get; set; } + public string CLIENTNAMEOLD { get; set; } + public string STORAGENAME { get; set; } + public string CHARGEUNIT { get; set; } + public string CORPID { get; set; } + public DateTime? STARTBILLINGDATE { get; set; } + public string CUSTOMNO { get; set; } + public string CUSTNO { get; set; } + public string GOODSSTANDARD { get; set; } + public decimal? GOODSPACKACTUAL { get; set; } + public decimal? GOODSRKSLACTUAL { get; set; } + public string ARCLIENT { get; set; } + public int? FREESTORAGEPERIODAP { get; set; } + public DateTime? STARTBILLINGDATEAP { get; set; } + public bool? ISCHANGE { get; set; } + public string AREANAME { get; set; } + public decimal? MARKETVALUE { get; set; } + public decimal? BANKVALUE { get; set; } + public string CREATEUSER { get; set; } + public DateTime? CREATETIME { get; set; } + public string CLIENTBSNO { get; set; } + public string CARGOGID { get; set; } + public string CARGO_GID { get; set; } + public string REMARK { get; set; } + public string BZTCHNO { get; set; } + public string putintype { get; set; } + public string WHS_CODE { get; set; } + public string GOODSNAMEID { get; set; } + public string ACCDATE { get; set; } + public bool? FEESTATUS { get; set; } + public bool ISLOCK2 { get; set; } = false; + public string PICIHAO { get; set; } + public bool? ISVOU { get; set; } + public string VOUNO { get; set; } + public decimal? TiDanJianShu { get; set; } + public decimal? TiDanZhongLiang { get; set; } + public decimal? GOODSKGS { get; set; } + public string FilePath { get; set; } + public string REMARKS { get; set; } + public string COMPANY { get; set; } + public string Factory { get; set; } + public string Driver { get; set; } + public string TruckNo { get; set; } + public bool? EIP { get; set; } + public string WET { get; set; } + public decimal? RENTAREA { get; set; } + public int? BillFeeStatus { get; set; } + public DateTime? BILLFEESTATUSTIME { get; set; } + public string SALE { get; set; } + } + + [Table("wms_in")] + public partial class wms_in_md + { + [Key] + public string GID { get; set; } + public string ASSOCIATEDNO { get; set; } + public string BLNO { get; set; } + public string CONTRACTNO { get; set; } + public string CNTRNO { get; set; } + public string SEALNO { get; set; } + public string BSNO { get; set; } + public string CLIENTCODE { get; set; } + public string CLIENTNAME { get; set; } + public DateTime? DODATE { get; set; } + public string STORAGECODE { get; set; } + public string STORAGENAME { get; set; } + public string AREACODE { get; set; } + public string AREANAME { get; set; } + public string GOODSCODE { get; set; } + public string GOODSNAME { get; set; } + public string GOODSTYPE { get; set; } + public string GOODSMODEL { get; set; } + public string GOODSSTANDARD { get; set; } + public decimal? GOODSPACK { get; set; } + public string CHARGEUNIT { get; set; } + + /// + /// 入库量 + /// + public decimal? GOODSRKSL { get; set; } + /// + /// 库存量 + /// + public decimal? GOODSSTOCK { get; set; } + public int? FREESTORAGEPERIOD { get; set; } + public bool? ISLOCK { get; set; } + public DateTime? LOCKTIME { get; set; } + public string LOCKUSER { get; set; } + public bool? ISDELETE { get; set; } + public DateTime? DELETETIME { get; set; } + public string DELETEUSER { get; set; } + public string CREATEUSER { get; set; } + public DateTime? CREATETIME { get; set; } + public string MODIFIEDUSER { get; set; } + public DateTime? MODIFIEDTIME { get; set; } + public string REMARK { get; set; } + public decimal? GOODSPACKSTOCK { get; set; } + public string KINDPKGS { get; set; } + /// + /// 重量 + /// + public decimal? GOODSKGS { get; set; } + public string CLIENTCODEOLD { get; set; } + public string CLIENTNAMEOLD { get; set; } + public decimal? ARFEE { get; set; } + public decimal? APFEE { get; set; } + public string CORPID { get; set; } + public string CTNALL { get; set; } + public decimal? GOODSTHICKNESS { get; set; } + public decimal? GOODSWIDTH { get; set; } + public decimal? GOODSLENGTH { get; set; } + public decimal? GOODSSLICE { get; set; } + public string GOODSGRADE { get; set; } + public string STACKLOCATION { get; set; } + public decimal? GOODSPACKACTUAL { get; set; } + public decimal? GOODSRKSLACTUAL { get; set; } + public bool? ISCHANGE { get; set; } + public decimal? MARKETVALUE { get; set; } + public decimal? BANKVALUE { get; set; } + public int? LINENUM { get; set; } + public string GOODSNAMEID { get; set; } + public string PICIHAO { get; set; } + public bool ISLOCK2 { get; set; } = false; + public string XIANGHAO2 { get; set; } + public decimal? JIANSHU2 { get; set; } + public string ZHUANGXIEGONGID { get; set; } + public string TRUCKNO { get; set; } + public double LUYUNFEI { get; set; } + public double DIAOTOUFEI { get; set; } + public double XIUXIXIANGFEI { get; set; } + public double DIAOZHUANGFEI { get; set; } + public string CHEDUIID { get; set; } + public double CHIMA1 { get; set; } + public double CHIMA2 { get; set; } + public decimal? ZHONGLIANG2 { get; set; } + /// + /// 实际重量 + /// + public double SHIJIZHONGLIANG { get; set; } + public double SHIJICHIMA { get; set; } + public decimal? JIANSHU1 { get; set; } + public decimal? ZhuangXieFei { get; set; } + public bool? ISVOU { get; set; } + public string VOUNO { get; set; } + public string ZhuangXieFeeType { get; set; } + public string COUNTRYID { get; set; } + public string dock { get; set; } + public decimal? LinShiZhuangXieFeiDanJiaDun { get; set; } + public decimal? LinShiZhuangXieFeiDanJiaJian { get; set; } + public string Productiondate { get; set; } + public string FactoryNo { get; set; } + public string TrayNo { get; set; } + public decimal? LOADERFEE { get; set; } + public string INVOICENO { get; set; } + public string BZTCHNO { get; set; } + public int? BillFeeStatus { get; set; } + public DateTime? BILLFEESTATUSTIME { get; set; } + + } + + + + [Table("wms_out")] + public partial class wms_out_md + { + [Key] + public string GID { get; set; } + public string ASSOCIATEDNO { get; set; } + public string BSNO { get; set; } + public string CLIENTGID { get; set; } + public string CLIENTCODE { get; set; } + public string CUSTOMERNAME { get; set; } + public DateTime? DODATE { get; set; } + public string STORAGECODE { get; set; } + public string STORAGENAME { get; set; } + public string AREACODE { get; set; } + public string AREANAME { get; set; } + public string GOODSCODE { get; set; } + public string GOODSNAME { get; set; } + public string GOODSTYPE { get; set; } + public string GOODSMODEL { get; set; } + public string GOODSSTANDARD { get; set; } + public string GOODSPACK { get; set; } + /// + /// 出库量 + /// + public decimal? GOODSPFSL { get; set; } + public decimal? GOODSOUTFEE { get; set; } + public string TRUCKNO { get; set; } + public string REMARK { get; set; } + public bool? ISDELETE { get; set; } + public DateTime? DELETETIME { get; set; } + public string DELETEUSER { get; set; } + public string CREATEUSER { get; set; } + public DateTime? CREATETIME { get; set; } + public string MODIFIEDUSER { get; set; } + public DateTime? MODIFIEDTIME { get; set; } + + /// + /// 出库件数 + /// + public decimal? GOODSPACKPFSL { get; set; } + public string TRUCKNAME { get; set; } + public string WMSOP { get; set; } + public string STOREMAN { get; set; } + public bool? ISLOCK { get; set; } + public string LOCKUSER { get; set; } + public DateTime? LOCKTIME { get; set; } + public decimal? GOODSOUTFEEAP { get; set; } + public decimal? ARFEE { get; set; } + public decimal? APFEE { get; set; } + public string INSPECTIONNO { get; set; } + public string CUSTOMNO { get; set; } + public string CORPID { get; set; } + public string CLIENTNAMEOLD { get; set; } + public DateTime? OLDCUSTFEEDATE { get; set; } + public string CLIENTBSNO { get; set; } + public string ARCLIENT { get; set; } + public string INGIDNEW { get; set; } + public string TOTALNO { get; set; } + public string REMARK2 { get; set; } + public DateTime? VALIDDATE { get; set; } + public string CHARGEUNIT { get; set; } + public string MBLNONEW { get; set; } + public bool? ISCHANGE { get; set; } + public decimal? MARKETVALUE { get; set; } + public string ARCLIENTWMSOUT { get; set; } + public string BZTCHNO { get; set; } + public byte? WMSOUTSTATUS { get; set; } + public string WHS_CODE { get; set; } + public string GOODSNAMEID { get; set; } + public string ACCDATE { get; set; } + public bool? FEESTATUS { get; set; } + public decimal? ARFEE_2 { get; set; } + public bool? ISVOU { get; set; } + public string VOUNO { get; set; } + public bool? ISCOLLECTING { get; set; } + public string FilePath { get; set; } + public string EXPRESSEXNO { get; set; } + public string EXPRESSCORP { get; set; } + public string IsDetail { get; set; } + public string SaleContract { get; set; } + public bool? EIP { get; set; } + public decimal? zhuangxiefei { get; set; } + public string QUOTANO { get; set; } + public decimal? RENTAREA { get; set; } + public string CNTRTOTAL { get; set; } + public decimal? KGS_OUT { get; set; } + public decimal? PKGS_OUT { get; set; } + public decimal? CBM_OUT { get; set; } + public int? BillFeeStatus { get; set; } + public DateTime? BILLFEESTATUSTIME { get; set; } + public string COUNTRYOFORIGIN { get; set; } + + public void SetSum(List outdetaillist) + { + GOODSPFSL = outdetaillist.Sum(s => s.GOODSPFSL); + GOODSPACKPFSL = outdetaillist.Sum(s => s.GOODSPACKPFSL); + PKGS_OUT = GOODSPACKPFSL; + KGS_OUT= outdetaillist.Sum(s => s.GOODSKGS); + if (CHARGEUNIT == "CBM") + { + CBM_OUT = GOODSPFSL; + } + else { + CBM_OUT = 0; + } + } + } + + [Table("wms_out_detail")] + public partial class wms_out_detail_md + { + [Key] + public string GID { get; set; } + public string INBSNO { get; set; } + public string OUTBSNO { get; set; } + public string BSNO { get; set; } + public string CLIENTGID { get; set; } + public string CLIENTCODE { get; set; } + public string CUSTOMERNAME { get; set; } + public DateTime? DODATE { get; set; } + public string STORAGECODE { get; set; } + public string STORAGENAME { get; set; } + public string AREACODE { get; set; } + public string AREANAME { get; set; } + public string GOODSCODE { get; set; } + public string GOODSNAME { get; set; } + public string GOODSTYPE { get; set; } + public string GOODSMODEL { get; set; } + public string GOODSSTANDARD { get; set; } + public string GOODSPACK { get; set; } + /// + /// 计费单位 吨/千克/CBM/箱/件 + /// + public string CHARGEUNIT { get; set; } + /// + /// 出库量 + /// + public decimal? GOODSPFSL { get; set; } + public decimal? GOODSOUTFEE { get; set; } + public string TRUCKNO { get; set; } + public string CREATEUSER { get; set; } + public DateTime? CREATETIME { get; set; } + public string REMARK { get; set; } + public string ASSOCIATEDNO { get; set; } + /// + /// 出库件数 + /// + public decimal? GOODSPACKPFSL { get; set; } + public decimal? ARFEE { get; set; } + public decimal? APFEE { get; set; } + public bool? ISLOCK { get; set; } + public string LOCKUSER { get; set; } + public DateTime? LOCKTIME { get; set; } + public decimal? GOODSOUTFEEAP { get; set; } + public string CORPID { get; set; } + public string CLIENTNAMEOLD { get; set; } + public DateTime? OLDCUSTFEEDATE { get; set; } + public DateTime? STARTBILLINGDATE { get; set; } + public DateTime? ENDBILLINGDATE { get; set; } + public int? FEEDAYS { get; set; } + public decimal? GOODSSLICE { get; set; } + public string GOODSGRADE { get; set; } + public DateTime? STARTBILLINGDATEAP { get; set; } + public DateTime? ENDBILLINGDATEAP { get; set; } + public int? FEEDAYSAP { get; set; } + public bool? ISCHANGE { get; set; } + public decimal? MARKETVALUE { get; set; } + public string BZTCHNO { get; set; } + public string WHS_CODE { get; set; } + public string GOODSNAMEID { get; set; } + public string TRUCKTYPE { get; set; } + public string ZHUANGXIEGONGID { get; set; } + public decimal? TRUCKKGS { get; set; } + public decimal? ARFEE_2 { get; set; } + public string QianFengNO { get; set; } + public decimal? GOODSKGS { get; set; } + public decimal? ZHONGLIANG2 { get; set; } + public string TRGID { get; set; } + public string TrayNo { get; set; } + public string CntrNo { get; set; } + public string SealNo { get; set; } + public decimal? zhuangxiefei { get; set; } + public string DRIVERIDCARD { get; set; } + public decimal? LOADERFEE { get; set; } + public string GOODSCKQSTOCK { get; set; } + + } + + /// + /// 暂时只用于查询出库相关库存在入库单和入库单明细中的提单号箱号 + /// + [Table("VW_WMS_OUT_DETAIL")] + public partial class VW_WMS_OUT_DETAIL_md + { + [Key] + public string GID_OUT { get; set; } + public string BLNO { get; set; } + public string CNTRNO { get; set; } + + public string GOODSNAME_OUT { get; set; } + } + + + [Table("workflow_type")] + public class workflow_type_md + { + [Key] + public string GID { get; set; } + /// + /// 英文名 + /// + public string NAME { get; set; } + public string DESCRIPTION { get; set; } + /// + /// 类型序列号 数字 + /// + public int? TYPENO { get; set; } + public string CREATEUSER { get; set; } + public DateTime? CREATETIME { get; set; } + public string MODIFIEDUSER { get; set; } + public DateTime? MODIFIEDTIME { get; set; } + } + + [Table("workflow")] + public partial class workflow_md + { + [Key] + public string GID { get; set; } + public string NAME { get; set; } + public string DESCRIPTION { get; set; } + public string MODULEID { get; set; } + public int? TYPE { get; set; } + public string CREATEUSER { get; set; } + public DateTime? CREATETIME { get; set; } + public string MODIFIEDUSER { get; set; } + public DateTime? MODIFIEDTIME { get; set; } + public int? STATE { get; set; } + public int? SORT { get; set; } + public int? ISDELETE { get; set; } + public string COMPANYID { get; set; } + public string DEPTGID { get; set; } + public string TASKURL { get; set; } + public Byte ISDEFAULT { get; set; } + public bool ISCONDITION { get; set; } + public string CONDITIONSQL { get; set; } + public Byte? SORTNO { get; set; } + } + + [Table("workflow_step")] + public partial class workflow_step_md + { + [Key] + public string GID { get; set; } + public string NAME { get; set; } + public string DESCRIPTION { get; set; } + public string WORKFLOWID { get; set; } + public int? STEPNO { get; set; } + public string DEFAULTAUDITOR { get; set; } + public string AUDITOR { get; set; } + public string CONDITIONID { get; set; } + public bool? NEEDALLPASS { get; set; } + public bool? ISMUST { get; set; } + public bool? ISLAST { get; set; } + public string GROUPID { get; set; } + public string NextGROUP { get; set; } + public string NextSTEPNO { get; set; } + public string CREATEUSER { get; set; } + public DateTime? CREATETIME { get; set; } + public string MODIFIEDUSER { get; set; } + public DateTime? MODIFIEDTIME { get; set; } + public string REMARK { get; set; } + public bool? ISPARALLEL { get; set; } + public bool? ISDEPARTMENT { get; set; } + public string DEPARTMENTID { get; set; } + public string TASKURL { get; set; } + } + + [Table("workflow_UserPath")] + public partial class workflow_UserPath_md + { + [Key] + public Int32 id { get; set; } + public string USERID { get; set; } + public string workflowTypeNO { get; set; } + public string workflowID { get; set; } + } + + [Table("BillCheckOut")] + public partial class BillCheckOut_md + { + [Key] + public string GID { get; set; } + public string CHECKOUTNO { get; set; } + public string CUSTOMERNAME { get; set; } + public string CORPID { get; set; } + public string SALECORPID { get; set; } + public string INPUTBY { get; set; } + public DateTime? CREATETIME { get; set; }=DateTime.Now; + public string MODIFIER { get; set; } + public DateTime? MODIFYTIME { get; set; } = DateTime.Now; + public bool? SENDED { get; set; } = false; + public string SENDER { get; set; } + public DateTime? SENDTIME { get; set; } + public string RECEIVER { get; set; } + public string RECEIVEEMAIL { get; set; } + public bool? ISCHECKOUT { get; set; } = false; + public DateTime? CHECKOUTTIME { get; set; } + public string CHECKOUTUSER { get; set; } + public string MAILPDFURL { get; set; } + public string SIGNPDFURL { get; set; } + } + + + + [Table("BillCheckOut_Detail")] + public partial class BillCheckOut_Detail_md + { + [Key] + public string GID { get; set; } + public string LINKGID { get; set; } + public string CHECKOUTNO { get; set; } + public string BSNO { get; set; } + + } + + [Table("VW_BillCheckOut_Detail")] + public partial class VW_BillCheckOut_Detail_md + { + [Key] + public string GID { get; set; } + public string LINKGID { get; set; } + public string CHECKOUTNO { get; set; } + public string BSNO { get; set; } + public DateTime? ETD { get; set; } + public string MBLNO { get; set; } + public string HBLNO { get; set; } + public string CUSTNO { get; set; } + public string VESSEL { get; set; } + public string VOYNO { get; set; } + } + + + [Table("VW_BILL_BLISSUE_WORKLOG")] + public partial class VW_BILL_BLISSUE_WORKLOG_md + { + [Key] + public string GID { get; set; } + public string DOBSNO { get; set; } + public DateTime? OPDATE { get; set; } + public string ACTNAME { get; set; } + public string REMARK { get; set; } + public string BSNO { get; set; } + } + + [Table("WorkLog")] + public partial class WorkLog_md + { + [Key] + public string GID { get; set; } + public string BSNO { get; set; } + public string OP { get; set; } + public DateTime? OPDATE { get; set; } + public string ACTNAME { get; set; } + public string REMARK { get; set; } + public string ACTRESULT { get; set; } + } + + + + public static class StrHelper + { + #region 将一个dictionary转化为用;;和::隔开的文本 + public static string DicToStr(Dictionary dic) + { + var result = ""; + + foreach (var item in dic) + { + result += item.Key + "::" + item.Value + ";;"; + } + + return result; + } + #endregion + + #region 将一个用;;和::隔开的文本转化为dictionary + public static Dictionary StrToDic(string dicstr) + { + var result = new Dictionary(); + + var list = Regex.Split(dicstr, ";;").ToList(); + + foreach (var item in list) + { + var itemarray = Regex.Split(item, "::"); + if (itemarray.Length < 2) continue; + result.Add(itemarray[0], itemarray[1] == null ? "" : itemarray[1]); + } + + return result; + } + #endregion + } +} \ No newline at end of file diff --git a/DSWeb.Common/DB/CommonDataContext.cs b/DSWeb.Common/DB/CommonDataContext.cs new file mode 100644 index 0000000..c7e8e13 --- /dev/null +++ b/DSWeb.Common/DB/CommonDataContext.cs @@ -0,0 +1,95 @@ +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") + { + + } + + public CommonDataContext(string conn) : base(conn) + { + + } + + public DbSet MailSend { get; set; } + public DbSet MailSendSmtp { get; set; } + public DbSet MpConfigs { get; set; } + + public DbSet code_FtpSet { get; set; } + + public DbSet OP_LOGICINFO { get; set; } + + public DbSet sys_param_set { get; set; } + + public DbSet OP_CTN { get; set; } + + public DbSet Op_INTERNALTRADE { get; set; } + public DbSet info_client { get; set; } + public DbSet info_client_bank { get; set; } + public DbSet Info_Client_ACCDATE { get; set; } + + public DbSet code_fee { get; set; } + public DbSet CODE_CTN { get; set; } + public DbSet op_other { get; set; } + public DbSet ch_fee { get; set; } + public DbSet ch_fee_invoice { get; set; } + public DbSet ch_fee_invoicedetail { get; set; } + public DbSet code_goods_inv { get; set; } + + public DbSet ch_fee_do { get; set; } + public DbSet ch_fee_payapplication { get; set; } + + + public DbSet company { get; set; } + + public DbSet v_op_bs { get; set; } + public DbSet v_op_bill { get; set; } + + public DbSet v_fee_do_settlement{ get; set; } + + public DbSet v_ch_fee_settlementinfo { get; set; } + public DbSet VW_user { get; set; } + public DbSet Receipt_Doc { get; set; } + + public DbSet wms_settlement_detail { get; set; } + public DbSet wms_settlement_list { get; set; } + + public DbSet op_status { get; set; } + + public DbSet code_cust_edi { get; set; } + public DbSet code_issutype_edi { get; set; } + + public DbSet code_country { get; set; } + public DbSet wms { get; set; } + public DbSet wms_in { get; set; } + public DbSet wms_out { get; set; } + public DbSet wms_out_detail { get; set; } + public DbSet VW_WMS_OUT_DETAIL { get; set; } + + + public DbSet workflow_type { get; set; } + public DbSet workflow { get; set; } + public DbSet workflow_step { get; set; } + public DbSet workflow_UserPath { get; set; } + + public DbSet BillCheckOut { get; set; } + public DbSet BillCheckOut_Detail { get; set; } + public DbSet VW_BillCheckOut_Detail { get; set; } + public DbSet VW_BILL_BLISSUE_WORKLOG { get; set; } + + + public DbSet WorkLog { get; set; } + + } + + +} \ No newline at end of file diff --git a/DSWeb.Common/DB/DS6Comm.cs b/DSWeb.Common/DB/DS6Comm.cs new file mode 100644 index 0000000..1803d19 --- /dev/null +++ b/DSWeb.Common/DB/DS6Comm.cs @@ -0,0 +1,816 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text.RegularExpressions; +using System.Web; + +namespace DSWeb.Common.DB +{ + [Table("t_PublicInterface_Log")] + public partial class t_PublicInterface_Log_md + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long ID { get; set; } + public string GID { get; set; } + public string PORTNAME { get; set; } + public DateTime? CreateTime { get; set; } + public string Param { get; set; } + } + + [Table("t_crm_client")] + public partial class t_crm_client_md + { + [Key] + public string 客户简称 { get; set; } + public string 客户状态 { get; set; } + public string 客户价值 { get; set; } + public string 客户性质 { get; set; } + public int? 结费期限 { get; set; } + public string 代码 { get; set; } + public string EDI代码 { get; set; } + public string 客户全称 { get; set; } + public string 通讯地址 { get; set; } + public string 邮箱 { get; set; } + public string 网站 { get; set; } + public string 电话 { get; set; } + public string 传真 { get; set; } + public string 揽货人 { get; set; } + public string 法人 { get; set; } + public string 营业执照 { get; set; } + public string 国税登记 { get; set; } + public string 地税登记 { get; set; } + public string 开户行USD { get; set; } + public string 帐号USD { get; set; } + public string 开户行RMB { get; set; } + public string 帐号RMB { get; set; } + public string 发票抬头 { get; set; } + public string 企业规模 { get; set; } + public string 业务货量 { get; set; } + public string 出口区域 { get; set; } + public string 业务区域 { get; set; } + public string 出口箱型 { get; set; } + public string 货物名称 { get; set; } + public string 报关名称 { get; set; } + public string 海关编码 { get; set; } + public string 商品编码 { get; set; } + public bool? 是否商检 { get; set; } + public bool? 是否熏蒸 { get; set; } + public bool? 是否报关 { get; set; } + public string 报关习惯 { get; set; } + public string 运价要求 { get; set; } + public string 付费习惯 { get; set; } + public string 结费方式 { get; set; } + public string 发票要求 { get; set; } + public string 船公司要求 { get; set; } + public string 提单要求 { get; set; } + public string 结费习惯 { get; set; } + public string 派车习惯 { get; set; } + public string 操作习惯 { get; set; } + public string 注重环节 { get; set; } + public string 评价分析 { get; set; } + public string 其他要求 { get; set; } + public string 录入人 { get; set; } + public DateTime? 录入日期 { get; set; } + public string 快捷代码 { get; set; } + public string 备注 { get; set; } + public bool? 船公司 { get; set; } + public bool? 场站 { get; set; } + public bool? 车队 { get; set; } + public bool? 报关行 { get; set; } + public bool? 委托单位 { get; set; } + public bool? 代理 { get; set; } + public bool? 货代 { get; set; } + public bool? 收货人 { get; set; } + public bool? 发货人 { get; set; } + public bool? 通知人 { get; set; } + public bool? 航空公司 { get; set; } + public bool? 其他客户 { get; set; } + public string 客服员 { get; set; } + public bool? 快递公司 { get; set; } + public string 行业类型 { get; set; } + public DateTime? 登记日期 { get; set; } + public string 美元支票抬头 { get; set; } + public string 人民币支票抬头 { get; set; } + public string 结费类型 { get; set; } + public string 类型模式 { get; set; } + public string 日期模式 { get; set; } + public decimal? 结费金额 { get; set; } + public int? 结费日期 { get; set; } + public int? 结费开始 { get; set; } + public int? 结费结束 { get; set; } + public int? 结费开始2 { get; set; } + public int? 结费结束2 { get; set; } + public int? 结费日期2 { get; set; } + public DateTime? 结费开始日期 { get; set; } + public decimal? 退佣标准 { get; set; } + public decimal? 默认税率 { get; set; } + public string 国家 { get; set; } + public string 洲 { get; set; } + public string 城市 { get; set; } + public string IGZ代码 { get; set; } + public bool? 船代 { get; set; } + public int? 结费优惠期限 { get; set; } + public string 帐龄状态 { get; set; } + public string 订舱系统序列号 { get; set; } + public bool? 订舱代理 { get; set; } + public string 外运代码 { get; set; } + public string 英文全称 { get; set; } + public string 企业代码 { get; set; } + public string 国家代码 { get; set; } + public string VGM代码 { get; set; } + public string 放单状态 { get; set; } + public string 扣单状态 { get; set; } + public string 大简云代码 { get; set; } + public string 客商编码 { get; set; } + + public string bizCsCustId { get; set; } + + } + + public class csCust + { + /// + /// 来源业务系统ID + /// + public string bizCsCustId { get; set; } + /// + /// 业务系统(OTW(otw)/报关系统(bg)/船货代系统(FR)) + /// + public string bizSystemType { get; set; } + /// + /// 客商编码(需校验唯一性) + /// + public string custCode { get; set; } + /// + /// 中文简称 + /// + public string custAlias { get; set; } + /// + /// 英文全称 + /// + public string custNameEn { get; set; } + /// + /// VARCHAR(200) 中文全称 + /// + public string custNameCn { get; set; } + /// + /// VARCHAR(50) 国家 + /// + public string countryCode { get; set; } + /// + /// VARCHAR(50) 国家名称(中文) + /// + public string countryNameCn { get; set; } + /// + /// VARCHAR(50) 省份/州 + /// + public string stateCode { get; set; } + /// + /// VARCHAR(50) 省份/州 + /// + public string stateName { get; set; } + /// + /// VARCHAR(50) 城市 + /// + public string cityCode { get; set; } + /// + /// VARCHAR(50) 城市名 + /// + public string cityName { get; set; } + /// + /// VARCHAR(20) 邮政编码 + /// + public string zip { get; set; } + /// + /// VARCHAR(200) 中文地址 + /// + public string addrCn { get; set; } + /// + /// VARCHAR(200) 英文地址 + /// + public string addrEn { get; set; } + /// + /// CHAR(1) 有效标志 + /// + public string active { get; set; } + /// + /// CHAR(1) 一次性客商Y:是N:否 + /// + public string isOneTimeCustomers { get; set; } + /// + /// VARCHAR(20) 失效人 + /// + public string invalidName { get; set; } + /// + /// VARCHAR(50) 失效时间 + /// + public string invalidTime { get; set; } + /// + /// 规模(单个公司、员工型、一次性、全国、区域) + /// + public string scale { get; set; } + /// + /// VARCHAR(200) 所有制信息(国有企业、民营企业、三资企业、非营业组织机构、自然人) + /// + public string ownership { get; set; } + /// + /// VARCHAR(50) 销售渠道 + /// + public string salesChannelS { get; set; } + /// + /// CHAR(1) 是否结算对象Y:是N:否 + /// + public string isSettlement { get; set; } + /// + /// VARCHAR(50) 结算对象业务系统ID + /// + public string settleCustID { get; set; } + /// + /// VARCHAR(50) 结算对象 + /// + public string settleCustCode { get; set; } + /// + /// VARCHAR(50) 结算对象名称 + /// + public string settleCustName { get; set; } + /// + /// CHAR(1) 是否客户 Y:是 N:不是 + /// + public string csFlag { get; set; } + /// + /// CHAR(1) 是否供应商 Y:是 N:不是 + /// + public string supplierFlag { get; set; } + /// + /// VARCHAR(50) 注册资本 + /// + public string registeredCapitqal { get; set; } + /// + /// VARCHAR(50) 注册时间 + /// + public string registeredTime { get; set; } + /// + /// VARCHAR(50) 统一信用代码(对应主数据的企业注册码) + /// + public string unifiedCreditNo { get; set; } + /// + /// VARCHAR(50) 组织机构代码(对应主数据组织机构证代码) + /// + public string clientNo { get; set; } + /// + /// VARCHAR(50) 纳税人识别号(对应主数据税务登记证代码) + /// + public string taxpayerIdentificatioNo { get; set; } + /// + /// VARCHAR(50) 工商注册号 + ///(对应主数据营业执照注册码) + ///administration for industry and commerce 工商局 + + /// + public string aicRegisteredNo { get; set; } + /// + /// VARCHAR(50) 商检注册代码 + /// + public string iqbRegisteredNo { get; set; } + /// + /// VARCHAR(100) 海关注册代码 + /// + public string customesRegisteredNo { get; set; } + /// + /// VARCHAR(20) 法人代表 + /// + public string fictitiousPerson { get; set; } + /// + /// VARCHAR(100) 电话 + /// + public string tel { get; set; } + /// + /// VARCHAR(50) 手机 + /// + public string mobileNo { get; set; } + /// + /// VARCHAR(100) 邮箱 + /// + public string email { get; set; } + /// + /// VARCHAR(50) 传真 + /// + public string fax { get; set; } + /// + /// CHAR(1) 客户状态:1、临时客户2、正式客户 + /// + public string custStatus { get; set; } + /// + /// VARCHAR(50) 客户主数据代码 CDH(common data HUB) + /// + public string cdhCode { get; set; } + /// + /// VARCHAR(50) 供应商主数据代码 + /// + public string vCdhCode { get; set; } + /// + /// VARCHAR(1) 客户类型((内部组织I、外部组织O) + /// + public string custType { get; set; } + /// + /// VARCHAR(50) 创建人 + /// + public string creator { get; set; } + /// + /// VARCHAR(50) 创建时间 + /// + public string createTime { get; set; } + /// + /// VARCHAR(30) 行业类别 + /// + public string lndustryType { get; set; } + /// + /// VARCHAR(50) 行业子类(取自数据字典)(暂不使用) + /// + public string subLndustryType { get; set; } + /// + /// VARCHAR(50) 开票限额 + /// + public string invoiceMaximum { get; set; } + /// + /// VARCHAR(20) 默认付款条件(暂不使用) + /// + public string defaultPaymentTerm { get; set; } + /// + /// VARCHAR(20) 默认收款条件(暂不使用) + /// + public string defaultCollectionTerm { get; set; } + /// + /// VARCHAR(500) 备注 + /// + public string remark { get; set; } + /// + /// VARCHAR(20) 课税性质(一般纳税人、小规模纳税人) + /// + public string taxNature { get; set; } + /// + /// VARCHAR(50) 最后修改人 + /// + public string lastModifor { get; set; } + /// + /// VARCHAR(50) 最后修改时间 + /// + public string lastModifyTime { get; set; } + /// + /// VARCHAR(50) 内部组织代码 + /// + public string custOfficeCode { get; set; } + + public csCustOfficeInfo CustOfficeInfo { get; set; } + public csCustInvoice CustInvoice { get; set; } + public List CustType { get; set; } + public List CustContact { get; set; } + public List CustSales { get; set; } + public List CustAccount { get; set; } + + public t_crm_client_md GetCrmClient() { + var result = new t_crm_client_md(); + result.bizCsCustId = bizCsCustId; + result.客商编码 = custCode; + result.客户简称 = custAlias; + result.英文全称 = custNameEn; + result.客户全称 = custNameCn; + result.国家代码 = countryCode; + result.国家 = countryNameCn; + result.洲 = stateName; + result.城市 = cityName; + result.通讯地址 = addrCn; + + result.营业执照 = aicRegisteredNo; + result.国税登记 = taxpayerIdentificatioNo; + + result.海关编码 = customesRegisteredNo; + + result.法人 = fictitiousPerson; + result.电话 = tel; + //result.手机 = mobileNo; + result.邮箱 = email; + result.传真 = fax; + + result.录入人 = creator; + result.录入日期 = createTime == null ? DateTime.Now : Convert.ToDateTime(createTime); + result.备注 = remark; + + result.代码= CustOfficeInfo.memoryCode==null?"": (CustOfficeInfo.memoryCode.Length>10 + ?CustOfficeInfo.memoryCode.Substring(0,10) + :CustOfficeInfo.memoryCode); + + return result; + } + + } + public class csCustOfficeInfo { + /// + /// VARCHAR(50) 业务系统(OTW(otw)/报关系统(bg) /船货代系统(FR)) + /// + public string bizSystemType { get; set; } + /// + /// VARCHAR(50) 来源业务系统CS_CUST ID + /// + public string bizCsCustId { get; set; } + /// + /// VARCHAR(50) 业务系统客户资料ID + /// + public string bizCsCustOfficeInfoId { get; set; } + /// + /// VARCHAR(50) 助记码 + /// + public string memoryCode { get; set; } + /// + /// VARCHAR(100) 结算公司 + /// + public string settleOffice { get; set; } + /// + /// VARCHAR(200) 结算公司名称 + /// + public string settleOfficeName { get; set; } + /// + /// VARCHAR(200) 创建人 + /// + public string creator { get; set; } + /// + /// VARCHAR(50) 创建时间 + /// + public string createTime { get; set; } + /// + /// VARCHAR(200) 审批状态:1、未提交 2、提交未审批 3、已审批 + /// + public string approvalStatus { get; set; } + /// + /// VARCHAR(50) 客户财务编码 + /// + public string fsAccountCode { get; set; } + /// + /// VARCHAR(10) 供应商财务编码 + /// + public string vFsAccountCode { get; set; } + /// + /// VARCHAR(200) NVOCC证书号 + /// + public string nvoccNo { get; set; } + /// + /// VARCHAR(50) 有效标志 + /// + public string active { get; set; } + /// + /// VARCHAR(50) 最后修改人 + /// + public string lastModifor { get; set; } + /// + /// VARCHAR(50) 最后修改时间 + /// + public string lastModifyTime { get; set; } + + } + public class csCustType { + /// + /// VARCHAR(50) 业务系统CS_CUST ID + /// + public string bizCsCustId { get; set; } + /// + /// VARCHAR(50) 业务系统物流角色ID + /// + public string bizCsCustTypeId { get; set; } + /// + /// VARCHAR(10) 客户类型 + /// + public string custType { get; set; } + /// + /// VARCHAR(50) 创建人 + /// + public string creator { get; set; } + /// + /// VARCHAR(50) 创建时间 + /// + public string createTime { get; set; } + /// + /// VARCHAR(50) 最后修改人 + /// + public string lastModifor { get; set; } + /// + /// VARCHAR(50) 最后修改时间 + /// + public string lastModifyTime { get; set; } + + } + public class csCustContact { + /// + /// VARCHAR(50) 来源业务系统(OTW(otw)/报关(bg) /船货代系统(FR)) + /// + public string bizSystemType { get; set; } + /// + /// VARCHAR(50) 来源业务系统CS_CUST ID + /// + public string bizCsCustId { get; set; } + /// + /// VARCHAR(50) 联系人业务系统ID + /// + public string bizCsCustContactId { get; set; } + /// + /// VARCHAR(100) 中文姓名 + /// + public string contactCn { get; set; } + /// + /// VARCHAR(100) 英文姓名 + /// + public string contactEn { get; set; } + /// + /// VARCHAR(50) 国家代码 + /// + public string countryCode { get; set; } + /// + /// VARCHAR(50) 国家 + /// + public string countryNameCn { get; set; } + /// + /// VARCHAR(20) 所属部门代码 + /// + public string departmentCode { get; set; } + /// + /// VARCHAR(50) 所属部门 + /// + public string departmentName { get; set; } + /// + /// CHAR(1) 是否默认 + /// + public string isDefault { get; set; } + /// + /// VARCHAR(50) 职位 + /// + public string position { get; set; } + /// + /// VARCHAR(100) 办公电话 + /// + public string tel { get; set; } + /// + /// VARCHAR(50) 手机 + /// + public string mobileNo { get; set; } + /// + /// VARCHAR(100) 邮箱 + /// + public string email { get; set; } + /// + /// VARCHAR(100) QQ + /// + public string qq { get; set; } + /// + /// VARCHAR(10) 地址 + /// + public string address { get; set; } + /// + /// VARCHAR(500) 备注 + /// + public string remark { get; set; } + /// + /// VARCHAR(50) 传真 + /// + public string fax { get; set; } + /// + /// VARCHAR(50) 创建人 + /// + public string creator { get; set; } + /// + /// VARCHAR(50) 创建时间 + /// + public string createTime { get; set; } + /// + /// VARCHAR(50) 微信 + /// + public string wechat { get; set; } + /// + /// VARCHAR(50) 结算公司 + /// + public string settleOffice { get; set; } + /// + /// VARCHAR(100) 结算公司 + /// + public string settleOfficeName { get; set; } + /// + /// CHAR(1) 生效状态 + /// + public string active { get; set; } + /// + /// VARCHAR(3) 联系人类型(业务联系人BIZ、财务联系人FIN) + /// + public string contactType { get; set; } + /// + /// VARCHAR(50) 最后修改人 + /// + public string lastModifor { get; set; } + /// + /// VARCHAR(50) 最后修改时间 + /// + public string lastModifyTime { get; set; } + + } + public class csCustSales { + /// + /// VARCHAR(50) 来源业务系统(OTW(otw)/报关(bg) /船货代系统(FR)) + /// + public string bizSystemType { get; set; } + /// + /// VARCHAR(50) 业务系统CS_CUST ID + /// + public string bizCsCustId { get; set; } + /// + /// VARCHAR(50) 业务系统销售ID + /// + public string bizCsCustSalesId { get; set; } + /// + /// VARCHAR(20) 销售代码 + /// + public string salesCode { get; set; } + /// + /// VARCHAR(20) 中文姓名 + /// + public string salesNameCn { get; set; } + /// + /// VARCHAR(20) 英文姓名 + /// + public string salesNameEn { get; set; } + /// + /// VARCHAR(50) 结算公司 + /// + public string settleOffice { get; set; } + /// + /// VARCHAR(100) 结算公司 + /// + public string settleOfficeName { get; set; } + /// + /// VARCHAR(50) 创建人 + /// + public string creator { get; set; } + /// + /// VARCHAR(50) 创建时间 + /// + public string createTime { get; set; } + /// + /// CHAR(1) 生效状态 + /// + public string active { get; set; } + /// + /// CHAR(1) 默认 + /// + public string isDefault { get; set; } + /// + /// VARCHAR(20) 角色(C:客服,S:销售) + /// + public string roles { get; set; } + /// + /// VARCHAR(20) 业务类型CODE + /// + public string businessType { get; set; } + /// + /// VARCHAR(20) 业务类型名 + /// + public string businessTypeName { get; set; } + /// + /// VARCHAR(50) 最后修改人 + /// + public string lastModifor { get; set; } + /// + /// VARCHAR(50) 最后修改时间 + /// + public string lastModifyTime { get; set; } + + } + public class csCustAccount { + /// + /// VARCHAR(50) 来源业务系统(OTW(otw)/报关(bg) /船货代系统(FR)) + /// + public string bizSystemType { get; set; } + /// + /// VARCHAR(50) 业务系统CS_CUST ID + /// + public string bizCsCustId { get; set; } + /// + /// VARCHAR(50) 业务系统客商账号ID + /// + public string bizCsCustAccountId { get; set; } + /// + /// VARCHAR(50) 银行账号 + /// + public string accounts { get; set; } + /// + /// VARCHAR(200) 账号名称 + /// + public string bacntName { get; set; } + /// + /// VARCHAR(100) 开户银行 + /// + public string custBankName { get; set; } + /// + /// VARCHAR(20) 银行行号 + /// + public string bankNumber { get; set; } + /// + /// VARCHAR(3) 默认币别 + /// + public string currency { get; set; } + /// + /// CHAR(1) 是否默认帐户 Y:是 N:否 + /// + public string isDefault { get; set; } + /// + /// VARCHAR(20) 托收协议号 + /// + public string collectiongAgreementNo { get; set; } + /// + /// VARCHAR(50) 结算公司 + /// + public string settleOffice { get; set; } + /// + /// VARCHAR(100) 结算公司 + /// + public string settleOfficeName { get; set; } + /// + /// VARCHAR(100) 备案状态Y :有 N: 无 + /// + public string recordStatus { get; set; } + /// + /// VARCHAR(100) 备案备注 + /// + public string recodeRemark { get; set; } + /// + /// VARCHAR(50) 创建人 + /// + public string creator { get; set; } + /// + /// VARCHAR(50) 创建时间 + /// + public string createTime { get; set; } + /// + /// VARCHAR(50) 最后修改人 + /// + public string lastModifor { get; set; } + /// + /// VARCHAR(50) 最后修改时间 + /// + public string lastModifyTime { get; set; } + + } + public class csCustInvoice { + /// + /// VARCHAR(50) 来源业务系统(OTW(otw)/报关(bg) /船货代系统(FR)) + /// + public string bizSystemType { get; set; } + /// + /// VARCHAR(50) 业务系统CS_CUST ID + /// + public string bizCsCustId { get; set; } + /// + /// VARCHAR(50) 业务系统客商账号ID + /// + public string bizCsCustInvoiceId { get; set; } + /// + /// VARCHAR(200) 默认缺省抬头 + /// + public string defaultInvoiceTitle { get; set; } + /// + /// VARCHAR(200) 地址 + /// + public string invoiceAddress { get; set; } + /// + /// VARCHAR(100) 电话 + /// + public string tel { get; set; } + /// + /// VARCHAR(50) 纳税人识别号 + /// + public string taxpayerIdentificatioNo { get; set; } + /// + /// VARCHAR(50) 结算公司 + /// + public string settleOffice { get; set; } + /// + /// VARCHAR(100) 结算公司 + /// + public string settleOfficeName { get; set; } + /// + /// VARCHAR(50) 创建人 + /// + public string creator { get; set; } + /// + /// VARCHAR(50) 创建时间 + /// + public string createTime { get; set; } + /// + /// VARCHAR(50) 最后修改人 + /// + public string lastModifor { get; set; } + /// + /// VARCHAR(50) 最后修改时间 + /// + public string lastModifyTime { get; set; } + + } +} \ No newline at end of file diff --git a/DSWeb.Common/DB/DS6DataContext.cs b/DSWeb.Common/DB/DS6DataContext.cs new file mode 100644 index 0000000..38aa8b2 --- /dev/null +++ b/DSWeb.Common/DB/DS6DataContext.cs @@ -0,0 +1,29 @@ +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 DS6DataContext : DbContext + { + public DS6DataContext() : base("DS6DB") + { + + } + + public DS6DataContext(string conn) : base(conn) + { + + } + + public DbSet t_PublicInterface_Log { get; set; } + + + } + + +} \ No newline at end of file diff --git a/DSWeb.Common/DB/EDIFTPInfo.cs b/DSWeb.Common/DB/EDIFTPInfo.cs new file mode 100644 index 0000000..db8c2c6 --- /dev/null +++ b/DSWeb.Common/DB/EDIFTPInfo.cs @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Web; + +namespace DSWeb.Common.DB +{ + [Table("code_FtpSet")] + public class code_FtpSet_md + { + [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 RECEIVEOP { get; set; } + public string RECEIVESALE { get; set; } + public string RECEIVEDEPT { 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 SHIPPERTEL { get; set; } + public string CONSIGNEETEL { get; set; } + public string NOTIFYPARTYTEL { get; set; } + public string ISUSETEL { get; set; } + public string SERVERIP2 { get; set; } + public string FOLDERNAME2 { get; set; } + public string USERNAME2 { get; set; } + public string PASSWORD2 { get; set; } + public string ALIASSENDCODE { get; set; } + public string SFTPPORT { get; set; } + public bool? ISSSL { get; set; } + + public string TMPFOLDERNAME { get; set; } + public string SFTPCERFILENAME { get; set; } + + } + + [Table("OP_LOGICINFO")] + + public class OP_LOGICINFO_md + { + [Key] + public Guid GID { get; set; } + public string BSNO { get; set; } + public string PROPNAME { get; set; } + public string PROPVALUE { get; set; } + } + + [Table("op_ctn")] + public class op_ctn_md + { + [Key] + public string CTN_ID { get; set; } + public string BSNO { get; set; } + public string CTNCODE { get; set; } + public string SIZE { get; set; } + public string CTN { get; set; } + public int? CTNNUM { get; set; } + public int? TEU { get; set; } + public string CTNALL { get; set; } + public string CNTRNO { get; set; } + public string SEALNO { get; set; } + public int PKGS { get; set; } + public decimal? KGS { get; set; } + public decimal? CBM { get; set; } + public string REMARK { get; set; } + public string KINDPKGS { get; set; } + public decimal? TAREWEIGHT { get; set; } + public string GOODSNAME { get; set; } + public string CTNSTATUS { get; set; } + public string WEIGHTYPE { get; set; } + public decimal? WEIGHKGS { get; set; } + public string WEIGHATTN { get; set; } + public string WEIGHTEL { get; set; } + public string WEIGHSIGN { get; set; } + public string WEIGHDATE { get; set; } + public string MASTERNO { get; set; } + public string TRUCKER { get; set; } + public decimal? TRUCKFEE { get; set; } + public int? FREESTORAGEDAY { get; set; } + public int? STORAGEDAY { get; set; } + public decimal? STORAGEPRICE { get; set; } + public decimal? STORAGEFEE { get; set; } + public int? FREECTNDAY { get; set; } + public int? CTNDAY { get; set; } + public decimal? CTNPRICE { get; set; } + public decimal? CTNFEE { get; set; } + public string TRUCKNO { get; set; } + public string vgmconncom { get; set; } + public string VGMADDR { get; set; } + public string VGMEMAIL { get; set; } + public string MTMC { get; set; } + public DateTime? SJRGSJ { get; set; } + public DateTime? SJCGSJ { get; set; } + public bool ISWMS { get; set; } + public DateTime? WMSDATE { get; set; } + public string TiXiangShiJian { get; set; } + public string FanChangShiJian { get; set; } + public string JiGangShiJian { get; set; } + public string AREANAME { get; set; } + public string DaoGangShiJian { get; set; } + public string TiHuoShiJian { get; set; } + public string FanKongShiJian { get; set; } + public string PCTN_ID { get; set; } + public string ISTEMP { get; set; } + } +} \ No newline at end of file diff --git a/DSWeb.Common/DB/MailSend.cs b/DSWeb.Common/DB/MailSend.cs new file mode 100644 index 0000000..77af8ff --- /dev/null +++ b/DSWeb.Common/DB/MailSend.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Web; + +namespace DSWeb.Common.DB +{ + [Table("Mail_Send")] + public class MailSend + { + public const string MailSendStatusCreate = "Create"; + public const string MailSendStatusSending = "Sending"; + public const string MailSendStatusSuccess = "Success"; + public const string MailSendStatusFail = "Fail"; + + public MailSend() + { + this.GID = Guid.NewGuid().ToString().Replace("-", ""); + SendStatus = MailSendStatusCreate; + CreateTime = DateTime.Now; + } + + [Key] + public string GID { get; set; } + public string SendTo { get; set; } + public string CCTo { get; set; } + public string Title { get; set; } + public string Body { get; set; } + public string SendStatus { get; set; } + public DateTime? SendTime { get; set; } + public int TryCount { get; set; } + public DateTime CreateTime { get; set; } + public string RelativeId { get; set; } + public string SmtpConfig { get; set; } + public string ShowName { get; set; } + + public string Sender { get; set; } + } +} \ No newline at end of file diff --git a/DSWeb.Common/DB/MailSendSmtp.cs b/DSWeb.Common/DB/MailSendSmtp.cs new file mode 100644 index 0000000..a92f082 --- /dev/null +++ b/DSWeb.Common/DB/MailSendSmtp.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Web; + +namespace DSWeb.Common.DB +{ + [Table("Mail_Send_Smtp")] + public class MailSendSmtp + { + [Key] + public string GID { get; set; } + public string Account { get; set; } + public string Password { get; set; } + public string Server { get; set; } + public int Port { get; set; } + public bool UseSSL { get; set; } + public string Remark { get; set; } + + } +} \ No newline at end of file diff --git a/DSWeb.Common/DB/MpConfigInfo.cs b/DSWeb.Common/DB/MpConfigInfo.cs new file mode 100644 index 0000000..2cfcff3 --- /dev/null +++ b/DSWeb.Common/DB/MpConfigInfo.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Web; + +namespace DSWeb.Common.DB +{ + + [Table("sys_MpConfig")] + public class MpConfigInfo + { + public MpConfigInfo() + { + this.AppId = string.Empty; + this.AppSecret = string.Empty; + this.LastUpdate = DateTime.Now; + this.Token = string.Empty; + } + + [Key] + public string AppId { get; set; } + public string AppSecret { get; set; } + public DateTime? LastUpdate { get; set; } + public DateTime? ExpireTime { get; set; } + public string Token { get; set; } + } +} \ No newline at end of file diff --git a/DSWeb.Common/DB/Op_INTERNALTRADE.cs b/DSWeb.Common/DB/Op_INTERNALTRADE.cs new file mode 100644 index 0000000..94eb5ad --- /dev/null +++ b/DSWeb.Common/DB/Op_INTERNALTRADE.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Web; + +namespace DSWeb.Common.DB +{ + [Table("Op_INTERNALTRADE")] + public class Op_INTERNALTRADEmd + { + [Key] + public string BSNO { get; set; } + public string MASTERNO { get; set; } + public bool BSSTATUS { get; set; } + public bool FEESTATUS { get; set; } + public string CUSTOMERNAME { get; set; } + public decimal? CONTAINERDAYS { get; set; } + public DateTime BSDATE { get; set; } + public string ACCDATE { get; set; } + public string MBLNO { get; set; } + public string HBLNO { get; set; } + public string CUSTNO { get; set; } + public string STLNAME { get; set; } + public DateTime? STLDATE { get; set; } + public string BSSOURCE { get; set; } + public string BSSOURCEDETAIL { get; set; } + public string TRANSNO { get; set; } + public string OP { get; set; } + public string CUSTSERVICE { get; set; } + public string SALE { get; set; } + public string OPERATOR { get; set; } + public string CORPID { get; set; } + public string SALEDEPT { get; set; } + public string CARRIER { get; set; } + public string VESSEL { get; set; } + public string VOYNO { get; set; } + public string PORTLOADID { get; set; } + public string PORTLOAD { get; set; } + public DateTime? ETD { get; set; } + public string YARD { get; set; } + public DateTime? LOADEDCTNRETURNDATE { get; set; } + public DateTime? EMPTYCTNTOSHIPPERDATE { get; set; } + public string TRUCKER { get; set; } + public string TRUCKNO { get; set; } + public string CNTRNO { get; set; } + public string SEALNO { get; set; } + public decimal PORTLOADSTORAGEPERIOD { get; set; } + public decimal FBPPORTLOAD { get; set; } + public string PORTLOADREMARK { get; set; } + public string VIAID { get; set; } + public string VIA { get; set; } + public DateTime? VIA_ETA { get; set; } + public string VIA_VESSEL { get; set; } + public string VIA_VOYNO { get; set; } + public DateTime? VIA_ETD { get; set; } + public decimal? VIA_STORAGEPERIOD { get; set; } + public string VIA2ID { get; set; } + public string VIA2 { get; set; } + public DateTime? VIA2_ETA { get; set; } + public string VIA2_VESSEL { get; set; } + public string VIA2_VOYNO { get; set; } + public DateTime? VIA2_ETD { get; set; } + public decimal? VIA2_STORAGEPERIOD { get; set; } + public string VIA3ID { get; set; } + public string VIA3 { get; set; } + public DateTime? VIA3_ETA { get; set; } + public string VIA3_VESSEL { get; set; } + public string VIA3_VOYNO { get; set; } + public DateTime? VIA3_ETD { get; set; } + public decimal? VIA3_STORAGEPERIOD { get; set; } + public string VIA_MARK { get; set; } + public string PORTDISCHARGEID { get; set; } + public string PORTDISCHARGE { get; set; } + public string PlACERECEIPT { get; set; } + public string TRUCKER2 { get; set; } + public string TRUCKNO2 { get; set; } + public string CONSIGNEE { get; set; } + public string CONSIGNEECONTACT { get; set; } + public string CONSIGNEETEL { get; set; } + public DateTime? DISPATCHDATE { get; set; } + public DateTime? DELIVERYDATE { get; set; } + public DateTime? RECEIVEDATE { get; set; } + public DateTime? ETA { get; set; } + [Timestamp] + public byte[] TIMEMARK { get; set; } + + public string DISCHARGEREMARK { get; set; } + public string CREATOR { get; set; } + public DateTime? BILLFEESTATUSTIME { get; set; } + public int? BillFeeStatus { get; set; } + + } + + +} \ No newline at end of file diff --git a/DSWeb.Common/DB/OtherDB.cs b/DSWeb.Common/DB/OtherDB.cs new file mode 100644 index 0000000..67160b3 --- /dev/null +++ b/DSWeb.Common/DB/OtherDB.cs @@ -0,0 +1,31 @@ +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 OtherDB : DbContext + { + public OtherDB() : base("DongShengDB") + { + + } + + public OtherDB(string conn) : base(conn) + { + + } + + public DbSet view_hrmresource { get; set; } + public DbSet view_pjrequestbas { get; set; } + public DbSet view_xdf { get; set; } + + + } + + +} \ No newline at end of file diff --git a/DSWeb.Common/DB/OtherDBModel.cs b/DSWeb.Common/DB/OtherDBModel.cs new file mode 100644 index 0000000..ada712b --- /dev/null +++ b/DSWeb.Common/DB/OtherDBModel.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Web; + +namespace DSWeb.Common.DB +{ + + /// + /// 泛微OA 用用户名查找ID + /// + [Table("view_hrmresource")] + + public class view_hrmresource_md + { + [Key] + public int id { get; set; } + public string loginid { get; set; } + public string lastname { get; set; } + public int departmentid { get; set; } + public int subcompanyid1 { get; set; } + } + + /// + /// 泛微OA 审核结果 + /// + [Table("view_pjrequestbas")] + + public class view_pjrequestbas_md + { + [Key] + public int requestid { get; set; } + public int workflowid { get; set; } + public string requestname { get; set; } + public int? creater { get; set; } + public int? lastoperator { get; set; } + public string lastoperatedate { get; set; } + public string lastoperatetime { get; set; } + public string currentnodetype { get; set; } + } + + + [Table("view_xdf")] + + public class view_xdf_md + { + [Key] + public int id { get; set; } + public int? requestId { get; set; } + public string yxzhmc { get; set; } + public string khx { get; set; } + public string yxzh { get; set; } + public string gyskhmc { get; set; } + public int? formmodeid { get; set; } + public int? modedatacreater { get; set; } + public int? modedatacreatertype { get; set; } + public string modedatacreatedate { get; set; } + public string modedatacreatetime { get; set; } + public int? modedatamodifier { get; set; } + public string modedatamodifydatetime { get; set; } + public string form_biz_id { get; set; } + public string MODEUUID { get; set; } + public string kjry { get; set; } + } +} \ No newline at end of file diff --git a/DSWeb.Common/DSWeb.Common.csproj b/DSWeb.Common/DSWeb.Common.csproj new file mode 100644 index 0000000..782a61b --- /dev/null +++ b/DSWeb.Common/DSWeb.Common.csproj @@ -0,0 +1,102 @@ + + + + + + Debug + AnyCPU + {A0AB3D23-0DAD-49BA-9D23-107FAA1C369E} + Library + Properties + DSWeb.Common + DSWeb.Common + v4.5 + 512 + true + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll + + + ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll + + + ..\packages\log4net.1.2.10\lib\2.0\log4net.dll + + + ..\packages\Newtonsoft.Json.13.0.2\lib\net45\Newtonsoft.Json.dll + + + ..\Lib\NuonuoSDK.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 + + + + + + \ No newline at end of file diff --git a/DSWeb.Common/Helper/EnumHelper.cs b/DSWeb.Common/Helper/EnumHelper.cs new file mode 100644 index 0000000..ae861f4 --- /dev/null +++ b/DSWeb.Common/Helper/EnumHelper.cs @@ -0,0 +1,86 @@ +using DSWeb.Common.DB; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DSWeb.Common.Helper +{ + public static class EnumHelper + { + /// + /// 获取枚举值的description文本 + /// + /// + /// + /// + public static string GetDescription(Type type, string strVal) + { + System.Reflection.FieldInfo field = type.GetField(strVal); + if (field != null) + { + var attribute = Attribute.GetCustomAttribute(field, typeof(DescriptionAttribute)) as DescriptionAttribute; + if (attribute != null) + { + return attribute.Description; + } + } + + return string.Empty; + } + + /// + /// 获取枚举所有项的名称(name)和显示文本(description) + /// + /// + /// + public static Dictionary GetEnumList(Type type) + { + Dictionary dic = new Dictionary(); + foreach (int val in Enum.GetValues(type)) + { + string strName = Enum.GetName(type, val);//获取名称 + string desp = GetDescription(type, strName); + dic.Add(strName, desp); + } + + return dic; + } + } + + public static class ModelHelper + { + public static ch_fee_md getchfeeHelper() { + var feeShou = new ch_fee_md(); + //2021-12-31,要求下列字段不能为空,填写0或false + feeShou.COMMISSIONRATE = 0; + feeShou.AUDITSTATUS = 0; + feeShou.LINENUM = 0; + feeShou.ISDEBIT = false; + feeShou.ISOPEN = false; + feeShou.ACCTAXRATE = 0; + feeShou.ISVOU = false; + feeShou.TAX = 0; + feeShou.PREAMOUNT = 0; + feeShou.ISACC = false; + feeShou.CUSTDUI = false; + + feeShou.SETTLEMENT = 0; + feeShou.ORDERAMOUNT = 0; + feeShou.ORDERINVOICE = 0; + feeShou.ORDERINVSETTLEMENT = 0; + feeShou.ORDERSETTLEMENT = 0; + feeShou.INVOICE = 0; + feeShou.TAXRATE = 0; + feeShou.ISADVANCEDPAY = false; + feeShou.ISINVOICE = false; + feeShou.ISCRMORDERFEE = false; + feeShou.TAXUNITPRICE = 0;//2021-12-29,于菲:同样赋值单价和金额 + feeShou.NOTAXAMOUNT = 0;//2021-12-29,于菲:同样赋值单价和金额 + + return feeShou; + } + } +} diff --git a/DSWeb.Common/Helper/FTPHelper.cs b/DSWeb.Common/Helper/FTPHelper.cs new file mode 100644 index 0000000..b1412a3 --- /dev/null +++ b/DSWeb.Common/Helper/FTPHelper.cs @@ -0,0 +1,591 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using log4net; +using System.IO; +using System.Net; +using System.Text; + +namespace DSWeb.Common.Helper +{ + public class FtpHelper + { + private static ILog logger = LogManager.GetLogger("FtpHelper"); + + string ftpServerIP; + public string ftpRemotePath; + string ftpUserID; + string ftpPassword; + string ftpURI; + + /// + /// 连接FTP + /// + /// FTP连接地址 + /// 指定FTP连接成功后的当前目录, 如果不指定即默认为根目录 + /// 用户名 + /// 密码 + public FtpHelper(string FtpServerIP, string FtpRemotePath, string FtpUserID, string FtpPassword) + { + ftpServerIP = FtpServerIP; + ftpRemotePath = FtpRemotePath; + ftpUserID = FtpUserID; + ftpPassword = FtpPassword; + ftpURI = "ftp://" + ftpServerIP + "/"; + if (!string.IsNullOrWhiteSpace(FtpRemotePath)) + { + ftpURI = ftpURI + ftpRemotePath + "/"; + } + + } + + /// + /// 上传 + /// + /// + public void Upload(string filename) + { + FileInfo fileInf = new FileInfo(filename); + string uri = ftpURI + fileInf.Name; + FtpWebRequest reqFTP; + + reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri)); + reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword); + reqFTP.KeepAlive = false; + reqFTP.Method = WebRequestMethods.Ftp.UploadFile; + reqFTP.UseBinary = true; + reqFTP.ContentLength = fileInf.Length; + int buffLength = 2048; + byte[] buff = new byte[buffLength]; + int contentLen; + FileStream fs = fileInf.OpenRead(); + try + { + Stream strm = reqFTP.GetRequestStream(); + contentLen = fs.Read(buff, 0, buffLength); + while (contentLen != 0) + { + strm.Write(buff, 0, contentLen); + contentLen = fs.Read(buff, 0, buffLength); + } + strm.Close(); + fs.Close(); + } + catch (Exception ex) + { + logger.Error("FtpWeb_1" , ex); + } + } + + /// + /// 下载 + /// + /// + /// + public void Download(string filePath, string fileName) + { + FtpWebRequest reqFTP; + + FileStream outputStream = new FileStream(filePath + "\\" + fileName, FileMode.Create); + + reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpURI + fileName)); + + try + { + reqFTP.Method = WebRequestMethods.Ftp.DownloadFile; + reqFTP.UseBinary = true; + reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword); + FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse(); + Stream ftpStream = response.GetResponseStream(); + long cl = response.ContentLength; + int bufferSize = 1024; + int readCount; + byte[] buffer = new byte[bufferSize]; + + readCount = ftpStream.Read(buffer, 0, bufferSize); + while (readCount > 0) + { + outputStream.Write(buffer, 0, readCount); + readCount = ftpStream.Read(buffer, 0, bufferSize); + } + + ftpStream.Close(); + outputStream.Close(); + response.Close(); + reqFTP.Abort(); + } + catch (Exception ex) + { + reqFTP.Abort(); + logger.Error("FtpWeb_2", ex); + } + } + + public string getFileStr(string fileName) + { + FtpWebRequest reqFTP; + var result = ""; + reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpURI + fileName)); + + try + { + + reqFTP.Method = WebRequestMethods.Ftp.DownloadFile; + reqFTP.UseBinary = true; + reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword); + FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse(); + Stream ftpStream = response.GetResponseStream(); + long cl = response.ContentLength; + //int bufferSize = 1024; + //int readCount; + //byte[] buffer = new byte[bufferSize]; + + //readCount = ftpStream.Read(buffer, 0, bufferSize); + //while (readCount > 0) + //{ + // for (var _i = 0; _i < readCount; _i++) { + // result += buffer[_i]; + // } + // readCount = ftpStream.Read(buffer, 0, bufferSize); + //} + + StreamReader reader = new StreamReader(ftpStream); + result = reader.ReadToEnd(); + + ftpStream.Close(); + + response.Close(); + reqFTP.Abort(); + return result; + } + catch (Exception ex) + { + reqFTP.Abort(); + logger.Error("FtpWeb_3", ex); + } + reqFTP.Abort(); + return ""; + } + + /// + /// 删除文件 + /// + /// + public void Delete(string fileName) + { + + string uri = ftpURI + fileName; + FtpWebRequest reqFTP; + reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri)); + try + { + reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword); + reqFTP.KeepAlive = false; + reqFTP.Method = WebRequestMethods.Ftp.DeleteFile; + + string result = String.Empty; + FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse(); + long size = response.ContentLength; + Stream datastream = response.GetResponseStream(); + StreamReader sr = new StreamReader(datastream); + result = sr.ReadToEnd(); + sr.Close(); + datastream.Close(); + response.Close(); + reqFTP.Abort(); + } + catch (Exception ex) + { + reqFTP.Abort(); + logger.Error("FtpWeb Delete Error --> " +fileName,ex); + } + } + + /// + /// 删除文件夹 + /// + /// + public void RemoveDirectory(string folderName) + { + try + { + string uri = ftpURI + folderName; + FtpWebRequest reqFTP; + reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri)); + + reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword); + reqFTP.KeepAlive = false; + reqFTP.Method = WebRequestMethods.Ftp.RemoveDirectory; + + string result = String.Empty; + FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse(); + long size = response.ContentLength; + Stream datastream = response.GetResponseStream(); + StreamReader sr = new StreamReader(datastream); + result = sr.ReadToEnd(); + sr.Close(); + datastream.Close(); + response.Close(); + } + catch (Exception ex) + { + logger.Error("FtpWeb Delete folder Error --> " + folderName, ex); + //Insert_Standard_ErrorLog.Insert("FtpWeb", "Delete Error --> " + ex.Message + " 文件名:" + folderName); + } + } + + /// + /// 获取当前目录下明细(包含文件和文件夹) + /// + /// + public string[] GetFilesDetailList(string _path = "") + { + string[] downloadFiles; + + StringBuilder result = new StringBuilder(); + FtpWebRequest ftp; + ftp = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpURI + _path)); + ftp.Credentials = new NetworkCredential(ftpUserID, ftpPassword); + ftp.Method = WebRequestMethods.Ftp.ListDirectoryDetails; + WebResponse response = ftp.GetResponse(); + StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.Default); + + try + { + //while (reader.Read() > 0) + //{ + + //} + string line = reader.ReadLine(); + //line = reader.ReadLine(); + //line = reader.ReadLine(); + + while (line != null) + { + result.Append(line); + result.Append("\n"); + line = reader.ReadLine(); + } + result.Remove(result.ToString().LastIndexOf("\n"), 1); + reader.Close(); + response.Close(); + ftp.Abort(); + return result.ToString().Split('\n'); + } + catch (Exception ex) + { + ftp.Abort(); + downloadFiles = null; + logger.Error("FtpWeb GetFilesDetailList Error -->" + ex.Message, ex); + //Insert_Standard_ErrorLog.Insert("FtpWeb", "GetFilesDetailList Error --> " + ex.Message); + return downloadFiles; + } + } + + /// + /// 获取当前目录下文件列表(仅文件) + /// 文件名包含【mask】内容的 + /// + /// + public string[] GetFileList(string mask, out string msg) + { + string[] downloadFiles; + StringBuilder result = new StringBuilder(); + FtpWebRequest reqFTP; + reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpURI)); + + try + { + + reqFTP.UseBinary = true; + reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword); + reqFTP.Method = WebRequestMethods.Ftp.ListDirectory; + WebResponse response = reqFTP.GetResponse(); + StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.Default); + + string line = reader.ReadLine(); + while (line != null) + { + if (mask.Trim() != string.Empty && mask.Trim() != "*.*") + { + + string mask_ = mask.Substring(0, mask.IndexOf("*")); + if (line.Substring(0, mask_.Length) == mask_) + { + result.Append(line); + result.Append("\n"); + } + } + else + { + result.Append(line); + result.Append("\n"); + } + line = reader.ReadLine(); + } + result.Remove(result.ToString().LastIndexOf('\n'), 1); + reader.Close(); + response.Close(); + msg = ""; + reqFTP.Abort(); + return result.ToString().Split('\n'); + } + catch (Exception ex) + { + downloadFiles = null; + if (ex.Message.Trim() != "远程服务器返回错误: (550) 文件不可用(例如,未找到文件,无法访问文件)。") + { + logger.Error("FtpWeb GetFileList Error -->" + ex.Message, ex); + //Insert_Standard_ErrorLog.Insert("FtpWeb", "GetFileList Error --> " + ex.Message.ToString()); + } + msg = ex.Message; + reqFTP.Abort(); + return downloadFiles; + } + } + + /// + /// 获取当前目录下所有的文件夹列表(仅文件夹) + /// + /// + public string[] GetDirectoryList() + { + string[] drectory = GetFilesDetailList(); + string m = string.Empty; + foreach (string str in drectory) + { + int dirPos = str.IndexOf(""); + if (dirPos > 0) + { + /*判断 Windows 风格*/ + m += str.Substring(dirPos + 5).Trim() + "\n"; + } + else if (str.Trim().Substring(0, 1).ToUpper() == "D") + { + /*判断 Unix 风格*/ + string dir = str.Substring(54).Trim(); + if (dir != "." && dir != "..") + { + m += dir + "\n"; + } + } + } + + char[] n = new char[] { '\n' }; + return m.Split(n); + } + + /// + /// 判断当前目录下指定的子目录是否存在 + /// + /// 指定的目录名 + public bool DirectoryExist(string RemoteDirectoryName) + { + string[] dirList = GetDirectoryList(); + foreach (string str in dirList) + { + if (str.Trim() == RemoteDirectoryName.Trim()) + { + return true; + } + } + return false; + } + + + /// + /// 判断当前目录下指定的文件是否存在 + /// + /// 远程文件名 + public bool FileExist(string RemoteFileName) + { + string msg = ""; + string[] fileList = GetFileList("*.*", out msg); + foreach (string str in fileList) + { + if (str.Trim() == RemoteFileName.Trim()) + { + return true; + } + } + return false; + } + + /// + /// 创建文件夹 + /// + /// + public Boolean MakeDir(string localFile)//想要创bai建的文du件夹 +        { + //  _Uri是Uri类的zhi路径 + FtpWebRequest req = (FtpWebRequest)WebRequest.Create(ftpURI + localFile); + req.Credentials = new NetworkCredential(ftpUserID, ftpPassword); + req.Method = WebRequestMethods.Ftp.MakeDirectory; + try + { + FtpWebResponse response = (FtpWebResponse)req.GetResponse(); + response.Close(); + } + catch (Exception) + { + req.Abort(); + + return false; + } + req.Abort(); + return true; + } + + /// + /// 获取指定文件大小 + /// + /// + /// + public long GetFileSize(string filename) + { + FtpWebRequest reqFTP; + long fileSize = 0; + try + { + reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpURI + filename)); + reqFTP.Method = WebRequestMethods.Ftp.GetFileSize; + reqFTP.UseBinary = true; + reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword); + FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse(); + Stream ftpStream = response.GetResponseStream(); + fileSize = response.ContentLength; + + ftpStream.Close(); + response.Close(); + } + catch (Exception ex) + { + logger.Error("FtpWeb GetFileSize Error -->" + ex.Message, ex); + //Insert_Standard_ErrorLog.Insert("FtpWeb", "GetFileSize Error --> " + ex.Message); + } + return fileSize; + } + + /// + /// 改名 + /// + /// + /// + public void ReName(string currentFilename, string newFilename) + { + FtpWebRequest reqFTP; + reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpURI + currentFilename)); + try + { + reqFTP.Method = WebRequestMethods.Ftp.Rename; + reqFTP.RenameTo = newFilename; + reqFTP.UseBinary = true; + reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword); + FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse(); + Stream ftpStream = response.GetResponseStream(); + + ftpStream.Close(); + response.Close(); + reqFTP.Abort(); + } + catch (Exception ex) + { + reqFTP.Abort(); + logger.Error("FtpWeb ReName Error -->" + ex.Message, ex); + //Insert_Standard_ErrorLog.Insert("FtpWeb", "ReName Error --> " + ex.Message); + } + } + + /// + /// 移动文件 + /// + /// + /// + public void MoveFile(string currentFilename, string newDirectory) + { + ReName(currentFilename, newDirectory); + } + + /// + /// 切换当前目录 + /// + /// + /// true 绝对路径 false 相对路径 + public void GotoDirectory(string DirectoryName, bool IsRoot) + { + if (IsRoot) + { + ftpRemotePath = DirectoryName; + } + else + { + ftpRemotePath += DirectoryName + "/"; + } + ftpURI = "ftp://" + ftpServerIP + "/" + ftpRemotePath + "/"; + } + + /// + /// 删除订单目录 + /// + /// FTP 主机地址 + /// FTP 用户名 + /// FTP 用户名 + /// FTP 密码 + public static void DeleteOrderDirectory(string ftpServerIP, string folderToDelete, string ftpUserID, string ftpPassword) + { + try + { + if (!string.IsNullOrEmpty(ftpServerIP) && !string.IsNullOrEmpty(folderToDelete) && !string.IsNullOrEmpty(ftpUserID) && !string.IsNullOrEmpty(ftpPassword)) + { + FtpHelper fw = new FtpHelper(ftpServerIP, folderToDelete, ftpUserID, ftpPassword); + //进入订单目录 + fw.GotoDirectory(folderToDelete, true); + //获取规格目录 + string[] folders = fw.GetDirectoryList(); + foreach (string folder in folders) + { + if (!string.IsNullOrEmpty(folder) || folder != "") + { + //进入订单目录 + string subFolder = folderToDelete + "/" + folder; + fw.GotoDirectory(subFolder, true); + //获取文件列表 + string msg = ""; + string[] files = fw.GetFileList("*.*", out msg); + + if (files != null) + { + //删除文件 + foreach (string file in files) + { + fw.Delete(file); + } + } + //删除冲印规格文件夹 + fw.GotoDirectory(folderToDelete, true); + fw.RemoveDirectory(folder); + } + } + + //删除订单文件夹 + string parentFolder = folderToDelete.Remove(folderToDelete.LastIndexOf('/')); + string orderFolder = folderToDelete.Substring(folderToDelete.LastIndexOf('/') + 1); + fw.GotoDirectory(parentFolder, true); + fw.RemoveDirectory(orderFolder); + } + else + { + throw new Exception("FTP 及路径不能为空!"); + } + } + catch (Exception ex) + { + throw new Exception("删除订单时发生错误,错误信息为:" + ex.Message); + } + } + + + } + +} \ No newline at end of file diff --git a/DSWeb.Common/Helper/IdHelper.cs b/DSWeb.Common/Helper/IdHelper.cs new file mode 100644 index 0000000..5dd99fc --- /dev/null +++ b/DSWeb.Common/Helper/IdHelper.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace DSWeb.Common.Helper +{ + public class IdHelper + { + //机器ID + private static long workerId=1; + private static long twepoch = 1565667764198;//2019-08-13为基准 + private static long sequence = 0L; + private static int workerIdBits = 1; //机器码字节数 + public static long maxWorkerId = -1L ^ -1L << workerIdBits; //最大机器ID + private static int sequenceBits = 4; //计数器字节数 + private static int workerIdShift = sequenceBits; //机器码数据左移位数,就是后面计数器占用的位数 + private static int timestampLeftShift = sequenceBits + workerIdBits; //时间戳左移动位数就是机器码和计数器总字节数 + public static long sequenceMask = -1L ^ -1L << sequenceBits; //一微秒内可以产生计数,如果达到该值则等到下一微妙在进行生成 + private long lastTimestamp = -1L; + + + public IdHelper() + { + } + + public long nextId() + { + lock (this) + { + long timestamp = timeGen(); + if (this.lastTimestamp == timestamp) + { //同一微妙中生成ID + IdHelper.sequence = (IdHelper.sequence + 1) & IdHelper.sequenceMask; //用&运算计算该微秒内产生的计数是否已经到达上限 + if (IdHelper.sequence == 0) + { + //一微妙内产生的ID计数已达上限,等待下一微妙 + timestamp = tillNextMillis(this.lastTimestamp); + } + } + else + { //不同微秒生成ID + IdHelper.sequence = 0; //计数清0 + } + if (timestamp < lastTimestamp) + { //如果当前时间戳比上一次生成ID时时间戳还小,抛出异常,因为不能保证现在生成的ID之前没有生成过 + throw new Exception(string.Format("Clock moved backwards. Refusing to generate id for {0} milliseconds", + this.lastTimestamp - timestamp)); + } + this.lastTimestamp = timestamp; //把当前时间戳保存为最后生成ID的时间戳 + long nextId = (timestamp - twepoch << timestampLeftShift) | IdHelper.workerId << IdHelper.workerIdShift | IdHelper.sequence; + return nextId; + } + } + + /// + /// 获取下一微秒时间戳 + /// + /// + /// + private long tillNextMillis(long lastTimestamp) + { + long timestamp = timeGen(); + while (timestamp <= lastTimestamp) + { + timestamp = timeGen(); + } + return timestamp; + } + + /// + /// 生成当前时间戳 + /// + /// + private long timeGen() + { + return (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalMilliseconds; + } + } +} \ No newline at end of file diff --git a/DSWeb.Common/Helper/MailHelper.cs b/DSWeb.Common/Helper/MailHelper.cs new file mode 100644 index 0000000..7d38799 --- /dev/null +++ b/DSWeb.Common/Helper/MailHelper.cs @@ -0,0 +1,283 @@ +using DSWeb.Common.DB; +using log4net; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Web; + +namespace DSWeb.Common.Helper +{ + /// + /// 发送邮件辅助类 + /// + public static class MailHelper + { + private static ILog logger = LogManager.GetLogger("MailHelper"); + + /// + /// 使用随机邮箱发送邮件 + /// + /// 邮件标题 + /// 邮件内容 + /// 接收人(多个接收人用英文逗号或分号隔开) + public static bool SendMail(string title, string body, string sendTo) + { + bool succ = false; + CommonDataContext commonDataContext = new CommonDataContext(); + + var smtpList = commonDataContext.MailSendSmtp.AsNoTracking().ToList(); + MailSendSmtp smtp = null; + if (smtpList.Count > 0) + { + Random rnd = new Random(); + int idx = rnd.Next(smtpList.Count); + smtp = smtpList[idx]; + } + + MailSend mailSend = new MailSend(); + mailSend.SendTo = sendTo; + mailSend.Title = title; + mailSend.Body = body; + if (smtp != null) + { + mailSend.SendStatus = MailSend.MailSendStatusCreate; + mailSend.SmtpConfig = smtp.GID; + succ = true; + } + else + { + mailSend.SendStatus = MailSend.MailSendStatusFail; + logger.Error("没有配置发送邮箱,邮件将不会发送"); + } + commonDataContext.MailSend.Add(mailSend); + commonDataContext.SaveChanges(); + + return succ; + } + + /// + /// 使用指定的邮箱发送邮件 + /// + /// 指定smtp配置的id + /// 邮件标题 + /// 邮件内容 + /// 接收人(多个接收人用英文逗号或分号隔开) + /// 显示名称 + /// 自定义发件人(只有小部分邮箱支持) + public static bool SendMail(string configId, string title, string body, string sendTo, string showName = null, string sender = null) + { + bool succ = false; + CommonDataContext commonDataContext = new CommonDataContext(); + + var smtp = commonDataContext.MailSendSmtp.AsNoTracking().FirstOrDefault(c => c.GID == configId); + MailSend mailSend = new MailSend(); + mailSend.SendTo = sendTo; + mailSend.Title = title; + mailSend.Body = body; + mailSend.ShowName = showName; + mailSend.Sender = sender; + if (smtp != null) + { + mailSend.SendStatus = MailSend.MailSendStatusCreate; + mailSend.SmtpConfig = smtp.GID; + succ = true; + } + else + { + mailSend.SendStatus = MailSend.MailSendStatusFail; + logger.Error("没有配置发送邮箱,邮件将不会发送"); + } + commonDataContext.MailSend.Add(mailSend); + commonDataContext.SaveChanges(); + + return succ; + } + + /// + /// 使用默认发件地址发送邮件 + /// + /// 邮件标题 + /// 邮件内容 + /// 接收人(多个接收人用英文逗号或分号隔开) + /// + public static bool SendMailCommon(string title, string body, string sendTo) + { + return SendMail("4AB9E4EE-7E62-4E95-9168-F7CF0605E088", title, body, sendTo); + } + + /// + /// 使用马士基发件地址发送邮件 + /// + /// 邮件标题 + /// 邮件内容 + /// 接收人(多个接收人用英文逗号或分号隔开) + /// + public static bool SendMailMaersk(string title, string body, string sendTo) + { + return SendMail("37F7BF61-41F1-4B77-A1B8-41BAFEDF5AF1", title, body, sendTo); + } + + /// + /// 使用发票转发发件地址发送邮件 + /// + /// 邮件标题 + /// 邮件内容 + /// 接收人(多个接收人用英文逗号或分号隔开) + /// + public static bool SendMailInvoice(string title, string body, string sendTo) + { + return SendMail("4E07BC66-0E0A-4A97-A3B5-EC6516FAE24A", title, body, sendTo, "大简云发票平台"); + } + + /// + /// 发送发票邮件 + /// + /// 发票记录Id + /// + //public static bool SendMailInvoiceRecord(string invId) + //{ + // return SendMailInvoiceRecordOther(invId, null); + //} + /// + /// 发送发票邮件 + /// + /// 发票记录Id + /// 优先使用参数的邮箱,若参数未null时使用发票记录的邮箱 + /// + //public static bool SendMailInvoiceRecordOther(string invId, string email) + //{ + // InvoiceDbContext invDB = new InvoiceDbContext(); + // CommonDataContext comDB = new CommonDataContext(); + // var inv = invDB.Invoices.AsNoTracking().FirstOrDefault(i => i.GID == invId); + // if (inv != null && inv.Status == InvoiceRecord.StatusIssued && (!string.IsNullOrEmpty(email) || !string.IsNullOrEmpty(inv.Email))) + // { + // var cfg = comDB.ConfigDatas.AsNoTracking().FirstOrDefault(cd => cd.Module == ConfigData.ModuleInvoice && cd.Category == ConfigData.CateMailSubject && cd.UserId == inv.UserId); + // var title = ""; + // if (cfg != null) + // { + // var subjectArr = JsonConvert.DeserializeObject(cfg.JsonData); + // #region 标题拼接 + // string mailTitle = string.Empty; + + // if (subjectArr.Contains("SalerName")) + // { + // mailTitle += "销售方:" + inv.SalerName; + // } + + // if (subjectArr.Contains("Total")) + // { + // if (mailTitle.Length > 0) + // { + // mailTitle += "---"; + // } + // mailTitle += "金额:" + inv.Total; + // } + + // if (subjectArr.Contains("InvoiceDate")) + // { + // if (mailTitle.Length > 0) + // { + // mailTitle += "---"; + // } + // mailTitle += "开票日期:" + inv.InvoiceDate.Value.ToString("yyyy年MM月dd日"); + // } + + // if (subjectArr.Contains("InvNum")) + // { + // if (mailTitle.Length > 0) + // { + // mailTitle += "---"; + // } + // mailTitle += "发票号码:" + inv.InvNum; + // } + + // if (subjectArr.Contains("InvoiceLine")) + // { + // if (mailTitle.Length > 0) + // { + // mailTitle += "---"; + // } + + // switch (inv.InvoiceLine) + // { + // case "p": + // mailTitle += "发票种类:普通发票(电票)"; + // break; + // case "c": + // mailTitle += "发票种类:普通发票(纸票)"; + // break; + // case "s": + // mailTitle += "发票种类:专用发票"; + // break; + // case "e": + // mailTitle += "发票种类:收购发票(电票)"; + // break; + // case "f": + // mailTitle += "发票种类:收购发票(纸质)"; + // break; + // } + + // } + + // if (subjectArr.Contains("Clerk")) + // { + // if (mailTitle.Length > 0) + // { + // mailTitle += "---"; + // } + // mailTitle += "开票人:" + inv.Clerk; + // } + + // if (subjectArr.Contains("BuyerName")) + // { + // if (mailTitle.Length > 0) + // { + // mailTitle += "---"; + // } + // mailTitle += "购货方名称:" + inv.BuyerName; + // } + // #endregion + + // title = $"您收到一张电子发票:{mailTitle}"; + // } + // else + // { + // title = $"您收到一张电子发票:销售方:{inv.SalerName}---金额:{inv.Total}---开票日期:{inv.InvoiceDate.Value.ToString("yyyy年MM月dd日")}"; + // } + + // //读取html模板,填充数据 + // var htmlFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Areas/Invoice/Content/InvoiceMailTemplate.html"); + // var content = File.ReadAllText(htmlFile); + // content = content.Replace("$VIEW_URL$", inv.PictureUrl); + // content = content.Replace("$CUST_NAME$", inv.BuyerName); + // content = content.Replace("$INV_DATA$", inv.InvoiceDate.Value.ToString("yyyy年MM月dd日")); + // content = content.Replace("$TOTAL$", inv.Total.ToString()); + // content = content.Replace("$INV_NUM$", inv.InvNum); + // content = content.Replace("$INV_CODE$", inv.InvCode); + // content = content.Replace("$PDF_URL$", inv.PdfUrl); + + // SendMailInvoice(title, content, string.IsNullOrEmpty(email) ? inv.Email : email); + // return true; + // } + + // return false; + //} + + /// + /// 发送邮件-运踪 + /// + /// 邮件标题 + /// 邮件内容 + /// 接收人(多个接收人用英文逗号或分号隔开) + /// 发件人显示名称 + /// 发件人显示邮箱地址(部分邮箱支持) + /// + public static bool SendMailBillTrace(string title, string body, string sendTo, string showName = null, string sender = null) + { + return SendMail("F48AA7593827456BB0DC12D4D8D13976", title, body, sendTo, showName, sender); + } + + } +} \ No newline at end of file diff --git a/DSWeb.Common/Helper/WebRequestHelper.cs b/DSWeb.Common/Helper/WebRequestHelper.cs new file mode 100644 index 0000000..e49eb41 --- /dev/null +++ b/DSWeb.Common/Helper/WebRequestHelper.cs @@ -0,0 +1,144 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.IO.Compression; +using System.Linq; +using System.Net; +using System.Text; +using System.Web; + +namespace DSWeb.Common.Helper +{ + public static class WebRequestHelper + { + public static string DoGet(string url) + { + string responseString = "";//post返回的结果 + ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, err) => { return true; }; + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; + HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url); + req.Method = "GET"; + req.ContentLength = 0; + req.Timeout = 3000; + req.KeepAlive = false; + + var response = req.GetResponse(); + Stream streamResponse = response.GetResponseStream(); + StreamReader streamRead = new StreamReader(streamResponse); + responseString = streamRead.ReadToEnd(); + response.Close(); + streamRead.Close(); + + return responseString; + } + + public static string DoPost(string url, string json) + { + string responseString = "";//post返回的结果 + ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, err) => { return true; }; + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; + HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url); + req.Method = "POST"; + + if (!string.IsNullOrWhiteSpace(json)) + { + byte[] postBytes = Encoding.UTF8.GetBytes(json); + req.ContentType = "application/json; charset=utf-8"; + req.ContentLength = Encoding.UTF8.GetByteCount(json); + Stream stream = req.GetRequestStream(); + stream.Write(postBytes, 0, postBytes.Length); + req.Timeout = 10000; + stream.Close(); + } + else + { + req.ContentLength = 0; + } + var response = req.GetResponse(); + Stream streamResponse = response.GetResponseStream(); + StreamReader streamRead = new StreamReader(streamResponse); + responseString = streamRead.ReadToEnd(); + response.Close(); + streamRead.Close(); + + return responseString; + } + + public static string DoPost(string url, Dictionary dic, int timeout = 10000) + { + string responseString = "";//post返回的结果 + ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, err) => { return true; }; + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; + HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url); + req.Method = "POST"; + req.Timeout = timeout; + req.Headers.Add("Accept-Encoding", "gzip, deflate"); + + if (dic.Count > 0) + { + string strContent = string.Empty; + foreach (var item in dic) + { + if (strContent.Length > 0) + { + strContent += "&"; + } + strContent += $"{item.Key}={item.Value}"; + } + + byte[] postBytes = Encoding.UTF8.GetBytes(strContent); + req.ContentType = "application/x-www-form-urlencoded"; + req.ContentLength = postBytes.Length; + Stream stream = req.GetRequestStream(); + stream.Write(postBytes, 0, postBytes.Length); + stream.Close(); + } + else + { + req.ContentLength = 0; + } + var response = req.GetResponse(); + responseString = GetResponseBody((HttpWebResponse)response); + return responseString; + } + + + private static string GetResponseBody(HttpWebResponse response) + { + string responseBody = string.Empty; + if (response.ContentEncoding.ToLower().Contains("gzip")) + { + using (GZipStream stream = new GZipStream(response.GetResponseStream(), CompressionMode.Decompress)) + { + using (StreamReader reader = new StreamReader(stream)) + { + responseBody = reader.ReadToEnd(); + } + } + } + else if (response.ContentEncoding.ToLower().Contains("deflate")) + { + using (DeflateStream stream = new DeflateStream( + response.GetResponseStream(), CompressionMode.Decompress)) + { + using (StreamReader reader = + new StreamReader(stream, Encoding.UTF8)) + { + responseBody = reader.ReadToEnd(); + } + } + } + else + { + using (Stream stream = response.GetResponseStream()) + { + using (StreamReader reader = new StreamReader(stream, Encoding.UTF8)) + { + responseBody = reader.ReadToEnd(); + } + } + } + return responseBody; + } + } +} \ No newline at end of file diff --git a/DSWeb.Common/Model/DateTimeExtension.cs b/DSWeb.Common/Model/DateTimeExtension.cs new file mode 100644 index 0000000..a904519 --- /dev/null +++ b/DSWeb.Common/Model/DateTimeExtension.cs @@ -0,0 +1,141 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DSWeb.Common +{ + + /// + /// datetime数据类型拓展 + /// + public static class DateTimeExtension + { + + /// + ///将一个时间转换为秒级时间戳 + /// + /// 时间 + /// + public static long ToTimeStampSeconds(this DateTime datetime) + { + return (long)Math.Round((datetime.ToUniversalTime() - new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero)).TotalSeconds); + } + + /// + ///将一个时间转换为毫秒级时间戳 + /// + /// + /// + public static long ToTimeStampMilliSeconds(this DateTime datetime) + { + + return (long)Math.Round((datetime.ToUniversalTime() - new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero)).TotalMilliseconds); + } + + /// + /// 获取标准时间戳 秒级 + /// + /// + /// + public static long ToTimeStamp(this DateTime datetime) + { return ToTimeStampSeconds(datetime); } + + /// + /// 将时间转换为时间字符串编码 yyyyMMddHHmmssffff + /// + /// + /// + public static string ToTimeStr(this DateTime datetime) + { + return datetime.ToString("yyyyMMddHHmmssffff"); + } + + /// + /// 判断时间是否大于1970年的有效时间 + /// + /// + /// + public static bool IsValidTime(this DateTime dateTime) + { + if (dateTime.Date >= DateTime.Parse("1970-1-1")) + return true; + else return false; + } + /// + /// 获时间一天中的开始时间 + /// + /// + public static DateTime GetDayStartTime(this DateTime dateTime) + { + return dateTime.Date; + } + /// + /// 获取时间一天的结束时间 + /// + /// + /// + + public static DateTime GetDateEndTime(this DateTime dateTime) + { + return dateTime.Date.AddDays(1).AddSeconds(-1); + } + + /// + /// 获取时间周的星期一的时间 + /// + /// + /// + public static DateTime GetWeekStartTime(this DateTime dateTime) + { + return dateTime.GetWeekOfDayTime(1); + } + + /// + /// 获取时间周的周日 + /// + /// + /// + public static DateTime GetWeekEndTime(this DateTime dateTime) + { + return dateTime.GetWeekOfDayTime(7); + } + + /// + /// 获取时间周的指定周几时间 + /// + /// + /// 周几 1 2 3 4 5 6 7 + /// + public static DateTime GetWeekOfDayTime(this DateTime dateTime, int Day) + { + if (Day < 1) + Day = 1; + if (Day > 7) + Day = (int)dateTime.DayOfWeek; + return dateTime.Subtract(new TimeSpan(dateTime.DayOfWeek - (DayOfWeek)Day, 0, 0, 0)).Date; + } + + /// + /// 获取时间月开始时间 + /// + /// + /// + public static DateTime GetMonthStartTime(this DateTime dateTime) + { + return new DateTime(dateTime.Year, dateTime.Month, 1).Date; + } + /// + /// 获取一个月的结束时间 + /// + /// + /// + public static DateTime GetMonthEndTime(this DateTime dateTime) + { + return dateTime.GetMonthStartTime().AddMonths(1).AddDays(-1); + + } + } + +} diff --git a/DSWeb.Common/Model/Int32Extensions.cs b/DSWeb.Common/Model/Int32Extensions.cs new file mode 100644 index 0000000..ea0b294 --- /dev/null +++ b/DSWeb.Common/Model/Int32Extensions.cs @@ -0,0 +1,90 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DSWeb.Common +{ + /// + /// 扩展Int32功能 + /// + public static class Int32Extensions + { + /// + /// 向上整除 + /// 1.当num能被divideBy整除时,结果即为num/divideBy; + /// 2.当num不能被divideBy整除时,结果为num/divideBy + 1; + /// + /// 被除数,大于或者等于0 + /// 除数,大于0 + /// 向上整除结果 + public static int CeilingDivide(this int num, int divideBy) + { + if (num < 0 || divideBy <= 0) + { + return 0; + } + + return (num + divideBy - 1) / divideBy; + + } + /// + /// 向上整除 + /// 1.当num能被divideBy整除时,结果即为num/divideBy; + /// 2.当num不能被divideBy整除时,结果为num/divideBy + 1; + /// + /// 被除数,大于或者等于0 + /// 除数,大于0 + /// 向上整除结果 + public static long CeilingDivide(this long num, long divideBy) + { + if (num < 0 || divideBy <= 0) + { + return 0; + } + + return (num + divideBy - 1) / divideBy; + + } + + /// + /// 将List 转为间隔字符串 + /// + /// + public static string ListToString(this List strlist, char Split = ',') + { + StringBuilder str = new StringBuilder(); + foreach (var item in strlist) + { + str.Append(item.ToString() + Split); + } + return str.ToString(); + } + + /// + /// 拓展 将字符串抓换为int + /// + /// + /// + public static int StrToInt(this string str) + { + if (str.Isint()) + { return Convert.ToInt32(str); } + else + { + return 0; + } + } + /// + /// 拓展 将字符串数组转换成int 数组 + /// + /// + /// + public static int[] strToIntArray(this string[] str) + { + return Array.ConvertAll(str, new Converter(StrToInt)); + } + + } +} diff --git a/DSWeb.Common/Model/JsonExtension.cs b/DSWeb.Common/Model/JsonExtension.cs new file mode 100644 index 0000000..990953a --- /dev/null +++ b/DSWeb.Common/Model/JsonExtension.cs @@ -0,0 +1,134 @@ +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DSWeb.Common.Extentions +{ + public static class JsonExtension + { + /// + /// 获取JObject + /// + /// + /// + /// + public static JObject GetJObjectValue(this JObject jobj, string prop) + { + var jt = jobj[prop]; + if (jt == null) + { + return null; + } + + return jt as JObject; + } + + /// + /// 获取字符串值 + /// + /// + /// + /// + public static string GetStringValue(this JObject jobj, string prop) + { + var jt = jobj[prop]; + if (jt == null) + { + return string.Empty; + } + + return jt.ToString(); + } + + /// + /// 获取int值 + /// + /// + /// + /// + public static int GetIntValue(this JObject jobj, string prop) + { + var jt = jobj[prop]; + if (jt == null) + { + return 0; + } + + var strVal = jt.ToString(); + int rtnVal = 0; + int.TryParse(strVal, out rtnVal); + return rtnVal; + } + + /// + /// 获取decimal值 + /// + /// + /// + /// + public static decimal GetDecimalValue(this JObject jobj, string prop) + { + var jt = jobj[prop]; + if (jt == null) + { + return 0; + } + + var strVal = jt.ToString(); + decimal rtnVal = 0; + decimal.TryParse(strVal, out rtnVal); + return rtnVal; + } + + /// + /// 获取datetime值 + /// + /// + /// + /// + public static DateTime? GetDateTimeValue(this JObject jobj, string prop) + { + var jt = jobj[prop]; + if (jt == null) + { + return null; + } + + var strVal = jt.ToString(); + DateTime rtnVal = DateTime.MinValue; + if (DateTime.TryParse(strVal, out rtnVal)) + { + return rtnVal; + } + + return null; + } + + /// + /// 获取datetime值,不带秒(yyyy-MM-dd HH:mm) + /// + /// + /// + /// + public static DateTime? GetDateTimeMinuteValue(this JObject jobj, string prop) + { + var jt = jobj[prop]; + if (jt == null) + { + return null; + } + + var strVal = jt.ToString() + ":00"; + DateTime rtnVal = DateTime.MinValue; + if (DateTime.TryParse(strVal, out rtnVal)) + { + return rtnVal; + } + + return null; + } + } +} diff --git a/DSWeb.Common/Model/LongExtension.cs b/DSWeb.Common/Model/LongExtension.cs new file mode 100644 index 0000000..60b4550 --- /dev/null +++ b/DSWeb.Common/Model/LongExtension.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DSWeb.Common +{ + /// + /// long数据拓展 + /// + public static class LongExtension + { + + /// + /// 将毫秒时间戳转换为普通时间 + /// + /// 毫秒级别的时间戳 + /// + public static DateTime ToDateTimeMilliseconds(this long timestamp) + { + System.DateTime time = System.DateTime.MinValue; + DateTime startTime = new DateTime(1970, 1, 1, 0, 0, 0); + time = startTime.AddMilliseconds(timestamp).Add(TimeZoneInfo.Local.BaseUtcOffset); + return time; + } + /// + /// 将秒级别时间戳转换为普通时间 + /// + /// 秒级别的时间戳 + /// + public static DateTime ToDateTimeSecoders(this long timestamp) + { + DateTime time = System.DateTime.MinValue; + + DateTime startTime = new DateTime(1970, 1, 1, 0, 0, 0); + time = startTime.AddSeconds(timestamp).Add(TimeZoneInfo.Local.BaseUtcOffset); + return time; + } + /// + /// 讲标准时间戳(秒级)转换为时间格式 + /// + /// + /// + + public static DateTime ToDataTime(this long timestamp) + { + return ToDateTimeSecoders(timestamp); + } + } +} diff --git a/DSWeb.Common/Model/RespModel.cs b/DSWeb.Common/Model/RespModel.cs new file mode 100644 index 0000000..97495d4 --- /dev/null +++ b/DSWeb.Common/Model/RespModel.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Web; + +namespace DSWeb.Common.Model +{ + public class RespCommon + { + public bool Success { get; set; } + public string Message { get; set; } + public int Code { get; set; } + } + + public class RespPage : RespCommon + { + public int Offset { get; set; } + public int Limit { get; set; } + public int Total { get; set; } + } + + public class RespCommonData : RespCommon + { + public object Data { get; set; } + } + + public class RespPageData : RespPage + { + public object DataList { get; set; } + } + + public class RespBsSuggest + { + public int code { get; set; } + public string message { get; set; } + public object value { get; set; } + } + public class RespCodeName + { + public string code { get; set; } + public string name { get; set; } + + } + + +} \ No newline at end of file diff --git a/DSWeb.Common/Model/StringExtension.cs b/DSWeb.Common/Model/StringExtension.cs new file mode 100644 index 0000000..0538a4d --- /dev/null +++ b/DSWeb.Common/Model/StringExtension.cs @@ -0,0 +1,479 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Security.Cryptography; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using Newtonsoft.Json; +namespace DSWeb.Common +{ + /// + /// string 拓展 + /// + public static class StringExtension + { + + + /// + /// 隐藏中间字符串 + /// + /// + /// + public static string GetHideCentre(this string str) + { + if (str.Length > 8) + { + + return string.Format("{0}***{1}", str.Substring(0, 4), str.Substring(str.Length - 4, 4)); + } + else if (str.Length > 5) + { + return string.Format("{0}***{1}", str.Substring(0, 2), str.Substring(str.Length - 2, 2)); + + } + else if (str.Length > 4) + { + return string.Format("{0}***{1}", str.Substring(0, 1), str.Substring(str.Length - 1, 1)); + + } + else + { + return GetHideHead(str); + } + } + + /// + /// 隐藏头部 + /// + /// + /// + public static string GetHideHead(this string str) + { + var length = 1; + length = length > str.Length ? str.Length : length; + if (str.Length < 4) + { + length = 1; + if (str.Length == 1) + { + return str; + } + + return "**" + str.Substring(str.Length - length, length); + } + length = 4; + return "****" + str.Substring(str.Length - length, length); + + + } + + /// + /// 用于判断是否为空字符 + /// + /// + /// + public static bool IsNull(this string s) + { + return s == null || (s.Trim().Length == 0); + } + + /// + /// 用于判断是否为非空字符 + /// + /// + /// + public static bool IsNotNull(this string s) + { + return !s.IsNull(); + } + + #region 加密算法 + + + /// + /// DES对称加密字符串 + /// + /// 待加密的字符串 + /// 加密密钥,要求为16位 + /// 加密成功返回加密后的字符串,失败返回源串 + public static string DESEncrypt(this string encryptString, string key) + { + try + { + byte[] rgbKey = Encoding.UTF8.GetBytes(key); + //用于对称算法的初始化向量(默认值)。 + byte[] rgbIV = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; + byte[] inputByteArray = Encoding.UTF8.GetBytes(encryptString); + Aes dCSP = Aes.Create(); + + MemoryStream mStream = new MemoryStream(); + CryptoStream cStream = new CryptoStream(mStream, dCSP.CreateEncryptor(rgbKey, rgbIV), CryptoStreamMode.Write); + cStream.Write(inputByteArray, 0, inputByteArray.Length); + cStream.FlushFinalBlock(); + return Convert.ToBase64String(mStream.ToArray()); + } + catch (Exception ex) + { + throw ex; + } + } + + /// + /// DES对称解密字符串 + /// + /// 待解密的字符串 + /// 解密密钥,要求16位 + /// + public static string DESDecrypt(this string decryptString, string key) + { + try + { + //用于对称算法的初始化向量(默认值) + byte[] Keys = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; + byte[] rgbKey = Encoding.UTF8.GetBytes(key); + byte[] rgbIV = Keys; + byte[] inputByteArray = Convert.FromBase64String(decryptString); + Aes DCSP = Aes.Create(); + + MemoryStream mStream = new MemoryStream(); + CryptoStream cStream = new CryptoStream(mStream, DCSP.CreateDecryptor(rgbKey, rgbIV), CryptoStreamMode.Write); + cStream.Write(inputByteArray, 0, inputByteArray.Length); + cStream.FlushFinalBlock(); + return Encoding.UTF8.GetString(mStream.ToArray()); + } + catch + { + return decryptString; + } + } + + /// + /// 将字符串转换成MD5加密字符串 + /// + /// + /// + public static string ToMd5(this string orgStr) + { + using (var md5 = MD5.Create()) + { + var encoding = Encoding.UTF8; + var encryptedBytes = md5.ComputeHash(encoding.GetBytes(orgStr)); + var sb = new StringBuilder(32); + foreach (var bt in encryptedBytes) + { + sb.Append(bt.ToString("x").PadLeft(2, '0')); + } + return sb.ToString().ToLower(); + } + } + #endregion + /// + /// 获取扩展名 + /// + /// + /// + public static string GetExt(this string s) + { + var ret = string.Empty; + if (!s.Contains('.')) return ret; + var temp = s.Split('.'); + ret = temp[temp.Length - 1]; + + return ret; + } + /// + /// 验证QQ格式 + /// + /// + /// + public static bool IsQq(this string s) + { + return s.IsNull() || Regex.IsMatch(s, @"^[1-9]\d{4,15}$"); + } + + /// + /// 将字符串根据分隔符转换我List + /// + /// + /// 分隔符 + /// + public static List ToListString(this string str, char split) + { + return new List(str.Split(split)); + + } + + /// + /// 判断是否为有效的Email地址 + /// + /// + /// + public static bool IsEmail(this string s) + { + if (!s.IsNull()) + { + //return Regex.IsMatch(s, + // @"^(?("")("".+?""@)|(([0-9a-zA-Z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-zA-Z])@))" + + // @"(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,6}))$"); + const string pattern = @"^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$"; + return Regex.IsMatch(s, pattern); + } + return false; + } + /// + /// 判断是否是url + /// + /// + /// + public static bool IsUrl(this string s) + { + if (!s.IsNull()) + { + const string pattern = @"^(http://|https://)?((?:[A-Za-z0-9]+-[A-Za-z0-9]+|[A-Za-z0-9]+)\.)+([A-Za-z]+)[/\?\:]?.*$"; + return Regex.IsMatch(s, pattern); + } + return false; + } + + /// + /// 验证是否是合法的电话号码 + /// + /// + /// + public static bool IsPhone(this string s) + { + if (!s.IsNull()) + { + return Regex.IsMatch(s, @"^\+?((\d{2,4}(-)?)|(\(\d{2,4}\)))*(\d{0,16})*$"); + } + return true; + } + + /// + /// 验证是否是合法的手机号码 + /// + /// + /// + public static bool IsMobile(this string s) + { + if (!s.IsNull()) + { + return Regex.IsMatch(s, @"^\+?\d{0,4}?[1][3-8]\d{9}$"); + } + return false; + } + + /// + /// 验证是否是合法的邮编 + /// + /// + /// + public static bool IsZipCode(this string s) + { + if (!s.IsNull()) + { + return Regex.IsMatch(s, @"[1-9]\d{5}(?!\d)"); + } + return true; + } + + /// + /// 验证是否是合法的传真 + /// + /// + /// + public static bool IsFax(this string s) + { + if (!s.IsNull()) + { + return Regex.IsMatch(s, @"(^[0-9]{3,4}\-[0-9]{7,8}$)|(^[0-9]{7,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)"); + } + return true; + } + + /// + /// 检查字符串是否为有效的int数字 + /// + /// + /// + public static bool Isint(this string val) + { + if (IsNull(val)) + return false; + int k; + return int.TryParse(val, out k); + } + + /// + /// 字符串转数字,未转换成功返回0 + /// + /// + /// + public static int ToInt(this string val) + { + + if (IsNull(val)) + return 0; + int k; + return int.TryParse(val, out k) ? k : 0; + } + + /// + /// 将int间隔字符串抓换为list + /// + /// + /// + /// + public static List ToIntList(this string str, char Split = ',') + { + return str.Split(Split).strToIntArray().ToList(); + } + + /// + /// 判断是否是json字符串 + /// + /// + /// + public static bool IsJson(this string str) + { + try + { + if (str.IsNull()) + return false; + + JsonConvert.DeserializeObject(str); + return true; + } + catch + { + return false; + } + } + + /// + /// 检查字符串是否为有效的INT64数字 + /// + /// + /// + public static bool IsInt64(this string val) + { + if (IsNull(val)) + return false; + long k; + return long.TryParse(val, out k); + } + + /// + /// 验证是否是身份证 + /// + /// + /// + public static bool IsCardId(this string ID) + { + var r = false; + if (IsNull(ID)) + r = false; + if (ID.Length == 15) + { + + var date = $"19{ID.Substring(6, 2)}-{ID.Substring(8, 2)}-{ID.Substring(10, 2)}"; + DateTime dt; + return DateTime.TryParse(date, out dt); + } + else if (ID.Length == 18) + { + var date = $"{ID.Substring(6, 4)}-{ID.Substring(10, 2)}-{ID.Substring(12, 2)}"; + DateTime dt; + return DateTime.TryParse(date, out dt); + } + else { r = false; } + + return r; + } + + /// + /// 检查字符串是否为有效的double + /// + /// + /// + public static bool IsDecimal(this string val) + { + if (IsNull(val)) + return false; + double d; + return double.TryParse(val, out d); + } + + /// + ///检测字符串是否是时间类型 + /// + /// + /// + public static bool IsDateTime(this string val) + { + if (IsNull(val)) + return false; + DateTime d; + return DateTime.TryParse(val, out d); + } + /// + /// 字符串转时间 非时间返回空 + /// + /// + /// + public static DateTime? ToDateTime(this string val) + { + if (val.IsDateTime()) + { + return DateTime.Parse(val); + } + else + { + return null; + } + } + /// + /// 将时间类型字符转时间戳 + /// + /// + /// + public static long ToTimestamp(this string Val) + { + var time = Val.ToDateTime(); + return time != null ? ((DateTime)time).ToTimeStamp() : 0; + } + + /// + /// 从左边截取N个字符 + /// + /// + /// + public static string GetLeftStr(this string val, int count = 0) + { + if (count > val.Length) + return null; + + return val.Substring(0, count); + } + + /// + ///从右边截取N个字符 + /// + /// + /// + /// + public static string GetRightStr(this string val, int count = 0) + { + + if (count > val.Length) + return null; + + return val.Substring(val.Length - count, count); + + } + + + } +} diff --git a/DSWeb.Common/Properties/AssemblyInfo.cs b/DSWeb.Common/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..89c0dd6 --- /dev/null +++ b/DSWeb.Common/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("DSWeb.Common")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("DSWeb.Common")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("a0ab3d23-0dad-49ba-9d23-107faa1c369e")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 +//通过使用 "*",如下所示: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DSWeb.Common/packages.config b/DSWeb.Common/packages.config new file mode 100644 index 0000000..5ec38a1 --- /dev/null +++ b/DSWeb.Common/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/DSWeb.sln b/DSWeb.sln index 611d3d5..809938a 100644 --- a/DSWeb.sln +++ b/DSWeb.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.539 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33205.214 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DSWeb", "DSWeb\DSWeb.csproj", "{A91BE74B-0E69-433D-8622-A5D9CCA76E93}" ProjectSection(ProjectDependencies) = postProject @@ -16,6 +16,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OfficeHelper", "OfficeHelpe EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HcDBUtility", "HcDBUtility\HcDBUtility.csproj", "{3251626D-7409-42C5-9BB6-2BF6BD6C285B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DSWeb.Common", "DSWeb.Common\DSWeb.Common.csproj", "{A0AB3D23-0DAD-49BA-9D23-107FAA1C369E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -76,6 +78,18 @@ Global {3251626D-7409-42C5-9BB6-2BF6BD6C285B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {3251626D-7409-42C5-9BB6-2BF6BD6C285B}.Release|Mixed Platforms.Build.0 = Release|Any CPU {3251626D-7409-42C5-9BB6-2BF6BD6C285B}.Release|x86.ActiveCfg = Release|Any CPU + {A0AB3D23-0DAD-49BA-9D23-107FAA1C369E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A0AB3D23-0DAD-49BA-9D23-107FAA1C369E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A0AB3D23-0DAD-49BA-9D23-107FAA1C369E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A0AB3D23-0DAD-49BA-9D23-107FAA1C369E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A0AB3D23-0DAD-49BA-9D23-107FAA1C369E}.Debug|x86.ActiveCfg = Debug|Any CPU + {A0AB3D23-0DAD-49BA-9D23-107FAA1C369E}.Debug|x86.Build.0 = Debug|Any CPU + {A0AB3D23-0DAD-49BA-9D23-107FAA1C369E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A0AB3D23-0DAD-49BA-9D23-107FAA1C369E}.Release|Any CPU.Build.0 = Release|Any CPU + {A0AB3D23-0DAD-49BA-9D23-107FAA1C369E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A0AB3D23-0DAD-49BA-9D23-107FAA1C369E}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A0AB3D23-0DAD-49BA-9D23-107FAA1C369E}.Release|x86.ActiveCfg = Release|Any CPU + {A0AB3D23-0DAD-49BA-9D23-107FAA1C369E}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/DSWeb/Areas/CommMng/Controllers/PublicInterfaceController.cs b/DSWeb/Areas/CommMng/Controllers/PublicInterfaceController.cs new file mode 100644 index 0000000..bce1f45 --- /dev/null +++ b/DSWeb/Areas/CommMng/Controllers/PublicInterfaceController.cs @@ -0,0 +1,125 @@ +using Aspose.Words.Saving; +using DSWeb.Areas.CommMng.DAL; +using DSWeb.Common.DB; +using DSWeb.MvcShipping.Helper; +using HcUtility.Comm; +using System; +using System.Collections.Generic; +using System.Data.Entity.Core.Metadata.Edm; +using System.Data.Entity.Migrations; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Reflection; +using System.Web; +using System.Web.Mvc; + +namespace DSWeb.Areas.CommMng.Controllers +{ + public class PublicInterfaceController + { + + + [HttpPost] + public InterfaceResult PostInterface(InterfaceParam param) { + try { + param.Save(); + Assembly assembly = Assembly.Load("DSWeb.Areas.CommMng.Controllers"); + var type = assembly.GetType("DSWeb.Areas.CommMng.Controllers.InterfaceBase." + param.PORTNAME); + + Object obj = type.Assembly.CreateInstance(type.ToString()); + + var doset = type.GetMethod("DoSet"); + var _param = new object[]{ param}; + InterfaceResult result = (InterfaceResult)doset.Invoke(obj,BindingFlags.Instance|BindingFlags.NonPublic,null, _param, null); + return result; + } catch (Exception e) { + var _r = new InterfaceResult(); + _r.errCode = "1"; + + var msg = e.Message; + if (e.InnerException != null && e.InnerException.Message != null) { + msg += "//InnerException.Message:" + e.InnerException.Message; + } + var _rs= BasicDataRefDAL.SaveLog(msg, "", param.PORTNAME, "公开接口"); + var _rr = JsonConvert.Deserialize(_rs.Content); + _r.errMsg = "未知错误,请联系相关人员,错误日志号【" + _rr.Data.ToString() + "】"; + return _r; + } + } + } + + public class InterfaceResult { + public string errCode { get; set; } + public string errMsg { get; set; } + + public InterfaceResult() { } + + public InterfaceResult(DBResult dbresult) { + if (dbresult.Success) + { + errCode = "0"; + } + else + { + errCode = "1"; + } + + errMsg = dbresult.Message + ";Data:" + JsonConvert.Serialize(dbresult.Data); + } + } + + public class InterfaceParam { + public string PORTNAME { get; set; } + public string GID { get; set; } + + public string Param { get; set; } + + public t_PublicInterface_Log_md getsaverec() { + var result = new t_PublicInterface_Log_md(); + result.GID= GID; + result.Param= Param; + result.PORTNAME = PORTNAME; + return result; + } + + public void Save() { + var saverec = getsaverec(); + if (string.IsNullOrWhiteSpace( saverec.Param) && string.IsNullOrWhiteSpace(saverec.PORTNAME)) + { + var cdc = new CommonDataContext(); + cdc.t_PublicInterface_Log.Add(saverec); + } + } + } + + public class InterfaceBase + { + public InterfaceBase() { } + + public InterfaceResult DoSet(InterfaceParam param) { + return new InterfaceResult(); + } + + //public static void SaveParam(InterfaceParam param) { + // param.Save(); + //} + + public class csCustInfo: InterfaceBase + { + public InterfaceResult DoSet(InterfaceParam param) + { + + var result = new DBResult(); + + //解析param.Param + var _str = param.Param; + + //向数据库保存 + + return new InterfaceResult(result); + } + + + } + } +} \ No newline at end of file diff --git a/DSWeb/DSWeb.csproj b/DSWeb/DSWeb.csproj index 7ebd4d3..96b0981 100644 --- a/DSWeb/DSWeb.csproj +++ b/DSWeb/DSWeb.csproj @@ -288,6 +288,7 @@ + @@ -1281,6 +1282,10 @@ + + {a0ab3d23-0dad-49ba-9d23-107faa1c369e} + DSWeb.Common + {3251626D-7409-42C5-9BB6-2BF6BD6C285B} HcDBUtility diff --git a/DSWeb/Web.config b/DSWeb/Web.config index 4745c47..bfd6cc9 100644 --- a/DSWeb/Web.config +++ b/DSWeb/Web.config @@ -64,9 +64,16 @@ + - + + + + + +