Browse Source

问题修改

master
lvzb 1 year ago
parent
commit
359cd543cf
  1. 29
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/UnknownAssemblys/UnknownAssemblyAppService.cs
  2. 16
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Entitys/BillNumberRecord.cs
  3. 56
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/BillNumberRecordDomainService.cs

29
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/UnknownAssemblys/UnknownAssemblyAppService.cs

@ -913,35 +913,6 @@ select * from
{
m100Obj.NeedReplenishPrint = 1;
await _billM100Repository.UpdateAsync(m100Obj);
//var waititem=await _waitPrintRepository.GetAsync(r=>r.M100Id== m100Obj.Id);
// if (waititem == null)
// {
// WaitPrint targetWaitPrint = new WaitPrint(GuidGenerator.Create());
// targetWaitPrint.M100Id = m100Obj.Id;
// //targetWaitPrint.BusinessType = m100Obj.BusinessType;
// //targetWaitPrint.ProductLine = sourceWaitPrint.ProductLine;
// //targetWaitPrint.OnlineTime = sourceWaitPrint.OnlineTime;
// //targetWaitPrint.HostSN = breaknum.ToString().Right(5).TryToIntZero();
// //targetWaitPrint.KNR = null;
// //targetWaitPrint.VIN = null;
// //targetWaitPrint.VehicleModelCode = null;
// //targetWaitPrint.AssemblyID = null;
// //targetWaitPrint.BillStatus = BillStatusEnum.BreakNum;
// //targetWaitPrint.PrintType = PrintTypeEnum.ReplenishPrint;
// //targetWaitPrint.HostSN2 = Convert.ToInt32 (m100Obj.HostSN2);
// //targetWaitPrint.Description = null;
// //targetWaitPrint.ReceiveTime = null;
// //targetWaitPrint.CreationTime = null;
// //targetWaitPrint.CreatorId = null;
// //targetWaitPrint.LastModificationTime = null;
// //targetWaitPrint.LastModifierId = null;
// await _waitPrintRepository.InsertAsync(targetWaitPrint);
// }
// else
// {
// waititem.PrintType =PrintTypeEnum.ReplenishPrint;
// }
}
#endregion
}

16
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Entitys/BillNumberRecord.cs

@ -6,6 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Entities.Auditing;
namespace WY.NewJit.MsgCheck
@ -13,7 +14,7 @@ namespace WY.NewJit.MsgCheck
/// <summary>
/// 单号纪律表
/// </summary>
public class BillNumberRecord : AuditedAggregateRoot<Guid>
public class BillNumberRecord : Entity<Guid>
{
public BillNumberRecord()
{
@ -27,34 +28,35 @@ namespace WY.NewJit.MsgCheck
RecordNumber = recordNumber;
InsertedRows = insertedRows;
UpdateTime = updateTime;
Datas= new List<PrintData>();
}
/// <summary>
/// 产线#
/// </summary>
public virtual string ProductLine { get; set; }
public string ProductLine { get; set; }
/// <summary>
/// 轮数#
/// </summary>
public virtual int RoundNumber { get; set; }
public int RoundNumber { get; set; }
/// <summary>
/// 记录号#
/// </summary>
public virtual int RecordNumber { get; set; }
public int RecordNumber { get; set; }
/// <summary>
/// 插入数据条数#
/// </summary>
public virtual int InsertedRows { get; set; }
public int InsertedRows { get; set; }
/// <summary>
/// 更新时间#
/// </summary>
public virtual DateTime UpdateTime { get; set; }
public DateTime? UpdateTime { get; set; }
/// <summary>
/// 一次处理后成的号码列表
/// </summary>
[NotMapped]
public virtual List<PrintData> Datas { get; set; } = new List<PrintData>();
public List<PrintData> Datas { get; set; } = new List<PrintData>();
}
}

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

@ -1,4 +1,5 @@
using Microsoft.Extensions.Logging;

using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
@ -7,6 +8,7 @@ using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Domain.Services;
using Volo.Abp.ObjectMapping;
using WY.NewJit.MsgBaseData;
using WY.NewJit.PrintTable;
@ -20,16 +22,20 @@ namespace WY.NewJit.MsgCheck
private readonly LogRemindDomainService _logRemindDomainService;
public static List<BillNumberRecord> _billNumberRecordCaches= new List<BillNumberRecord>() ;//记录内存
private readonly IObjectMapper _objectMapper;
public BillNumberRecordDomainService(
IRepository<BillNumberRecord, Guid> billNumberRepository,
ILogger<M100CheckDomainService> logger,
LogRemindDomainService logRemindDomainService,
IRepository<WaitPrint, Guid> waitPrintRepository)
IRepository<WaitPrint, Guid> waitPrintRepository,
IObjectMapper objectMapper)
{
_billNumberRepository = billNumberRepository;
_logger = logger;
_logRemindDomainService = logRemindDomainService;
_waitPrintRepository = waitPrintRepository;
_objectMapper = objectMapper;
}
/// <summary>
/// 获取和更新记录和内存
@ -58,21 +64,27 @@ namespace WY.NewJit.MsgCheck
else
{
_billNumberRecordCaches.Clear();
_billNumberRecordCaches = await _billNumberRepository.GetListAsync();
//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("获取记录缓存错误!");
// }
// }
//}
//_billNumberRecordCaches = await _billNumberRepository.GetListAsync();
var aa = await _billNumberRepository.GetListAsync();
_billNumberRecordCaches = _objectMapper.Map<List<BillNumberRecord>, List<BillNumberRecord>>(aa);
foreach (var item in _billNumberRecordCaches)
{
var aaaa = item.RecordNumber;
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 + item.RoundNumber * 100000) != max)
{
ret.Status = false;
ret.Message = "获取记录缓存错误!";
_logger.LogDebug("获取记录缓存错误!");
}
}
}
}
return ret;
}
@ -88,14 +100,7 @@ namespace WY.NewJit.MsgCheck
var recordcache= _billNumberRecordCaches.FirstOrDefault(r=>r.ProductLine==productLine);
if (recordcache == null)
{
recordcache = new BillNumberRecord(
GuidGenerator.Create(),
productLine,
1,
number,
0,
DateTime.Now
);
recordcache = new BillNumberRecord( GuidGenerator.Create(), productLine, 1,number,0, DateTime.Now);
_billNumberRecordCaches.Add(recordcache);
var item = CreatPrintData(BillNumberTypeEnum., number, 1 * 100000);
datas.Add(item);
@ -168,6 +173,7 @@ namespace WY.NewJit.MsgCheck
return recordcache;
}
/// <summary>
/// 创建实体
/// </summary>

Loading…
Cancel
Save