贾荣国Home
3 years ago
30 changed files with 1084 additions and 131 deletions
@ -1,12 +0,0 @@ |
|||
namespace Win_in.Sfs.Scp.WebApi.Asns; |
|||
|
|||
/// <summary>
|
|||
/// Function Group Trailer
|
|||
/// 功能组尾
|
|||
/// </summary>
|
|||
public class GE |
|||
{ |
|||
public string GE01 { get; set; } |
|||
public string GE02 { get; set; } |
|||
|
|||
} |
@ -1,18 +0,0 @@ |
|||
namespace Win_in.Sfs.Scp.WebApi.Asns; |
|||
|
|||
/// <summary>
|
|||
/// Function Group Header
|
|||
/// 功能组头
|
|||
/// </summary>
|
|||
public class GS |
|||
{ |
|||
public string GS01 { get; set; } |
|||
public string GS02 { get; set; } |
|||
public string GS03 { get; set; } |
|||
public string GS04 { get; set; } |
|||
public string GS05 { get; set; } |
|||
public string GS06 { get; set; } |
|||
public string GS07 { get; set; } |
|||
public string GS08 { get; set; } |
|||
|
|||
} |
@ -0,0 +1,34 @@ |
|||
namespace Win_in.Sfs.Scp.WebApi.Asns; |
|||
|
|||
/// <summary>
|
|||
/// Function Group Trailer
|
|||
/// 功能组尾
|
|||
/// </summary>
|
|||
public class GE |
|||
{ |
|||
/// <summary>
|
|||
/// Number of Included Sets
|
|||
/// 集合数量
|
|||
/// </summary>
|
|||
public string GE01 { get; set; } = "1"; |
|||
|
|||
/// <summary>
|
|||
/// Group Control Number
|
|||
/// 组编号
|
|||
/// </summary>
|
|||
public string GE02 { get; set; } |
|||
|
|||
public GE(string code, int count = 1) |
|||
{ |
|||
GE01 = count.ToString(); |
|||
GE02 = code; |
|||
} |
|||
|
|||
public override string ToString() |
|||
{ |
|||
return "GE" |
|||
+ X12Const.ElementSeparator + GE01 |
|||
+ X12Const.ElementSeparator + GE02; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,98 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Microsoft.VisualBasic; |
|||
|
|||
namespace Win_in.Sfs.Scp.WebApi.Asns; |
|||
|
|||
/// <summary>
|
|||
/// Function Group Header
|
|||
/// 功能组头
|
|||
/// </summary>
|
|||
public class GS |
|||
{ |
|||
/// <summary>
|
|||
/// Code Identifying Information Type
|
|||
/// Corresponding functional group.
|
|||
/// FA - Functional Acknowledgements
|
|||
/// PS - Planning Schedule with Release Capability
|
|||
/// SH - Ship Notice / Manifest
|
|||
/// SS - Shipping Schedule
|
|||
/// 组功能代码
|
|||
/// </summary>
|
|||
[StringLength(2, MinimumLength = 2)] |
|||
public string GS01 { get; } = "SS"; |
|||
|
|||
/// <summary>
|
|||
/// Sender ID Code
|
|||
/// 发送者ID
|
|||
/// </summary>
|
|||
[StringLength(2, MinimumLength = 15)] |
|||
public string GS02 { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Receiver ID Code
|
|||
/// 接收者ID
|
|||
/// </summary>
|
|||
[StringLength(2, MinimumLength = 15)] |
|||
public string GS03 { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Date
|
|||
/// 日期
|
|||
/// </summary>
|
|||
[StringLength(6, MinimumLength = 6)] |
|||
public string GS04 { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Time
|
|||
/// 时间
|
|||
/// </summary>
|
|||
[StringLength(4, MinimumLength = 4)] |
|||
public string GS05 { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Group Control Number
|
|||
/// 组编号
|
|||
/// </summary>
|
|||
[StringLength(1, MinimumLength = 9)] |
|||
public string GS06 { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Transaction Type Code
|
|||
/// X - ANSI X-12
|
|||
/// 事务类型代码
|
|||
/// </summary>
|
|||
[StringLength(1, MinimumLength = 2)] |
|||
public string GS07 { get; } = "X"; |
|||
|
|||
/// <summary>
|
|||
/// Version and Release
|
|||
/// 版本号和发布号
|
|||
/// 003060 – Version 3, Release 6
|
|||
/// </summary>
|
|||
[StringLength(1, MinimumLength = 12)] |
|||
public string GS08 { get; } = "003060"; |
|||
|
|||
public GS(string senderId, string receiverId, DateTime datetime, string code) |
|||
{ |
|||
GS02 = senderId; |
|||
GS03 = receiverId; |
|||
GS04 = datetime.ToString(X12Const.DateFormat); |
|||
GS05 = datetime.ToString(X12Const.TimeFormat); |
|||
GS06 = code; |
|||
} |
|||
|
|||
public override string ToString() |
|||
{ |
|||
return "GS" |
|||
+ X12Const.ElementSeparator + GS01 |
|||
+ X12Const.ElementSeparator + GS02 |
|||
+ X12Const.ElementSeparator + GS03 |
|||
+ X12Const.ElementSeparator + GS04 |
|||
+ X12Const.ElementSeparator + GS05 |
|||
+ X12Const.ElementSeparator + GS06 |
|||
+ X12Const.ElementSeparator + GS07 |
|||
+ X12Const.ElementSeparator + GS08; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,38 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Win_in.Sfs.Scp.WebApi.Asns; |
|||
|
|||
/// <summary>
|
|||
/// Interchange Control Trailer
|
|||
/// 报文尾
|
|||
/// </summary>
|
|||
public class IEA |
|||
{ |
|||
/// <summary>
|
|||
/// Number of Functional Groups in Transmission
|
|||
/// 包含的功能组数量
|
|||
/// </summary>
|
|||
[StringLength(5, MinimumLength = 1)] |
|||
public string IEA01 { get; set; } = "1"; |
|||
|
|||
/// <summary>
|
|||
/// Transmission Control Number
|
|||
/// 报文编号
|
|||
/// </summary>
|
|||
[StringLength(9, MinimumLength = 9)] |
|||
public string IEA02 { get; set; } |
|||
|
|||
public IEA(string code, int count = 1) |
|||
{ |
|||
IEA01 = count.ToString(); |
|||
IEA02 = code; |
|||
} |
|||
|
|||
public override string ToString() |
|||
{ |
|||
return "IEA" |
|||
+ X12Const.ElementSeparator + IEA01 |
|||
+ X12Const.ElementSeparator + IEA02; |
|||
} |
|||
} |
@ -0,0 +1,183 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.Net; |
|||
using System.Reflection; |
|||
using static System.Net.Mime.MediaTypeNames; |
|||
using static AutoMapper.Internal.ExpressionFactory; |
|||
|
|||
namespace Win_in.Sfs.Scp.WebApi.Asns; |
|||
|
|||
/// <summary>
|
|||
/// Interchange Control Header
|
|||
/// 报文头
|
|||
/// </summary>
|
|||
public class ISA |
|||
{ |
|||
/// <summary>
|
|||
/// Authorization Information Qualifier
|
|||
/// 授权限定符
|
|||
/// 固定值
|
|||
/// </summary>
|
|||
[StringLength(2, MinimumLength = 2)] |
|||
public string ISA01 { get; } = "00"; |
|||
|
|||
/// <summary>
|
|||
/// Authorization Information
|
|||
/// 授权信息
|
|||
/// </summary>
|
|||
[StringLength(10, MinimumLength = 10)] |
|||
public string ISA02 { get; set; } = " "; |
|||
|
|||
/// <summary>
|
|||
/// Security Information Qualifier
|
|||
/// 安全限定符
|
|||
/// 固定值
|
|||
/// </summary>
|
|||
[StringLength(2, MinimumLength = 2)] |
|||
public string ISA03 { get; } = "00"; |
|||
|
|||
/// <summary>
|
|||
/// Security Information
|
|||
/// 安全信息
|
|||
/// </summary>
|
|||
[StringLength(10, MinimumLength = 10)] |
|||
public string ISA04 { get; set; } = " "; |
|||
|
|||
/// <summary>
|
|||
/// Interchange ID Qualifier
|
|||
/// Sender ID Qualifier
|
|||
/// 01 - Duns (Dun & Bradstreet)
|
|||
/// ZZ - Mutually Defined
|
|||
/// 发送者ID限定符
|
|||
/// </summary>
|
|||
[StringLength(2, MinimumLength = 2)] |
|||
public string ISA05 { get; } = "01"; |
|||
|
|||
/// <summary>
|
|||
/// Interchange Sender ID
|
|||
/// 发送者ID
|
|||
/// </summary>
|
|||
[StringLength(15, MinimumLength = 15)] |
|||
public string ISA06 { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Interchange ID Qualifier.
|
|||
/// Receiver ID Qualifier. Same Qualifiers as ISA05
|
|||
/// 接收者ID限定符
|
|||
/// </summary>
|
|||
[StringLength(2, MinimumLength = 2)] |
|||
public string ISA07 { get; } = "ZZ"; |
|||
|
|||
/// <summary>
|
|||
/// Interchange Receiver ID
|
|||
/// 接收者ID
|
|||
/// </summary>
|
|||
[StringLength(15, MinimumLength = 15)] |
|||
public string ISA08 { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Interchange Date
|
|||
/// 交换日期
|
|||
/// </summary>
|
|||
[StringLength(6, MinimumLength = 6)] |
|||
public string ISA09 { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Interchange Time
|
|||
/// 交换时间
|
|||
/// </summary>
|
|||
[StringLength(4, MinimumLength = 4)] |
|||
public string ISA10 { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Interchange Control Standards Identifier.
|
|||
/// U - U. S. EDI Community of ASC X12, TDCC and UCS
|
|||
/// 控制标准
|
|||
/// </summary>
|
|||
[StringLength(1, MinimumLength = 1)] |
|||
public string ISA11 { get; } = "U"; |
|||
|
|||
/// <summary>
|
|||
/// Interchange Control Version Number
|
|||
/// This version number covers the interchange control segments.
|
|||
/// 00200 - Standard issued as ANSI X12.5 -1987
|
|||
/// 00300 - Standard issued as ANSI X12.5 -1992
|
|||
/// 00400 - Standard issued as ANSI X12.5 -1997
|
|||
/// 控制版本号
|
|||
/// </summary>
|
|||
[StringLength(5, MinimumLength = 5)] |
|||
public string ISA12 { get; set; } = "00300"; |
|||
|
|||
/// <summary>
|
|||
/// Interchange Control Number
|
|||
/// 报文编号
|
|||
/// </summary>
|
|||
[StringLength(9, MinimumLength = 9)] |
|||
public string ISA13 { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Acknowledgement Requested
|
|||
/// 0 - No acknowledgement requested.
|
|||
/// 1 - Interchange acknowledgement requested
|
|||
/// 是否需要回执
|
|||
/// </summary>
|
|||
[StringLength(1, MinimumLength = 1)] |
|||
public string ISA14 { get; set; } = "0"; |
|||
|
|||
/// <summary>
|
|||
/// Usage Indicator
|
|||
/// Code to indicate whether data enclosed by this interchange envelope is test or production.
|
|||
/// T - Test
|
|||
/// P – Production
|
|||
/// 报文类型
|
|||
/// </summary>
|
|||
[StringLength(1, MinimumLength = 1)] |
|||
public string ISA15 { get; set; } = EnvType.P.ToString(); |
|||
|
|||
/// <summary>
|
|||
/// Component Element Separator
|
|||
/// 组件元素分隔符
|
|||
/// </summary>
|
|||
[StringLength(1, MinimumLength = 1)] |
|||
public string ISA16 { get; set; } = "|"; |
|||
|
|||
public ISA(string senderId, string receiverId, string date, DateTime datetime, EnvType type = EnvType.P, |
|||
string authorization = " ", string security = " ") |
|||
{ |
|||
ISA06 = senderId; |
|||
ISA08 = receiverId; |
|||
ISA09 = date; |
|||
ISA10 = datetime.ToString(X12Const.DateFormat); |
|||
ISA13 = datetime.ToString(X12Const.TimeFormat); |
|||
ISA15 = type.ToString(); |
|||
ISA02 = authorization; |
|||
ISA04 = security; |
|||
} |
|||
|
|||
public override string ToString() |
|||
{ |
|||
return "ISA" |
|||
+ X12Const.ElementSeparator + ISA01 |
|||
+ X12Const.ElementSeparator + ISA02 |
|||
+ X12Const.ElementSeparator + ISA03 |
|||
+ X12Const.ElementSeparator + ISA04 |
|||
+ X12Const.ElementSeparator + ISA05 |
|||
+ X12Const.ElementSeparator + ISA06 |
|||
+ X12Const.ElementSeparator + ISA07 |
|||
+ X12Const.ElementSeparator + ISA08 |
|||
+ X12Const.ElementSeparator + ISA09 |
|||
+ X12Const.ElementSeparator + ISA10 |
|||
+ X12Const.ElementSeparator + ISA11 |
|||
+ X12Const.ElementSeparator + ISA12 |
|||
+ X12Const.ElementSeparator + ISA13 |
|||
+ X12Const.ElementSeparator + ISA14 |
|||
+ X12Const.ElementSeparator + ISA15 |
|||
+ X12Const.ElementSeparator + ISA16; |
|||
} |
|||
|
|||
public enum EnvType |
|||
{ |
|||
P, |
|||
T |
|||
} |
|||
} |
@ -1,25 +0,0 @@ |
|||
namespace Win_in.Sfs.Scp.WebApi.Asns; |
|||
|
|||
/// <summary>
|
|||
/// Interchange Control Header
|
|||
/// 报文头
|
|||
/// </summary>
|
|||
public class ISA |
|||
{ |
|||
public string ISA01 { get; set; } |
|||
public string ISA02 { get; set; } |
|||
public string ISA03 { get; set; } |
|||
public string ISA04 { get; set; } |
|||
public string ISA05 { get; set; } |
|||
public string ISA06 { get; set; } |
|||
public string ISA07 { get; set; } |
|||
public string ISA08 { get; set; } |
|||
public string ISA09 { get; set; } |
|||
public string ISA10 { get; set; } |
|||
public string ISA11 { get; set; } |
|||
public string ISA12 { get; set; } |
|||
public string ISA13 { get; set; } |
|||
public string ISA14 { get; set; } |
|||
public string ISA15 { get; set; } |
|||
public string ISA16 { get; set; } |
|||
} |
@ -1,11 +0,0 @@ |
|||
namespace Win_in.Sfs.Scp.WebApi.Asns; |
|||
|
|||
/// <summary>
|
|||
/// Interchange Control Trailer
|
|||
/// 报文尾
|
|||
/// </summary>
|
|||
public class ISE |
|||
{ |
|||
public string ISE01 { get; set; } |
|||
public string ISE02 { get; set; } |
|||
} |
@ -0,0 +1,19 @@ |
|||
namespace Win_in.Sfs.Scp.WebApi.Asns; |
|||
|
|||
public static class X12Const |
|||
{ |
|||
/// <summary>
|
|||
/// 元素分隔符
|
|||
/// </summary>
|
|||
public const string ElementSeparator = "*"; |
|||
|
|||
/// <summary>
|
|||
/// 日期格式
|
|||
/// </summary>
|
|||
public const string DateFormat = "yyMMdd"; |
|||
|
|||
/// <summary>
|
|||
/// 时间格式
|
|||
/// </summary>
|
|||
public const string TimeFormat = "HHmm"; |
|||
} |
Loading…
Reference in new issue