lvzb
1 year ago
9 changed files with 206 additions and 13 deletions
@ -0,0 +1,32 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel; |
|||
using System.Text; |
|||
|
|||
namespace WY.NewJit.PrintTable |
|||
{ |
|||
//public enum BillStatusEnum
|
|||
//{
|
|||
// [Description("空")]
|
|||
// None = 0,
|
|||
|
|||
// /// <summary>
|
|||
// /// 未匹配
|
|||
// /// </summary>
|
|||
// [Description("解析失败")]
|
|||
// ParseFail = 1,
|
|||
|
|||
// /// <summary>
|
|||
// /// 已匹配,未打印
|
|||
// /// </summary>
|
|||
// [Description("解析成功")]
|
|||
// ParseSuccess = 2,
|
|||
|
|||
// /// <summary>
|
|||
// /// 断号
|
|||
// /// </summary>
|
|||
// [Description("断号")]
|
|||
// BreakNum = 4,
|
|||
|
|||
//}
|
|||
} |
@ -0,0 +1,24 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel; |
|||
using System.Text; |
|||
|
|||
namespace WY.NewJit.PrintTable |
|||
{ |
|||
/// <summary>
|
|||
/// 业务类型:1 门板 2 其它柱护板 3 柱护板
|
|||
/// </summary>
|
|||
public enum BusinessTypeEnum |
|||
{ |
|||
[Description("门板")] |
|||
MenBan = 1, |
|||
|
|||
[Description("其它柱护板")] |
|||
OtherZhuHuBan = 2, |
|||
|
|||
[Description("柱护板")] |
|||
ZhuHuBan = 3, |
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,20 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel; |
|||
using System.Text; |
|||
|
|||
namespace WY.NewJit.PrintTable |
|||
{ |
|||
/// <summary>
|
|||
/// 打印类型: 1 顺序打印 2 补账打印
|
|||
/// </summary>
|
|||
public enum PrintTypeEnum |
|||
{ |
|||
[Description("顺序打印")] |
|||
OrderPrint = 1, |
|||
|
|||
[Description("空")] |
|||
ReplenishPrint = 2, |
|||
|
|||
} |
|||
} |
@ -0,0 +1,97 @@ |
|||
using Microsoft.Extensions.Logging; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.Domain.Services; |
|||
using WY.NewJit.PrintTable; |
|||
|
|||
namespace WY.NewJit.MsgCheck |
|||
{ |
|||
public class M100DomainService : DomainService |
|||
{ |
|||
/// <summary>
|
|||
/// M100单据
|
|||
/// </summary>
|
|||
private readonly IRepository<BillM100, Guid> _billM100Repository; |
|||
|
|||
/// <summary>
|
|||
/// 日志
|
|||
/// </summary>
|
|||
private ILogger<M100CheckDomainService> _logger; |
|||
|
|||
/// <summary>
|
|||
/// 未打印表
|
|||
/// </summary>
|
|||
private readonly IRepository<WaitPrint, Guid> _waitPrintRepository; |
|||
|
|||
public M100DomainService( |
|||
IRepository<BillM100, Guid> billM100Repository, |
|||
ILogger<M100CheckDomainService> logger, |
|||
IRepository<WaitPrint, Guid> waitPrintRepository |
|||
) |
|||
{ |
|||
_billM100Repository = billM100Repository; |
|||
_logger = logger; |
|||
_waitPrintRepository = waitPrintRepository; |
|||
} |
|||
|
|||
public async Task<bool> InsertM100(BillM100 m100Obj, bool autoSave = false) |
|||
{ |
|||
//处理断号
|
|||
|
|||
var m100Ret = await _billM100Repository.InsertAsync(m100Obj, autoSave); |
|||
if (m100Ret != null) |
|||
{ |
|||
if (m100Obj.ProductLine == "08") |
|||
{ |
|||
WaitPrint mbRec = ConvertWaitPrint(m100Ret, BusinessTypeEnum.MenBan); |
|||
WaitPrint zhbOtherRec = ConvertWaitPrint(m100Ret, BusinessTypeEnum.OtherZhuHuBan); |
|||
WaitPrint zhbRec = ConvertWaitPrint(m100Ret, BusinessTypeEnum.ZhuHuBan); |
|||
WaitPrint[] arr = new WaitPrint[3] { mbRec, zhbOtherRec, zhbRec }; |
|||
await _waitPrintRepository.InsertManyAsync(arr); |
|||
} |
|||
else |
|||
{ |
|||
WaitPrint mbRec = ConvertWaitPrint(m100Ret, BusinessTypeEnum.MenBan); |
|||
await _waitPrintRepository.InsertAsync(mbRec); |
|||
} |
|||
return true; |
|||
} |
|||
return false; |
|||
} |
|||
|
|||
private WaitPrint ConvertWaitPrint(BillM100 m100Ret, BusinessTypeEnum businessType) |
|||
{ |
|||
WaitPrint waitPrint = new WaitPrint(GuidGenerator.Create()); |
|||
waitPrint.M100Id = m100Ret.Id; |
|||
waitPrint.BusinessType = businessType; |
|||
waitPrint.ProductLine = m100Ret.ProductLine; |
|||
waitPrint.OnlineTime = (DateTime)m100Ret.OnlineTime; |
|||
waitPrint.HostSN = (int)m100Ret.HostSN; |
|||
waitPrint.KNR = m100Ret.KNR; |
|||
waitPrint.VIN = m100Ret.VIN; |
|||
waitPrint.VehicleModelCode = m100Ret.VehicleModelCode; |
|||
waitPrint.AssemblyID = m100Ret.AssemblyID; |
|||
if (businessType == BusinessTypeEnum.MenBan) |
|||
{ |
|||
waitPrint.BillStatus = m100Ret.BillStatus; |
|||
} |
|||
else |
|||
{ |
|||
waitPrint.BillStatus = BillStatusEnum.Match; //柱护板默认是匹配状态
|
|||
} |
|||
waitPrint.PrintType = PrintTypeEnum.OrderPrint; |
|||
waitPrint.HostSN2 = (int)m100Ret.HostSN2; |
|||
waitPrint.Description = m100Ret.Description; |
|||
waitPrint.ReceiveTime = m100Ret.ReceiveTime; |
|||
waitPrint.CreationTime = m100Ret.CreationTime; |
|||
waitPrint.CreatorId = m100Ret.CreatorId; |
|||
waitPrint.LastModificationTime = m100Ret.LastModificationTime; |
|||
waitPrint.LastModifierId = m100Ret.LastModifierId; |
|||
return waitPrint; |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue