From e55e1164b9829c9b5c8c564e0a80f627ab9e1e09 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 22 Jul 2024 16:40:34 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E8=AE=A2?= =?UTF-8?q?=E8=88=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Constants/MultiLanguageConst.cs | 14 + .../Op/Dtos/SpaceBooking/MSKBookingDto.cs | 13 +- .../Op/Dtos/SpaceBooking/MSKSPOTBookingDto.cs | 12 +- .../SpaceBooking/Mapper/SpaceBookingMapper.cs | 112 +++++++ .../Entity/SpaceBooking/SpaceBookingOrder.cs | 12 + .../SpaceBooking/SpaceBookingMSKAPIService.cs | 210 +++++++++++- .../SpaceBookingMSKSPOTAPIService.cs | 305 +++++++++++++++--- .../DS.WMS.OpApi/Logs/internal-nlog.txt | 133 ++++++++ .../PublishProfiles/FolderProfile.pubxml.user | 2 +- ds-wms-service/DS.WMS.OpApi/appsettings.json | 2 +- ds-wms-service/DS.WMS.Test/SaasTest.cs | 26 +- 11 files changed, 754 insertions(+), 87 deletions(-) create mode 100644 ds-wms-service/DS.WMS.Core/Op/Dtos/SpaceBooking/Mapper/SpaceBookingMapper.cs diff --git a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs index ffef9ec4..471d211c 100644 --- a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs @@ -1004,6 +1004,20 @@ public static class MultiLanguageConst [Description("船期数据校验失败,请重新查询船期信息")] public const string SpaceBookingAPIShipScheduleCheckFailNotNull = "SpaceBK_API_Ship_Schedule_CheckFail_Not_Null"; + /// + /// 船期数据校验失败,当前船期请求参数错误,请重新查询船期信息 + /// + [Description("船期数据校验失败,当前船期请求参数错误,请重新查询船期信息")] + public const string SpaceBookingAPIShipScheduleCheckFailPriceIDNotEqual = "SpaceBK_API_Ship_Schedule_CheckFail_PriceIDNotEqual"; + + + /// + /// 船期数据校验失败,当前船期请求参数错误,价格发生差异,请重新查询船期信息 + /// + [Description("船期数据校验失败,当前船期请求参数错误,价格发生差异,请重新查询船期信息")] + public const string SpaceBookingAPIShipScheduleCheckFailAmountChange = "SpaceBK_API_Ship_Schedule_CheckFail_AmountChange"; + + /// /// 港口或城市名称不能为空 /// diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/SpaceBooking/MSKBookingDto.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/SpaceBooking/MSKBookingDto.cs index 36eb71de..c65d5ea2 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Dtos/SpaceBooking/MSKBookingDto.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SpaceBooking/MSKBookingDto.cs @@ -20,17 +20,22 @@ namespace DS.WMS.Core.Op.Dtos /// /// 船公司主键 /// - public long carrierId { get; set; } + public Nullable carrierId { get; set; } + + /// + /// 船公司代码 + /// + public string carrierCode { get; set; } /// /// 订舱ID /// - public long bookingId { get; set; } + public Nullable bookingId { get; set; } /// /// 主键ID /// - public long PId { get; set; } + public Nullable PId { get; set; } /// /// 船期MD5 @@ -126,7 +131,7 @@ namespace DS.WMS.Core.Op.Dtos /// /// 承运人代码(MAEU, SEAU, SEJJ, MCPU, MAEI) /// - public string carrierCode { get; set; } + public string vesselCarrierCode { get; set; } /// /// 最早起运日期, 不可小于当前日期 diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/SpaceBooking/MSKSPOTBookingDto.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/SpaceBooking/MSKSPOTBookingDto.cs index 8baaf763..b9a55161 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Dtos/SpaceBooking/MSKSPOTBookingDto.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SpaceBooking/MSKSPOTBookingDto.cs @@ -20,12 +20,12 @@ namespace DS.WMS.Core.Op.Dtos /// /// 船公司主键 /// - public long carrierId { get; set; } + public Nullable carrierId { get; set; } - ///// - ///// 船公司代码 - ///// - //public string carrierCode { get; set; } + /// + /// 船公司代码 + /// + public string carrierCode { get; set; } /// /// 订舱ID @@ -136,7 +136,7 @@ namespace DS.WMS.Core.Op.Dtos /// /// 承运人代码(MAEU, SEAU, SEJJ, MCPU, MAEI) /// - public string carrierCode { get; set; } + public string vesselCarrierCode { get; set; } /// /// 最早起运日期, 不可小于当前日期 diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/SpaceBooking/Mapper/SpaceBookingMapper.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/SpaceBooking/Mapper/SpaceBookingMapper.cs new file mode 100644 index 00000000..cbee074e --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SpaceBooking/Mapper/SpaceBookingMapper.cs @@ -0,0 +1,112 @@ +using AutoMapper; +using DS.WMS.Core.Op.Entity; +using Mapster; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.Op.Dtos +{ + public class SpaceBookingMapper : IRegister + { + public void Register(TypeAdapterConfig config) + { + config.ForType() + .Map(dest => dest.CarrierCode, src => src.carrierCode) + .Map(dest => dest.PriceReference, src => src.priceReference) + .Map(dest => dest.ProductCode, src => src.productCode) + .Map(dest => dest.Sender, src => src.sender) + .Map(dest => dest.BookedByCompanyName, src => src.bookedByCompanyName) + .Map(dest => dest.BookedByCompanyPartyCode, src => src.bookedByMaerskPartyCode) + .Map(dest => dest.BookedByCompanyContact, src => src.bookedByCompanyContactName) + .Map(dest => dest.BookedByCompanyContactEmail, src => src.bookedByCompanyContactEmail) + .Map(dest => dest.IsBookingPartOwnPrice, src => src.isBookingPartOwnPrice) + .Map(dest => dest.PriceOwnerCompanyName, src => src.priceOwnerCompanyName) + .Map(dest => dest.PriceOwnerCompanyPartyCode, src => src.priceOwnerMaerskPartyCode) + .Map(dest => dest.PriceOwnerCompanyContact, src => src.priceOwnerContactName) + .Map(dest => dest.PriceOwnerCompanyContactEmail, src => src.priceOwnerContactEmail) + .Map(dest => dest.CarrierCode, src => src.carrierCode) + .Map(dest => dest.EarliestDepartureDate, src => src.earliestDepartureDate) + .Map(dest => dest.ExportServiceMode, src => src.exportServiceMode) + .Map(dest => dest.ImportServiceMode, src => src.importServiceMode) + .Map(dest => dest.PlaceReceiptCity, src => src.placeOfReceiptCityName) + .Map(dest => dest.PlaceReceiptUnlocCode, src => src.placeOfReceiptUnLocCode) + .Map(dest => dest.PlaceDeliveryCity, src => src.placeOfDeliveryCityName) + .Map(dest => dest.PlaceDeliveryUnlocCode, src => src.placeOfDeliveryUnLocCode) + .Map(dest => dest.ETD, src => src.originDepartureDateTimeLocal) + .Map(dest => dest.ETA, src => src.destinationArrivalDateTimeLocal) + .Map(dest => dest.Vessel, src => src.vesselName) + .Map(dest => dest.VesselCode, src => src.carrierVesselCode) + .Map(dest => dest.Voyno, src => src.exportVoyageNumber) + .Map(dest => dest.TransportMode, src => src.transportMode) + .Map(dest => dest.TotalCargoWeight, src => src.totalCargoWeight) + .Map(dest => dest.NoOfProbes, src => src.noOfProbes) + .Map(dest => dest.TempSet, src => src.temperature) + .Map(dest => dest.Vent, src => src.ventilation) + .Map(dest => dest.Humidity, src => src.humidity) + .Map(dest => dest.CommodityCodeType, src => src.commodityCodeType) + .Map(dest => dest.GoodsCode, src => src.commodityCode) + .Map(dest => dest.GoodsName, src => src.commodityName) + .Map(dest => dest.CargoType, src => src.cargoType) + .Map(dest => dest.PlaceReceiptCountryCode, src => src.placeOfReceiptCountryCode) + .Map(dest => dest.PlaceDeliveryCountryCode, src => src.placeOfDeliveryCountryCode) + .Map(dest => dest.EstSailingDays, src => src.EstSailingDays) + .Map(dest => dest.PriceReferenceId, src => src.priceReferenceId) + .Map(dest => dest.PriceReferenceName, src => src.priceReferenceName) + .Map(dest => dest.PriceOwnerReferenceId, src => src.priceOwnerReferenceId) + .Map(dest => dest.PriceOwnerReference, src => src.priceOwnerReference) + .Map(dest => dest.PriceOwnerReferenceName, src => src.priceOwnerReferenceName) + .Map(dest => dest.IsReefer, src => src.isReefer) + .Map(dest => dest.IsShipperOwner, src => src.isShipperOwned) + .Map(dest => dest.IsImportReturned, src => src.isImportReturned) + .Map(dest => dest.CarrierProductId, src => src.carrierProductId) + .Map(dest => dest.IsSendNoSchedule, src => src.isSendNoSchedule) + .Map(dest => dest.PlaceReceiptCountryName, src => src.placeOfReceiptCountryName) + .Map(dest => dest.PlaceReceiptRegionName, src => src.placeOfReceiptRegionName) + .Map(dest => dest.PlaceReceiptCountryName, src => src.placeOfDeliveryCountryName) + .Map(dest => dest.PlaceDeliveryRegionName, src => src.placeOfDeliveryRegionName) + .Map(dest => dest.PlaceDeliveryCity, src => src.userPlaceOfDeliveryCityName) + .Map(dest => dest.PlaceDeliveryCountryCode, src => src.userPlaceOfDeliveryCountryCode) + .Map(dest => dest.PlaceDeliveryCountryName, src => src.userPlaceOfDeliveryCountryName) + .Map(dest => dest.ShipRatePId, src => src.PId) + .Map(dest => dest.ShipRateMD5, src => src.MD5) + .Map(dest => dest.PlaceReceiptGeoId, src => src.carrierCollectionOriginGeoID) + .Map(dest => dest.PlaceDeliveryGeoId, src => src.carrierDeliveryDestinationGeoID); + } + } + + + public class SpaceBookingAutoProfile : Profile + { + public SpaceBookingAutoProfile() + { + CreateMap() + .ForMember(x => x.Id, option => option.MapFrom(x => x.id)) + .ForMember(x => x.PriceReference, option => option.MapFrom(x => x.priceReference)) + .ForMember(x => x.ProductCode, option => option.MapFrom(x => x.priceReference)) + .ForMember(x => x.Sender, option => option.MapFrom(x => x.sender)) + .ForMember(x => x.BookedByCompanyName, option => option.MapFrom(x => x.bookedByCompanyName)) + .ForMember(x => x.BookedByCompanyPartyCode, option => option.MapFrom(x => x.bookedByMaerskPartyCode)) + .ForMember(x => x.BookedByCompanyContact, option => option.MapFrom(x => x.bookedByCompanyContactName)) + ; + } + + } + + //public class Maker + //{ + // static IMapper _mapper; + // static IMapper Configure() + // { + // var config = new MapperConfiguration(cfg => + // { + // cfg.AddProfile(); + // }); + // return config.CreateMapper(); + // } + + // public static IMapper Mapper => _mapper ??= Configure(); + //} +} diff --git a/ds-wms-service/DS.WMS.Core/Op/Entity/SpaceBooking/SpaceBookingOrder.cs b/ds-wms-service/DS.WMS.Core/Op/Entity/SpaceBooking/SpaceBookingOrder.cs index 89b13e68..34b16806 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Entity/SpaceBooking/SpaceBookingOrder.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Entity/SpaceBooking/SpaceBookingOrder.cs @@ -620,5 +620,17 @@ namespace DS.WMS.Core.Op.Entity /// [SqlSugar.SugarColumn(ColumnDescription = "交货地定位ID", Length = 50, IsNullable = true)] public string PlaceDeliveryGeoId { get; set; } + + /// + /// 船公司主键 + /// + [SqlSugar.SugarColumn(ColumnDescription = "船公司主键", IsNullable = true)] + public Nullable CarrierId { get; set; } + + /// + /// 承运人代码 + /// + [SqlSugar.SugarColumn(ColumnDescription = "承运人代码", Length = 20, IsNullable = true)] + public string vesselCarrierCode { get; set; } } } diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs index 7fe1b622..8b52447c 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs @@ -35,6 +35,9 @@ using LanguageExt; using DS.Module.Core.Data; using DS.WMS.Core.TaskPlat.Dtos; using NLog.Fluent; +using Fasterflect; +using AutoMapper; +using System.Reflection; namespace DS.WMS.Core.Op.Method { @@ -53,6 +56,7 @@ namespace DS.WMS.Core.Op.Method private readonly IRedisService redisService; private readonly IConfigService configService; + const string CONST_MSK_API_Poing2P_SECD_URL = "MSKApiSailingSchedulePoint2Point"; const string CONST_MSK_API_BOOKING_URL = "MSKApiBooking"; const string CONST_MSK_API_LOCATION_URL = "MSKApilocation"; @@ -588,7 +592,7 @@ namespace DS.WMS.Core.Op.Method if (spaceBookingOrderShipSchedule == null) { - selectedShipSchedule = GetCacheShipSailingSchedule(model.PId); + selectedShipSchedule = GetCacheShipSailingSchedule(model.PId.Value); } else { @@ -824,7 +828,7 @@ namespace DS.WMS.Core.Op.Method { model.ctns.ForEach(async ctn => { - var ctnMapping = mappingCtnService.QueryMappingCtn(model.carrierId, CONST_MSK_API_MAPPING_MODULE, ctn.ctnCode).GetAwaiter().GetResult()?.Data; + var ctnMapping = mappingCtnService.QueryMappingCtn(model.carrierId.Value, CONST_MSK_API_MAPPING_MODULE, ctn.ctnCode).GetAwaiter().GetResult()?.Data; //var ctnMapping = ctnCodeMappingList.FirstOrDefault(t => t.Code.Equals(ctn.ctnCode)); //if (ctnMapping == null) @@ -1366,10 +1370,72 @@ namespace DS.WMS.Core.Op.Method var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var entity = await tenantDb.Queryable().FirstAsync(a => a.Id == id); - //if (entity == null) - //throw Oops.Oh($"获取马士基API订舱详情失败,不存在或已作废"); - - model = entity.Adapt(); + if (entity == null) + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingAPIOrderDeletedOrNoExists))); + + model = new MSKBookingDto { + id = entity.Id, + carrierCode = entity.CarrierCode, + vesselCarrierCode = entity.vesselCarrierCode, + carrierId = entity.CarrierId, + priceReference = entity.PriceReference, + productCode = entity.ProductCode, + sender = entity.Sender, + bookedByCompanyName = entity.BookedByCompanyName, + bookedByMaerskPartyCode = entity.BookedByCompanyPartyCode, + bookedByCompanyContactName = entity.BookedByCompanyContact, + bookedByCompanyContactEmail = entity.BookedByCompanyContactEmail, + isBookingPartOwnPrice = entity.IsBookingPartOwnPrice, + priceOwnerCompanyName = entity.PriceOwnerCompanyName, + priceOwnerMaerskPartyCode = entity.PriceOwnerCompanyPartyCode, + priceOwnerContactName = entity.PriceOwnerCompanyContact, + priceOwnerContactEmail = entity.PriceOwnerCompanyContactEmail, + earliestDepartureDate = entity.EarliestDepartureDate, + exportServiceMode = entity.ExportServiceMode, + importServiceMode = entity.ImportServiceMode, + placeOfReceiptCityName = entity.PlaceReceiptCity, + placeOfReceiptUnLocCode = entity.PlaceReceiptUnlocCode, + placeOfDeliveryCityName = entity.PlaceDeliveryCity, + placeOfDeliveryUnLocCode = entity.PlaceDeliveryUnlocCode, + originDepartureDateTimeLocal = entity.ETD, + destinationArrivalDateTimeLocal = entity.ETA, + vesselName = entity.Vessel, + carrierVesselCode = entity.VesselCode, + exportVoyageNumber = entity.Voyno, + transportMode = entity.TransportMode, + totalCargoWeight = entity.TotalCargoWeight, + noOfProbes = entity.NoOfProbes, + temperature = !string.IsNullOrWhiteSpace(entity.TempSet)?decimal.Parse(entity.TempSet):null, + ventilation = entity.Vent, + humidity = entity.Humidity, + commodityCodeType = entity.CommodityCodeType, + commodityCode = entity.GoodsCode, + commodityName = entity.GoodsName, + isReefer = entity.IsReefer, + cargoType = entity.CargoType, + placeOfReceiptCountryCode = entity.PlaceReceiptCountryCode, + placeOfDeliveryCountryCode = entity.PlaceDeliveryCountryCode, + EstSailingDays = entity.EstSailingDays, + priceReferenceId = entity.PriceOwnerReferenceId, + priceReferenceName = entity.PriceOwnerReference, + priceOwnerReferenceId = entity.PriceOwnerReferenceId.HasValue? entity.PriceOwnerReferenceId.Value.ToString():"", + priceOwnerReference = entity.PriceOwnerReference, + priceOwnerReferenceName = entity.PriceOwnerReferenceName, + isShipperOwned = entity.IsShipperOwner, + isImportReturned = entity.IsImportReturned, + carrierProductId = entity.CarrierProductId, + isSendNoSchedule = entity.IsSendNoSchedule, + placeOfReceiptCountryName = entity.PlaceReceiptCountryName, + placeOfReceiptRegionName = entity.PlaceReceiptRegionName, + placeOfDeliveryCountryName = entity.PlaceDeliveryCountryName, + placeOfDeliveryRegionName = entity.PlaceDeliveryRegionName, + PId = entity.ShipRatePId, + MD5 = entity.ShipRateMD5, + bookingChannelTypeName = entity.BookingChannelType, + bookingChannelType = entity.BookingChannelTypeName, + carrierCollectionOriginGeoID = entity.PlaceReceiptGeoId, + carrierDeliveryDestinationGeoID = entity.PlaceDeliveryGeoId + }; var ctnList = tenantDb.Queryable().Where(a => a.RecordId == id && a.Deleted == false).ToList(); @@ -1436,7 +1502,7 @@ namespace DS.WMS.Core.Op.Method string ctnStat = string.Empty; - //_logger.LogInformation($"获取请求马士基API订舱报文,JSON={JSON.Serialize(model)}"); + Logger.Log(NLog.LogLevel.Info, $"获取请求马士基API订舱报文,JSON={JsonConvert.SerializeObject(model)}"); var tenantDb = saasService.GetBizDbScopeById(user.TenantId); @@ -1457,7 +1523,7 @@ namespace DS.WMS.Core.Op.Method if (shipScheduleRecord == null) { - selectedShipSchedule = GetCacheShipSailingSchedule(model.PId); + selectedShipSchedule = GetCacheShipSailingSchedule(model.PId.Value); } else { @@ -1502,7 +1568,69 @@ namespace DS.WMS.Core.Op.Method } - SpaceBookingOrder entity = model.Adapt(); + #region 赋值 + SpaceBookingOrder entity = new SpaceBookingOrder + { + CarrierCode = model.carrierCode, + vesselCarrierCode = model.vesselCarrierCode, + CarrierId = model.carrierId, + PriceReference = model.priceReference, + ProductCode = model.productCode, + Sender = model.sender, + BookedByCompanyName = model.bookedByCompanyName, + BookedByCompanyPartyCode = model.bookedByMaerskPartyCode, + BookedByCompanyContact = model.bookedByCompanyContactName, + BookedByCompanyContactEmail = model.bookedByCompanyContactEmail, + IsBookingPartOwnPrice = model.isBookingPartOwnPrice, + PriceOwnerCompanyName = model.priceOwnerCompanyName, + PriceOwnerCompanyPartyCode = model.priceOwnerMaerskPartyCode, + PriceOwnerCompanyContact = model.priceOwnerContactName, + PriceOwnerCompanyContactEmail = model.priceOwnerContactEmail, + EarliestDepartureDate = model.earliestDepartureDate, + ExportServiceMode = model.exportServiceMode, + ImportServiceMode = model.importServiceMode, + PlaceReceiptCity = model.placeOfReceiptCityName, + PlaceReceiptUnlocCode = model.placeOfReceiptUnLocCode, + PlaceDeliveryCity = model.placeOfDeliveryCityName, + PlaceDeliveryUnlocCode = model.placeOfDeliveryUnLocCode, + ETD = model.originDepartureDateTimeLocal, + ETA = model.destinationArrivalDateTimeLocal, + Vessel = model.vesselName, + VesselCode = model.carrierVesselCode, + Voyno = model.exportVoyageNumber, + TransportMode = model.transportMode, + TotalCargoWeight = model.totalCargoWeight, + NoOfProbes = model.noOfProbes, + TempSet = model.temperature.HasValue ? model.temperature.Value.ToString() : "", + Vent = model.ventilation, + Humidity = model.humidity, + CommodityCodeType = model.commodityCodeType, + GoodsCode = model.commodityCode, + GoodsName = model.commodityName, + CargoType = model.cargoType, + PlaceReceiptCountryCode = model.placeOfReceiptCountryCode, + PlaceDeliveryCountryCode = model.placeOfDeliveryCountryCode, + EstSailingDays = model.EstSailingDays, + PriceReferenceId = model.priceReferenceId, + PriceReferenceName = model.priceReferenceName, + PriceOwnerReferenceId = !string.IsNullOrWhiteSpace(model.priceOwnerReferenceId) ? long.Parse(model.priceOwnerReferenceId) : null, + PriceOwnerReference = model.priceOwnerReference, + PriceOwnerReferenceName = model.priceOwnerReferenceName, + IsReefer = model.isReefer, + IsShipperOwner = model.isShipperOwned, + IsImportReturned = model.isImportReturned, + CarrierProductId = model.carrierProductId, + IsSendNoSchedule = model.isSendNoSchedule, + PlaceReceiptCountryName = model.placeOfReceiptCountryName, + PlaceReceiptRegionName = model.placeOfReceiptRegionName, + PlaceDeliveryRegionName = model.placeOfDeliveryRegionName, + PlaceDeliveryCountryName = model.userPlaceOfDeliveryCountryName, + ShipRatePId = model.PId, + ShipRateMD5 = model.MD5, + PlaceReceiptGeoId = model.carrierCollectionOriginGeoID, + PlaceDeliveryGeoId = model.carrierDeliveryDestinationGeoID, + }; + #endregion entity.Id = model.id.Value; entity.UpdateTime = nowDate; @@ -1630,12 +1758,74 @@ namespace DS.WMS.Core.Op.Method } else { - SpaceBookingOrder entity = model.Adapt(); + #region 赋值 + SpaceBookingOrder entity = new SpaceBookingOrder { + CarrierCode = model.carrierCode, + vesselCarrierCode = model.vesselCarrierCode, + CarrierId = model.carrierId, + PriceReference = model.priceReference, + ProductCode = model.productCode, + Sender = model.sender, + BookedByCompanyName = model.bookedByCompanyName, + BookedByCompanyPartyCode = model.bookedByMaerskPartyCode, + BookedByCompanyContact = model.bookedByCompanyContactName, + BookedByCompanyContactEmail = model.bookedByCompanyContactEmail, + IsBookingPartOwnPrice = model.isBookingPartOwnPrice, + PriceOwnerCompanyName = model.priceOwnerCompanyName, + PriceOwnerCompanyPartyCode = model.priceOwnerMaerskPartyCode, + PriceOwnerCompanyContact = model.priceOwnerContactName, + PriceOwnerCompanyContactEmail = model.priceOwnerContactEmail, + EarliestDepartureDate = model.earliestDepartureDate, + ExportServiceMode = model.exportServiceMode, + ImportServiceMode = model.importServiceMode, + PlaceReceiptCity = model.placeOfReceiptCityName, + PlaceReceiptUnlocCode = model.placeOfReceiptUnLocCode, + PlaceDeliveryCity = model.placeOfDeliveryCityName, + PlaceDeliveryUnlocCode = model.placeOfDeliveryUnLocCode, + ETD = model.originDepartureDateTimeLocal, + ETA = model.destinationArrivalDateTimeLocal, + Vessel = model.vesselName, + VesselCode = model.carrierVesselCode, + Voyno = model.exportVoyageNumber, + TransportMode = model.transportMode, + TotalCargoWeight = model.totalCargoWeight, + NoOfProbes = model.noOfProbes, + TempSet = model.temperature.HasValue? model.temperature.Value.ToString():"", + Vent = model.ventilation, + Humidity = model.humidity, + CommodityCodeType = model.commodityCodeType, + GoodsCode = model.commodityCode, + GoodsName = model.commodityName, + CargoType = model.cargoType, + PlaceReceiptCountryCode = model.placeOfReceiptCountryCode, + PlaceDeliveryCountryCode = model.placeOfDeliveryCountryCode, + EstSailingDays = model.EstSailingDays, + PriceReferenceId = model.priceReferenceId, + PriceReferenceName = model.priceReferenceName, + PriceOwnerReferenceId = !string.IsNullOrWhiteSpace(model.priceOwnerReferenceId)?long.Parse(model.priceOwnerReferenceId):null, + PriceOwnerReference = model.priceOwnerReference, + PriceOwnerReferenceName = model.priceOwnerReferenceName, + IsReefer = model.isReefer, + IsShipperOwner = model.isShipperOwned, + IsImportReturned = model.isImportReturned, + CarrierProductId = model.carrierProductId, + IsSendNoSchedule = model.isSendNoSchedule, + PlaceReceiptCountryName = model.placeOfReceiptCountryName, + PlaceReceiptRegionName = model.placeOfReceiptRegionName, + PlaceDeliveryRegionName = model.placeOfDeliveryRegionName, + PlaceDeliveryCountryName = model.userPlaceOfDeliveryCountryName, + ShipRatePId = model.PId, + ShipRateMD5 = model.MD5, + PlaceReceiptGeoId = model.carrierCollectionOriginGeoID, + PlaceDeliveryGeoId = model.carrierDeliveryDestinationGeoID, + }; + #endregion entity.CreateTime = nowDate; entity.UpdateTime = nowDate; entity.CreateBy = long.Parse(user.UserId); entity.CreateUserName = user.UserName; + entity.Status = "TEMP"; entity.StatusName = "暂存"; entity.CtnStat = ctnStat; diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKSPOTAPIService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKSPOTAPIService.cs index 07257a4b..37c2ac93 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKSPOTAPIService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKSPOTAPIService.cs @@ -962,7 +962,7 @@ namespace DS.WMS.Core.Op.Method { model.ctns.ForEach(ctn => { - var ctnMapping = mappingCtnService.QueryMappingCtn(model.carrierId, CONST_MSK_API_BOOKING_URL, ctn.ctnCode).GetAwaiter().GetResult()?.Data; + var ctnMapping = mappingCtnService.QueryMappingCtn(model.carrierId.Value, CONST_MSK_API_BOOKING_URL, ctn.ctnCode).GetAwaiter().GetResult()?.Data; MSKAPIBookingEquipmentAndHaulage haulage = new MSKAPIBookingEquipmentAndHaulage { @@ -1397,10 +1397,76 @@ namespace DS.WMS.Core.Op.Method var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var entity = await tenantDb.Queryable().FirstAsync(a => a.Id == id); - //if (entity == null) - //throw Oops.Oh($"获取马士基API订舱详情失败,不存在或已作废"); + if (entity == null) + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingAPIOrderDeletedOrNoExists))); - model = entity.Adapt(); + model = new MSKSPOTBookingDto + { + id = entity.Id, + carrierCode = entity.CarrierCode, + vesselCarrierCode = entity.vesselCarrierCode, + carrierId = entity.CarrierId, + priceReference = entity.PriceReference, + productCode = entity.ProductCode, + sender = entity.Sender, + bookedByCompanyName = entity.BookedByCompanyName, + bookedByMaerskPartyCode = entity.BookedByCompanyPartyCode, + bookedByCompanyContactName = entity.BookedByCompanyContact, + bookedByCompanyContactEmail = entity.BookedByCompanyContactEmail, + isBookingPartOwnPrice = entity.IsBookingPartOwnPrice, + priceOwnerCompanyName = entity.PriceOwnerCompanyName, + priceOwnerMaerskPartyCode = entity.PriceOwnerCompanyPartyCode, + priceOwnerContactName = entity.PriceOwnerCompanyContact, + priceOwnerContactEmail = entity.PriceOwnerCompanyContactEmail, + earliestDepartureDate = entity.EarliestDepartureDate, + exportServiceMode = entity.ExportServiceMode, + importServiceMode = entity.ImportServiceMode, + placeOfReceiptCityName = entity.PlaceReceiptCity, + placeOfReceiptUnLocCode = entity.PlaceReceiptUnlocCode, + placeOfDeliveryCityName = entity.PlaceDeliveryCity, + placeOfDeliveryUnLocCode = entity.PlaceDeliveryUnlocCode, + originDepartureDateTimeLocal = entity.ETD, + destinationArrivalDateTimeLocal = entity.ETA, + vesselName = entity.Vessel, + carrierVesselCode = entity.VesselCode, + exportVoyageNumber = entity.Voyno, + transportMode = entity.TransportMode, + totalCargoWeight = entity.TotalCargoWeight, + noOfProbes = entity.NoOfProbes, + temperature = !string.IsNullOrWhiteSpace(entity.TempSet) ? decimal.Parse(entity.TempSet) : null, + ventilation = entity.Vent, + humidity = entity.Humidity, + commodityCodeType = entity.CommodityCodeType, + commodityCode = entity.GoodsCode, + commodityName = entity.GoodsName, + isReefer = entity.IsReefer, + cargoType = entity.CargoType, + placeOfReceiptCountryCode = entity.PlaceReceiptCountryCode, + placeOfDeliveryCountryCode = entity.PlaceDeliveryCountryCode, + EstSailingDays = entity.EstSailingDays, + priceReferenceId = entity.PriceOwnerReferenceId, + priceReferenceName = entity.PriceOwnerReference, + priceOwnerReferenceId = entity.PriceOwnerReferenceId.HasValue ? entity.PriceOwnerReferenceId.Value.ToString() : "", + priceOwnerReference = entity.PriceOwnerReference, + priceOwnerReferenceName = entity.PriceOwnerReferenceName, + isShipperOwned = entity.IsShipperOwner, + isImportReturned = entity.IsImportReturned, + carrierProductId = entity.CarrierProductId, + isSendNoSchedule = entity.IsSendNoSchedule, + placeOfReceiptCountryName = entity.PlaceReceiptCountryName, + placeOfReceiptRegionName = entity.PlaceReceiptRegionName, + placeOfDeliveryCountryName = entity.PlaceDeliveryCountryName, + placeOfDeliveryRegionName = entity.PlaceDeliveryRegionName, + PId = entity.ShipRatePId.HasValue? entity.ShipRatePId.Value:0, + MD5 = entity.ShipRateMD5, + bookingChannelTypeName = entity.BookingChannelType, + bookingChannelType = entity.BookingChannelTypeName, + carrierCollectionOriginGeoID = entity.PlaceReceiptGeoId, + carrierDeliveryDestinationGeoID = entity.PlaceDeliveryGeoId, + priceID = entity.PriceId, + ShipRateTotalAmount = entity.ShipRateTotalAmount, + ShipRateTotalCurrency = entity.ShipRateTotalCurrency + }; var ctnList = tenantDb.Queryable().Where(a => a.RecordId == id && a.Deleted == false).ToList(); @@ -1495,22 +1561,26 @@ namespace DS.WMS.Core.Op.Method selectedShipSchedule = JsonConvert.DeserializeObject(shipScheduleRecord.ShipJson); } - //if (selectedShipSchedule == null) - // throw Oops.Oh("船期数据校验失败,请重新查询船期信息"); + //船期数据校验失败,请重新查询船期信息 + if (selectedShipSchedule == null) + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingAPIShipScheduleCheckFailNotNull))); - //if (!selectedShipSchedule.priceID.Equals(model.priceID)) - //{ - // _logger.LogInformation($"请求当前船期请求参数错误 priceID={model.priceID} 缓存priceID={selectedShipSchedule.priceID} PId={model.PId}"); + if (!selectedShipSchedule.priceID.Equals(model.priceID)) + { + Logger.Log(NLog.LogLevel.Info, $"请求当前船期请求参数错误 priceID={model.priceID} 缓存priceID={selectedShipSchedule.priceID} PId={model.PId}"); - // throw Oops.Oh("船期数据校验失败,当前船期请求参数错误,请重新查询船期信息"); - //} + //船期数据校验失败,当前船期请求参数错误,请重新查询船期信息 + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingAPIShipScheduleCheckFailPriceIDNotEqual))); + } - //if (selectedShipSchedule.totalAmount.Value != model.ShipRateTotalAmount.Value) - //{ - // _logger.LogInformation($"请求当前船期请求参数错误 totalAmount={selectedShipSchedule.totalAmount.Value} 缓存totalAmount={model.ShipRateTotalAmount.Value} PId={model.PId}"); + if (selectedShipSchedule.totalAmount.Value != model.ShipRateTotalAmount.Value) + { + Logger.Log(NLog.LogLevel.Info, $"请求当前船期请求参数错误 totalAmount={selectedShipSchedule.totalAmount.Value} 缓存totalAmount={model.ShipRateTotalAmount.Value} PId={model.PId}"); - // throw Oops.Oh("船期数据校验失败,当前船期请求参数错误,价格发生差异,请重新查询船期信息"); - //} + //船期数据校验失败,当前船期请求参数错误,价格发生差异,请重新查询船期信息 + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingAPIShipScheduleCheckFailAmountChange))); + + } model.placeOfReceiptCountryName = selectedShipSchedule.originCountryName; model.placeOfReceiptRegionName = selectedShipSchedule.originRegionName; @@ -1532,24 +1602,89 @@ namespace DS.WMS.Core.Op.Method var oldInfo = tenantDb.Queryable() .First(a => a.Id == model.id); - //if (oldInfo == null) - //throw Oops.Oh("订舱数据不存在或已作废"); + if (oldInfo == null) + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingRecordDeletedOrNoExists))); if (oldInfo.Status == "SUCC") { - //if (isSendApi) - //throw Oops.Oh("订舱数据已发送成功,不能重复发送"); - - //throw Oops.Oh("订舱数据已发送成功,不能修改"); - } - - - SpaceBookingOrder entity = model.Adapt(); + if (isSendApi) + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingBeSendNotRepeat))); + + //预订舱数据已发送成功,不能修改 + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingBeSendNotModify))); + } + + #region 赋值 + SpaceBookingOrder entity = new SpaceBookingOrder + { + CarrierCode = model.carrierCode, + vesselCarrierCode = model.vesselCarrierCode, + CarrierId = model.carrierId, + PriceReference = model.priceReference, + ProductCode = model.productCode, + Sender = model.sender, + BookedByCompanyName = model.bookedByCompanyName, + BookedByCompanyPartyCode = model.bookedByMaerskPartyCode, + BookedByCompanyContact = model.bookedByCompanyContactName, + BookedByCompanyContactEmail = model.bookedByCompanyContactEmail, + IsBookingPartOwnPrice = model.isBookingPartOwnPrice, + PriceOwnerCompanyName = model.priceOwnerCompanyName, + PriceOwnerCompanyPartyCode = model.priceOwnerMaerskPartyCode, + PriceOwnerCompanyContact = model.priceOwnerContactName, + PriceOwnerCompanyContactEmail = model.priceOwnerContactEmail, + EarliestDepartureDate = model.earliestDepartureDate, + ExportServiceMode = model.exportServiceMode, + ImportServiceMode = model.importServiceMode, + PlaceReceiptCity = model.placeOfReceiptCityName, + PlaceReceiptUnlocCode = model.placeOfReceiptUnLocCode, + PlaceDeliveryCity = model.placeOfDeliveryCityName, + PlaceDeliveryUnlocCode = model.placeOfDeliveryUnLocCode, + ETD = model.originDepartureDateTimeLocal, + ETA = model.destinationArrivalDateTimeLocal, + Vessel = model.vesselName, + VesselCode = model.carrierVesselCode, + Voyno = model.exportVoyageNumber, + TransportMode = model.transportMode, + TotalCargoWeight = model.totalCargoWeight, + NoOfProbes = model.noOfProbes, + TempSet = model.temperature.HasValue ? model.temperature.Value.ToString() : "", + Vent = model.ventilation, + Humidity = model.humidity, + CommodityCodeType = model.commodityCodeType, + GoodsCode = model.commodityCode, + GoodsName = model.commodityName, + CargoType = model.cargoType, + PlaceReceiptCountryCode = model.placeOfReceiptCountryCode, + PlaceDeliveryCountryCode = model.placeOfDeliveryCountryCode, + EstSailingDays = model.EstSailingDays, + PriceReferenceId = model.priceReferenceId, + PriceReferenceName = model.priceReferenceName, + PriceOwnerReferenceId = !string.IsNullOrWhiteSpace(model.priceOwnerReferenceId) ? long.Parse(model.priceOwnerReferenceId) : null, + PriceOwnerReference = model.priceOwnerReference, + PriceOwnerReferenceName = model.priceOwnerReferenceName, + IsReefer = model.isReefer, + IsShipperOwner = model.isShipperOwned, + IsImportReturned = model.isImportReturned, + CarrierProductId = model.carrierProductId, + IsSendNoSchedule = model.isSendNoSchedule, + PlaceReceiptCountryName = model.placeOfReceiptCountryName, + PlaceReceiptRegionName = model.placeOfReceiptRegionName, + PlaceDeliveryRegionName = model.placeOfDeliveryRegionName, + PlaceDeliveryCountryName = model.userPlaceOfDeliveryCountryName, + ShipRatePId = model.PId, + ShipRateMD5 = model.MD5, + PlaceReceiptGeoId = model.carrierCollectionOriginGeoID, + PlaceDeliveryGeoId = model.carrierDeliveryDestinationGeoID, + PriceId = model.priceID, + ShipRateTotalAmount = model.ShipRateTotalAmount, + ShipRateTotalCurrency = model.ShipRateTotalCurrency + }; + #endregion entity.Id = model.id.Value; entity.UpdateTime = nowDate; entity.UpdateBy = long.Parse(user.UserId); - //entity.UpdatedUserName = UserManager.Name; + entity.UpdateUserName = user.UserName; entity.CtnStat = ctnStat; entity.BookingChannelType = "SPOT_API"; entity.BookingChannelTypeName = "SPOT订舱"; @@ -1558,7 +1693,7 @@ namespace DS.WMS.Core.Op.Method { x.CreateTime, x.CreateBy, - //x.CreatedUserName, + x.CreateUserName, x.BookingReference, x.BookingId, x.RequestAcknowledgementId, @@ -1591,11 +1726,11 @@ namespace DS.WMS.Core.Op.Method ctnEntity.RecordId = entity.Id; ctnEntity.UpdateTime = nowDate; ctnEntity.UpdateBy = long.Parse(user.UserId); - //ctnEntity.UpdatedUserName = UserManager.Name; + ctnEntity.UpdateUserName = user.UserName; tenantDb.Updateable(ctnEntity).IgnoreColumns(x => new { x.CreateBy, - //x.CreatedUserName, + x.CreateUserName, x.CreateTime, //x.TenantId, x.StuffingMeasurementType, @@ -1617,7 +1752,7 @@ namespace DS.WMS.Core.Op.Method ctnEntity.CreateTime = nowDate; ctnEntity.UpdateTime = nowDate; ctnEntity.CreateBy = long.Parse(user.UserId); - //ctnEntity.CreatedUserName = UserManager.Name; + ctnEntity.CreateUserName = user.UserName; ctnEntity.StuffingMeasurementType = "WEIGHT"; ctnEntity.StuffingMeasurementUnit = "KGS"; @@ -1632,13 +1767,13 @@ namespace DS.WMS.Core.Op.Method ctn.Deleted = true; ctn.DeleteTime = nowDate; ctn.DeleteBy = long.Parse(user.UserId); - //ctn.UpdatedUserName = UserManager.Name; + ctn.UpdateUserName = user.UserName; await tenantDb.Updateable(ctn).UpdateColumns(x => new { x.Deleted, x.DeleteTime, x.DeleteBy, - //x.UpdatedUserName + x.UpdateUserName }).ExecuteCommandAsync(); }); } @@ -1658,7 +1793,7 @@ namespace DS.WMS.Core.Op.Method CreateTime = nowDate, UpdateTime = nowDate, CreateBy = long.Parse(user.UserId), - //CreatedUserName = UserManager.Name + CreateUserName = user.UserName }; await tenantDb.Insertable(shipScheduleRecord).ExecuteCommandAsync(); @@ -1669,12 +1804,77 @@ namespace DS.WMS.Core.Op.Method } else { - SpaceBookingOrder entity = model.Adapt(); + #region 赋值 + SpaceBookingOrder entity = new SpaceBookingOrder + { + CarrierCode = model.carrierCode, + vesselCarrierCode = model.vesselCarrierCode, + CarrierId = model.carrierId, + PriceReference = model.priceReference, + ProductCode = model.productCode, + Sender = model.sender, + BookedByCompanyName = model.bookedByCompanyName, + BookedByCompanyPartyCode = model.bookedByMaerskPartyCode, + BookedByCompanyContact = model.bookedByCompanyContactName, + BookedByCompanyContactEmail = model.bookedByCompanyContactEmail, + IsBookingPartOwnPrice = model.isBookingPartOwnPrice, + PriceOwnerCompanyName = model.priceOwnerCompanyName, + PriceOwnerCompanyPartyCode = model.priceOwnerMaerskPartyCode, + PriceOwnerCompanyContact = model.priceOwnerContactName, + PriceOwnerCompanyContactEmail = model.priceOwnerContactEmail, + EarliestDepartureDate = model.earliestDepartureDate, + ExportServiceMode = model.exportServiceMode, + ImportServiceMode = model.importServiceMode, + PlaceReceiptCity = model.placeOfReceiptCityName, + PlaceReceiptUnlocCode = model.placeOfReceiptUnLocCode, + PlaceDeliveryCity = model.placeOfDeliveryCityName, + PlaceDeliveryUnlocCode = model.placeOfDeliveryUnLocCode, + ETD = model.originDepartureDateTimeLocal, + ETA = model.destinationArrivalDateTimeLocal, + Vessel = model.vesselName, + VesselCode = model.carrierVesselCode, + Voyno = model.exportVoyageNumber, + TransportMode = model.transportMode, + TotalCargoWeight = model.totalCargoWeight, + NoOfProbes = model.noOfProbes, + TempSet = model.temperature.HasValue ? model.temperature.Value.ToString() : "", + Vent = model.ventilation, + Humidity = model.humidity, + CommodityCodeType = model.commodityCodeType, + GoodsCode = model.commodityCode, + GoodsName = model.commodityName, + CargoType = model.cargoType, + PlaceReceiptCountryCode = model.placeOfReceiptCountryCode, + PlaceDeliveryCountryCode = model.placeOfDeliveryCountryCode, + EstSailingDays = model.EstSailingDays, + PriceReferenceId = model.priceReferenceId, + PriceReferenceName = model.priceReferenceName, + PriceOwnerReferenceId = !string.IsNullOrWhiteSpace(model.priceOwnerReferenceId) ? long.Parse(model.priceOwnerReferenceId) : null, + PriceOwnerReference = model.priceOwnerReference, + PriceOwnerReferenceName = model.priceOwnerReferenceName, + IsReefer = model.isReefer, + IsShipperOwner = model.isShipperOwned, + IsImportReturned = model.isImportReturned, + CarrierProductId = model.carrierProductId, + IsSendNoSchedule = model.isSendNoSchedule, + PlaceReceiptCountryName = model.placeOfReceiptCountryName, + PlaceReceiptRegionName = model.placeOfReceiptRegionName, + PlaceDeliveryRegionName = model.placeOfDeliveryRegionName, + PlaceDeliveryCountryName = model.userPlaceOfDeliveryCountryName, + ShipRatePId = model.PId, + ShipRateMD5 = model.MD5, + PlaceReceiptGeoId = model.carrierCollectionOriginGeoID, + PlaceDeliveryGeoId = model.carrierDeliveryDestinationGeoID, + PriceId = model.priceID, + ShipRateTotalAmount = model.ShipRateTotalAmount, + ShipRateTotalCurrency = model.ShipRateTotalCurrency + }; + #endregion entity.CreateTime = nowDate; entity.UpdateTime = nowDate; entity.CreateBy = long.Parse(user.UserId); - //entity.CreatedUserName = UserManager.Name; + entity.CreateUserName = user.UserName; entity.Status = "TEMP"; entity.StatusName = "暂存"; entity.CtnStat = ctnStat; @@ -1699,7 +1899,7 @@ namespace DS.WMS.Core.Op.Method ctnEntity.CreateTime = nowDate; ctnEntity.UpdateTime = nowDate; ctnEntity.CreateBy = long.Parse(user.UserId); - //ctnEntity.CreatedUserName = UserManager.Name; + ctnEntity.CreateUserName = user.UserName; ctnEntity.StuffingMeasurementType = "WEIGHT"; ctnEntity.StuffingMeasurementUnit = "KGS"; @@ -1721,7 +1921,7 @@ namespace DS.WMS.Core.Op.Method CreateTime = nowDate, UpdateTime = nowDate, CreateBy = long.Parse(user.UserId), - //CreatedUserName = UserManager.Name + CreateUserName = user.UserName }; await tenantDb.Insertable(shipScheduleRecord).ExecuteCommandAsync(); @@ -1732,17 +1932,18 @@ namespace DS.WMS.Core.Op.Method //只有船期发生变化时才重新写入新的船期记录 if (model.PId != shipScheduleRecord.ShipRatePid.Value) { - //_logger.LogInformation($"MSK CON id={model.id} 换了船期 原记录:{selectedShipSchedule.PId} 新记录:{model.PId} 作废原船期,插入新船期"); + Logger.Log(NLog.LogLevel.Info, $"MSK CON id={model.id} 换了船期 原记录:{selectedShipSchedule.PId} 新记录:{model.PId} 作废原船期,插入新船期"); shipScheduleRecord.Deleted = true; shipScheduleRecord.DeleteTime = nowDate; shipScheduleRecord.DeleteBy = long.Parse(user.UserId); - //shipScheduleRecord.UpdatedUserName = UserManager.Name; + shipScheduleRecord.DeleteUserName = user.UserName; await tenantDb.Updateable(shipScheduleRecord).UpdateColumns(x => new { x.Deleted, x.DeleteTime, x.DeleteBy, + x.DeleteUserName //x.UpdatedTime }).ExecuteCommandAsync(); @@ -1756,14 +1957,14 @@ namespace DS.WMS.Core.Op.Method CreateTime = nowDate, UpdateTime = nowDate, CreateBy = long.Parse(user.UserId), - //CreatedUserName = UserManager.Name + CreateUserName = user.UserName }; await tenantDb.Insertable(shipScheduleRecord).ExecuteCommandAsync(); } else { - //_logger.LogInformation($"MSK CON id={model.id} 船期没变化 model.PId={model.PId} shipScheduleRecord.SHIP_RATE_PID={shipScheduleRecord.SHIP_RATE_PID.Value}"); + Logger.Log(NLog.LogLevel.Info, $"MSK CON id={model.id} 船期没变化 model.PId={model.PId} shipScheduleRecord.SHIP_RATE_PID={shipScheduleRecord.ShipRatePid.Value}"); } } @@ -1790,7 +1991,7 @@ namespace DS.WMS.Core.Op.Method info.Deleted = true; info.DeleteTime = DateTime.Now; info.DeleteBy = long.Parse(user.UserId); - //info.UpdatedUserName = UserManager.Name; + info.UpdateUserName = user.UserName; await tenantDb.Updateable(info).UpdateColumns(x => new { x.Deleted, @@ -1900,7 +2101,7 @@ namespace DS.WMS.Core.Op.Method DateTime nowDate = DateTime.Now; - //_logger.LogInformation("获取到批量复制功能"); + Logger.Log(NLog.LogLevel.Info, "获取到批量复制功能"); //如果是指定的编辑信息需要先把编辑数据同步到实体类,再进行复制 if (model.opType == "copy_edit") @@ -1940,7 +2141,7 @@ namespace DS.WMS.Core.Op.Method entity.CreateTime = nowDate; entity.UpdateTime = nowDate; entity.CreateBy = long.Parse(user.UserId); - //entity.CreatedUserName = UserManager.Name; + entity.CreateUserName = user.UserName; entity.Status = "TEMP"; entity.StatusName = "暂存"; entity.CtnStat = ctnStat; @@ -1971,7 +2172,7 @@ namespace DS.WMS.Core.Op.Method copyEntity.Id = 0; copyEntity.CreateTime = nowDate; copyEntity.CreateBy = long.Parse(user.UserId); - //copyEntity.CreatedUserName = UserManager.Name; + copyEntity.CreateUserName = user.UserName; copyEntity.UpdateTime = nowDate; copyEntity.Status = "TEMP"; copyEntity.StatusName = "暂存"; @@ -1998,7 +2199,7 @@ namespace DS.WMS.Core.Op.Method ctnEntity.CreateTime = nowDate; ctnEntity.UpdateTime = nowDate; ctnEntity.CreateBy = long.Parse(user.UserId); - //ctnEntity.CreatedUserName = UserManager.Name; + ctnEntity.CreateUserName = user.UserName; await tenantDb.Insertable(ctnEntity).ExecuteReturnEntityAsync(); }); @@ -2019,7 +2220,7 @@ namespace DS.WMS.Core.Op.Method CreateTime = nowDate, UpdateTime = nowDate, CreateBy = long.Parse(user.UserId), - //CreatedUserName = UserManager.Name + CreateUserName = user.UserName }; await tenantDb.Insertable(shipScheduleRecord).ExecuteReturnEntityAsync(); @@ -2060,7 +2261,7 @@ namespace DS.WMS.Core.Op.Method model.LstRecvBCDate = nowDate; model.UpdateTime = nowDate; model.UpdateBy = long.Parse(user.UserId); - //model.UpdatedUserName = UserManager.Name; + model.UpdateUserName = user.UserName; await tenantDb.Updateable(model).UpdateColumns(x => new { @@ -2068,7 +2269,7 @@ namespace DS.WMS.Core.Op.Method x.LstRecvBCDate, x.UpdateTime, x.UpdateBy, - //x.UpdatedUserName + x.UpdateUserName }).ExecuteCommandAsync(); } else if (opTypeName == "Cancellation") @@ -2077,7 +2278,7 @@ namespace DS.WMS.Core.Op.Method model.LstRecvBKCancelDate = nowDate; model.UpdateTime = nowDate; model.UpdateBy = long.Parse(user.UserId); - //model.UpdatedUserName = UserManager.Name; + model.UpdateUserName = user.UserName; await tenantDb.Updateable(model).UpdateColumns(x => new { @@ -2085,7 +2286,7 @@ namespace DS.WMS.Core.Op.Method x.LstRecvBKCancelDate, x.UpdateTime, x.UpdateBy, - //x.UpdatedUserName + x.UpdateUserName }).ExecuteCommandAsync(); } diff --git a/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt b/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt index 78650756..8f6d2b99 100644 --- a/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt +++ b/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt @@ -516,3 +516,136 @@ 2024-07-19 11:37:09.1867 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config 2024-07-19 11:37:09.1867 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile 2024-07-19 11:37:09.2022 Info Configuration initialized. +2024-07-19 18:57:19.3838 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-19 18:57:19.3975 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-19 18:57:19.3975 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-19 18:57:19.4105 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-19 18:57:19.4105 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-19 18:57:19.4105 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-19 18:57:19.4105 Info Configuration initialized. +2024-07-19 19:28:21.2912 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-19 19:28:21.3048 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-19 19:28:21.3048 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-19 19:28:21.3201 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-19 19:28:21.3268 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-19 19:28:21.3268 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-19 19:28:21.3268 Info Configuration initialized. +2024-07-19 19:30:36.8206 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-19 19:30:36.8359 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-19 19:30:36.8359 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-19 19:30:36.8512 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-19 19:30:36.8580 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-19 19:30:36.8580 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-19 19:30:36.8580 Info Configuration initialized. +2024-07-19 19:36:30.1695 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-19 19:36:30.1843 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-19 19:36:30.1843 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-19 19:36:30.1843 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-19 19:36:30.2039 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-19 19:36:30.2039 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-19 19:36:30.2039 Info Configuration initialized. +2024-07-22 08:37:02.2527 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 08:37:02.2691 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 08:37:02.2691 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 08:37:02.2900 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 08:37:02.2995 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 08:37:02.2995 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 08:37:02.2995 Info Configuration initialized. +2024-07-22 08:56:57.5643 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 08:56:57.5820 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 08:56:57.5820 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 08:56:57.6000 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 08:56:57.6000 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 08:56:57.6124 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 08:56:57.6124 Info Configuration initialized. +2024-07-22 09:00:03.8931 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 09:00:03.8931 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 09:00:03.9080 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 09:00:03.9080 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 09:00:03.9241 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 09:00:03.9241 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 09:00:03.9241 Info Configuration initialized. +2024-07-22 09:20:15.0020 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 09:20:15.0020 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 09:20:15.0172 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 09:20:15.0172 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 09:20:15.0336 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 09:20:15.0336 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 09:20:15.0336 Info Configuration initialized. +2024-07-22 09:34:16.8672 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 09:34:16.8810 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 09:34:16.8810 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 09:34:16.8946 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 09:34:16.8946 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 09:34:16.8946 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 09:34:16.9082 Info Configuration initialized. +2024-07-22 10:30:43.8182 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 10:30:43.8311 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 10:30:43.8311 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 10:30:43.8499 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 10:30:43.8499 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 10:30:43.8615 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 10:30:43.8615 Info Configuration initialized. +2024-07-22 10:32:06.0346 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 10:32:06.0346 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 10:32:06.0346 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 10:32:06.0571 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 10:32:06.0571 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 10:32:06.0653 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 10:32:06.0653 Info Configuration initialized. +2024-07-22 11:02:04.9887 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 11:02:05.0015 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 11:02:05.0015 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 11:02:05.0015 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 11:02:05.0194 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 11:02:05.0194 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 11:02:05.0194 Info Configuration initialized. +2024-07-22 11:04:21.7204 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 11:04:21.7204 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 11:04:21.7364 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 11:04:21.7364 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 11:04:21.7517 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 11:04:21.7517 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 11:04:21.7517 Info Configuration initialized. +2024-07-22 11:37:30.2987 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 11:37:30.2987 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 11:37:30.2987 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 11:37:30.3214 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 11:37:30.3214 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 11:37:30.3298 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 11:37:30.3298 Info Configuration initialized. +2024-07-22 11:42:15.2716 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 11:42:15.2874 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 11:42:15.2874 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 11:42:15.3034 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 11:42:15.3034 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 11:42:15.3169 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 11:42:15.3169 Info Configuration initialized. +2024-07-22 11:48:44.5703 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 11:48:44.5830 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 11:48:44.5830 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 11:48:44.5983 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 11:48:44.5983 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 11:48:44.6142 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 11:48:44.6142 Info Configuration initialized. +2024-07-22 12:03:46.0798 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 12:03:46.0798 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 12:03:46.0798 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 12:03:46.1062 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 12:03:46.1149 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 12:03:46.1149 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 12:03:46.1262 Info Configuration initialized. +2024-07-22 12:05:30.8727 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 12:05:30.8906 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 12:05:30.8940 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 12:05:30.8940 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 12:05:30.9115 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 12:05:30.9115 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 12:05:30.9115 Info Configuration initialized. +2024-07-22 12:38:46.1107 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 12:38:46.1107 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 12:38:46.1268 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 12:38:46.1268 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 12:38:46.1446 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 12:38:46.1446 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 12:38:46.1446 Info Configuration initialized. diff --git a/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user b/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user index e2a27942..b2c4ea20 100644 --- a/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -6,7 +6,7 @@ <_PublishTargetUrl>D:\Code\PublishCopy\ds8-opapi - True|2024-07-19T07:45:49.1068004Z||;True|2024-07-19T15:33:45.3242155+08:00||;False|2024-07-19T15:32:41.9604526+08:00||;True|2024-07-19T13:48:27.9722093+08:00||;False|2024-07-19T13:47:56.7900396+08:00||;True|2024-07-19T11:41:15.4223247+08:00||;True|2024-07-19T08:46:28.8014836+08:00||;True|2024-07-18T19:24:50.4184188+08:00||;True|2024-07-18T19:19:14.7056635+08:00||;True|2024-07-18T19:04:43.5615501+08:00||;True|2024-07-18T18:38:39.1976753+08:00||;True|2024-07-18T18:25:15.6833492+08:00||;True|2024-07-18T18:08:46.3114951+08:00||;True|2024-07-18T17:59:12.5292256+08:00||;True|2024-07-18T16:18:45.8049777+08:00||;True|2024-07-18T16:12:42.9723969+08:00||;True|2024-07-18T16:07:14.1432207+08:00||;True|2024-07-17T17:44:18.4741963+08:00||;True|2024-07-17T17:42:47.2735071+08:00||;True|2024-07-17T16:13:32.9037697+08:00||;True|2024-07-17T15:40:21.2550083+08:00||;True|2024-07-17T14:03:08.1814323+08:00||;True|2024-07-15T13:43:42.6073130+08:00||;True|2024-07-15T11:53:40.6498579+08:00||;True|2024-07-15T11:53:03.1652559+08:00||;True|2024-07-15T11:42:33.0154478+08:00||;True|2024-07-15T10:20:03.3925876+08:00||;True|2024-07-15T10:13:28.1415352+08:00||;True|2024-07-08T14:33:12.6884426+08:00||;True|2024-07-08T09:56:58.4995696+08:00||; + True|2024-07-19T10:28:29.1420269Z||;True|2024-07-19T15:45:49.1068004+08:00||;True|2024-07-19T15:33:45.3242155+08:00||;False|2024-07-19T15:32:41.9604526+08:00||;True|2024-07-19T13:48:27.9722093+08:00||;False|2024-07-19T13:47:56.7900396+08:00||;True|2024-07-19T11:41:15.4223247+08:00||;True|2024-07-19T08:46:28.8014836+08:00||;True|2024-07-18T19:24:50.4184188+08:00||;True|2024-07-18T19:19:14.7056635+08:00||;True|2024-07-18T19:04:43.5615501+08:00||;True|2024-07-18T18:38:39.1976753+08:00||;True|2024-07-18T18:25:15.6833492+08:00||;True|2024-07-18T18:08:46.3114951+08:00||;True|2024-07-18T17:59:12.5292256+08:00||;True|2024-07-18T16:18:45.8049777+08:00||;True|2024-07-18T16:12:42.9723969+08:00||;True|2024-07-18T16:07:14.1432207+08:00||;True|2024-07-17T17:44:18.4741963+08:00||;True|2024-07-17T17:42:47.2735071+08:00||;True|2024-07-17T16:13:32.9037697+08:00||;True|2024-07-17T15:40:21.2550083+08:00||;True|2024-07-17T14:03:08.1814323+08:00||;True|2024-07-15T13:43:42.6073130+08:00||;True|2024-07-15T11:53:40.6498579+08:00||;True|2024-07-15T11:53:03.1652559+08:00||;True|2024-07-15T11:42:33.0154478+08:00||;True|2024-07-15T10:20:03.3925876+08:00||;True|2024-07-15T10:13:28.1415352+08:00||;True|2024-07-08T14:33:12.6884426+08:00||;True|2024-07-08T09:56:58.4995696+08:00||; \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.OpApi/appsettings.json b/ds-wms-service/DS.WMS.OpApi/appsettings.json index 6fe2f4b5..d04d7ae7 100644 --- a/ds-wms-service/DS.WMS.OpApi/appsettings.json +++ b/ds-wms-service/DS.WMS.OpApi/appsettings.json @@ -92,7 +92,7 @@ "Environment": "TEST" }, "RedisInfo": { - "RedisConfig": "127.0.0.1:6379,password=,defaultDatabase=15" + "RedisConfig": "60.209.125.238:36379,password=,defaultDatabase=15" }, "BCCompare": { "Url": "http://localhost:5110/api/TaskBookingAmendmentParser/ExcuteBookingAmendmentCompare" diff --git a/ds-wms-service/DS.WMS.Test/SaasTest.cs b/ds-wms-service/DS.WMS.Test/SaasTest.cs index 7e36f6fc..a0e39f3c 100644 --- a/ds-wms-service/DS.WMS.Test/SaasTest.cs +++ b/ds-wms-service/DS.WMS.Test/SaasTest.cs @@ -213,19 +213,19 @@ public class SaasTest var tenantDb = saasService.GetBizDbScopeById("1750335377144680448"); StaticConfig.CodeFirst_MySqlCollate = "utf8mb4_0900_ai_ci";//较高版本支持 tenantDb.CodeFirst.InitTables(typeof(SpaceBookingOrder)); - tenantDb.CodeFirst.InitTables(typeof(SpaceBookingOrderCtn)); - tenantDb.CodeFirst.InitTables(typeof(SpaceBookingOrderShipSchedule)); - tenantDb.CodeFirst.InitTables(typeof(BookingSlotBase)); - tenantDb.CodeFirst.InitTables(typeof(BookingSlotCtn)); - tenantDb.CodeFirst.InitTables(typeof(BookingSlotStock)); - tenantDb.CodeFirst.InitTables(typeof(BookingSlotAllocation)); - tenantDb.CodeFirst.InitTables(typeof(BookingSlotAllocationCtn)); - tenantDb.CodeFirst.InitTables(typeof(BookingSlotDemand)); - tenantDb.CodeFirst.InitTables(typeof(BookingSlotDemandCtn)); - tenantDb.CodeFirst.InitTables(typeof(BookingSlotCompare)); - tenantDb.CodeFirst.InitTables(typeof(BookingContractNoManage)); - tenantDb.CodeFirst.InitTables(typeof(BookingLabel)); - tenantDb.CodeFirst.InitTables(typeof(BookingLabelAllocation)); + //tenantDb.CodeFirst.InitTables(typeof(SpaceBookingOrderCtn)); + //tenantDb.CodeFirst.InitTables(typeof(SpaceBookingOrderShipSchedule)); + //tenantDb.CodeFirst.InitTables(typeof(BookingSlotBase)); + //tenantDb.CodeFirst.InitTables(typeof(BookingSlotCtn)); + //tenantDb.CodeFirst.InitTables(typeof(BookingSlotStock)); + //tenantDb.CodeFirst.InitTables(typeof(BookingSlotAllocation)); + //tenantDb.CodeFirst.InitTables(typeof(BookingSlotAllocationCtn)); + //tenantDb.CodeFirst.InitTables(typeof(BookingSlotDemand)); + //tenantDb.CodeFirst.InitTables(typeof(BookingSlotDemandCtn)); + //tenantDb.CodeFirst.InitTables(typeof(BookingSlotCompare)); + //tenantDb.CodeFirst.InitTables(typeof(BookingContractNoManage)); + //tenantDb.CodeFirst.InitTables(typeof(BookingLabel)); + //tenantDb.CodeFirst.InitTables(typeof(BookingLabelAllocation)); //tenantDb.CodeFirst.InitTables(typeof(CodeThirdParty)); //tenantDb.CodeFirst.InitTables(typeof(CheckBillAutoDetail)); From 26d548d495a3ba38ecf43d5d478845f2cc7a6a20 Mon Sep 17 00:00:00 2001 From: cjy Date: Mon, 22 Jul 2024 16:41:43 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E6=89=93=E5=8D=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MultiLanguageMiddleware.cs | 1 + ds-wms-service/DS.WMS.Gateway/Program.cs | 2 +- ds-wms-service/DS.WMS.Gateway/ocelot.json | 33 +++++++++++++ .../Controllers/PrintController.cs | 46 +++++++++---------- .../Properties/launchSettings.json | 2 +- ds-wms-service/DS.WMS.PrintApi/Startup.cs | 3 +- .../DS.WMS.PrintApi/appsettings.json | 2 +- 7 files changed, 62 insertions(+), 27 deletions(-) diff --git a/ds-wms-service/DS.Module.MultiLanguage/MultiLanguageMiddleware.cs b/ds-wms-service/DS.Module.MultiLanguage/MultiLanguageMiddleware.cs index 82218bba..67ef712b 100644 --- a/ds-wms-service/DS.Module.MultiLanguage/MultiLanguageMiddleware.cs +++ b/ds-wms-service/DS.Module.MultiLanguage/MultiLanguageMiddleware.cs @@ -47,6 +47,7 @@ public class MultiLanguageMiddleware || context.Request.Path.Value.IndexOf("HealthCheck", StringComparison.InvariantCultureIgnoreCase) > -1 || context.Request.Path.Value.IndexOf("DownloadOpFileInfo", StringComparison.InvariantCultureIgnoreCase) > -1 || context.Request.Path.Value.IndexOf("LinkAttach", StringComparison.InvariantCultureIgnoreCase) > -1 + || context.Request.Path.Value.IndexOf("PrintTempFile", StringComparison.InvariantCultureIgnoreCase) > -1 || context.Request.Path.Value.IndexOf("GetOcrImg", StringComparison.InvariantCultureIgnoreCase) > -1 || context.Request.Path.Value.IndexOf("DownloadBookingOrClosingEDI", StringComparison.InvariantCultureIgnoreCase) > -1 ) diff --git a/ds-wms-service/DS.WMS.Gateway/Program.cs b/ds-wms-service/DS.WMS.Gateway/Program.cs index c5178adf..6a57c248 100644 --- a/ds-wms-service/DS.WMS.Gateway/Program.cs +++ b/ds-wms-service/DS.WMS.Gateway/Program.cs @@ -41,7 +41,7 @@ if (!policyName.IsNullOrEmpty()) // if (app.Environment.IsDevelopment()) // { - var apis = new List { "WmsMainAPI", "WmsAdminAPI", "WmsOpAPI", "WmsFeeAPI", "WmsCheckAPI", "WmsFinanceAPI", "TestApi" }; + var apis = new List { "WmsMainAPI", "WmsAdminAPI", "WmsOpAPI", "WmsFeeAPI", "WmsCheckAPI", "WmsFinanceAPI", "WmsPrintAPI", "TestApi" }; app .UseSwagger() diff --git a/ds-wms-service/DS.WMS.Gateway/ocelot.json b/ds-wms-service/DS.WMS.Gateway/ocelot.json index 76d043e2..49d632c6 100644 --- a/ds-wms-service/DS.WMS.Gateway/ocelot.json +++ b/ds-wms-service/DS.WMS.Gateway/ocelot.json @@ -234,6 +234,39 @@ "Type": "RoundRobin" } }, + { + "DownstreamPathTemplate": "/swagger/v1/swagger.json", + "DownstreamScheme": "http", + "DownstreamHostAndPorts": [ + { + "Host": "localhost", + "Port": 2999 + } + ], + "UpstreamPathTemplate": "/WmsPrintAPI/swagger.json", + "UpstreamHttpMethod": [ + "Get", + "Post" + ] + }, + { + "DownstreamPathTemplate": "/printApi/{url}", + "DownstreamScheme": "http", + "DownstreamHostAndPorts": [ + { + "Host": "localhost", + "Port": 2999 + } + ], + "UpstreamPathTemplate": "/printApi/{url}", + "UpstreamHttpMethod": [ + "Get", + "Post" + ], + "LoadBalancerOptions": { + "Type": "RoundRobin" + } + }, { "DownstreamPathTemplate": "/PrintTempFile/{url}", "DownstreamScheme": "http", diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/PrintController.cs b/ds-wms-service/DS.WMS.MainApi/Controllers/PrintController.cs index d6242eb5..2899ffe1 100644 --- a/ds-wms-service/DS.WMS.MainApi/Controllers/PrintController.cs +++ b/ds-wms-service/DS.WMS.MainApi/Controllers/PrintController.cs @@ -152,30 +152,30 @@ namespace DS.WMS.MainApi.Controllers { return await _invokeService.GetOpenPrintTemplateList(req); } - /// - /// 获取Json本地打印信息 - /// - /// - /// - [HttpPost] - [Route("GetJsonPrintInfoAsync")] - public async Task> GetJsonPrintInfoAsync([FromBody] OpenJsonPrintReq req) - { + ///// + ///// 获取Json本地打印信息 + ///// + ///// + ///// + //[HttpPost] + //[Route("GetJsonPrintInfoAsync")] + //public async Task> GetJsonPrintInfoAsync([FromBody] OpenJsonPrintReq req) + //{ - var url = AppSetting.Configuration["PrintService:LocalPrintUrl"]; - if (url.IsNull()) - return await Task.FromResult(DataResult.Failed("未配置本地打印地址")); + // var url = AppSetting.Configuration["PrintService:LocalPrintUrl"]; + // if (url.IsNull()) + // return await Task.FromResult(DataResult.Failed("未配置本地打印地址")); - var res = await RequestHelper.PostJosnAsyncNoHeaders(url, req.ToJson()); - var result = JsonConvert.DeserializeObject>(res); - if (result.Succeeded) - { - return await Task.FromResult(DataResult.Success(result.Message)); - } - else - { - return await Task.FromResult(DataResult.Failed(result.Message)); - } - } + // var res = await RequestHelper.PostJosnAsyncNoHeaders(url, req.ToJson()); + // var result = JsonConvert.DeserializeObject>(res); + // if (result.Succeeded) + // { + // return await Task.FromResult(DataResult.Success(result.Message)); + // } + // else + // { + // return await Task.FromResult(DataResult.Failed(result.Message)); + // } + //} } } diff --git a/ds-wms-service/DS.WMS.PrintApi/Properties/launchSettings.json b/ds-wms-service/DS.WMS.PrintApi/Properties/launchSettings.json index 0a468c50..5ed5da9b 100644 --- a/ds-wms-service/DS.WMS.PrintApi/Properties/launchSettings.json +++ b/ds-wms-service/DS.WMS.PrintApi/Properties/launchSettings.json @@ -4,7 +4,7 @@ "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://localhost:14242", + "applicationUrl": "http://localhost:2999", "sslPort": 0 } }, diff --git a/ds-wms-service/DS.WMS.PrintApi/Startup.cs b/ds-wms-service/DS.WMS.PrintApi/Startup.cs index 011cab5b..e79d7927 100644 --- a/ds-wms-service/DS.WMS.PrintApi/Startup.cs +++ b/ds-wms-service/DS.WMS.PrintApi/Startup.cs @@ -63,10 +63,11 @@ namespace DS.WMS.PrintApi // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { + var documentName = AppSetting.Configuration["SwaggerDoc:ContactName"]; // app.UseHttpsRedirection(); app.UseSwagger().UseSwaggerUI(c => { - c.SwaggerEndpoint("/swagger/v1/swagger.json", AppSetting.Configuration["SwaggerDoc:Version"]); + c.SwaggerEndpoint("/swagger/v1/swagger.json", documentName); }); app.UseRouting(); //̬ļ diff --git a/ds-wms-service/DS.WMS.PrintApi/appsettings.json b/ds-wms-service/DS.WMS.PrintApi/appsettings.json index 524a5e54..bf846f16 100644 --- a/ds-wms-service/DS.WMS.PrintApi/appsettings.json +++ b/ds-wms-service/DS.WMS.PrintApi/appsettings.json @@ -12,7 +12,7 @@ "Pro": "server=60.209.125.238;port=32006;uid=root;pwd=Djy@Mysql.test;database=shippingweb8_dev" }, "SwaggerDoc": { - "ContactName": "WmsPrint API.Core", + "ContactName": "WmsPrintAPI", "ContactEmail": "WmsPrint API.Core@xxx.com", "ContactUrl": "https://www.xxx.com", "Version": "1.0", From 506eb8cc82f4692b9ba5040b2ea5ebffcf86a0d0 Mon Sep 17 00:00:00 2001 From: cjy Date: Mon, 22 Jul 2024 17:15:35 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=89=93=E5=8D=B0=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ds-wms-service/DS.WMS.Gateway/JwtSafeMiddleware.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ds-wms-service/DS.WMS.Gateway/JwtSafeMiddleware.cs b/ds-wms-service/DS.WMS.Gateway/JwtSafeMiddleware.cs index 47f410e1..3a4a4aad 100644 --- a/ds-wms-service/DS.WMS.Gateway/JwtSafeMiddleware.cs +++ b/ds-wms-service/DS.WMS.Gateway/JwtSafeMiddleware.cs @@ -22,7 +22,7 @@ public class JwtSafeMiddleware { // Console.WriteLine(context.Request.Path); var path = context.Request.Path.ToString().ToLower(); - if (path.Contains("swagger") || path.Contains("login")|| path.Contains("tenantregister") || path.Contains("linkattach") || path.Contains("PrintTempFile") || path.Contains("favicon") || path.Contains("clientuserlogin") ) + if (path.Contains("swagger") || path.Contains("login")|| path.Contains("tenantregister") || path.Contains("linkattach") || path.Contains("printtempfile") || path.Contains("favicon") || path.Contains("clientuserlogin") ) { //跳过swagger及login } From 76433e468dff5e4c7951ab2580550a96809bcd17 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 22 Jul 2024 17:16:38 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E8=AE=A2?= =?UTF-8?q?=E8=88=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs | 2 +- .../Op/Method/SpaceBooking/SpaceBookingMSKSPOTAPIService.cs | 2 +- .../Properties/PublishProfiles/FolderProfile.pubxml.user | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs index 8b52447c..29000124 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs @@ -652,7 +652,7 @@ namespace DS.WMS.Core.Op.Method bookingDto.bookingBody.transport = new MSKAPIBookingTransport { - carrierCode = model.carrierCode, + carrierCode = model.vesselCarrierCode, earliestDepartureDate = model.earliestDepartureDate.Value.ToString("yyyy-MM-ddTHH:mm:ss"), exportServiceMode = model.exportServiceMode, importServiceMode = model.importServiceMode, diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKSPOTAPIService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKSPOTAPIService.cs index 37c2ac93..eebbba01 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKSPOTAPIService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKSPOTAPIService.cs @@ -773,7 +773,7 @@ namespace DS.WMS.Core.Op.Method bookingDto.bookingBody.transport = new MSKAPIBookingTransport { - carrierCode = model.carrierCode, + carrierCode = model.vesselCarrierCode, //earliestDepartureDate = model.earliestDepartureDate.Value.ToString("yyyy-MM-ddTHH:mm:ss"), exportServiceMode = model.exportServiceMode, importServiceMode = model.importServiceMode, diff --git a/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user b/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user index b2c4ea20..f07afe67 100644 --- a/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/ds-wms-service/DS.WMS.OpApi/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -6,7 +6,7 @@ <_PublishTargetUrl>D:\Code\PublishCopy\ds8-opapi - True|2024-07-19T10:28:29.1420269Z||;True|2024-07-19T15:45:49.1068004+08:00||;True|2024-07-19T15:33:45.3242155+08:00||;False|2024-07-19T15:32:41.9604526+08:00||;True|2024-07-19T13:48:27.9722093+08:00||;False|2024-07-19T13:47:56.7900396+08:00||;True|2024-07-19T11:41:15.4223247+08:00||;True|2024-07-19T08:46:28.8014836+08:00||;True|2024-07-18T19:24:50.4184188+08:00||;True|2024-07-18T19:19:14.7056635+08:00||;True|2024-07-18T19:04:43.5615501+08:00||;True|2024-07-18T18:38:39.1976753+08:00||;True|2024-07-18T18:25:15.6833492+08:00||;True|2024-07-18T18:08:46.3114951+08:00||;True|2024-07-18T17:59:12.5292256+08:00||;True|2024-07-18T16:18:45.8049777+08:00||;True|2024-07-18T16:12:42.9723969+08:00||;True|2024-07-18T16:07:14.1432207+08:00||;True|2024-07-17T17:44:18.4741963+08:00||;True|2024-07-17T17:42:47.2735071+08:00||;True|2024-07-17T16:13:32.9037697+08:00||;True|2024-07-17T15:40:21.2550083+08:00||;True|2024-07-17T14:03:08.1814323+08:00||;True|2024-07-15T13:43:42.6073130+08:00||;True|2024-07-15T11:53:40.6498579+08:00||;True|2024-07-15T11:53:03.1652559+08:00||;True|2024-07-15T11:42:33.0154478+08:00||;True|2024-07-15T10:20:03.3925876+08:00||;True|2024-07-15T10:13:28.1415352+08:00||;True|2024-07-08T14:33:12.6884426+08:00||;True|2024-07-08T09:56:58.4995696+08:00||; + True|2024-07-22T08:42:12.1933090Z||;True|2024-07-19T18:28:29.1420269+08:00||;True|2024-07-19T15:45:49.1068004+08:00||;True|2024-07-19T15:33:45.3242155+08:00||;False|2024-07-19T15:32:41.9604526+08:00||;True|2024-07-19T13:48:27.9722093+08:00||;False|2024-07-19T13:47:56.7900396+08:00||;True|2024-07-19T11:41:15.4223247+08:00||;True|2024-07-19T08:46:28.8014836+08:00||;True|2024-07-18T19:24:50.4184188+08:00||;True|2024-07-18T19:19:14.7056635+08:00||;True|2024-07-18T19:04:43.5615501+08:00||;True|2024-07-18T18:38:39.1976753+08:00||;True|2024-07-18T18:25:15.6833492+08:00||;True|2024-07-18T18:08:46.3114951+08:00||;True|2024-07-18T17:59:12.5292256+08:00||;True|2024-07-18T16:18:45.8049777+08:00||;True|2024-07-18T16:12:42.9723969+08:00||;True|2024-07-18T16:07:14.1432207+08:00||;True|2024-07-17T17:44:18.4741963+08:00||;True|2024-07-17T17:42:47.2735071+08:00||;True|2024-07-17T16:13:32.9037697+08:00||;True|2024-07-17T15:40:21.2550083+08:00||;True|2024-07-17T14:03:08.1814323+08:00||;True|2024-07-15T13:43:42.6073130+08:00||;True|2024-07-15T11:53:40.6498579+08:00||;True|2024-07-15T11:53:03.1652559+08:00||;True|2024-07-15T11:42:33.0154478+08:00||;True|2024-07-15T10:20:03.3925876+08:00||;True|2024-07-15T10:13:28.1415352+08:00||;True|2024-07-08T14:33:12.6884426+08:00||;True|2024-07-08T09:56:58.4995696+08:00||; \ No newline at end of file From 25ab279a36d31fa261c2c7e9ac04a78672c15dff Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 22 Jul 2024 17:42:03 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=88=E7=BA=A6?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Method/BookingContractNo/BookingContractNoManageService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/BookingContractNo/BookingContractNoManageService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/BookingContractNo/BookingContractNoManageService.cs index 7330f95b..1deceaa2 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/BookingContractNo/BookingContractNoManageService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/BookingContractNo/BookingContractNoManageService.cs @@ -198,7 +198,7 @@ namespace DS.WMS.Core.Op.Method var data = await query.Select().OrderBy(a=>a.ContractNo).Take(top).ToListAsync(); - if(data.Count > 0) + if(data.Count == 0) return DataResult>.FailedData(data); return DataResult>.Success(data); From 2102bef94444a9889597f9f21620c54d355bc298 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 22 Jul 2024 18:26:04 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E8=AE=A2?= =?UTF-8?q?=E8=88=B1=E5=8F=B0=E8=B4=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/SpaceBooking/SpaceBookingPageDto.cs | 88 ++++++++++++------- .../SpaceBooking/SpaceBookingMSKAPIService.cs | 14 ++- .../SpaceBookingMSKSPOTAPIService.cs | 11 ++- .../DS.WMS.OpApi/Logs/internal-nlog.txt | 35 ++++++++ 4 files changed, 111 insertions(+), 37 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/SpaceBooking/SpaceBookingPageDto.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/SpaceBooking/SpaceBookingPageDto.cs index c9e88f17..84e5c26d 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Dtos/SpaceBooking/SpaceBookingPageDto.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SpaceBooking/SpaceBookingPageDto.cs @@ -1,5 +1,7 @@ -using System; +using SqlSugar; +using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -388,36 +390,6 @@ namespace DS.WMS.Core.Op.Dtos /// public string priceReferenceName { get; set; } - /// - /// 创建时间 - /// - public DateTime CreatedTime { get; set; } - - /// - /// 修改时间 - /// - public Nullable UpdatedTime { get; set; } - - /// - /// 创建人ID - /// - public long CreatedUserId { get; set; } - - /// - /// 创建人名称 - /// - public string CreatedUserName { get; set; } - - /// - /// 修改人ID - /// - public long UpdatedUserId { get; set; } - - /// - /// 修改人名称 - /// - public string UpdatedUserName { get; set; } - /// /// 我希望使用托运人自己的集装箱 /// @@ -482,5 +454,59 @@ namespace DS.WMS.Core.Op.Dtos /// 订舱通道类型 CON_API-合约API,SPOT_API-SPOT订舱,EDI-EDI订舱 /// public string bookingChannelTypeName { get; set; } + + /// + /// 备注 + /// + public string Note { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 创建人 + /// + public long CreateBy { get; set; } + + /// + /// 创建人名称 + /// + public string CreateUserName { get; set; } + + /// + /// 修改人 + /// + public long UpdateBy { get; set; } + + /// + /// 修改人名称 + /// + public string UpdateUserName { get; set; } + + /// + /// 更新时间 + /// + public DateTime UpdateTime { get; set; } + + /// + /// 删除 + /// + public bool Deleted { get; set; } = false; + /// + /// 删除人名称 + /// + public string DeleteUserName { get; set; } + + /// + /// 删除时间 + /// + public DateTime DeleteTime { get; set; } + + /// + /// 删除人 + /// + public long DeleteBy { get; set; } } } diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs index 29000124..87a3d3f1 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs @@ -1416,8 +1416,8 @@ namespace DS.WMS.Core.Op.Method placeOfReceiptCountryCode = entity.PlaceReceiptCountryCode, placeOfDeliveryCountryCode = entity.PlaceDeliveryCountryCode, EstSailingDays = entity.EstSailingDays, - priceReferenceId = entity.PriceOwnerReferenceId, - priceReferenceName = entity.PriceOwnerReference, + priceReferenceId = entity.PriceReferenceId, + priceReferenceName = entity.PriceReferenceName, priceOwnerReferenceId = entity.PriceOwnerReferenceId.HasValue? entity.PriceOwnerReferenceId.Value.ToString():"", priceOwnerReference = entity.PriceOwnerReference, priceOwnerReferenceName = entity.PriceOwnerReferenceName, @@ -1434,7 +1434,7 @@ namespace DS.WMS.Core.Op.Method bookingChannelTypeName = entity.BookingChannelType, bookingChannelType = entity.BookingChannelTypeName, carrierCollectionOriginGeoID = entity.PlaceReceiptGeoId, - carrierDeliveryDestinationGeoID = entity.PlaceDeliveryGeoId + carrierDeliveryDestinationGeoID = entity.PlaceDeliveryGeoId, }; var ctnList = tenantDb.Queryable().Where(a => a.RecordId == id && a.Deleted == false).ToList(); @@ -1671,7 +1671,13 @@ namespace DS.WMS.Core.Op.Method } //更新 - var ctnEntity = ctn.Adapt(); + var ctnEntity = new SpaceBookingOrderCtn + { + CtnCode = ctn.ctnCode, + CtnName = ctn.ctnName, + CtnNum = ctn.ctnNum, + CtnSufferWeight = ctn.ctnSufferWeight.HasValue?(int)ctn.ctnSufferWeight.Value:0 + }; ctnEntity.Id = ctn.id.Value; ctnEntity.RecordId = entity.Id; diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKSPOTAPIService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKSPOTAPIService.cs index eebbba01..7c152621 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKSPOTAPIService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKSPOTAPIService.cs @@ -1720,7 +1720,13 @@ namespace DS.WMS.Core.Op.Method } //更新 - var ctnEntity = ctn.Adapt(); + var ctnEntity = new SpaceBookingOrderCtn + { + CtnCode = ctn.ctnCode, + CtnName = ctn.ctnName, + CtnNum = ctn.ctnNum, + CtnSufferWeight = ctn.ctnSufferWeight.HasValue ? (int)ctn.ctnSufferWeight.Value : 0 + }; ctnEntity.Id = ctn.id.Value; ctnEntity.RecordId = entity.Id; @@ -2128,7 +2134,7 @@ namespace DS.WMS.Core.Op.Method ctnEntity.CreateTime = nowDate; ctnEntity.UpdateTime = nowDate; ctnEntity.CreateBy = long.Parse(user.UserId); - //ctnEntity.CreatedUserName = UserManager.Name; + ctnEntity.CreateUserName = user.UserName; ctnEntity.StuffingMeasurementType = "WEIGHT"; ctnEntity.StuffingMeasurementUnit = "KGS"; @@ -2169,6 +2175,7 @@ namespace DS.WMS.Core.Op.Method { var copyEntity = entity.Adapt(); + copyEntity.Id = 0; copyEntity.CreateTime = nowDate; copyEntity.CreateBy = long.Parse(user.UserId); diff --git a/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt b/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt index 8f6d2b99..eeae5b2c 100644 --- a/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt +++ b/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt @@ -649,3 +649,38 @@ 2024-07-22 12:38:46.1446 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config 2024-07-22 12:38:46.1446 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile 2024-07-22 12:38:46.1446 Info Configuration initialized. +2024-07-22 17:44:20.8207 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 17:44:20.8363 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 17:44:20.8363 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 17:44:20.8530 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 17:44:20.8530 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 17:44:20.8626 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 17:44:20.8626 Info Configuration initialized. +2024-07-22 17:51:49.8988 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 17:51:49.9117 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 17:51:49.9117 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 17:51:49.9244 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 17:51:49.9244 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 17:51:49.9244 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 17:51:49.9244 Info Configuration initialized. +2024-07-22 17:55:06.9758 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 17:55:06.9881 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 17:55:06.9881 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 17:55:07.0020 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 17:55:07.0020 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 17:55:07.0020 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 17:55:07.0191 Info Configuration initialized. +2024-07-22 18:15:38.5262 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 18:15:38.5390 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 18:15:38.5390 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 18:15:38.5528 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 18:15:38.5528 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 18:15:38.5528 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 18:15:38.5659 Info Configuration initialized. +2024-07-22 18:23:25.1858 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 18:23:25.1982 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 18:23:25.1982 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 18:23:25.2121 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 18:23:25.2121 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 18:23:25.2121 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 18:23:25.2263 Info Configuration initialized. From cf4d370ec6f0f832674ff095064c3b36a676a4e9 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 22 Jul 2024 18:38:12 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E8=AE=A2?= =?UTF-8?q?=E8=88=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Constants/MultiLanguageConst.cs | 20 ++++++++++++ .../SpaceBooking/SpaceBookingMSKAPIService.cs | 32 +++++++++++-------- .../SpaceBookingMSKSPOTAPIService.cs | 22 +++++++------ .../DS.WMS.OpApi/Logs/internal-nlog.txt | 21 ++++++++++++ 4 files changed, 72 insertions(+), 23 deletions(-) diff --git a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs index 471d211c..ed02d193 100644 --- a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs @@ -1118,6 +1118,26 @@ public static class MultiLanguageConst /// [Description("MSK API SPOT 检索海运船期详情失败,原因:{0}")] public const string SpaceBookingAPISpotSearchShipResultError2 = "SpaceBK_API_Spot_SearchShip_Exception"; + + /// + /// 复制数量不能小于1 + /// + [Description("复制数量不能小于1")] + public const string SpaceBookingAPICopyLowNum = "SpaceBK_API_CopyLowNum"; + + /// + /// 复制数量不能大于1000 + /// + [Description("复制数量不能大于1000")] + public const string SpaceBookingAPICopyLimitNum = "SpaceBK_API_CopyLimitNum"; + + /// + /// 请求的操作类型不能为空 + /// + [Description("请求的操作类型不能为空")] + public const string SpaceBookingAPIOpTypeNull = "SpaceBK_API_OpTypeNull"; + + #endregion #region 舱位管理 diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs index 87a3d3f1..934e2c24 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKAPIService.cs @@ -2037,20 +2037,24 @@ namespace DS.WMS.Core.Op.Method /// 返回执行结果消息 public async Task> BatchCopy(MSKAPIBookingCopyDto model) { - //if (model.copyNum < 1) - // throw Oops.Oh($"复制数量不能小于1"); + //复制数量不能小于1 + if (model.copyNum < 1) + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingAPICopyLowNum))); - //if (model.copyNum > 1000) - // throw Oops.Oh($"复制数量不能大于1000"); + //复制数量不能大于1000 + if (model.copyNum > 1000) + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingAPICopyLimitNum))); - //if (string.IsNullOrWhiteSpace(model.opType)) - // throw Oops.Oh($"请求的操作类型不能为空"); + //请求的操作类型不能为空 + if (string.IsNullOrWhiteSpace(model.opType)) + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingAPIOpTypeNull))); var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var entity = await tenantDb.Queryable().FirstAsync(a => a.Id == model.originalId); - //if (entity == null) - // throw Oops.Oh($"获取马士基API订舱详情失败,不存在或已作废"); + //预订舱数据不存在或已作废 + if (entity == null) + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingRecordDeletedOrNoExists))); var ctnList = tenantDb.Queryable() .Where(a => a.RecordId == model.originalId && a.Deleted == false).ToList(); @@ -2059,7 +2063,7 @@ namespace DS.WMS.Core.Op.Method DateTime nowDate = DateTime.Now; - //_logger.LogInformation("获取到批量复制功能"); + Logger.Log(NLog.LogLevel.Info, "获取到批量复制功能"); //如果是指定的编辑信息需要先把编辑数据同步到实体类,再进行复制 if (model.opType == "copy_edit") @@ -2079,14 +2083,14 @@ namespace DS.WMS.Core.Op.Method { CtnCode = ctn.ctnCode, CtnName = ctn.ctnName, - CtnNum = ctn.ctnNum.Value, + CtnNum = ctn.ctnNum.HasValue? ctn.ctnNum.Value:0, CtnSufferWeight = (int)ctn.ctnSufferWeight.Value, }; ctnEntity.CreateTime = nowDate; ctnEntity.UpdateTime = nowDate; ctnEntity.CreateBy = long.Parse(user.UserId); - //ctnEntity.CreatedUserName = UserManager.Name; + ctnEntity.CreateUserName = user.UserName; ctnEntity.StuffingMeasurementType = "WEIGHT"; ctnEntity.StuffingMeasurementUnit = "KGS"; @@ -2099,7 +2103,7 @@ namespace DS.WMS.Core.Op.Method entity.CreateTime = nowDate; entity.UpdateTime = nowDate; entity.CreateBy = long.Parse(user.UserId); - //entity.CreatedUserName = UserManager.Name; + entity.CreateUserName = user.UserName; entity.Status = "TEMP"; entity.StatusName = "暂存"; entity.CtnStat = ctnStat; @@ -2116,7 +2120,7 @@ namespace DS.WMS.Core.Op.Method copyEntity.Id = 0; copyEntity.CreateTime = nowDate; copyEntity.CreateBy = long.Parse(user.UserId); - //copyEntity.CreatedUserName = UserManager.Name; + copyEntity.CreateUserName = user.UserName; copyEntity.UpdateTime = nowDate; copyEntity.Status = "TEMP"; copyEntity.StatusName = "暂存"; @@ -2143,7 +2147,7 @@ namespace DS.WMS.Core.Op.Method ctnEntity.CreateTime = nowDate; ctnEntity.UpdateTime = nowDate; ctnEntity.CreateBy = long.Parse(user.UserId); - //ctnEntity.CreatedUserName = UserManager.Name; + ctnEntity.CreateUserName = user.UserName; await tenantDb.Insertable(ctnEntity).ExecuteReturnEntityAsync(); }); diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKSPOTAPIService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKSPOTAPIService.cs index 7c152621..d188166e 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKSPOTAPIService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SpaceBooking/SpaceBookingMSKSPOTAPIService.cs @@ -2085,20 +2085,24 @@ namespace DS.WMS.Core.Op.Method /// 返回执行结果消息 public async Task> BatchCopy(MSKAPISPOTBookingCopyDto model) { - //if (model.copyNum < 1) - // throw Oops.Oh($"复制数量不能小于1"); + //复制数量不能小于1 + if (model.copyNum < 1) + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingAPICopyLowNum))); - //if (model.copyNum > 1000) - // throw Oops.Oh($"复制数量不能大于1000"); + //复制数量不能大于1000 + if (model.copyNum > 1000) + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingAPICopyLimitNum))); - //if (string.IsNullOrWhiteSpace(model.opType)) - // throw Oops.Oh($"请求的操作类型不能为空"); + //请求的操作类型不能为空 + if (string.IsNullOrWhiteSpace(model.opType)) + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingAPIOpTypeNull))); var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var entity = await tenantDb.Queryable().FirstAsync(a => a.Id == model.originalId); - //if (entity == null) - // throw Oops.Oh($"获取马士基API订舱详情失败,不存在或已作废"); + //预订舱数据不存在或已作废 + if (entity == null) + throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingRecordDeletedOrNoExists))); var ctnList = tenantDb.Queryable() .Where(a => a.RecordId == model.originalId && a.Deleted == false).ToList(); @@ -2127,7 +2131,7 @@ namespace DS.WMS.Core.Op.Method { CtnCode = ctn.ctnCode, CtnName = ctn.ctnName, - CtnNum = ctn.ctnNum.Value, + CtnNum = ctn.ctnNum.HasValue? ctn.ctnNum.Value:0, CtnSufferWeight = (int)ctn.ctnSufferWeight.Value, }; diff --git a/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt b/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt index eeae5b2c..8cfac7ae 100644 --- a/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt +++ b/ds-wms-service/DS.WMS.OpApi/Logs/internal-nlog.txt @@ -684,3 +684,24 @@ 2024-07-22 18:23:25.2121 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config 2024-07-22 18:23:25.2121 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile 2024-07-22 18:23:25.2263 Info Configuration initialized. +2024-07-22 18:32:54.7832 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 18:32:54.7983 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 18:32:54.7983 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 18:32:54.8151 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 18:32:54.8219 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 18:32:54.8219 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 18:32:54.8219 Info Configuration initialized. +2024-07-22 18:34:27.7720 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 18:34:27.7720 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 18:34:27.7861 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 18:34:27.7861 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 18:34:27.7861 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 18:34:27.8037 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 18:34:27.8037 Info Configuration initialized. +2024-07-22 18:36:53.4718 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-07-22 18:36:53.4718 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-07-22 18:36:53.4872 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-07-22 18:36:53.4872 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-07-22 18:36:53.5029 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config +2024-07-22 18:36:53.5029 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-07-22 18:36:53.5029 Info Configuration initialized. From 4858eb59b585da17d50f39bcb8256526f673553a Mon Sep 17 00:00:00 2001 From: cjy Date: Mon, 22 Jul 2024 18:53:36 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E9=82=AE=E7=AE=B1=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=8F=8A=E6=89=93=E5=8D=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Constants/MultiLanguageConst.cs | 8 ++ .../DS.WMS.Core/Code/Dtos/CodeUserEmailReq.cs | 4 + .../DS.WMS.Core/Code/Dtos/CodeUserEmailRes.cs | 5 ++ .../DS.WMS.Core/Code/Entity/CodeUserEmail.cs | 6 ++ .../Code/Interface/IUserEmaiService.cs | 7 ++ .../Code/Method/CodeUserEmailService.cs | 28 ++++++ .../Sys/Interface/IClientCommonService.cs | 3 +- .../Sys/Method/ClientCommonService.cs | 1 + .../Controllers/UserMailController.cs | 13 +++ .../Controllers/OpenPrintController.cs | 16 +++- .../Model/OpenJsonPrintByCodeReq.cs | 28 ++++++ .../DS.WMS.PrintApi/Model/SysPrintTemplate.cs | 5 ++ .../Service/IOpenPrintService.cs | 8 ++ .../Service/OpenPrintService.cs | 86 +++++++++++++++++++ 14 files changed, 216 insertions(+), 2 deletions(-) create mode 100644 ds-wms-service/DS.WMS.PrintApi/Model/OpenJsonPrintByCodeReq.cs diff --git a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs index 471d211c..e5dbcc29 100644 --- a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs @@ -33,6 +33,11 @@ public static class MultiLanguageConst [Description("查询成功")] public const string DataQuerySuccess = "Data_Query_Success"; /// + /// 查询无数据 + /// + [Description("查询无数据")] + public const string DataQueryNoData = "Data_Query_NoData"; + /// /// 新增成功 /// [Description("新增成功")] @@ -424,6 +429,9 @@ public static class MultiLanguageConst [Description("用户邮箱设置不存在")] public const string UserEmailNotExist = "UserEmail_Not_Exist"; + [Description("未配置个人邮箱账号")] + public const string UserEmailNotSet = "UserEmail_Not_Set"; + [Description("列表字段设置已存在")] public const string ColumnSetExist = "Column_Set_Exist"; [Description("表单复制字段设置已存在")] diff --git a/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeUserEmailReq.cs b/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeUserEmailReq.cs index e4a19c62..48967c77 100644 --- a/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeUserEmailReq.cs +++ b/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeUserEmailReq.cs @@ -58,6 +58,10 @@ namespace DS.WMS.Core.Code.Dtos /// 发件SSL /// public bool? SmtpSSL { get; set; } = false; + /// + /// 是否为公司账号 + /// + public bool IsCompany { get; set; } = false; /// /// 状态 0启用 1禁用 diff --git a/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeUserEmailRes.cs b/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeUserEmailRes.cs index b5419c70..de11111f 100644 --- a/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeUserEmailRes.cs +++ b/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeUserEmailRes.cs @@ -60,5 +60,10 @@ namespace DS.WMS.Core.Code.Dtos /// 状态 0启用 1禁用 /// public StatusEnum? Status { get; set; } = StatusEnum.Enable; + + /// + /// 是否为公司账号 + /// + public bool IsCompany { get; set; } = false; } } diff --git a/ds-wms-service/DS.WMS.Core/Code/Entity/CodeUserEmail.cs b/ds-wms-service/DS.WMS.Core/Code/Entity/CodeUserEmail.cs index f68ea7b4..96dd515f 100644 --- a/ds-wms-service/DS.WMS.Core/Code/Entity/CodeUserEmail.cs +++ b/ds-wms-service/DS.WMS.Core/Code/Entity/CodeUserEmail.cs @@ -71,5 +71,11 @@ namespace DS.WMS.Core.Code.Entity /// [SugarColumn(ColumnDescription = "状态", DefaultValue = "0")] public StatusEnum? Status { get; set; } = StatusEnum.Enable; + + /// + /// 是否为公司账号 + /// + [SugarColumn(ColumnDescription = "是否为公司账号", DefaultValue = "0")] + public bool IsCompany { get; set; } = false; } } diff --git a/ds-wms-service/DS.WMS.Core/Code/Interface/IUserEmaiService.cs b/ds-wms-service/DS.WMS.Core/Code/Interface/IUserEmaiService.cs index 045869f0..b8907fd1 100644 --- a/ds-wms-service/DS.WMS.Core/Code/Interface/IUserEmaiService.cs +++ b/ds-wms-service/DS.WMS.Core/Code/Interface/IUserEmaiService.cs @@ -46,4 +46,11 @@ public interface IUserEmailService /// /// public DataResult BatchDelUserEmail(IdModel req); + + + /// + /// 获取用户邮箱配置 + /// + /// + public Task> GetUserEmailSetInfo(); } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Code/Method/CodeUserEmailService.cs b/ds-wms-service/DS.WMS.Core/Code/Method/CodeUserEmailService.cs index 8fe59309..dcc46110 100644 --- a/ds-wms-service/DS.WMS.Core/Code/Method/CodeUserEmailService.cs +++ b/ds-wms-service/DS.WMS.Core/Code/Method/CodeUserEmailService.cs @@ -125,4 +125,32 @@ public class CodeUserEmailService : IUserEmailService } return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess); } + + + /// + /// 获取用户邮箱配置 + /// + /// + public async Task> GetUserEmailSetInfo() + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + + var data = await tenantDb.Queryable() + .Where(a => a.IsCompany == false && a.CreateBy == long.Parse(user.UserId)) + .Select() + .FirstAsync(); + + if (data == null) + { + data = await tenantDb.Queryable() + .Where(a => a.IsCompany == true) + .Select() + .FirstAsync(); + } + + if (data == null) + return DataResult.Failed("未配置个人邮箱账号", MultiLanguageConst.UserEmailNotSet); + + return DataResult.Success(data, MultiLanguageConst.DataQuerySuccess); + } } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Sys/Interface/IClientCommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Interface/IClientCommonService.cs index b738ff4b..fd1ac156 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Interface/IClientCommonService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Interface/IClientCommonService.cs @@ -13,7 +13,8 @@ namespace DS.WMS.Core.Sys.Interface; /// /// public interface IClientCommonService -{ +{ + /// /// 根据类型获取用户下拉列表 /// diff --git a/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs index f3c951bb..a17e59f5 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Method/ClientCommonService.cs @@ -43,6 +43,7 @@ public class ClientCommonService : IClientCommonService user = _serviceProvider.GetRequiredService(); saasService = _serviceProvider.GetRequiredService(); } + /// /// 根据类型获取用户下拉列表 /// diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/UserMailController.cs b/ds-wms-service/DS.WMS.MainApi/Controllers/UserMailController.cs index 82f5cecc..4a6a6e54 100644 --- a/ds-wms-service/DS.WMS.MainApi/Controllers/UserMailController.cs +++ b/ds-wms-service/DS.WMS.MainApi/Controllers/UserMailController.cs @@ -75,4 +75,17 @@ public class UserEmailController : ApiController var res = _invokeService.BatchDelUserEmail(req); return res; } + + + /// + /// 获取用户邮箱配置 + /// + /// + [HttpGet] + [Route("GetUserEmailSetInfo")] + public async Task> GetUserEmailSetInfo() + { + var res = await _invokeService.GetUserEmailSetInfo(); + return res; + } } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.PrintApi/Controllers/OpenPrintController.cs b/ds-wms-service/DS.WMS.PrintApi/Controllers/OpenPrintController.cs index 90d0407b..e1a2ca8b 100644 --- a/ds-wms-service/DS.WMS.PrintApi/Controllers/OpenPrintController.cs +++ b/ds-wms-service/DS.WMS.PrintApi/Controllers/OpenPrintController.cs @@ -23,7 +23,7 @@ namespace DS.WMS.PrintApi.Controllers } /// - /// 获取Json打印信息 + /// 根据模板Id获取Json打印信息 /// /// /// @@ -35,5 +35,19 @@ namespace DS.WMS.PrintApi.Controllers var res = await _invokeService.GetOpenJsonPrintInfo(req); return res; } + + /// + /// 根据模板Code获取Json打印信息 + /// + /// + /// + [HttpPost] + [AllowAnonymous] + [Route("GetOpenJsonPrintInfoByTemplateCode")] + public async Task GetOpenJsonPrintInfoByTemplateCode([FromBody] OpenJsonPrintByCodeReq req) + { + var res = await _invokeService.GetOpenJsonPrintInfoByTemplateCode(req); + return res; + } } } diff --git a/ds-wms-service/DS.WMS.PrintApi/Model/OpenJsonPrintByCodeReq.cs b/ds-wms-service/DS.WMS.PrintApi/Model/OpenJsonPrintByCodeReq.cs new file mode 100644 index 00000000..88a2bc99 --- /dev/null +++ b/ds-wms-service/DS.WMS.PrintApi/Model/OpenJsonPrintByCodeReq.cs @@ -0,0 +1,28 @@ +namespace DS.WMS.PrintApi.Model +{ + /// + /// Json打印请求数据 + /// + public class OpenJsonPrintByCodeReq + { + /// + /// 租户Id + /// + public long TenantId { get; set; } + + /// + /// 模板Code + /// + public string Code { get; set; } + + /// + /// Json数据 + /// + public string JsonDataStr { get; set; } + + /// + /// 打印类型 1. PDF 2.EXCEL 2.WORD + /// + public string PrintType { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.PrintApi/Model/SysPrintTemplate.cs b/ds-wms-service/DS.WMS.PrintApi/Model/SysPrintTemplate.cs index 23382a57..5cb3e99b 100644 --- a/ds-wms-service/DS.WMS.PrintApi/Model/SysPrintTemplate.cs +++ b/ds-wms-service/DS.WMS.PrintApi/Model/SysPrintTemplate.cs @@ -20,6 +20,11 @@ namespace DS.WMS.PrintApi.Model /// public long ModuleId { get; set; } /// + ///打印模板唯一编码 + /// + [Description("打印模板唯一编码")] + public string TemplateCode { get; set; } + /// ///打印模板名称 /// [Description("打印模板名称")] diff --git a/ds-wms-service/DS.WMS.PrintApi/Service/IOpenPrintService.cs b/ds-wms-service/DS.WMS.PrintApi/Service/IOpenPrintService.cs index b38cf226..b8e37109 100644 --- a/ds-wms-service/DS.WMS.PrintApi/Service/IOpenPrintService.cs +++ b/ds-wms-service/DS.WMS.PrintApi/Service/IOpenPrintService.cs @@ -11,5 +11,13 @@ namespace DS.WMS.PrintApi.Service /// /// public Task GetOpenJsonPrintInfo(OpenJsonPrintReq req); + + /// + /// 根据打印模板代码获取Json打印信息 + /// + /// + /// + + public Task GetOpenJsonPrintInfoByTemplateCode(OpenJsonPrintByCodeReq req); } } diff --git a/ds-wms-service/DS.WMS.PrintApi/Service/OpenPrintService.cs b/ds-wms-service/DS.WMS.PrintApi/Service/OpenPrintService.cs index 22bf7d34..c5564920 100644 --- a/ds-wms-service/DS.WMS.PrintApi/Service/OpenPrintService.cs +++ b/ds-wms-service/DS.WMS.PrintApi/Service/OpenPrintService.cs @@ -97,5 +97,91 @@ namespace DS.WMS.PrintApi.Service return await Task.FromResult(PrintDataResult.Failed(ex.Message)); } } + + public async Task GetOpenJsonPrintInfoByTemplateCode(OpenJsonPrintByCodeReq req) + { + try + { + using (var db = SqlSugarUtil.GetInstance()) + { + var template = db.Queryable().Filter(null, true).Where(x => x.TemplateCode == req.Code && x.TenantId == req.TenantId).First(); + if (template == null) + { + return await Task.FromResult(PrintDataResult.Failed("打印模板编码:["+ req.Code+"]的打印格式不存在!")); + } + if (template.IsUseDataSource) + { + return await Task.FromResult(PrintDataResult.Failed("非Json打印接口!")); + } + + try + { + var basePath = String.Empty; + var savePath = "wwwroot/PrintTempFile"; + + var fileName = DateTime.Now.Ticks; + var printFileName = $"{fileName}.frx"; + var printFile = Path.Combine(savePath, printFileName); + + //写入CRX文件 + using (FileStream fs = new FileStream(printFile, FileMode.Create)) + { + Byte[] info = new UTF8Encoding(true).GetBytes(template.PrintJsonContent); + fs.Write(info, 0, info.Length); + } + + //生成报表 + FastReport.Report report = new FastReport.Report(); + report.Load(printFile); + + var dataSource = report.Dictionary.Connections[0] as JsonDataSourceConnection; + var str = new FastReport.Data.JsonConnection.JsonDataSourceConnectionStringBuilder(); + str.Json = req.JsonDataStr; + dataSource.ConnectionString = str.ConnectionString; + + report.Prepare(); + var printName = string.Empty; + var saveFile = string.Empty; + //var saveFile = Path.Combine(savePath, printName); + if (req.PrintType == "1") + { + printName = $"{fileName}.pdf"; + saveFile = Path.Combine(savePath, printName); + PDFExport pdfExport = new PDFExport(); + pdfExport.Export(report, saveFile); + } + else if (req.PrintType == "2") + { + printName = $"{fileName}.xlsx"; + saveFile = Path.Combine(savePath, printName); + Excel2007Export excelExport = new Excel2007Export(); + excelExport.Export(report, saveFile); + } + else if (req.PrintType == "3") + { + printName = $"{fileName}.doc"; + saveFile = Path.Combine(savePath, printName); + Word2007Export wordExport = new Word2007Export(); + wordExport.Export(report, saveFile); + } + else + { + return await Task.FromResult(PrintDataResult.Failed("非法打印格式!")); + } + + return await Task.FromResult(PrintDataResult.OK(printName)); + } + catch (Exception e) + { + return await Task.FromResult(PrintDataResult.Failed(e.Message)); + } + } + } + catch (Exception ex) + { + //Logger.Warn(ex, "方法: GetOpenJsonPrintInfo"); + return await Task.FromResult(PrintDataResult.Failed(ex.Message)); + } + } } }