Browse Source

代码合并

master
lvzb 1 year ago
parent
commit
fce5082110
  1. 6
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/BillM100AppService.cs
  2. 31
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/BillNumberRecordDomainService.cs
  3. 14
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/M100DomainService.cs

6
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/BillM100AppService.cs

@ -230,11 +230,11 @@ namespace WY.NewJit.MsgCheck
[UnitOfWork]
[HttpPost]
[Route("get-billnumberrec")]
public async Task<List<BillNumberRecord>> GetBillNumberRec(bool isupdate)
public async Task<bool> GetBillNumberRec(bool isupdate)
{
var aaa =await _aaa.GetOrUpDateBillNumberRecordCache(isupdate);
return aaa;
var ret = await _aaa.GetOrUpDateBillNumberRecordCache(isupdate);
return ret.Status;
}
/// <summary>
/// 查询柱护板

31
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/BillNumberRecordDomainService.cs

@ -14,7 +14,7 @@ namespace WY.NewJit.MsgCheck
public class BillNumberRecordDomainService : DomainService
{
private readonly IRepository<BillNumberRecord, Guid> _billNumberRepository;
// private readonly IRepository<WaitPrint, Guid> _waitPrintRepository;
private readonly IRepository<WaitPrint, Guid> _waitPrintRepository;
private ILogger<M100CheckDomainService> _logger;
private readonly LogRemindDomainService _logRemindDomainService;
public static List<BillNumberRecord> _billNumberRecordCaches= new List<BillNumberRecord>() ;
@ -22,11 +22,13 @@ namespace WY.NewJit.MsgCheck
public BillNumberRecordDomainService(
IRepository<BillNumberRecord, Guid> billNumberRepository,
ILogger<M100CheckDomainService> logger,
LogRemindDomainService logRemindDomainService)
LogRemindDomainService logRemindDomainService,
IRepository<WaitPrint, Guid> waitPrintRepository)
{
_billNumberRepository = billNumberRepository;
_logger = logger;
_logRemindDomainService = logRemindDomainService;
_waitPrintRepository = waitPrintRepository;
}
/// <summary>
/// 清空缓存
@ -36,8 +38,9 @@ namespace WY.NewJit.MsgCheck
_billNumberRecordCaches.Clear();
}
public async Task<List<BillNumberRecord>> GetOrUpDateBillNumberRecordCache(bool isupdate)
public async Task<ObjectResultDto> GetOrUpDateBillNumberRecordCache(bool isupdate)
{
ObjectResultDto ret = new ObjectResultDto(true, null);
if (isupdate)
{
await _billNumberRepository.UpdateManyAsync(_billNumberRecordCaches);
@ -45,13 +48,22 @@ namespace WY.NewJit.MsgCheck
else
{
_billNumberRecordCaches = await _billNumberRepository.GetListAsync();
//foreach (var item in _billNumberRecordCaches)
//{
// var iii=await _waitPrintRepository.GetListAsync(r => r.ProductLine == item.ProductLine);
// var ss= iii.Select(r => r.HostSN2).Max();
//}
foreach (var item in _billNumberRecordCaches)
{
var list = await _waitPrintRepository.GetListAsync(r => r.ProductLine == item.ProductLine);
if (list.Count > 0)
{
var max = list.Select(r => r.HostSN2).Max();
if(item.RecordNumber!= max)
{
ret.Status = false;
ret.Message = "获取记录缓存错误!";
_logger.LogDebug("获取记录缓存错误!");
}
}
return _billNumberRecordCaches;
}
}
return ret;
}
/// <summary>
/// 解析号码
@ -143,5 +155,6 @@ namespace WY.NewJit.MsgCheck
item.HostSN2 = item.HostSN + item.Round;
return item;
}
}
}

14
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/M100DomainService.cs

@ -47,11 +47,11 @@ namespace WY.NewJit.MsgCheck
{
//调用HostSN2方法
BillNumberRecord billNumRec = await _billNumRecDomainSrv.GetBillNumber(m100Obj.HostSN.TryToIntNotNull(), m100Obj.ProductLine);
var normalObj = billNumRec.dic.FirstOrDefault(itm => itm.Value == BillNumberTypeEnum.);
var lateObj = billNumRec.dic.FirstOrDefault(itm => itm.Value == BillNumberTypeEnum.);
var breaknumLst = billNumRec.dic.Where(itm => itm.Value == BillNumberTypeEnum.).ToList();
var normalObj = billNumRec.Datas.FirstOrDefault(itm => itm.BillNumberType == BillNumberTypeEnum.);
var lateObj = billNumRec.Datas.FirstOrDefault(itm => itm.BillNumberType == BillNumberTypeEnum.);
var breaknumLst = billNumRec.Datas.Where(itm => itm.BillNumberType == BillNumberTypeEnum.).ToList();
//更新M100
m100Obj.HostSN2 = normalObj.Key.TryToInt();
m100Obj.HostSN2 = normalObj.HostSN2.TryToInt();
//M100转换成WaitPrint:一个底盘、08产线插入3条记录,其它产线插入1条记录
WaitPrint[] wpArr;
if (m100Obj.ProductLine == "08")
@ -87,7 +87,7 @@ namespace WY.NewJit.MsgCheck
targetWaitPrint.AssemblyID = null;
targetWaitPrint.BillStatus = BillStatusEnum.BreakNum;
targetWaitPrint.PrintType = PrintTypeEnum.OrderPrint;
targetWaitPrint.HostSN2 = breaknum.Key.TryToIntZero();
targetWaitPrint.HostSN2 = breaknum.HostSN2;
targetWaitPrint.Description = null;
targetWaitPrint.ReceiveTime = null;
targetWaitPrint.CreationTime = null;
@ -101,12 +101,12 @@ namespace WY.NewJit.MsgCheck
}
//处理正常、迟到
BillM100 m100Ret = null;
if (normalObj.Key != null) //正常
if (normalObj != null) //正常
{
m100Ret = await _billM100Repository.InsertAsync(m100Obj, autoSave); //插入M100
await _waitPrintRepository.InsertManyAsync(wpArr, autoSave); //插入未打印表
}
else if (lateObj.Key != null) //迟到
else if (lateObj != null) //迟到
{
m100Ret = await _billM100Repository.InsertAsync(m100Obj, autoSave); //插入M100

Loading…
Cancel
Save