Browse Source

[fix]AsnFactory 抽离Magic string

master
贾荣国 2 years ago
parent
commit
f2348c3ec9
  1. 36
      WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/AsnBackgroundWorker/AsnFactory.cs

36
WebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi.Host/AsnBackgroundWorker/AsnFactory.cs

@ -8,9 +8,19 @@ namespace Win_in.Sfs.Scp.WebApi
{
public class AsnFactory
{
private const string IdentificationCode = "PSTV"; //TODO
private const string TruckNumber = "000000"; //TODO 车牌号
private const string PackagingCode = "PLT90"; //TODO 包装代码
private const string Authorization = ""; //用户名
private const string Security = ""; //密码
private const string IdentificationCode = "PSTV"; //识别码(SCAC代码)
private const string PackagingCode = "PLT90"; //包装代码
private const string ShipNoticeCode = "0001"; //事务编号
private const string DatetimeType = "011"; //日期类型
private const string Uom = "KG"; //计量单位
private const string RouteSequenceCode = "B"; //路由序列号
private const string Mode = "LT"; //模式
private const string EquipmentCode = "TL"; //设备代码
private const string TruckNumber = "000000"; //车牌号
public ASN_X12_856_3060 CreateAsnX128563060(string receiver,TB_ASN scpAsn,List<TS_BARCODE> barcodes)
{
@ -21,8 +31,8 @@ namespace Win_in.Sfs.Scp.WebApi
var shipTime = scpAsn.ShipTime ?? DateTime.Now;
var envType = ISA.EnvType.P;
var authorization = "";
var security = "";
var authorization = Authorization;
var security = Security;
//初始化ASN单
var asn = CreateAsn(asnCode,senderId,receiverId,shipTime,envType,authorization,security);
@ -30,19 +40,19 @@ namespace Win_in.Sfs.Scp.WebApi
//初始化功能组
var functionalGroup = CreateFunctionalGroup(senderId,receiverId,shipTime,functionalGroupCode);
var shipNoticeCode = "0001";
var datetimeType = "011";
var shipNoticeCode = ShipNoticeCode;
var datetimeType = DatetimeType;
//初始化发货单
var shipNotice = CreateShipNotice(shipNoticeCode,functionalGroupCode,shipTime,datetimeType);
var gValue = 0;
var gUom = "KG";
var gUom = Uom;
var nValue = 0;
var nUom = "KG";
var routeSequenceCode = "B";
var nUom = Uom;
var routeSequenceCode = RouteSequenceCode;
var identificationCode = IdentificationCode;
var mode = "LT";
var equipmentCode = "TL";
var mode = Mode;
var equipmentCode = EquipmentCode;
var equipmentNumber = TruckNumber;
//初始化发货明细
var shipment = CreateShipment(shipNotice,gValue,gUom,nValue,nUom,routeSequenceCode,identificationCode,mode,
@ -138,7 +148,7 @@ namespace Win_in.Sfs.Scp.WebApi
}
private ShipNotice CreateShipNotice(string shipNoticeCode, string noticeNumber, DateTime datetime,
string datetimeType="011", string purpose = "00")
string datetimeType, string purpose = "00")
{
var shipNotice = new ShipNotice();
shipNotice

Loading…
Cancel
Save