lvzb 10 months ago
parent
commit
b3abed0b71
  1. 6
      package-lock.json
  2. 419
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/EdiParseDomainService.cs
  3. 249
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/HQ_CacheManagerDomainService.cs
  4. 209
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/HQ_M100DomainService.cs
  5. 73
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/LastImportHostSNDomainService.cs
  6. 10
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/AssemblyCfgErp.cs
  7. 11
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/AssemblyCfgGroup.cs
  8. 52
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/Group_Assembly_Part.cs
  9. 16
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Entitys/BillM100.cs
  10. 3
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/BillNumberRecordDomainService.cs
  11. 7
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/CacheManagerDomainService.cs
  12. 345
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/M100DomainService.cs
  13. 42
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/R100CheckDomainService.cs
  14. 1
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/WY.NewJit.Domain.csproj
  15. 6126
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240110033428_NewJitPG_HQ_0110.Designer.cs
  16. 41
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240110033428_NewJitPG_HQ_0110.cs
  17. 6132
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115023640_NewJitPG_HQ_Init.Designer.cs
  18. 33
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115023640_NewJitPG_HQ_Init.cs
  19. 6134
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115024450_NewJitPG_HQ_Init2.Designer.cs
  20. 53
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115024450_NewJitPG_HQ_Init2.cs
  21. 6142
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115055730_NewJitPG_HQ_Init3.Designer.cs
  22. 35
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115055730_NewJitPG_HQ_Init3.cs
  23. 57
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/NewJitMigrationsDbContextModelSnapshot.cs
  24. 7
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore/EntityFrameworkCore/NewJitDbContextModelCreatingExtensions.cs
  25. 178
      vue/src/components/ImportExcel-normal/index.vue
  26. 10
      vue/src/router/modules/fis.js
  27. 15
      vue/src/views/pg-fis/basedate/m100Online/normalPritIndex.vue
  28. 469
      vue/src/views/pg-fis/basedate/planControl/index.vue
  29. 5
      vue/static/config.js

6
package-lock.json

@ -0,0 +1,6 @@
{
"name": "FIS1.5",
"lockfileVersion": 2,
"requires": true,
"packages": {}
}

419
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/EdiParseDomainService.cs

@ -0,0 +1,419 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Domain.Services;
using WY.NewJit.EdiReceive.Entitys;
using WY.NewJit.IRepositories;
using WY.NewJit.MsgBaseData;
using WY.NewJit.MsgCheck;
using WY.NewJit.Common;
using WY.NewJit.MsgBaseData.Entitys;
namespace WY.NewJit.EdiReceive.Services
{
/// <summary>
/// 红旗报文接收
/// </summary>
public class EdiParseDomainService : DomainService
{
#region 成员
/// <summary>
/// 日志
/// </summary>
private readonly ILogger<EdiParseDomainService> _logger;
/// <summary>
/// Dapper仓储
/// </summary>
private readonly INewJitDapperRepository _newJitDapperRepository;
/// <summary>
/// 字典领域服务
/// </summary>
private readonly DicDomainService _dicDomainService;
/// <summary>
/// 零件仓储
/// </summary>
private readonly IRepository<ImportRecord, Guid> _importRecordRepository;
/// <summary>
/// M100单据
/// </summary>
private readonly IRepository<BillM100, Guid> _billM100Repository;
/// <summary>
/// ERP总成分组仓库
/// </summary>
private readonly IRepository<AssemblyCfgGroup, Guid> _assemblyCfgGroupRepository;
/// <summary>
/// ERP总成仓储
/// </summary>
private readonly IRepository<AssemblyCfgErp, Guid> _assemblyCfgErpRepository;
/// <summary>
/// 整车总成配置仓库
/// </summary>
private readonly IRepository<AssemblyCfgVehicle, Guid> _assemblyCfgVehicleRepository;
private readonly LastImportHostSNDomainService _lastImportHostSNDomainService;
private readonly HQ_CacheManagerDomainService _hqCacheManagerDomainService;
private readonly HQ_M100DomainService _hqM100DomainServie;
/// <summary>
/// 重复M100
/// </summary>
private readonly IRepository<RepeatM100, Guid> _repeatM100Repository;
/// <summary>
/// 未知总成维护
/// </summary>
private readonly IRepository<UnknownAssembly, Guid> _unknownAssemblyRepository;
/// <summary>
/// 报文车型对应零件生产工厂车型
/// </summary>
private static List<DicItem> _msgToPaiGeVehicleModelList = new List<DicItem>();
/// <summary>
/// M100零件生产工厂车型对应生产线
/// </summary>
private static List<DicItem> _m100VehicleModelProductLineList = new List<DicItem>();
/// <summary>
/// 根据车型代码中的前两位(HS),过滤属于派格的订单;只针对派格的订单进行报文解析
/// </summary>
private const string _vehicleModelPrefix = "HS";
/// <summary>
/// 错误信息前缀
/// </summary>
private string _errorMessagePrefix
{
get
{
return System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + ".";
}
}
#endregion
public EdiParseDomainService(ILogger<EdiParseDomainService> logger, INewJitDapperRepository newJitDapperRepository, DicDomainService dicDomainService, IRepository<ImportRecord, Guid> importRecordRepository, IRepository<BillM100, Guid> billM100Repository, LastImportHostSNDomainService lastImportHostSNDomainService, IRepository<AssemblyCfgGroup, Guid> assemblyCfgGroupRepository = null, IRepository<AssemblyCfgErp, Guid> assemblyCfgErpRepository = null, IRepository<AssemblyCfgVehicle, Guid> assemblyCfgVehicleRepository = null, HQ_CacheManagerDomainService hqCacheManagerDomainService = null, HQ_M100DomainService hqM100DomainServie = null, IRepository<RepeatM100, Guid> repeatM100Repository = null, IRepository<UnknownAssembly, Guid> unknownAssemblyRepository = null)
{
_logger = logger;
_newJitDapperRepository = newJitDapperRepository;
_dicDomainService = dicDomainService;
_importRecordRepository = importRecordRepository;
_billM100Repository = billM100Repository;
_lastImportHostSNDomainService = lastImportHostSNDomainService;
_msgToPaiGeVehicleModelList = _dicDomainService.GetDicItems(DicTypeName.);
_m100VehicleModelProductLineList = _dicDomainService.GetDicItems(DicTypeName.M100派格车型对应生产线);
_assemblyCfgGroupRepository = assemblyCfgGroupRepository;
_assemblyCfgErpRepository = assemblyCfgErpRepository;
_assemblyCfgVehicleRepository = assemblyCfgVehicleRepository;
_hqCacheManagerDomainService = hqCacheManagerDomainService;
_hqM100DomainServie = hqM100DomainServie;
_repeatM100Repository = repeatM100Repository;
_unknownAssemblyRepository = unknownAssemblyRepository;
}
/// <summary>
/// 解析报文
/// </summary>
/// <param name="impRecLst"></param>
public async Task<ObjectResultDto> ParseEdi(List<ImportRecord> input, bool forceExecute = false)
{
ObjectResultDto ret = new ObjectResultDto();
//取本次导入的最小HostSN
int minHostSN = input.Min(itm => itm.HostSN);
//上次导入的最大HostSN
int lastHostSN = await _lastImportHostSNDomainService.GetLastImportHostSN();
string betweenBreakNumMsg = "";
if (minHostSN <= lastHostSN + 1)
{
}
else
{
if (forceExecute == false)
{
//两次导入断号提醒
betweenBreakNumMsg = $"两次导入断号提醒:本次导入的最小流水号是:{minHostSN},上次导入的最大流水号是:{lastHostSN}";
}
}
//扣除重复导入的订单
List<ImportRecord> notRepeatOrder = await GetNotRepeatOrder(input);
#region 断号提醒
string breakNumMsg = "";
notRepeatOrder = notRepeatOrder.OrderBy(itm => itm.HostSN).ToList();
for (int curIdx = 1; curIdx < notRepeatOrder.Count; curIdx++)
{
int curVal = notRepeatOrder[curIdx].HostSN;
int priorIdx = curIdx - 1;
int priorVal = notRepeatOrder[priorIdx].HostSN;
if (curVal - priorVal != 1)
{
breakNumMsg += $"流水号{priorVal}和{curVal}之间存在断号\r\n";
}
}
if (betweenBreakNumMsg.HasValue() || breakNumMsg.HasValue())
{
if (forceExecute == false)
{
//断号提醒
ret.Status = true;
ret.Message = betweenBreakNumMsg + breakNumMsg;
return ret;
}
}
#endregion
//批量插入 导入记录
await _importRecordRepository.InsertManyAsync(notRepeatOrder);
//初始化缓存
_hqCacheManagerDomainService.InitLoadCache();
//过滤掉其它订单,只取派格订单
var paigeOrderLst = notRepeatOrder.Where(itm => itm.VehicleModelCode.Substring(0, 2) == _vehicleModelPrefix).OrderBy(itm => itm.HostSN).ToList();
foreach (ImportRecord orderItem in paigeOrderLst)
{
#region 构建M100实体
BillM100 m100Obj = new BillM100(GuidGenerator.Create());
m100Obj.MessageFileReceiveID = orderItem.Id;
m100Obj.SerialNum = ServerHelper.VinToSN(orderItem.Vin);
m100Obj.SerialNumStr = ServerHelper.ToSerialNumStr(orderItem.OnlineTime, orderItem.HostSN);
m100Obj.HostSN = orderItem.HostSN;
m100Obj.HostSN2 = orderItem.HostSN; //流水号
m100Obj.KNR = orderItem.VehicleBodyCode;
m100Obj.VIN = orderItem.Vin;
m100Obj.AssemblyID = null;
m100Obj.OnlineTime = orderItem.OnlineTime;
m100Obj.VehicleModelCode = orderItem.VehicleBodyCode;
m100Obj.ProductLine = "";
m100Obj.Version = "";
m100Obj.ReceiveTime = ServerHelper.CurrentDateTime;
m100Obj.BillStatus = BillStatusEnum.NotMatch;
m100Obj.Description = "";
//m100Obj.OperationType = operationType;
//m100Obj.Operator = @operator;
//m100Obj.OperationTime = operationTime;
m100Obj.CanNotPrint = false;
m100Obj.NeedReplenishPrint = 0;
m100Obj.IsPartSwitch = false;
#endregion
UpdateProductLine(m100Obj);
string snStr = ServerHelper.ToSerialNumStr(m100Obj.OnlineTime, m100Obj.HostSN);
m100Obj.SetSerialNumStr(snStr);
//重复报文
bool isRepeat = _billM100Repository.Any(itm => itm.HostSN == orderItem.HostSN && itm.VIN == orderItem.Vin);
if (isRepeat == true)
{
#region 重复报文
var succObj = InsertM100RepeatBill(orderItem, m100Obj);
_logger.LogDebug(_errorMessagePrefix + $"流水号{orderItem.HostSN}是重复报文");
ret.Status = (succObj != null);
return ret;
#endregion
}
//绑定总成分组
string colorExplain = orderItem.VehicleModelDesc.Trim().Right(7);
Group_Assembly groupAssemblyObj = HQ_CacheManagerDomainService._groupAssemblyList.FirstOrDefault(itm => itm.SpecExplain == orderItem.SpecDesc && itm.ColorExplain == colorExplain);
if (groupAssemblyObj != null)
{
#region 插入整车总成
Guid vehicleAssemblyId = GuidGenerator.Create();
AssemblyCfgVehicle vehicleAssemblyCfgObj = new AssemblyCfgVehicle(vehicleAssemblyId, null, "", null, true);
foreach (OnlyAssemblyInfo assemblyItem in groupAssemblyObj.AssemblyDetails) //插入子表
{
vehicleAssemblyCfgObj.AddChildObj(GuidGenerator.Create(), assemblyItem.Id);
}
var vehicleAssemblyResu = await _assemblyCfgVehicleRepository.InsertAsync(vehicleAssemblyCfgObj, true);
if (vehicleAssemblyResu == null)
{
throw new Exception("插入整车总成返回结果为空InsertAsync!");
}
#endregion
//插入M100、未打印表
m100Obj.SetAssemblyID(vehicleAssemblyResu.Id);
var insM100Ret = await _hqM100DomainServie.InsertM100(m100Obj, true);
}
else
{
//未知总成
_logger.LogDebug(_errorMessagePrefix + $"未匹配总成,插入未知总成开始:{orderItem.HostSN}");
//更新单据表
m100Obj.SetAssemblyID(null);
m100Obj.SetBillStatus(BillStatusEnum.NotMatch);
var succObj1 = await _hqM100DomainServie.InsertM100(m100Obj, true);
//不匹配时,插入未知总成
var succObj2 = await InsertUnknownAssembly(m100Obj);
_logger.LogDebug(_errorMessagePrefix + $"未匹配总成,插入未知总成完成:{orderItem.HostSN}");
ret.Status = (succObj1 != null && succObj2 != null);
}
}
/*
1. EXCEL格式的订单列表
2. HostSN必须<= HostSN + 1 10 9 10 1112
3. VIN和HostSN
4. Excel时
5. impRecLst
M100
1. HS
2. VIN判断是否重复报文
3. 4
4. M100 ( 线)
5. WaitPrint
*/
ret.Status = true;
return ret;
}
/// <summary>
/// 根据流水号、VIN 扣除重复导入的订单
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
private async Task<List<ImportRecord>> GetNotRepeatOrder(List<ImportRecord> input)
{
List<ImportRecord> notRepeatLst = new List<ImportRecord>();
List<ImportRecord> importHistoryLst = await _importRecordRepository.AsQueryable()
.OrderBy(itm => itm.HostSN)
.TakeLast(10000)
.ToListAsync();
foreach (ImportRecord item in input)
{
bool hasData = importHistoryLst.Any(itm => itm.HostSN == item.HostSN && itm.Vin == item.Vin);
if (hasData)
{
}
else
{
notRepeatLst.Add(item);
}
}
return notRepeatLst;
}
/// <summary>
/// 更新车型、生产线
/// </summary>
/// <param name="billResObj"></param>
private void UpdateProductLine(BillM100 bill)
{
string ediVehicleModel = bill.VehicleModelCode; //报文车型
//车型转换:3H 转 CC
var obj1 = _msgToPaiGeVehicleModelList.FirstOrDefault(itm => itm.DicItemCode == ediVehicleModel);
if (obj1 != null)
{
string paigeVehicleModel = obj1.DicItemName; // CC
if (paigeVehicleModel.Contains('-')) //去掉B8L-PHEV中的-PHEV
{
paigeVehicleModel = paigeVehicleModel.Split('-')[0];
}
bill.SetVehicleModelCode(paigeVehicleModel);
//根据车型取对应生产线
var obj2 = _m100VehicleModelProductLineList.FirstOrDefault(itm => itm.DicItemCode == paigeVehicleModel);
if (obj2 != null)
{
string productLine = obj2.DicItemName;
bill.SetProductLine(productLine);
}
else
{
string errorMsg = $"零件生产工厂车型{paigeVehicleModel}没有对应的生产线!";
_logger.LogError(errorMsg);
}
}
else //报文车型 没有对应的 派格车型
{
string errorMsg = $"报文车型{ediVehicleModel}没有对应的零件生产工厂车型!";
_logger.LogError(errorMsg);
}
}
private RepeatM100 InsertM100RepeatBill(ImportRecord impordRec, BillM100 m100Bill) //, int? maxSerialNum
{
RepeatM100 ret = null;
int newSN = ServerHelper.VinToSN(m100Bill.VIN);
RepeatM100 repeatBill = new RepeatM100(
GuidGenerator.Create(),
impordRec.Id,
newSN,
m100Bill.HostSN,
m100Bill.KNR,
m100Bill.VIN,
null,
m100Bill.OnlineTime,
ServerHelper.CurrentDateTime,
m100Bill.VehicleModelCode,
m100Bill.ProductLine,
((DateTime)m100Bill.OnlineTime).ToString("yyyyMM"),
BillStatusEnum.None
);
//零件子表赋值
foreach (BillM100Part m100Part in m100Bill.BillM100Parts)
{
repeatBill.AddChildObj(GuidGenerator.Create(), m100Part.PartCode, m100Part.PartNum, m100Part.Description);
}
//插入重复单据
ret = _repeatM100Repository.InsertAsync(repeatBill, true).GetAwaiter().GetResult();
return ret;
}
/// <summary>
/// 不匹配时,插入未知总成,写提醒日志
/// </summary>
/// <param name="bill"></param>
private async Task<UnknownAssembly> InsertUnknownAssembly(BillM100 bill)
{
UnknownAssembly ret = null;
try
{
//插入未知总成
UnknownAssembly unknownAssemblyObj = new UnknownAssembly(GuidGenerator.Create(), bill.Id, "M100");
//预批量赋值
unknownAssemblyObj.Description = bill.Description; //描述字段保存预批量信息
//foreach (BillM100Part billPart in bill.BillM100Parts)
//{
// unknownAssemblyObj.AddChildObj(GuidGenerator.Create(), billPart.PartCode, billPart.PartNum, billPart.Description);
//}
//var partNumSum = unknownAssemblyObj.UnknownAssemblyParts.Sum(itm => (int)itm.PartNum);
//unknownAssemblyObj.SetPartNum(partNumSum);
ret = await _unknownAssemblyRepository.InsertAsync(unknownAssemblyObj);
return ret;
}
catch (Exception ex)
{
throw new Exception($"InsertUnknownAssembly方法报错:" + ex.Message);
}
}
}
}

249
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/HQ_CacheManagerDomainService.cs

@ -0,0 +1,249 @@
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Guids;
using Volo.Abp.Uow;
using WY.NewJit.Common;
using WY.NewJit.MsgBaseData;
using WY.NewJit.MsgCheck;
using WY.NewJit.IRepositories;
using WY.NewJit.MsgBaseData.Entitys;
namespace WY.NewJit.EdiReceive.Services
{
public partial class HQ_CacheManagerDomainService : ITransientDependency
{
#region 仓储
/// <summary>
/// 日志
/// </summary>
private ILogger<HQ_CacheManagerDomainService> _logger;
/// <summary>
/// 配置
/// </summary>
private readonly Microsoft.Extensions.Configuration.IConfiguration _configuration;
/// <summary>
/// Dapper仓储
/// </summary>
private readonly INewJitDapperRepository _newJitDapperRepository;
/// <summary>
/// 字典领域服务
/// </summary>
private readonly DicDomainService _dicDomainService;
/// <summary>
/// 跨进程全局配置领域服务
/// </summary>
private readonly GlobalSettingsDomainService _globalSettingsDomainService;
#endregion
#region 缓存
public static List<ErpAssemblyMain> _erpAssemblyMainList = new List<ErpAssemblyMain>();
/// <summary>
/// 分组VS总成关系
/// </summary>
//public static List<Group2Assembly> _group2assemblyList = new List<Group2Assembly>();
/// <summary>
/// 分组对应多个总成 清单-
/// </summary>
public static List<Group_Assembly> _groupAssemblyList = new List<Group_Assembly>();
/// <summary>
/// 结算件切换列表
/// </summary>
public static List<PartSwitch> _partSwitchList = new List<PartSwitch>();
/// <summary>
/// 报文车型VS派格车型
/// </summary>
public static List<DicItem> _msgToPaiGeVehicleModelList = new List<DicItem>();
/// <summary>
/// R100派格车型VS生产线
/// </summary>
public static List<DicItem> _r100VehicleModelProductLineList = new List<DicItem>();
/// <summary>
/// M100派格车型VS生产线
/// </summary>
public static List<DicItem> _m100VehicleModelProductLineList = new List<DicItem>();
/// <summary>
/// 结算件信息列表
/// </summary>
public static List<PartCfg> _partCfgList = new List<PartCfg>();
#endregion
#region 变量
/// <summary>
/// 错误信息前缀
/// </summary>
private string _errorMessagePrefix
{
get
{
return System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + ".";
}
}
/// <summary>
/// 上一次缓存刷新时间,和配置文件中RefreshCacheIntervalInMinutes一起使用
/// </summary>
private DateTime _lastRefreshCacheTime = DateTime.Now;
#endregion
#region 构造函数
/// <summary>
/// 构造函数
/// </summary>
public HQ_CacheManagerDomainService(
ILogger<HQ_CacheManagerDomainService> logger,
Microsoft.Extensions.Configuration.IConfiguration configuration,
INewJitDapperRepository newJitDapperRepository,
DicDomainService dicDomainService,
GlobalSettingsDomainService globalSettingsDomainService
)
{
_logger = logger;
_configuration = configuration;
_newJitDapperRepository = newJitDapperRepository;
_dicDomainService = dicDomainService;
_globalSettingsDomainService = globalSettingsDomainService;
}
#endregion
#region 方法
public bool InitLoadCache(bool forceRefresh = false)
{
bool ret = false;
try
{
if (forceRefresh == true)
{
DoInitLoadCache();
//结算件信息列表,库存系统同步过来,无法缓存
DoInitPartCfg();
ret = true;
}
else
{
bool isFirstRun = (_partCfgList.Any() == false); //第一次执行
if (isFirstRun)
{
DoInitLoadCache();
ret = true;
}
else //不是第一次执行
{
//判断是否需要刷新
bool isRefresh = _globalSettingsDomainService.GetSetting(GlobalSettingsNameEnum.);
if (isRefresh)
{
DoInitLoadCache();
_globalSettingsDomainService.SetSetting(GlobalSettingsNameEnum., false);
}
else
{
#region 10分钟自动刷新一次缓存
int refCacheInterval = _configuration["ConfigDic:RefreshCacheIntervalInMinutes"]?.TryToInt() ?? 10;
DateTime nowRefreshCacheTime = DateTime.Now;
TimeSpan ts = nowRefreshCacheTime - _lastRefreshCacheTime;
if (ts.TotalMinutes >= refCacheInterval)
{
DoInitLoadCache();
_lastRefreshCacheTime = DateTime.Now;
}
#endregion
ret = true;
}
}
//结算件信息列表,库存系统同步过来,无法缓存
DoInitPartCfg();
}
return ret;
}
catch (Exception ex)
{
string errorMsg = _errorMessagePrefix + "调用InitLoadCache方法时报错:" + ex.Message;
throw new Exception(errorMsg);
}
}
/// <summary>
/// 报文解析前加载缓存
/// </summary>
public void DoInitLoadCache()
{
//取ERP总成主表
string erpMainSql = "select Id, VehicleModel from FisAssemblyCfgErp where NewVersionId is null order by ErpAssemblyVersion, CreationTime desc";
_erpAssemblyMainList = _newJitDapperRepository.GetListBySql<ErpAssemblyMain>(erpMainSql, true);
//取ERP总成的零件
string group2assemblySql = @"
select g.Id as GroupId, g.GroupCode, g.VehicleModel, e.Id as ErpAssemblyId, e.ErpAssemblyCode,
g.SpecExplain, g.ColorExplain
from FisAssemblyCfgGroup g
join FisAssemblyCfgErp e on g.Id = e.GroupId
where IsDeleted = 0 and g.IsDisable = 0
order by g.CreationTime desc
";
var group2assemblyList = _newJitDapperRepository.GetListBySql<Group2Assembly>(group2assemblySql, true);
//转换成分组、总成 两层结构
List<Group_Assembly> _groupAssemblyList = group2assemblyList.GroupBy(itm => itm.GroupId).Select(itm => new Group_Assembly
{
Id = itm.Key,
GroupCode = itm.ElementAt(0).GroupCode,
SpecExplain = itm.ElementAt(0).SpecExplain,
ColorExplain = itm.ElementAt(0).ColorExplain,
AssemblyDetails = itm.Select(itm2 => new OnlyAssemblyInfo
{
Id = itm2.ErpAssemblyId,
ErpAssemblyCode = itm2.ErpAssemblyCode,
ErpAssemblyName = itm2.ErpAssemblyName
}).ToList()
}).ToList();
//结算件切换列表
string partSwitchSql = "select SourcePartCode, TargetPartCode, ActiveBeginTime, ActiveEndTime from FisPartSwitch";
_partSwitchList = _newJitDapperRepository.GetListBySql<PartSwitch>(partSwitchSql, true);
_msgToPaiGeVehicleModelList = _dicDomainService.GetDicItems(DicTypeName.);
_r100VehicleModelProductLineList = _dicDomainService.GetDicItems(DicTypeName.R100派格车型对应生产线);
_m100VehicleModelProductLineList = _dicDomainService.GetDicItems(DicTypeName.M100派格车型对应生产线);
_logger.LogDebug("重新刷新报文解析缓存!");
}
/// <summary>
/// 初始化零件基本信息
/// </summary>
private void DoInitPartCfg()
{
//结算件信息列表,库存系统同步过来,无法缓存
string partCfgSql = @"select Id, PartCode, PartName, PartType, Description, PartType2, PartType3, RelationKey from FisPartCfg where 1=1"; //,DaXiaoLiangGang,DoorPlankCode,MaterialDescription,SAPMaterialNum
_partCfgList = _newJitDapperRepository.GetListBySql<PartCfg>(partCfgSql, true);
}
#endregion
}
}

209
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/HQ_M100DomainService.cs

@ -0,0 +1,209 @@
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;
using WY.NewJit.Common;
namespace WY.NewJit.MsgCheck
{
public class HQ_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 HQ_M100DomainService(
IRepository<BillM100, Guid> billM100Repository,
ILogger<M100CheckDomainService> logger,
IRepository<WaitPrint, Guid> waitPrintRepository
)
{
_billM100Repository = billM100Repository;
_logger = logger;
_waitPrintRepository = waitPrintRepository;
}
public async Task<BillM100> InsertM100(BillM100 m100Obj, bool autoSave = false, bool isBatchImportBreakNum = false)
{
BillM100 m100Ret = null;
if (isBatchImportBreakNum) //批量导入断号模块调用
{
//更新M100
m100Obj.HostSN2 = 0;
//M100转换成WaitPrint:一个底盘、08产线插入3条记录,其它产线插入1条记录
WaitPrint[] wpArr2 = M100ConvertToWaitPrint(m100Obj);
foreach (var wp in wpArr2)
{
wp.PrintType = PrintTypeEnum.ReplenishPrint;
//wp.HostSN2 = 0; //WaitPrint的HostSN2从m100的HostSN2取值
}
m100Ret = await _billM100Repository.InsertAsync(m100Obj, autoSave); //插入M100
await _waitPrintRepository.InsertManyAsync(wpArr2, autoSave); //插入未打印表
return m100Ret;
}
//M100转换成WaitPrint:一个底盘、08产线插入3条记录,其它产线插入1条记录
WaitPrint[] wpArr = M100ConvertToWaitPrint(m100Obj);
m100Ret = await _billM100Repository.InsertAsync(m100Obj, autoSave); //插入M100
await _waitPrintRepository.InsertManyAsync(wpArr, autoSave); //插入未打印表
return m100Ret;
}
private WaitPrint[] M100ConvertToWaitPrint(BillM100 m100Obj)
{
WaitPrint[] wpArr;
WaitPrint mbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.MenBan);
wpArr = new WaitPrint[1] { mbRec };
return wpArr;
}
public async Task<BillM100> UpdateM100(BillM100 m100Obj, bool autoSave = false)
{
var m100Ret = await _billM100Repository.UpdateAsync(m100Obj, autoSave);
if (m100Ret != null)
{
//更新已解析状态时,只涉及门板、不涉及柱护板【柱护板一对一解析成功】
List<WaitPrint> wpLst = await _waitPrintRepository.GetListAsync(itm => itm.M100Id == m100Ret.Id && itm.BusinessType == BusinessTypeEnum.MenBan);
foreach (var wp in wpLst)
{
wp.AssemblyID = m100Ret.AssemblyID;
wp.BillStatus = m100Ret.BillStatus;
}
await _waitPrintRepository.UpdateManyAsync(wpLst, autoSave);
return m100Ret;
}
return null;
}
private WaitPrint ConvertWaitPrint(BillM100 m100Ret, BusinessTypeEnum businessType)
{
WaitPrint waitPrint = new WaitPrint(GuidGenerator.Create());
ConvertWaitPrint(m100Ret, businessType, waitPrint);
return waitPrint;
}
private void ConvertWaitPrint(BillM100 m100Ret, BusinessTypeEnum businessType, WaitPrint waitPrint)
{
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 = ServerHelper.CurrentDateTime; //m100Ret.CreationTime;
waitPrint.CreatorId = m100Ret.CreatorId;
waitPrint.LastModificationTime = m100Ret.LastModificationTime;
waitPrint.LastModifierId = m100Ret.LastModifierId;
}
private void Set_WaitPrint(WaitPrint sourceWaitPrint, WaitPrint targetWaitPrint)
{
targetWaitPrint.M100Id = sourceWaitPrint.M100Id;
targetWaitPrint.BusinessType = sourceWaitPrint.BusinessType;
targetWaitPrint.ProductLine = sourceWaitPrint.ProductLine;
targetWaitPrint.OnlineTime = sourceWaitPrint.OnlineTime;
targetWaitPrint.HostSN = sourceWaitPrint.HostSN;
targetWaitPrint.KNR = sourceWaitPrint.KNR;
targetWaitPrint.VIN = sourceWaitPrint.VIN;
targetWaitPrint.VehicleModelCode = sourceWaitPrint.VehicleModelCode;
targetWaitPrint.AssemblyID = sourceWaitPrint.AssemblyID;
targetWaitPrint.BillStatus = sourceWaitPrint.BillStatus;
targetWaitPrint.PrintType = sourceWaitPrint.PrintType;
targetWaitPrint.HostSN2 = sourceWaitPrint.HostSN2;
targetWaitPrint.Description = sourceWaitPrint.Description;
targetWaitPrint.ReceiveTime = sourceWaitPrint.ReceiveTime;
targetWaitPrint.CreationTime = sourceWaitPrint.CreationTime;
targetWaitPrint.CreatorId = sourceWaitPrint.CreatorId;
targetWaitPrint.LastModificationTime = sourceWaitPrint.LastModificationTime;
targetWaitPrint.LastModifierId = sourceWaitPrint.LastModifierId;
}
public async Task<Dictionary<Guid, List<BillM100Part>>> GetM100PartDic(List<Guid> m100IdLst)
{
List<BillM100> m100Lst = await _billM100Repository.GetListAsync(itm => m100IdLst.Contains(itm.Id), true);
Dictionary<Guid, List<BillM100Part>> ret = m100Lst.ToDictionary(itm => itm.Id, itm2 => itm2.BillM100Parts);
return ret;
}
/// <summary>
/// 根据M100插入或更新未打印表,【未知总成重新解析时调用】
/// </summary>
/// <param name="m100Obj"></param>
/// <returns></returns>
public async Task<ObjectResultDto> InsertOrUpdateWaitPrintByM100(BillM100 m100Obj, bool autoSave = false)
{
ObjectResultDto ret = new ObjectResultDto(true, "");
List<WaitPrint> wpLst = await _waitPrintRepository.GetListAsync(itm => itm.VIN == m100Obj.VIN && itm.BusinessType == BusinessTypeEnum.MenBan);
bool hasData = wpLst.Count > 0;
if (hasData) //未打印表有数据
{
foreach (WaitPrint wp in wpLst)
{
wp.AssemblyID = m100Obj.AssemblyID;
wp.BillStatus = m100Obj.BillStatus;
}
await _waitPrintRepository.UpdateManyAsync(wpLst, autoSave);
}
else //未打印表没有数据
{
WaitPrint[] wpArr;
if (m100Obj.ProductLine == "08")
{
WaitPrint mbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.MenBan);
//WaitPrint zhbOtherRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.OtherZhuHuBan);
//WaitPrint zhbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.AC_ZhuHuBan);
//wpArr = new WaitPrint[3] { mbRec, zhbOtherRec, zhbRec };
wpArr = new WaitPrint[1] { mbRec };
}
else
{
WaitPrint mbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.MenBan);
wpArr = new WaitPrint[1] { mbRec };
}
foreach (WaitPrint wp in wpArr)
{
wp.PrintType = PrintTypeEnum.ReplenishPrint;
}
await _waitPrintRepository.InsertManyAsync(wpArr, autoSave); //插入未打印表
}
return ret;
}
}
}

73
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/LastImportHostSNDomainService.cs

@ -0,0 +1,73 @@
using Microsoft.EntityFrameworkCore;
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.EdiReceive.Entitys;
using WY.NewJit.IRepositories;
using WY.NewJit.MsgBaseData;
using WY.NewJit.MsgCheck;
namespace WY.NewJit.EdiReceive.Services
{
public class LastImportHostSNDomainService : DomainService
{
#region 成员
/// <summary>
/// 日志
/// </summary>
private readonly ILogger<LastImportHostSNDomainService> _logger;
/// <summary>
/// Dapper仓储
/// </summary>
private readonly INewJitDapperRepository _newJitDapperRepository;
/// <summary>
/// 字典领域服务
/// </summary>
private readonly DicDomainService _dicDomainService;
/// <summary>
/// 零件仓储
/// </summary>
private readonly IRepository<ImportRecord, Guid> _importRecordRepository;
/// <summary>
/// M100单据
/// </summary>
private readonly IRepository<BillM100, Guid> _billM100Repository;
private readonly IRepository<LastImportHostSN, Guid> _lastImportHostSNRepository;
#endregion
public LastImportHostSNDomainService(ILogger<LastImportHostSNDomainService> logger, INewJitDapperRepository newJitDapperRepository, DicDomainService dicDomainService, IRepository<ImportRecord, Guid> importRecordRepository, IRepository<BillM100, Guid> billM100Repository, IRepository<LastImportHostSN, Guid> lastImportHostSNRepository)
{
_logger = logger;
_newJitDapperRepository = newJitDapperRepository;
_dicDomainService = dicDomainService;
_importRecordRepository = importRecordRepository;
_billM100Repository = billM100Repository;
_lastImportHostSNRepository = lastImportHostSNRepository;
}
public async Task<int> GetLastImportHostSN()
{
var lst = await _lastImportHostSNRepository.GetListAsync();
if (lst.Count > 0)
{
return lst[0].HostSN;
}
else
{
int maxSN = await _lastImportHostSNRepository.MaxAsync(itm => itm.HostSN);
return maxSN;
}
}
}
}

10
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/AssemblyCfgErp.cs

@ -52,6 +52,16 @@ namespace WY.NewJit.MsgBaseData
/// </summary> /// </summary>
public virtual Guid GroupId { get; set; } public virtual Guid GroupId { get; set; }
/// <summary>
/// 规格说明
/// </summary>
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明
/// </summary>
public virtual string ColorExplain { get; set; }
/// <summary> /// <summary>
/// 结算件列表 /// 结算件列表
/// </summary> /// </summary>

11
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/AssemblyCfgGroup.cs

@ -27,6 +27,17 @@ namespace WY.NewJit.MsgBaseData
/// </summary> /// </summary>
public virtual bool IsDisable { get; set; } public virtual bool IsDisable { get; set; }
/// <summary>
/// 规格说明
/// </summary>
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明
/// </summary>
public virtual string ColorExplain { get; set; }
private AssemblyCfgGroup() private AssemblyCfgGroup()
{ {
} }

52
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/Group_Assembly_Part.cs

@ -28,6 +28,34 @@ namespace WY.NewJit.MsgBaseData.Entitys
} }
public class Group_Assembly
{
public virtual Guid Id { get; set; }
/// <summary>
/// SAP分组编码(对应SAP的长描述或补充备注)
/// </summary>
public virtual string GroupCode { get; set; }
/// <summary>
/// 规格说明
/// </summary>
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明
/// </summary>
public virtual string ColorExplain { get; set; }
public List<OnlyAssemblyInfo> AssemblyDetails;
public Group_Assembly()
{
AssemblyDetails = new List<OnlyAssemblyInfo>();
}
}
public class AssemblyInfo public class AssemblyInfo
{ {
/// <summary> /// <summary>
@ -49,6 +77,30 @@ namespace WY.NewJit.MsgBaseData.Entitys
} }
public class OnlyAssemblyInfo
{
/// <summary>
/// Erp总成ID
/// </summary>
public Guid Id { get; set; }
/// <summary>
/// Erp总成编码
/// </summary>
public string ErpAssemblyCode { get; set; }
/// <summary>
/// Erp总成编码
/// </summary>
public string ErpAssemblyName { get; set; }
public OnlyAssemblyInfo()
{
}
}
public class PartInfo public class PartInfo
{ {
/// <summary> /// <summary>

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

@ -17,7 +17,7 @@ namespace WY.NewJit.MsgCheck
/// <summary> /// <summary>
/// 报文接收ID,对应报文接收表主键 /// 报文接收ID,对应报文接收表主键
/// </summary> /// </summary>
public virtual Guid? MessageFileReceiveID { get; protected set; } public virtual Guid? MessageFileReceiveID { get; set; }
/// <summary> /// <summary>
/// 流水号# /// 流水号#
@ -49,7 +49,7 @@ namespace WY.NewJit.MsgCheck
/// <summary> /// <summary>
/// 车型代码(取通用字典) /// 车型代码(取通用字典)
/// </summary> /// </summary>
public virtual string VehicleModelCode { get; protected set; } public virtual string VehicleModelCode { get; set; }
/// <summary> /// <summary>
/// 生产线(派格按生产线分类) /// 生产线(派格按生产线分类)
@ -59,17 +59,17 @@ namespace WY.NewJit.MsgCheck
/// <summary> /// <summary>
/// 版本 /// 版本
/// </summary> /// </summary>
public virtual string Version { get; protected set; } public virtual string Version { get; set; }
/// <summary> /// <summary>
/// 接收时间 /// 接收时间
/// </summary> /// </summary>
public virtual DateTime? ReceiveTime { get; protected set; } public virtual DateTime? ReceiveTime { get; set; }
/// <summary> /// <summary>
/// 单据状态(0 空;1 未匹配;2 已匹配未打印;3 已打印) /// 单据状态(0 空;1 未匹配;2 已匹配未打印;3 已打印)
/// </summary> /// </summary>
public virtual BillStatusEnum BillStatus { get; protected set; } public virtual BillStatusEnum BillStatus { get; set; }
/// <summary> /// <summary>
/// 描述 /// 描述
@ -142,9 +142,9 @@ namespace WY.NewJit.MsgCheck
//因为它会被来自数据库的值覆盖.可能不适用于私有构造函数. //因为它会被来自数据库的值覆盖.可能不适用于私有构造函数.
} }
//protected BillM100(Guid id) public BillM100(Guid id)
// :base(id) : base(id)
//{ } { }
//public BillM100(Guid id, Guid? messageFileReceiveID, int? serialNum, int? hostSN, string kNR, string vIN, Guid? assemblyID, DateTime? onlineTime, string vehicleModelCode, string version, DateTime? receiveTime, BillStatusEnum billStatus) //public BillM100(Guid id, Guid? messageFileReceiveID, int? serialNum, int? hostSN, string kNR, string vIN, Guid? assemblyID, DateTime? onlineTime, string vehicleModelCode, string version, DateTime? receiveTime, BillStatusEnum billStatus)
// : base(id) // : base(id)

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

@ -15,6 +15,9 @@ using WY.NewJit.PrintTable;
namespace WY.NewJit.MsgCheck namespace WY.NewJit.MsgCheck
{ {
/// <summary>
/// 吕志斌开发的生成断号数据
/// </summary>
[Dependency(Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton, ReplaceServices = true)] [Dependency(Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton, ReplaceServices = true)]
public class BillNumberRecordDomainService : DomainService public class BillNumberRecordDomainService : DomainService
{ {

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

@ -1,4 +1,5 @@
using Microsoft.Extensions.Logging; /*
using Microsoft.Extensions.Logging;
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
@ -22,7 +23,7 @@ using WY.NewJit.MsgBaseData.Entitys;
namespace WY.NewJit.MsgCheck namespace WY.NewJit.MsgCheck
{ {
public partial class CacheManagerDomainService : ITransientDependency public partial class CacheManagerDomainService : ITransientDependency
{ {
#region 仓储 #region 仓储
@ -301,6 +302,8 @@ namespace WY.NewJit.MsgCheck
} }
} }
*/
/* /*
private readonly CacheManagerDomainService _cacheManagerDomainService; private readonly CacheManagerDomainService _cacheManagerDomainService;
CacheManagerDomainService cacheManagerDomainService CacheManagerDomainService cacheManagerDomainService

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

@ -43,102 +43,7 @@ namespace WY.NewJit.MsgCheck
_billNumRecDomainSrv = billNumRecDomainSrv; _billNumRecDomainSrv = billNumRecDomainSrv;
} }
public async Task<BillM100> InsertM100(BillM100 m100Obj, bool autoSave = false, bool isBatchImportBreakNum = false) /*
{
BillM100 m100Ret = null;
if (isBatchImportBreakNum) //批量导入断号模块调用
{
//更新M100
m100Obj.HostSN2 = 0;
//M100转换成WaitPrint:一个底盘、08产线插入3条记录,其它产线插入1条记录
WaitPrint[] wpArr2 = M100ConvertToWaitPrint(m100Obj);
foreach (var wp in wpArr2)
{
wp.PrintType = PrintTypeEnum.ReplenishPrint;
//wp.HostSN2 = 0; //WaitPrint的HostSN2从m100的HostSN2取值
}
m100Ret = await _billM100Repository.InsertAsync(m100Obj, autoSave); //插入M100
await _waitPrintRepository.InsertManyAsync(wpArr2, autoSave); //插入未打印表
return m100Ret;
}
//调用HostSN2方法
BillNumberRecord billNumRec = await _billNumRecDomainSrv.GetBillNumber(m100Obj.HostSN.TryToIntNotNull(), m100Obj.ProductLine);
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 != null ? normalObj.HostSN2 : lateObj.HostSN2;
//M100转换成WaitPrint:一个底盘、08产线插入3条记录,其它产线插入1条记录
WaitPrint[] wpArr = M100ConvertToWaitPrint(m100Obj);
//处理断号
if (breakNumLst.Count > 0)
{
List<WaitPrint> waitPrintBreakNumLst = new List<WaitPrint>();
foreach (var sourceWaitPrint in wpArr) //遍历门板、柱护板、其它柱护板
{
foreach (var breaknum in breakNumLst) //遍历断号
{
WaitPrint targetWaitPrint = new WaitPrint(GuidGenerator.Create());
targetWaitPrint.M100Id = Guid.Parse("00000000-0000-0000-0000-000000000000");
targetWaitPrint.BusinessType = sourceWaitPrint.BusinessType;
targetWaitPrint.ProductLine = sourceWaitPrint.ProductLine;
targetWaitPrint.OnlineTime = sourceWaitPrint.OnlineTime;
targetWaitPrint.HostSN = breaknum.HostSN;
targetWaitPrint.KNR = null;
targetWaitPrint.VIN = null;
targetWaitPrint.VehicleModelCode = null;
targetWaitPrint.AssemblyID = null;
targetWaitPrint.BillStatus = BillStatusEnum.BreakNum;
targetWaitPrint.PrintType = PrintTypeEnum.OrderPrint;
targetWaitPrint.HostSN2 = breaknum.HostSN2;
targetWaitPrint.Description = null;
targetWaitPrint.ReceiveTime = null;
targetWaitPrint.CreationTime = ServerHelper.CurrentDateTime;
//targetWaitPrint.CreatorId = null;
//targetWaitPrint.LastModificationTime = null;
//targetWaitPrint.LastModifierId = null;
waitPrintBreakNumLst.Add(targetWaitPrint);
}
}
await _waitPrintRepository.InsertManyAsync(waitPrintBreakNumLst, autoSave); //插入断号
}
//处理正常、迟到
if (normalObj != null) //正常
{
m100Ret = await _billM100Repository.InsertAsync(m100Obj, autoSave); //插入M100
await _waitPrintRepository.InsertManyAsync(wpArr, autoSave); //插入未打印表
}
else if (lateObj != null) //迟到
{
m100Ret = await _billM100Repository.InsertAsync(m100Obj, autoSave); //插入M100
foreach (var item in wpArr) //遍历门板、柱护板、其它柱护板
{
var insObj = await _waitPrintRepository.FirstOrDefaultAsync(itm =>
itm.HostSN2 == m100Obj.HostSN2
&& itm.BillStatus == BillStatusEnum.BreakNum
&& itm.BusinessType == item.BusinessType);
if (insObj != null)
{
//如果未打印表有对应断号记录,将迟到记录与之合并
Set_WaitPrint(item, insObj);
var updateRet = await _waitPrintRepository.UpdateAsync(insObj);
}
else
{
//如果未打印表没有----对应断号记录,则插入
item.PrintType = PrintTypeEnum.ReplenishPrint;
var insertRet = await _waitPrintRepository.InsertAsync(item, autoSave);
}
}
}
return m100Ret;
}
private WaitPrint[] M100ConvertToWaitPrint(BillM100 m100Obj) private WaitPrint[] M100ConvertToWaitPrint(BillM100 m100Obj)
{ {
WaitPrint[] wpArr; WaitPrint[] wpArr;
@ -158,40 +63,6 @@ namespace WY.NewJit.MsgCheck
return wpArr; return wpArr;
} }
public async Task<BillM100> UpdateM100(BillM100 m100Obj, bool autoSave = false)
{
var m100Ret = await _billM100Repository.UpdateAsync(m100Obj, autoSave);
if (m100Ret != null)
{
//if (m100Obj.ProductLine == "08")
//{
// //更新已解析状态时,只涉及门板、2条柱护板
// WaitPrint mbRec = await _waitPrintRepository.GetAsync(itm => itm.M100Id == m100Ret.Id && itm.BusinessType == BusinessTypeEnum.MenBan);
// ConvertWaitPrint(m100Ret, BusinessTypeEnum.MenBan, mbRec);
// await _waitPrintRepository.UpdateAsync(mbRec);
//}
//else
//{
// WaitPrint mbRec = await _waitPrintRepository.GetAsync(itm => itm.M100Id == m100Ret.Id && itm.BusinessType == BusinessTypeEnum.MenBan);
// ConvertWaitPrint(m100Ret, BusinessTypeEnum.MenBan, mbRec);
// await _waitPrintRepository.UpdateAsync(mbRec);
//}
//更新已解析状态时,只涉及门板、不涉及柱护板【柱护板一对一解析成功】
List<WaitPrint> wpLst = await _waitPrintRepository.GetListAsync(itm => itm.M100Id == m100Ret.Id && itm.BusinessType == BusinessTypeEnum.MenBan);
foreach (var wp in wpLst)
{
wp.AssemblyID = m100Ret.AssemblyID;
wp.BillStatus = m100Ret.BillStatus;
}
await _waitPrintRepository.UpdateManyAsync(wpLst, autoSave);
return m100Ret;
}
return null;
}
private WaitPrint ConvertWaitPrint(BillM100 m100Ret, BusinessTypeEnum businessType) private WaitPrint ConvertWaitPrint(BillM100 m100Ret, BusinessTypeEnum businessType)
{ {
WaitPrint waitPrint = new WaitPrint(GuidGenerator.Create()); WaitPrint waitPrint = new WaitPrint(GuidGenerator.Create());
@ -249,12 +120,148 @@ namespace WY.NewJit.MsgCheck
targetWaitPrint.LastModificationTime = sourceWaitPrint.LastModificationTime; targetWaitPrint.LastModificationTime = sourceWaitPrint.LastModificationTime;
targetWaitPrint.LastModifierId = sourceWaitPrint.LastModifierId; targetWaitPrint.LastModifierId = sourceWaitPrint.LastModifierId;
} }
*/
public async Task<BillM100> InsertM100(BillM100 m100Obj, bool autoSave = false, bool isBatchImportBreakNum = false)
{
throw new NotImplementedException();
//BillM100 m100Ret = null;
//if (isBatchImportBreakNum) //批量导入断号模块调用
//{
// //更新M100
// m100Obj.HostSN2 = 0;
// //M100转换成WaitPrint:一个底盘、08产线插入3条记录,其它产线插入1条记录
// WaitPrint[] wpArr2 = M100ConvertToWaitPrint(m100Obj);
// foreach (var wp in wpArr2)
// {
// wp.PrintType = PrintTypeEnum.ReplenishPrint;
// //wp.HostSN2 = 0; //WaitPrint的HostSN2从m100的HostSN2取值
// }
// m100Ret = await _billM100Repository.InsertAsync(m100Obj, autoSave); //插入M100
// await _waitPrintRepository.InsertManyAsync(wpArr2, autoSave); //插入未打印表
// return m100Ret;
//}
////调用HostSN2方法
//BillNumberRecord billNumRec = await _billNumRecDomainSrv.GetBillNumber(m100Obj.HostSN.TryToIntNotNull(), m100Obj.ProductLine);
//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 != null ? normalObj.HostSN2 : lateObj.HostSN2;
////M100转换成WaitPrint:一个底盘、08产线插入3条记录,其它产线插入1条记录
//WaitPrint[] wpArr = M100ConvertToWaitPrint(m100Obj);
////处理断号
//if (breakNumLst.Count > 0)
//{
// List<WaitPrint> waitPrintBreakNumLst = new List<WaitPrint>();
// foreach (var sourceWaitPrint in wpArr) //遍历门板、柱护板、其它柱护板
// {
// foreach (var breaknum in breakNumLst) //遍历断号
// {
// WaitPrint targetWaitPrint = new WaitPrint(GuidGenerator.Create());
// targetWaitPrint.M100Id = Guid.Parse("00000000-0000-0000-0000-000000000000");
// targetWaitPrint.BusinessType = sourceWaitPrint.BusinessType;
// targetWaitPrint.ProductLine = sourceWaitPrint.ProductLine;
// targetWaitPrint.OnlineTime = sourceWaitPrint.OnlineTime;
// targetWaitPrint.HostSN = breaknum.HostSN;
// targetWaitPrint.KNR = null;
// targetWaitPrint.VIN = null;
// targetWaitPrint.VehicleModelCode = null;
// targetWaitPrint.AssemblyID = null;
// targetWaitPrint.BillStatus = BillStatusEnum.BreakNum;
// targetWaitPrint.PrintType = PrintTypeEnum.OrderPrint;
// targetWaitPrint.HostSN2 = breaknum.HostSN2;
// targetWaitPrint.Description = null;
// targetWaitPrint.ReceiveTime = null;
// targetWaitPrint.CreationTime = ServerHelper.CurrentDateTime;
// //targetWaitPrint.CreatorId = null;
// //targetWaitPrint.LastModificationTime = null;
// //targetWaitPrint.LastModifierId = null;
// waitPrintBreakNumLst.Add(targetWaitPrint);
// }
// }
// await _waitPrintRepository.InsertManyAsync(waitPrintBreakNumLst, autoSave); //插入断号
//}
////处理正常、迟到
//if (normalObj != null) //正常
//{
// m100Ret = await _billM100Repository.InsertAsync(m100Obj, autoSave); //插入M100
// await _waitPrintRepository.InsertManyAsync(wpArr, autoSave); //插入未打印表
//}
//else if (lateObj != null) //迟到
//{
// m100Ret = await _billM100Repository.InsertAsync(m100Obj, autoSave); //插入M100
// foreach (var item in wpArr) //遍历门板、柱护板、其它柱护板
// {
// var insObj = await _waitPrintRepository.FirstOrDefaultAsync(itm =>
// itm.HostSN2 == m100Obj.HostSN2
// && itm.BillStatus == BillStatusEnum.BreakNum
// && itm.BusinessType == item.BusinessType);
// if (insObj != null)
// {
// //如果未打印表有对应断号记录,将迟到记录与之合并
// Set_WaitPrint(item, insObj);
// var updateRet = await _waitPrintRepository.UpdateAsync(insObj);
// }
// else
// {
// //如果未打印表没有----对应断号记录,则插入
// item.PrintType = PrintTypeEnum.ReplenishPrint;
// var insertRet = await _waitPrintRepository.InsertAsync(item, autoSave);
// }
// }
//}
//return m100Ret;
}
public async Task<BillM100> UpdateM100(BillM100 m100Obj, bool autoSave = false)
{
throw new NotImplementedException();
//var m100Ret = await _billM100Repository.UpdateAsync(m100Obj, autoSave);
//if (m100Ret != null)
//{
// //if (m100Obj.ProductLine == "08")
// //{
// // //更新已解析状态时,只涉及门板、2条柱护板
// // WaitPrint mbRec = await _waitPrintRepository.GetAsync(itm => itm.M100Id == m100Ret.Id && itm.BusinessType == BusinessTypeEnum.MenBan);
// // ConvertWaitPrint(m100Ret, BusinessTypeEnum.MenBan, mbRec);
// // await _waitPrintRepository.UpdateAsync(mbRec);
// //}
// //else
// //{
// // WaitPrint mbRec = await _waitPrintRepository.GetAsync(itm => itm.M100Id == m100Ret.Id && itm.BusinessType == BusinessTypeEnum.MenBan);
// // ConvertWaitPrint(m100Ret, BusinessTypeEnum.MenBan, mbRec);
// // await _waitPrintRepository.UpdateAsync(mbRec);
// //}
// //更新已解析状态时,只涉及门板、不涉及柱护板【柱护板一对一解析成功】
// List<WaitPrint> wpLst = await _waitPrintRepository.GetListAsync(itm => itm.M100Id == m100Ret.Id && itm.BusinessType == BusinessTypeEnum.MenBan);
// foreach (var wp in wpLst)
// {
// wp.AssemblyID = m100Ret.AssemblyID;
// wp.BillStatus = m100Ret.BillStatus;
// }
// await _waitPrintRepository.UpdateManyAsync(wpLst, autoSave);
// return m100Ret;
//}
//return null;
}
public async Task<Dictionary<Guid, List<BillM100Part>>> GetM100PartDic(List<Guid> m100IdLst) public async Task<Dictionary<Guid, List<BillM100Part>>> GetM100PartDic(List<Guid> m100IdLst)
{ {
List<BillM100> m100Lst = await _billM100Repository.GetListAsync(itm => m100IdLst.Contains(itm.Id), true); throw new NotImplementedException();
Dictionary<Guid, List<BillM100Part>> ret = m100Lst.ToDictionary(itm => itm.Id, itm2 => itm2.BillM100Parts);
return ret; //List<BillM100> m100Lst = await _billM100Repository.GetListAsync(itm => m100IdLst.Contains(itm.Id), true);
//Dictionary<Guid, List<BillM100Part>> ret = m100Lst.ToDictionary(itm => itm.Id, itm2 => itm2.BillM100Parts);
//return ret;
} }
/// <summary> /// <summary>
@ -264,41 +271,43 @@ namespace WY.NewJit.MsgCheck
/// <returns></returns> /// <returns></returns>
public async Task<ObjectResultDto> InsertOrUpdateWaitPrintByM100(BillM100 m100Obj, bool autoSave = false) public async Task<ObjectResultDto> InsertOrUpdateWaitPrintByM100(BillM100 m100Obj, bool autoSave = false)
{ {
ObjectResultDto ret = new ObjectResultDto(true, ""); throw new NotImplementedException();
List<WaitPrint> wpLst = await _waitPrintRepository.GetListAsync(itm => itm.VIN == m100Obj.VIN && itm.BusinessType == BusinessTypeEnum.MenBan);
bool hasData = wpLst.Count > 0; //ObjectResultDto ret = new ObjectResultDto(true, "");
if (hasData) //未打印表有数据 //List<WaitPrint> wpLst = await _waitPrintRepository.GetListAsync(itm => itm.VIN == m100Obj.VIN && itm.BusinessType == BusinessTypeEnum.MenBan);
{ //bool hasData = wpLst.Count > 0;
foreach (WaitPrint wp in wpLst) //if (hasData) //未打印表有数据
{ //{
wp.AssemblyID = m100Obj.AssemblyID; // foreach (WaitPrint wp in wpLst)
wp.BillStatus = m100Obj.BillStatus; // {
} // wp.AssemblyID = m100Obj.AssemblyID;
await _waitPrintRepository.UpdateManyAsync(wpLst, autoSave); // wp.BillStatus = m100Obj.BillStatus;
} // }
else //未打印表没有数据 // await _waitPrintRepository.UpdateManyAsync(wpLst, autoSave);
{ //}
WaitPrint[] wpArr; //else //未打印表没有数据
if (m100Obj.ProductLine == "08") //{
{ // WaitPrint[] wpArr;
WaitPrint mbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.MenBan); // if (m100Obj.ProductLine == "08")
//WaitPrint zhbOtherRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.OtherZhuHuBan); // {
//WaitPrint zhbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.AC_ZhuHuBan); // WaitPrint mbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.MenBan);
//wpArr = new WaitPrint[3] { mbRec, zhbOtherRec, zhbRec }; // //WaitPrint zhbOtherRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.OtherZhuHuBan);
wpArr = new WaitPrint[1] { mbRec }; // //WaitPrint zhbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.AC_ZhuHuBan);
} // //wpArr = new WaitPrint[3] { mbRec, zhbOtherRec, zhbRec };
else // wpArr = new WaitPrint[1] { mbRec };
{ // }
WaitPrint mbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.MenBan); // else
wpArr = new WaitPrint[1] { mbRec }; // {
} // WaitPrint mbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.MenBan);
foreach (WaitPrint wp in wpArr) // wpArr = new WaitPrint[1] { mbRec };
{ // }
wp.PrintType = PrintTypeEnum.ReplenishPrint; // foreach (WaitPrint wp in wpArr)
} // {
await _waitPrintRepository.InsertManyAsync(wpArr, autoSave); //插入未打印表 // wp.PrintType = PrintTypeEnum.ReplenishPrint;
} // }
return ret; // await _waitPrintRepository.InsertManyAsync(wpArr, autoSave); //插入未打印表
//}
//return ret;
} }
} }
} }

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

@ -991,6 +991,48 @@ namespace WY.NewJit.MsgCheck
} }
[Serializable]
public class Group2Assembly
{
/// <summary>
/// 分组Id, 对应总成分组表Id
/// </summary>
public Guid GroupId { get; set; }
/// <summary>
/// 分组代码
/// </summary>
public string GroupCode { get; set; }
/// <summary>
/// Erp总成ID
/// </summary>
public Guid ErpAssemblyId { get; set; }
/// <summary>
/// Erp总成编码
/// </summary>
public string ErpAssemblyCode { get; set; }
/// <summary>
/// Erp总成名称
/// </summary>
public string ErpAssemblyName { get; set; }
/// <summary>
/// 规格说明
/// </summary>
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明
/// </summary>
public virtual string ColorExplain { get; set; }
}
public class ErpAssemblyMain public class ErpAssemblyMain
{ {
public Guid Id { get; set; } public Guid Id { get; set; }

1
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/WY.NewJit.Domain.csproj

@ -30,7 +30,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="EdiReceive\Services\" />
<Folder Include="MsgConversion\Services\" /> <Folder Include="MsgConversion\Services\" />
<Folder Include="MsgTransmission\Services\" /> <Folder Include="MsgTransmission\Services\" />
</ItemGroup> </ItemGroup>

6126
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240110033428_NewJitPG_HQ_0110.Designer.cs

File diff suppressed because it is too large

41
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240110033428_NewJitPG_HQ_0110.cs

@ -0,0 +1,41 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace WY.NewJit.Migrations
{
public partial class NewJitPG_HQ_0110 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "FisBaseConfig",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ParamName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ParamValue = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
State = table.Column<int>(type: "int", precision: 1, nullable: false),
Remark = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FisBaseConfig", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_FisBaseConfig_ParamName",
table: "FisBaseConfig",
column: "ParamName",
unique: true,
filter: "[ParamName] IS NOT NULL");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "FisBaseConfig");
}
}
}

6132
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115023640_NewJitPG_HQ_Init.Designer.cs

File diff suppressed because it is too large

33
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115023640_NewJitPG_HQ_Init.cs

@ -0,0 +1,33 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace WY.NewJit.Migrations
{
public partial class NewJitPG_HQ_Init : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ColorExplain",
table: "FisAssemblyCfgErp",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "SpecExplain",
table: "FisAssemblyCfgErp",
type: "nvarchar(max)",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ColorExplain",
table: "FisAssemblyCfgErp");
migrationBuilder.DropColumn(
name: "SpecExplain",
table: "FisAssemblyCfgErp");
}
}
}

6134
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115024450_NewJitPG_HQ_Init2.Designer.cs

File diff suppressed because it is too large

53
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115024450_NewJitPG_HQ_Init2.cs

@ -0,0 +1,53 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace WY.NewJit.Migrations
{
public partial class NewJitPG_HQ_Init2 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "SpecExplain",
table: "FisAssemblyCfgErp",
type: "varchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ColorExplain",
table: "FisAssemblyCfgErp",
type: "varchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "SpecExplain",
table: "FisAssemblyCfgErp",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ColorExplain",
table: "FisAssemblyCfgErp",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true);
}
}
}

6142
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115055730_NewJitPG_HQ_Init3.Designer.cs

File diff suppressed because it is too large

35
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115055730_NewJitPG_HQ_Init3.cs

@ -0,0 +1,35 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace WY.NewJit.Migrations
{
public partial class NewJitPG_HQ_Init3 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ColorExplain",
table: "FisAssemblyCfgGroup",
type: "varchar(50)",
maxLength: 50,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "SpecExplain",
table: "FisAssemblyCfgGroup",
type: "varchar(50)",
maxLength: 50,
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ColorExplain",
table: "FisAssemblyCfgGroup");
migrationBuilder.DropColumn(
name: "SpecExplain",
table: "FisAssemblyCfgGroup");
}
}
}

57
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/NewJitMigrationsDbContextModelSnapshot.cs

@ -3287,6 +3287,10 @@ namespace WY.NewJit.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<string>("ColorExplain")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken() .IsConcurrencyToken()
.HasMaxLength(40) .HasMaxLength(40)
@ -3351,6 +3355,10 @@ namespace WY.NewJit.Migrations
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("varchar(50)"); .HasColumnType("varchar(50)");
b.Property<string>("SpecExplain")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("VehicleModel") b.Property<string>("VehicleModel")
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("varchar(50)"); .HasColumnType("varchar(50)");
@ -3366,6 +3374,10 @@ namespace WY.NewJit.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<string>("ColorExplain")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken() .IsConcurrencyToken()
.HasMaxLength(40) .HasMaxLength(40)
@ -3413,6 +3425,10 @@ namespace WY.NewJit.Migrations
.HasColumnType("uniqueidentifier") .HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId"); .HasColumnName("LastModifierId");
b.Property<string>("SpecExplain")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("VehicleModel") b.Property<string>("VehicleModel")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
@ -3619,6 +3635,47 @@ namespace WY.NewJit.Migrations
b.ToTable("FisAssemblyCfgVehicleChild"); b.ToTable("FisAssemblyCfgVehicleChild");
}); });
modelBuilder.Entity("WY.NewJit.MsgBaseData.BaseConfig", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<string>("ParamName")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ParamValue")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Remark")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<int>("State")
.HasPrecision(1)
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("ParamName")
.IsUnique()
.HasFilter("[ParamName] IS NOT NULL");
b.ToTable("FisBaseConfig");
});
modelBuilder.Entity("WY.NewJit.MsgBaseData.DicItem", b => modelBuilder.Entity("WY.NewJit.MsgBaseData.DicItem", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")

7
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore/EntityFrameworkCore/NewJitDbContextModelCreatingExtensions.cs

@ -73,8 +73,8 @@ namespace WY.NewJit.EntityFrameworkCore
b.Property(itm => itm.VehicleModel).HasColumnType("varchar").HasMaxLength(50); b.Property(itm => itm.VehicleModel).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.RelationKey).HasColumnType("varchar").HasMaxLength(50); b.Property(itm => itm.RelationKey).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.GroupCode).HasColumnType("varchar").HasMaxLength(100); b.Property(itm => itm.GroupCode).HasColumnType("varchar").HasMaxLength(100);
b.Property(itm => itm.SpecExplain).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.ColorExplain).HasColumnType("varchar").HasMaxLength(50);
}); });
builder.Entity<AssemblyCfgGroup>(b => builder.Entity<AssemblyCfgGroup>(b =>
@ -83,6 +83,9 @@ namespace WY.NewJit.EntityFrameworkCore
b.ConfigureByConvention();//配置/映射继承的属性,应始终对你所有的实体使用它 b.ConfigureByConvention();//配置/映射继承的属性,应始终对你所有的实体使用它
b.Property(itm => itm.GroupCode).HasColumnType("varchar").HasMaxLength(100); b.Property(itm => itm.GroupCode).HasColumnType("varchar").HasMaxLength(100);
b.Property(itm => itm.SpecExplain).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.ColorExplain).HasColumnType("varchar").HasMaxLength(50);
}); });

178
vue/src/components/ImportExcel-normal/index.vue

@ -0,0 +1,178 @@
<template>
<el-dialog
:visible="show"
:title="title"
:append-to-body="true"
:close-on-click-modal="false"
width="600px"
@close="closeView"
v-loading="loading"
>
<el-upload
ref="upload"
class="avatar-uploader"
drag
action="#"
accept=".xlsx, .xls"
:http-request="httpRequestfiles"
:headers="httpHeader"
:file-list="fileuploadList"
:before-upload="beforeAvatarUpload"
:before-remove="beforeRemove"
:on-remove="handleRemove"
:on-change="handleChange"
:limit="10"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处
<em>点击上传</em>
</div>
</el-upload>
<span slot="footer" class="dialog-footer">
<el-button @click="closeView" >取消</el-button>
<el-button type="primary" @click="sureClick">立即导入</el-button>
</span>
</el-dialog>
</template>
<script>
import { getToken } from "@/utils/auth"; // get token from cookie
export default {
name: "ImportExcelNormal",
props: {
show: {
type: Boolean,
default: false,
},
title:{
type: String,
default: "导入文件",
},
//
importURL:{
type: String,
default: null,
}
},
computed:{
httpHeader() {
//token
return {
Authorization: "Bearer " + getToken(),
};
},
},
watch: {
show: function (val) {
this.fileuploadList = []
}
},
data(){
return {
fileuploadList: [],
isLt2M: "",
loading:false
}
},
methods:{
//
closeView() {
this.$emit("update:show", false);
this.$emit("close");
},
httpRequestfiles(data) {
let _this = this;
let rd = new FileReader(); //
let file = data.file;
this.fileuploadList.push(file);
rd.readAsDataURL(file); // base64
},
beforeAvatarUpload(file) {
var FileExt = file.name.replace(/.+\./, "");
if (["xlsx"].indexOf(FileExt.toLowerCase()) === -1) {
this.$message({
type: "warning",
message: "只支持xlsx类型文件!",
});
this.isFileType = "0";
return false;
} else {
this.isFileType = "1";
}
this.isLt2M = file.size / 1024 / 1024 < 100 ? "1" : "0";
if (this.isLt2M === "0") {
this.$message.error("上传文件大小不能超过 100MB!");
}
return this.isLt2M === "1" ? true : false;
},
beforeRemove(file, fileList) {
if (this.isLt2M === "1" && this.isFileType === "1") {
return this.$confirm(`确定移除 ${file.name}`);
}
},
handleRemove(file, fileList) {
//
const index = this.fileuploadList.indexOf(file.originFileObj);
const newFileList = this.fileuploadList.slice();
newFileList.splice(index, 1);
this.fileuploadList = newFileList;
},
handleChange(file, fileList) {
this.fileuploadList = []
},
//
sureClick() {
if (
this.fileuploadList === [] ||
JSON.stringify(this.fileuploadList) === "[]"
) {
this.$message.error("请选择导入文件");
return false;
}
this.saveTemplateData();
},
saveTemplateData() {
this.loading = true;
if (JSON.stringify(this.fileuploadList) != "[]") {
let fd = new FormData();
const { fileuploadList } = this;
fileuploadList.forEach((file) => {
fd.append("files", file); //
});
const webapi = this.importURL;
this.$axios
.posts(webapi, fd)
.then(async (res) => {
this.loading = false;
if (res.status) {
this.$message({
message: "导入成功!",
type: "success",
});
this.$parent.importCallback()
} else {
this.$message({
message: res.message,
type: "error",
});
}
})
.catch(() => {
this.loading = false;
this.$message({
message: "导入失败!",
type: "error",
});
});
} else {
this.loading = false;
this.$message({
message: "未上传任何附件,请查检!",
type: "warning",
});
}
},
}
}
</script>

10
vue/src/router/modules/fis.js

@ -145,6 +145,16 @@ const pgfis = {
//roles: ['SettleAccount.Reports'], //roles: ['SettleAccount.Reports'],
icon: '客户零件' icon: '客户零件'
} }
},
{
path: '/pg-planControl',
component: () => import('@/views/pg-fis/basedate/planControl/index.vue'),
name: 'pg-planControl',//命名路由
meta: {
title: '计划管理',
//roles: ['SettleAccount.Reports'],
icon: '客户零件'
}
} }
] ]
} }

15
vue/src/views/pg-fis/basedate/m100Online/normalPritIndex.vue

@ -372,7 +372,7 @@
@change="beginHostSNChange" @change="beginHostSNChange"
:disabled="true" :disabled="true"
/> />
<label class="label1">-</label> <!-- <label class="label1">-</label>
<el-input <el-input
v-model="form.endHostSN" v-model="form.endHostSN"
placeholder="" placeholder=""
@ -380,7 +380,7 @@
:disabled="true" :disabled="true"
size="small" size="small"
style="width: 240px" style="width: 240px"
/> /> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -529,7 +529,7 @@ export default {
drawerZHBPrint: false, drawerZHBPrint: false,
drawerZHBDelete: false, drawerZHBDelete: false,
activeNames: ["1"], activeNames: ["1"],
printNum: "12", printNum: "10",
printNumZHB: "24", printNumZHB: "24",
rules: { rules: {
erpAssemblyName: [ erpAssemblyName: [
@ -1335,7 +1335,7 @@ export default {
}); });
return; return;
} }
(this.printNum = "12"), (this.printNum = "10"),
(this.printNumZHB = "24"), (this.printNumZHB = "24"),
(this.hostSNQuery.productLine = this.listQuery.productLine); (this.hostSNQuery.productLine = this.listQuery.productLine);
this.hostPrintQuery.productLine = this.listQuery.productLine; this.hostPrintQuery.productLine = this.listQuery.productLine;
@ -1699,8 +1699,11 @@ export default {
/** /**
* 保存加载打印门板 * 保存加载打印门板
*/ */
private_printMenBan() private_printMenBan(){
{ // 2024-01-10 PrintCount
if(this.listQuery.productType == 1){
this.hostPrintQuery.printCount = this.printNum
}
this.$axios this.$axios
.posts( .posts(
//"/api/newjit/bill-m100/save-menban-report", //"/api/newjit/bill-m100/save-menban-report",

469
vue/src/views/pg-fis/basedate/planControl/index.vue

@ -0,0 +1,469 @@
<!--计划管理信息页-->
<template>
<div class="cr-body-content">
<div ref="box">
<flexbox class="content-header">
<el-form
:model="listQuery"
ref="searchForm"
v-show="showSearch"
:inline="true">
<el-form-item label="工厂" prop="factory" >
<el-input
v-model="listQuery.factory"
clearable
size="small"
style="width: 120px"
/>
</el-form-item>
<el-form-item label="底盘号" prop="vin" >
<el-input
v-model="listQuery.vin"
clearable
size="small"
style="width: 120px"
/>
</el-form-item>
<el-form-item label="车型代码" prop="vehicleModelCode" >
<el-input
v-model="listQuery.vehicleModelCode"
clearable
size="small"
style="width: 120px"
/>
</el-form-item>
<el-form-item label="涂装下线时间">
<el-date-picker
v-model="listQuery.paintOfflineTimeBegin"
size="small"
style="width: 200px"
type="datetime"
></el-date-picker>
</el-form-item>
<el-form-item label="-">
<el-date-picker
v-model="listQuery.paintOfflineTimeEnd"
size="small"
style="width: 200px"
type="datetime"
></el-date-picker>
</el-form-item>
<el-form-item label="总装上线时间">
<el-date-picker
v-model="listQuery.onlineTimeBegin"
size="small"
style="width: 200px"
type="datetime"
></el-date-picker>
</el-form-item>
<el-form-item label="-">
<el-date-picker
v-model="listQuery.onlineTimeEnd"
size="small"
style="width: 200px"
type="datetime"
></el-date-picker>
</el-form-item>
<el-form-item label="序列号">
<el-input
v-model="listQuery.serialNumBegin"
clearable
size="small"
style="width: 120px"
/>
</el-form-item>
<el-form-item label="-">
<el-input
v-model="listQuery.serialNumEnd"
clearable
size="small"
style="width: 120px"
/>
</el-form-item>
<el-form-item label="流水号">
<el-input
v-model="listQuery.hostSNBegin"
clearable
size="small"
style="width: 120px"
/>
</el-form-item>
<el-form-item label="-">
<el-input
v-model="listQuery.hostSNEnd"
clearable
size="small"
style="width: 120px"
/>
</el-form-item>
<el-form-item label="生产线">
<el-select v-model="listQuery.productLine" clearable>
<el-option label="A" value="A"></el-option>
<el-option label="B" value="B"></el-option>
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="listQuery.createTimeBegin"
size="small"
style="width: 200px"
type="datetime"
></el-date-picker>
</el-form-item>
<el-form-item label="-">
<el-date-picker
v-model="listQuery.createTimeEnd"
size="small"
style="width: 200px"
type="datetime"
></el-date-picker>
</el-form-item>
<el-form-item label="导入时间">
<el-date-picker
v-model="listQuery.importTimeBegin"
size="small"
style="width: 200px"
type="datetime"
></el-date-picker>
</el-form-item>
<el-form-item label="-">
<el-date-picker
v-model="listQuery.importTimeEnd"
size="small"
style="width: 200px"
type="datetime"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleFilter"
>搜索</el-button
>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery('searchForm')"
>重置</el-button
>
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
style="margin-left: 15px"
@click="handleDownload()"
>导出(Excel)查询信息
</el-button>
<el-button
class="filter-item"
size="mini"
type="success"
icon="el-icon-plus"
@click="handleImport"
>导入
</el-button>
</el-form-item>
</el-form>
</flexbox>
</div>
<div class="l-table">
<!--表格渲染-->
<el-table
ref="multipleTable"
v-loading="listLoading"
element-loading-text="拼命加载中..."
element-loading-spinner="el-icon-loading"
class="cr-table"
:data="list"
:height="tableHeight"
size="small"
stripe
border
highlight-current-row
style="width: 100%"
@sort-change="sortChange"
@selection-change="handleSelectionChange"
@row-click="handleRowClick"
>
<el-table-column
v-for="(item, index) in getDefaultField"
:key="index"
:prop="item.prop"
:label="item.label"
:min-width="item.width"
:formatter="fieldFormatter"
sortable="custom"
show-overflow-tooltip
:gutter="0"
>
<template slot="header" slot-scope="scope">
{{ scope.column.label }}
</template>
</el-table-column>
</el-table>
</div>
<div class="table-footer">
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"-->
<pagination
v-show="totalCount > 0"
:total="totalCount"
:page.sync="page"
:limit.sync="listQuery.MaxResultCount"
@pagination="getList"
/>
<!-- 导入Excel组件 -->
<importExcel
ref="importexcel"
:show="showExcelImport"
:importURL="'/api/newjit/import-record/import'"
@close="importClose"
/>
</div>
</div>
</template>
<script>
import Pagination from "@/components/Pagination";
import permission from "@/directive/permission/index.js";
import CRMTableHead from "../../components/CRMTableHead";
import importExcel from "@/components/ImportExcel-normal";
import { mapGetters } from "vuex";
import Lockr from "lockr";
import moment from "moment";
import message_table from "../../components/mixins/message_table";
import { downloadFile } from "@/utils/crmindex.js";
//
const bomUnit = [
{ key: 0, display_name: "PC" },
{ key: 1, display_name: "TON" },
{ key: 2, display_name: "Other" },
];
const projectTypeKeyValue = bomUnit.reduce((acc, cur) => {
acc[cur.key] = cur.display_name;
return acc;
}, {});
export default {
name: "RepeatM100",
components: { Pagination, CRMTableHead, importExcel },
directives: { permission },
mixins: [message_table],
data() {
return {
showExcelImport: false,
form: {},
list: null,
totalCount: 0,
listLoading: true,
listQuery: {
factory:undefined,
vin:undefined,
vehicleModelCode:undefined,
paintOfflineTimeBegin:undefined,
paintOfflineTimeEnd:undefined,
onlineTimeBegin:undefined,
onlineTimeEnd:undefined,
serialNumBegin:undefined,
serialNumEnd:undefined,
hostSNBegin:undefined,
hostSNEnd:undefined,
productLine:undefined,
createTimeBegin:undefined,
createTimeEnd:undefined,
importTimeBegin:undefined,
importTimeEnd:undefined,
SkipCount: 0,
MaxResultCount: 15,
},
page: 1,
showSearch: true,
bomUnit,
multipleSelection: [],
tableHeight: document.documentElement.clientHeight - 260,
};
},
mounted() {
this.$nextTick(() => {
var offsetHei = document.documentElement.clientHeight;
let boxH = this.$refs.box.offsetHeight;
this.tableHeight = offsetHei - boxH - 57 - 79;//57footer79
});
},
created() {
this.getList();
},
computed: {
getDefaultField() {
var tempsTabs = [
{ label: "底盘号", prop: "vin", width: 180 },
{ label: "序列号", prop: "serialNum", width: 120 },
{ label: "流水号", prop: "hostSN", width: 120 },
{ label: "生产线", prop: "productLine", width: 120 },
{ label: "工厂", prop: "factory", width: 120 },
{ label: "工位", prop: "workLocation", width: 120 },
{ label: "车位", prop: "vehicleLocation", width: 120 },
{ label: "车身号", prop: "vehicleBodyCode", width: 120 },
{ label: "车型代码", prop: "vehicleModelCode", width: 180 },
{ label: "车型名称", prop: "vehicleModelName", width: 120 },
{ label: "车型描述", prop: "vehicleModelDesc", width: 120 },
{ label: "规格", prop: "spec", width: 120 },
{ label: "规格说明", prop: "specDesc", width: 120 },
{ label: "类别", prop: "type", width: 120 },
{ label: "涂装下线时间", prop: "paintOfflineTime", width: 150 },
{ label: "总装上线时间", prop: "onlineTime", width: 150 },
{ label: "内饰颜色", prop: "interiorColor", width: 120 },
{ label: "外饰颜色", prop: "exteriorTrimmingColor", width: 120 },
{ label: "目的", prop: "target", width: 120 },
{ label: "备注", prop: "remark", width: 120 },
{ label: "备注2", prop: "remark2", width: 120 },
{ label: "备注3", prop: "remark3", width: 120 },
{ label: "备注4", prop: "remark4", width: 120 },
{ label: "备注5", prop: "remark5", width: 120 },
{ label: "创建时间", prop: "createTime", width: 150 },
{ label: "创建人", prop: "createPerson", width: 120 },
{ label: "导入时间", prop: "importTime", width: 150 },
{ label: "导入人", prop: "importPerson", width: 120 },
];
return tempsTabs;
},
...mapGetters(["userInfo"]), //
},
methods: {
/** 导出功能 */
handleDownload() {
this.listLoading = true;
console.log("计划管理导出条件:" + JSON.stringify(this.listQuery));
this.$axios
.posts("/api/newjit/import-record/export", this.listQuery)
.then((res) => {
let filename = res.item;
this.$axios
.BolbGets("/api/newjit/exclude-part-cfg/download/" + filename)
.then((response) => {
if (filename.indexOf("_") != -1) {
let downName =
filename.slice(0, filename.lastIndexOf("_")) +
filename.slice(filename.lastIndexOf("."));
downloadFile(response, downName);
this.$notify({
title: "成功",
message: "数据-导出成功!",
type: "success",
duration: 2000,
});
} else {
downloadFile(response, filename);
this.$notify({
title: "成功",
message: "数据-导出成功!",
type: "success",
duration: 2000,
});
}
this.listLoading = false;
})
.catch(() => {
this.listLoading = false;
});
});
},
/** 重置按钮操作 */
resetQuery(refName) {
this.$refs[refName].resetFields();
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.listQuery.SkipCount = 1;
this.getList();
},
//
importClose() {
this.showExcelImport = false;
},
//
importCallback(){
this.importClose()
this.getList();
},
/** 刷新列表 */
handleHandle(data) {
if (data.type !== "edit") {
this.getList();
}
},
/** 格式化字段 */
fieldFormatter(row, column) {
return row[column.property] || "--";
},
getList(data){
this.listLoading = true;
if (data != undefined) {
this.listQuery.SkipCount = (this.page - 1) * data.limit;
} else {
this.listQuery.SkipCount = (this.page - 1) * this.listQuery.MaxResultCount;
}
this.$axios.gets("/api/newjit/import-record/list", this.listQuery)
.then((response) => {
this.list = response.items;
this.totalCount = response.totalCount;
setTimeout(() => {
//
this.listLoading = false;
}, 500);
})
.catch(() => {
this.listLoading = false;
});
},
handleFilter() {
this.page = 1;
this.getList();
},
sortChange(data) {
const { prop, order } = data;
if (!prop || !order) {
this.listQuery.Sorting = undefined
this.handleFilter();
return;
}
this.listQuery.Sorting = prop + " " + order;
this.handleFilter();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleRowClick(row, column, event) {
this.$refs.multipleTable.clearSelection();
this.$refs.multipleTable.toggleRowSelection(row);
},
handleImport() {
//
this.showExcelImport = true;
},
},
};
</script>
<style lang="scss" scoped>
@import "../../../pg-fis/styles/crmtable.scss";
</style>

5
vue/static/config.js

@ -2,11 +2,14 @@ let configJSON;
if (process.env.NODE_ENV === "development") { if (process.env.NODE_ENV === "development") {
configJSON = { configJSON = {
base: { base: {
ip: "http://localhost", ip: "http://localhost",
auth_port: "44344", auth_port: "44344",
public_port: "44344", public_port: "44344",
backend_port: "44344", backend_port: "44344",
// ip: "http://222.169.228.163",
// auth_port: "7696",
// public_port: "7692",
// backend_port: "7692",
}, },
basic: {}, basic: {},
upload: { upload: {

Loading…
Cancel
Save