diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs
index 028ad78ac..5b264c20c 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs
@@ -535,6 +535,44 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
}
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class ResponCargoItem1
+ {
+
+ ///
+ /// 读取次数
+ ///
+ [Newtonsoft.Json.JsonProperty("number", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
+ public string Number { get; set; }
+
+ ///
+ /// 区域ID
+ ///
+ [Newtonsoft.Json.JsonProperty("areaID", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
+ public string AreaID { get; set; }
+
+ ///
+ /// 货位号
+ ///
+ [Newtonsoft.Json.JsonProperty("cargoID", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
+ public string CargoID { get; set; }
+
+ ///
+ /// 零件号
+ ///
+ [Newtonsoft.Json.JsonProperty("partCode", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
+ public string PartCode { get; set; }
+
+ ///
+ /// 货位状态
+ ///
+ [Newtonsoft.Json.JsonProperty("flag", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
+ public int Flag { get; set; }
+
+ }
+
+
+
[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs
index c45c85c27..47335b81c 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs
@@ -23,6 +23,9 @@ using System.Net.NetworkInformation;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
using System.Threading;
using System.Diagnostics;
+using System.Reflection;
+using Microsoft.Extensions.Primitives;
+using Win_in.Sfs.Shared.Application;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming;
public class InjectionMoldingRequestReader : IReader
@@ -67,55 +70,89 @@ public class InjectionMoldingRequestReader : IReader
#if DEBUG
_options.Value.AutoRemote.TimeCycle = 1;
_options.Value.AutoRemote.Interval = 2;
-
#endif
// var sleepTime = (_options.Value.AutoRemote.TimeCycle*60/ _options.Value.AutoRemote.Interval)-10;
var invterval = _options.Value.AutoRemote.Interval;
-
var guid = DateTime.Now.ToString("yyyyMMddHHmmssfff");
-
-
-
Stopwatch sw = Stopwatch.StartNew();
-
Client client = new Client(_options.Value.AutoRemote.IpAddress, _httpClientFactory.CreateClient());//调用客户记录
-
var flag = await client.GetMacStaticAsync().ConfigureAwait(false);
+
+
if (flag != 1)
{
// 记录错误日志并返回空列表
_logger.LogInformation($"读取到摄像头信息为不可用{DateTime.Now},请检查摄像头");
+
return new List();
}
if (string.IsNullOrEmpty(_options.Value.AutoRemote.AreaIDs))
{
_logger.LogInformation($"没有设置指定区域AutoRemote->AreaIDs");
+
+
return new List();
}
var ids = _options.Value.AutoRemote.AreaIDs.Split(",");
List camralist = new List();
+ List camralist1 = new List();
for (int i = 1; i <= invterval; i++)
{
foreach (var itm in ids)//遍历区域查找所有货物
{
var idsList = await client.GetCargoStaticAsync(itm).ConfigureAwait(false);
+
+
+ Thread.Sleep(1000);//设备读取50ms延时,设置延时时间为1000ms保证读取更新到信息
//flag 1-有货 0-空闲
+ foreach (var respon in idsList.Where(r => r.Flag == 0))
+ {
+ var response = new ResponCargoItem1();
+ response.FromObject(respon);
+ response.Number = $"第{i.ToString()}次读取";
+ camralist1.Add(response);
+ }
+
camralist.AddRange(idsList.Where(r => r.Flag == 0));
}
+
_logger.LogInformation($"读取标识{guid}读取成功次数{i},耗时 {sw.ElapsedMilliseconds}毫秒");
}
+ _logger.LogInformation($"标识{guid}读取{invterval}次接口表:{System.Text.Json.JsonSerializer.Serialize(camralist1)}");
+
+
+ _logger.LogInformation(MakeGrid($"标识{guid}读取{invterval}次接口表",camralist1));
+
+
+
+
+
+
+
+
+
+
+
sw.Stop();
- Thread.Sleep(1000);
+
//按区域、货位号、零件、标志
var group= camralist.GroupBy(r => new { r.AreaID, r.CargoID, r.PartCode, r.Flag });
//获取和次数相等的空闲数据
var list = group.Where(r => r.Count() == invterval).ToList();
+
+ var errorlist= group.Where(r => r.Count() != invterval).ToList();
+
+ if (errorlist.Count > 0)
+ {
+ _logger.LogInformation($"标识{guid}不能同步内容JSON:{System.Text.Json.JsonSerializer.Serialize(errorlist.Select(r => r.Key).ToList())}");
+ _logger.LogInformation(MakeGrid($"标识{guid}不能同步内容", errorlist));
+ }
+
//如果有货位空闲
if (list.Count>0)
{
-
- sw = Stopwatch.StartNew();
+ sw = Stopwatch.StartNew();
_logger.LogInformation($"开始标识{guid}同步WMS开始");
List inputdetail = new List();
foreach (var item in list.Select(r=>r.Key).ToList())
@@ -137,11 +174,15 @@ public class InjectionMoldingRequestReader : IReader
select itm;
var injectionList = query.ToList();//已经完成的记录
+ _logger.LogInformation($"标识{guid}同步WMS内容:{System.Text.Json.JsonSerializer.Serialize(injectionList)}");
+
+ _logger.LogInformation(MakeGrid($"{guid}同步WMS内容", injectionList));
+
+
foreach (var inject in injectionList)
{
List cameraList = new List();
-
InjectionIssueRequestEditInput input = new InjectionIssueRequestEditInput();
input.Worker = "Vision";
input.IssueRequestType = EnumIssueRequestType.Vision;
@@ -249,7 +290,7 @@ public class InjectionMoldingRequestReader : IReader
{
// 获取对应零件信息
var itm = await _itemService.GetByCodeAsync(request.ItemCode).ConfigureAwait(false);
- if (itm == null) { errors.Add($"编号:{request.ItemCode}零件表中没找到!"); }
+ if (itm == null) { errors.Add($"编号:{request.ItemCode}零件表中没找到,请维护零件表!"); }
else
{
// 更新请求中的零件描述和名称
@@ -260,7 +301,7 @@ public class InjectionMoldingRequestReader : IReader
}
// 获取对应库位信息
var loc = await _locService.GetByCodeAsync(request.ToLocationCode).ConfigureAwait(false);
- if (loc == null) { errors.Add($"编号:{request.ToLocationCode}库位表中没找到!"); }
+ if (loc == null) { errors.Add($"编号:{request.ToLocationCode}库位表中没找到,请维护库位表!"); }
else
{
@@ -357,14 +398,79 @@ public class InjectionMoldingRequestReader : IReader
public decimal Qty { get; set; }
}
+ private string MakeGrid(string header,List p_list) where T : class
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.AppendLine(header);
+ int rows = p_list.Count;
+ var first = p_list.First();
+ var properties = first.GetType().GetProperties();
+ int columns = properties.Length;
+ var columNames = first.GetType().GetProperties().ToList().Select(p => p.Name).ToList();
+ int cellWidth = 20; // 每个单元格的宽度
+ List contents = new List();
+ for (int i = 0; i < rows; i++)
+ {
+ var row = p_list[i];
+ foreach (PropertyInfo property in properties)
+ {
+ // 使用反射获取属性值
+ contents.Add(property.GetValue(row).ToString());
+ }
+ }
+
+ // 输出列头
+ for (int j = 0; j < columns; j++)
+ {
+ sb.Append("|");
+ sb.Append(FormatCell(columNames[j], cellWidth));
+ }
+ sb.Append("|");
+ sb.AppendLine();
+
+ // 输出列头分隔线
+ for (int k = 0; k < columns * (cellWidth + 1) + 1; k++)
+ {
+ sb.Append("-");
+ }
+ sb.AppendLine();
+
+ // 输出网格内容
+ for (int i = 0; i < rows; i++)
+ {
+ for (int j = 0; j < columns; j++)
+ {
+ sb.Append("|");
+ sb.Append(FormatCell(contents[i * columns + j], cellWidth));
+ }
+ sb.Append("|");
+ sb.AppendLine();
+ }
+ return sb.ToString();
+
+ }
+
+
+
+
+
+
+
+
+
+
+ private string FormatCell(object value, int width)
+ {
+ return value.ToString().PadLeft(width);
+ }
}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.csproj b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.csproj
index 58f34a399..8006c4dfa 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.csproj
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.csproj
@@ -12,6 +12,7 @@
+
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs
index 5ede235e6..55f019b5b 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs
@@ -108,7 +108,7 @@ public class MesOutConverter : IIncomingConverter
wmsProductReceiptNoteDetail.Lot = ""; //排序批次
wmsProductReceiptNoteDetail.PackingCode = "";//箱标签
wmsProductReceiptNoteDetail.Status = EnumInventoryStatus.OK;
- wmsProductReceiptNoteDetail.WarehouseCode = "T8";
+ wmsProductReceiptNoteDetail.WarehouseCode = "T9";
wmsProductReceiptNoteDetail.LocationArea = "";
wmsProductReceiptNoteDetail.LocationGroup = "";
if (wmsProductReceiptNoteDetail.MesQuality=="1")//质量补
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs
index ab6456637..7903cbfe5 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs
@@ -172,7 +172,7 @@ public class TyrpAgentModule : AbpModule
ApplicationInitializationContext context)
{
- // context.AddBackgroundWorkerAsync();
+ context.AddBackgroundWorkerAsync();
context.AddBackgroundWorkerAsync();
}
diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/appsettings.json b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/appsettings.json
index 34e4e7d63..5fc6279cf 100644
--- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/appsettings.json
+++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/appsettings.json
@@ -3,7 +3,7 @@
"Default": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;TrustServerCertificate=True;Encrypt=false",
"DataExchange": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_DataExchange_CC;uid=ccwin-in;pwd=Microsoft@2022;TrustServerCertificate=True;Encrypt=false",
"TYRP": "Server=dev.ccwin-in.com,13319;Database=TYRP_CC;Uid=ccwin-in;Pwd=Microsoft@2022;TrustServerCertificate=True",
- "SYBASE_TYRP": "Data Source=10.164.115.137; Port=5000; Database=mesdb; Uid=sa; Pwd=dawning;Charset=cp850;" //iso_1
+ "SYBASE_TYRP": "Data Source=10.164.233.4; Port=5000; Database=mesdb; Uid=sa; Pwd=dawning;Charset=cp850;" //iso_1
},
"AuthServer": {
diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/Properties/launchSettings.json b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/Properties/launchSettings.json
index 62d24b6bb..f465bfc2b 100644
--- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/Properties/launchSettings.json
+++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/Properties/launchSettings.json
@@ -4,7 +4,7 @@
"commandName": "WSL2",
"distributionName": ""
},
- "配置文件 1": {
+ "Win_in.Sfs.Wms.DataExchange.Agent": {
"commandName": "Project"
}
}
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLines/ProductionLineAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLines/ProductionLineAppService.cs
index 504aef6c8..b51e7924e 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLines/ProductionLineAppService.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLines/ProductionLineAppService.cs
@@ -64,7 +64,7 @@ public class ProductionLineAppService
var entity = await _repository.FirstOrDefaultAsync(p => p.LocationCode == locationCode).ConfigureAwait(false);
if (entity == null)
{
- throw new UserFriendlyException($"【{locationCode}】库位不存在");
+ throw new UserFriendlyException($"生产线表中【{locationCode}】库位不存在");
}
return ObjectMapper.Map(entity);
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PurchasePrices/PurchasePriceSheetAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PurchasePrices/PurchasePriceSheetAutoMapperProfile.cs
index 10326b686..e464881e4 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PurchasePrices/PurchasePriceSheetAutoMapperProfile.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PurchasePrices/PurchasePriceSheetAutoMapperProfile.cs
@@ -11,5 +11,9 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
{
CreateMap()
.ReverseMap();
+ CreateMap()
+.IgnoreAuditedObjectProperties()
+.Ignore(x => x.ConcurrencyStamp)
+.Ignore(x => x.Id);
}
}
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SalePrices/SalePriceSheetAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SalePrices/SalePriceSheetAutoMapperProfile.cs
index 840a4f415..e11d9d291 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SalePrices/SalePriceSheetAutoMapperProfile.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SalePrices/SalePriceSheetAutoMapperProfile.cs
@@ -11,5 +11,9 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
{
CreateMap()
.ReverseMap();
+ CreateMap()
+ .IgnoreAuditedObjectProperties()
+ .Ignore(x => x.ConcurrencyStamp)
+ .Ignore(x => x.Id);
}
}
diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/StdCostPrices/StdCostPriceSheetAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/StdCostPrices/StdCostPriceSheetAutoMapperProfile.cs
index f99988470..abee52c1b 100644
--- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/StdCostPrices/StdCostPriceSheetAutoMapperProfile.cs
+++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/StdCostPrices/StdCostPriceSheetAutoMapperProfile.cs
@@ -11,5 +11,9 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
{
CreateMap()
.ReverseMap();
+ CreateMap()
+ .IgnoreAuditedObjectProperties()
+ .Ignore(x => x.ConcurrencyStamp)
+ .Ignore(x => x.Id);
}
}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAppService.cs
index c66029c60..71210b82b 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAppService.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAppService.cs
@@ -75,7 +75,7 @@ public class RecycledMaterialReceiptNoteAppService :
entity = await _repository.InsertAsync(entity).ConfigureAwait(false);
await LocalEventBus.PublishAsync(new SfsCreatedEntityEventData(entity), false).ConfigureAwait(false);
-
+ await LocalEventBus.PublishAsync(new SfsCompletedEntityEventData(entity), false).ConfigureAwait(false);
return ObjectMapper.Map(entity);
}
@@ -110,6 +110,7 @@ public class RecycledMaterialReceiptNoteAppService :
}
entity = await _repository.InsertAsync(entity).ConfigureAwait(false);
+ await LocalEventBus.PublishAsync(new SfsCompletedEntityEventData(entity), false).ConfigureAwait(false);
return ObjectMapper.Map(entity);
}
}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs
index b170280e8..46c284ca6 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs
@@ -9,6 +9,7 @@ using Microsoft.EntityFrameworkCore;
using Volo.Abp;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories;
+using Win_in.Sfs.Basedata.Application;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
@@ -30,13 +31,15 @@ public class PurchaseOrderAppService :
private readonly ISupplierAppService _supplierAppService;
private readonly IItemBasicAppService _itemBasicAppService;
private readonly ILocationAppService _locationAppService;
+ public readonly IPurchasePriceSheetAppService _purchasePriceSheetAppService;
public PurchaseOrderAppService(
IPurchaseOrderRepository repository,
IPurchaseOrderManager purchaseOrderManager,
ISupplierAppService supplierAppService,
IItemBasicAppService itemBasicAppService
- , ILocationAppService locationAppService) : base(repository)
+ , ILocationAppService locationAppService,
+IPurchasePriceSheetAppService purchasePriceSheetAppService) : base(repository)
{
_repository = repository;
_purchaseOrderManager = purchaseOrderManager;
@@ -46,6 +49,7 @@ public class PurchaseOrderAppService :
base.CreatePolicyName = PurchaseOrderPermissions.Create;
base.UpdatePolicyName = PurchaseOrderPermissions.Update;
base.DeletePolicyName = PurchaseOrderPermissions.Delete;
+ _purchasePriceSheetAppService = purchasePriceSheetAppService;
}
#region 东阳使用
@@ -60,7 +64,6 @@ public class PurchaseOrderAppService :
{
var ImportData = dictionary.Select(p => p.Key);
-
#region 校验ERP库位是否存在
var allTempErpLocationCode = ImportData.Select(p => p.Details.Select(p => p.LocationErpCode).ToList()).ToList();
var allErpLocationCode = new List();
@@ -87,6 +90,7 @@ public class PurchaseOrderAppService :
#endregion
+
foreach (var purchaseOrder in ImportData)
{
purchaseOrder.CreatorId = CurrentUser.Id;
@@ -98,10 +102,18 @@ public class PurchaseOrderAppService :
purchaseOrder.SupplierName = supplierDto.Name;
if (purchaseOrder.OrderStatus == EnumOrderStatus.Close)
{
- throw new UserFriendlyException($"不允许导入关闭订单状态的订单");
+ throw new UserFriendlyException($"不允许导入关闭订单状态的订单!");
+ }
+ #region 校验行号是否有重复的
+ var polineCount = purchaseOrder.Details.GroupBy(r => r.PoLine).Count();
+ if (polineCount != purchaseOrder.Details.Count)
+ {
+ throw new UserFriendlyException($"同一订单号内行号不允许重复!");
}
+ #endregion
foreach (var detail in purchaseOrder.Details)
{
+ await CheckItemPrice(purchaseOrder.SupplierCode,detail.ItemCode).ConfigureAwait(false);
detail.LineStatus = EnumOrderStatus.Open;
var itemBasicDto = itemBasicDtos.First(p => p.Code == detail.ItemCode);
@@ -115,6 +127,8 @@ public class PurchaseOrderAppService :
return dictionary;
}
+
+
///
/// 【创建】采购订单
///
@@ -209,6 +223,18 @@ public class PurchaseOrderAppService :
return result;
}
+ ///
+ /// 校验采购价格
+ ///
+ ///
+ private async Task CheckItemPrice(string supplierCode, string itemCode )
+ {
+ var isprice = await _purchasePriceSheetAppService.CheckPurPriceAsync(supplierCode, itemCode).ConfigureAwait(false);
+ if (isprice)
+ {
+ throw new UserFriendlyException($"供应商【{supplierCode}】零件名称【{itemCode}】无采购价格无法执行采购上架!");
+ }
+ }
private async Task> CheckErpLocationCodeAsync(List erpLocationCodes)
{
erpLocationCodes = erpLocationCodes.Distinct().ToList();
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs
index 8c30e86b4..9a9df2444 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs
@@ -70,9 +70,7 @@ public class PurchaseReceiptRequestAppService :
public virtual async Task GetDetailByItemAndPackingAsync(string itemCode,
string packingCode)
{
- var entitysList = (await _repository
- .GetListAsync(p => p.Details.Any(y => y.ItemCode == itemCode && y.PackingCode == packingCode), true)
- .ConfigureAwait(false));
+ var entitysList = (await _repository.GetListAsync(p => p.Details.Any(y => y.ItemCode == itemCode && y.PackingCode == packingCode), true).ConfigureAwait(false));
if (entitysList != null && entitysList.Any())
{
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/RecycledMaterialReceiptNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/RecycledMaterialReceiptNoteEventHandler.cs
index 2d4c787df..7967fb11a 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/RecycledMaterialReceiptNoteEventHandler.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/RecycledMaterialReceiptNoteEventHandler.cs
@@ -11,20 +11,20 @@ namespace Win_in.Sfs.Wms.Store.Event.DataExchanges;
public class RecycledMaterialReceiptNoteEventHandler
: StoreDataExchangeEventHandlerBase
-, ILocalEventHandler>
-, ILocalEventHandler>>
+, ILocalEventHandler>
+, ILocalEventHandler>>
{
private const EnumExchangeDataType ExchangeDataType = EnumExchangeDataType.RecycledMaterialReceipt;
[UnitOfWork]
- public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData)
+ public virtual async Task HandleEventAsync(SfsCompletedEntityEventData eventData)
{
var entity = eventData.Entity;
await AddExchangeDataAsync(entity).ConfigureAwait(false);
}
[UnitOfWork]
- public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData)
+ public virtual async Task HandleEventAsync(SfsCompletedEntityEventData> eventData)
{
var entities = eventData.Entity;
await AddExchangeDataAsync(entities).ConfigureAwait(false);
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ItemTransformNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ItemTransformNoteEventHandler.cs
index 601b86bbd..c21888889 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ItemTransformNoteEventHandler.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ItemTransformNoteEventHandler.cs
@@ -256,7 +256,7 @@ public class ItemTransformNoteEventHandler
JobNumber = note.JobNumber,
DocNumber = note.Number,
TransType = Type,
- TransSubType = SubType,
+ TransSubType = EnumTransSubType.UnplannedReceipt_RecycledMaterialReceipt,
TransInOut = EnumTransInOut.In,
LocationArea = detail.FromLocationArea,
LocationGroup = detail.FromLocationGroup,
diff --git a/build/src/docker/publish/conf/settings/appsettings.Development.json b/build/src/docker/publish/conf/settings/appsettings.Development.json
index c9e77bfc5..f41838a40 100644
--- a/build/src/docker/publish/conf/settings/appsettings.Development.json
+++ b/build/src/docker/publish/conf/settings/appsettings.Development.json
@@ -117,8 +117,8 @@
//"BaseUrl": "http://localhost:59093/"
},
"BaseData": {
- "BaseUrl": "http://dev.ccwin-in.com:60084/"
- //"BaseUrl": "http://localhost:59094/"
+ // "BaseUrl": "http://dev.ccwin-in.com:60084/"
+ "BaseUrl": "http://localhost:59094/"
},
"Default": {
"BaseUrl": "http://dev.ccwin-in.com:60083/"