You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
98 lines
2.5 KiB
98 lines
2.5 KiB
3 years ago
|
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";
|
||
|
|
||
3 years ago
|
public GS(string senderId, string receiverId, DateTime datetime, string functionalGroupCode)
|
||
3 years ago
|
{
|
||
|
GS02 = senderId;
|
||
|
GS03 = receiverId;
|
||
|
GS04 = datetime.ToString(X12Const.DateFormat);
|
||
|
GS05 = datetime.ToString(X12Const.TimeFormat);
|
||
3 years ago
|
GS06 = functionalGroupCode;
|
||
3 years ago
|
}
|
||
|
|
||
|
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;
|
||
|
}
|
||
|
|
||
|
}
|