已删除12个文件
已修改47个文件
已添加26个文件
已重命名3个文件
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_IBasicRepository; |
| | |
| | | using SqlSugar; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | |
| | | (bool, string, object?) result = ModelValidate.ValidateModelData(initializationLocationDTO); |
| | | if (!result.Item1) return WebResponseContent.Instance.Error(result.Item2); |
| | | |
| | | int side = 1; |
| | | int depth = initializationLocationDTO.Depth; |
| | | List<Dt_LocationInfo> locationInfos = new List<Dt_LocationInfo>(); |
| | | for (int i = 0; i < initializationLocationDTO.MaxRow; i++) |
| | | { |
| | | if((i + 1) % initializationLocationDTO.MaxRow == 1) |
| | | { |
| | | depth = initializationLocationDTO.Depth; |
| | | } |
| | | else if ((i + 1) % initializationLocationDTO.MaxRow == initializationLocationDTO.Depth + 1) |
| | | { |
| | | depth = 1; |
| | | } |
| | | else if ((i + 1) % initializationLocationDTO.MaxRow > 1 && (i + 1) % initializationLocationDTO.MaxRow <= initializationLocationDTO.Depth) |
| | | { |
| | | depth -= 1; |
| | | } |
| | | else |
| | | { |
| | | depth += 1; |
| | | } |
| | | for (int j = 0; j < initializationLocationDTO.MaxColumn; j++) |
| | | { |
| | | for (int k = 0; k < initializationLocationDTO.MaxLayer; k++) |
| | |
| | | EnableStatus = EnableStatusEnum.Normal.ObjToInt(), |
| | | Layer = k + 1, |
| | | LocationStatus = LocationStatusEnum.Free.ObjToInt(), |
| | | LocationType = LocationTypeEnum.Cube.ObjToInt(), |
| | | RoadwayNo = initializationLocationDTO.Roadway, |
| | | LocationType = LocationTypeEnum.Undefined.ObjToInt(), |
| | | RoadwayNo = $"R{initializationLocationDTO.Roadway.ToString()}", |
| | | Row = i + 1, |
| | | Depth = depth, |
| | | }; |
| | | |
| | | if (initializationLocationDTO.IsSingleDepth) |
| | | { |
| | | locationInfo.Depth = 1; |
| | | locationInfo.LocationCode = $"R{initializationLocationDTO.Roadway.ToString().PadLeft(2, '0')}-{locationInfo.Row.ToString().PadLeft(3, '0')}-{locationInfo.Column.ToString().PadLeft(3, '0')}-{locationInfo.Layer.ToString().PadLeft(3, '0')}-{locationInfo.Depth.ToString().PadLeft(2, '0')}"; |
| | | locationInfo.LocationName = $"R{initializationLocationDTO.Roadway.ToString().PadLeft(2, '0')}å··é{locationInfo.Row.ToString().PadLeft(3, '0')}è¡{locationInfo.Column.ToString().PadLeft(3, '0')}å{locationInfo.Layer.ToString().PadLeft(3, '0')}å±{locationInfo.Depth.ToString().PadLeft(2, '0')}æ·±"; |
| | | } |
| | | else |
| | | { |
| | | if (initializationLocationDTO.FirstDepthRows.Contains(i + 1)) |
| | | { |
| | | locationInfo.Depth = 1; |
| | | } |
| | | else |
| | | { |
| | | locationInfo.Depth = 2; |
| | | } |
| | | locationInfo.LocationCode = $"R{initializationLocationDTO.Roadway.ToString().PadLeft(2, '0')}-{locationInfo.Row.ToString().PadLeft(3, '0')}-{locationInfo.Column.ToString().PadLeft(3, '0')}-{locationInfo.Layer.ToString().PadLeft(3, '0')}-{locationInfo.Depth.ToString().PadLeft(2, '0')}"; |
| | | locationInfo.LocationName = $"R{initializationLocationDTO.Roadway.ToString().PadLeft(2, '0')}å··é{locationInfo.Row.ToString().PadLeft(3, '0')}è¡{locationInfo.Column.ToString().PadLeft(3, '0')}å{locationInfo.Layer.ToString().PadLeft(3, '0')}å±{locationInfo.Depth.ToString().PadLeft(2, '0')}æ·±"; |
| | | } |
| | | |
| | | locationInfo.LocationCode = $"{locationInfo.RoadwayNo}-{locationInfo.Row.ToString().PadLeft(3, '0')}-{locationInfo.Column.ToString().PadLeft(3, '0')}-{locationInfo.Layer.ToString().PadLeft(3, '0')}-{locationInfo.Depth.ToString().PadLeft(2, '0')}"; |
| | | locationInfo.LocationName = $"{locationInfo.RoadwayNo}å··é{locationInfo.Row.ToString().PadLeft(3, '0')}è¡{locationInfo.Column.ToString().PadLeft(3, '0')}å{locationInfo.Layer.ToString().PadLeft(3, '0')}å±{locationInfo.Depth.ToString().PadLeft(2, '0')}æ·±"; |
| | | locationInfos.Add(locationInfo); |
| | | } |
| | | } |
| | | } |
| | | |
| | | BaseDal.AddData(locationInfos); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Common.CommonEnum; |
| | | |
| | | namespace WIDESEA_BasicService |
| | | { |
| | |
| | | using WIDESEA_IRecordService; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Common.LocationEnum; |
| | | |
| | | namespace WIDESEA_BasicService |
| | | { |
| | |
| | | _basicRepository = basicRepository; |
| | | _recordService = recordService; |
| | | } |
| | | private Dictionary<string, OrderByType> _emptyAssignOrderBy = new Dictionary<string, OrderByType>() |
| | | |
| | | double weightValue = 0.5; |
| | | |
| | | private readonly static object _locker = new object(); |
| | | static List<LocationCache> locationCaches = new List<LocationCache>(); |
| | | public Dt_LocationInfo? AssignLocation(string roadwayNo, PalletTypeEnum palletType) |
| | | { |
| | | { nameof(Dt_LocationInfo.Depth), OrderByType.Desc }, |
| | | { nameof(Dt_LocationInfo.Layer), OrderByType.Asc }, |
| | | { nameof(Dt_LocationInfo.Column), OrderByType.Asc }, |
| | | { nameof(Dt_LocationInfo.Row), OrderByType.Asc }, |
| | | }; |
| | | lock (_locker) |
| | | { |
| | | List<LocationCache> removeItems = locationCaches.Where(x => (DateTime.Now - x.DateTime).TotalMinutes > 5).ToList(); |
| | | int count = removeItems.Count; |
| | | for (int i = 0; i < count; i++) |
| | | { |
| | | locationCaches.Remove(removeItems[i]); |
| | | } |
| | | |
| | | List<string> lockLocationCodes = locationCaches.Select(x => x.LocationCode).ToList(); |
| | | |
| | | List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == roadwayNo); |
| | | |
| | | //å·²å®ä¹è´§ä½ç±»åçè´§ä½ |
| | | List<Dt_LocationInfo> definedTypeLocations = locationInfos.Where(x => x.LocationType == palletType.ObjToInt()).ToList(); |
| | | |
| | | //æªå®ä¹ç±»åçç©ºè´§ä½ |
| | | List<Dt_LocationInfo> undefinedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList(); |
| | | |
| | | if (locationInfos.Count * weightValue >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Count > 0)//妿已å®ä¹ç±»åè´§ä½æªè¶
è¿æ¯ä¾ï¼ä¸ææªå®ä¹ç±»åçè´§ä½ |
| | | { |
| | | if (palletType == PalletTypeEnum.LargePallet) |
| | | { |
| | | undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Column % 2 == 1).ToList(); |
| | | } |
| | | for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++) |
| | | { |
| | | Dt_LocationInfo undefinedTypeEmptyLocation = undefinedTypeEmptyLocations[i]; |
| | | Dt_LocationInfo? locationInfo = GetUsableLocation(locationInfos, undefinedTypeEmptyLocation, palletType); |
| | | if (locationInfo != null) |
| | | { |
| | | //UpdateLocationStatus(locationInfo.LocationCode, palletType, LocationStatusEnum.Lock); |
| | | locationCaches.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now }); |
| | | return locationInfo; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | List<Dt_LocationInfo> definedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == palletType.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList(); |
| | | |
| | | for (int i = 0; i < definedTypeEmptyLocations.Count; i++) |
| | | { |
| | | Dt_LocationInfo definedTypeEmptyLocation = definedTypeEmptyLocations[i]; |
| | | Dt_LocationInfo? locationInfo = GetUsableLocation(locationInfos, definedTypeEmptyLocation, palletType); |
| | | if (locationInfo != null) |
| | | { |
| | | //UpdateLocationStatus(locationInfo.LocationCode, palletType, LocationStatusEnum.Lock); |
| | | locationCaches.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now }); |
| | | return locationInfo; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public Dt_LocationInfo? GetUsableLocation(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo undefinedTypeEmptyLocation, PalletTypeEnum palletType) |
| | | { |
| | | switch (palletType) |
| | | { |
| | | case PalletTypeEnum.LargePallet: |
| | | { |
| | | Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == undefinedTypeEmptyLocation.Row && x.Layer == undefinedTypeEmptyLocation.Layer && x.Depth == undefinedTypeEmptyLocation.Depth && x.Column == undefinedTypeEmptyLocation.Column + 1); |
| | | if (nearLocation != null && nearLocation.LocationStatus == LocationStatusEnum.Free.ObjToInt() && DepthLocationIsEmpty(locationInfos, undefinedTypeEmptyLocation) != null) |
| | | { |
| | | Dt_LocationInfo? locationInfo = DepthLocationIsEmpty(locationInfos, undefinedTypeEmptyLocation); |
| | | if (locationInfo != null) |
| | | { |
| | | return locationInfo; |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | case PalletTypeEnum.SmallPallet: |
| | | { |
| | | Dt_LocationInfo? locationInfo = DepthLocationIsEmpty(locationInfos, undefinedTypeEmptyLocation); |
| | | if (locationInfo != null) |
| | | { |
| | | return locationInfo; |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private Dt_LocationInfo? DepthLocationIsEmpty(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo undefinedTypeEmptyLocation) |
| | | { |
| | | int maxDepth = locationInfos.Max(x => x.Depth); |
| | | if (undefinedTypeEmptyLocation.Depth == 1 && maxDepth == 1) |
| | | { |
| | | return undefinedTypeEmptyLocation; |
| | | } |
| | | else |
| | | { |
| | | List<Dt_LocationInfo> locations = GetGroupLocations(locationInfos, undefinedTypeEmptyLocation); |
| | | |
| | | List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > undefinedTypeEmptyLocation.Depth).ToList(); |
| | | bool moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt()) == null;//æ¥è¯¢å¤§äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºæè´§çè´§ä½ï¼å¦ææ¯trueï¼åè¡¨ç¤ºæ·±è´§ä½ææªè¢«ä½¿ç¨çæ
åµ |
| | | |
| | | List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= undefinedTypeEmptyLocation.Depth).ToList(); |
| | | bool littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.OnlyIn.ObjToInt() && x.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) == null; //æ¥è¯¢å°äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºç©ºï¼ä¸ç¦ç¨ç¶æä¸ä¸ºç¦ç¨ä»¥ååªå
¥çè´§ä½ï¼å¦ææ¯trueï¼å表示æµ
è´§ä½è¢«ä½¿ç¨æè
被ç¦ç¨çæ
åµ |
| | | |
| | | if (moreDepthFlag && littleDepthFlag) |
| | | { |
| | | return undefinedTypeEmptyLocation; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public void UpdateLocationStatus(string locationCode, PalletTypeEnum palletType, LocationStatusEnum locationStatus, string taskNum = "", string orderNo = "") |
| | | { |
| | | Dt_LocationInfo location = Repository.QueryFirst(x => x.LocationCode == locationCode); |
| | | List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == location.RoadwayNo); |
| | | |
| | | List<Dt_LocationInfo> locations = GetGroupLocations(locationInfos, location); |
| | | if (locationInfos.Max(x => x.Depth) < 3) |
| | | { |
| | | for (int i = 0; i < locations.Count; i++) |
| | | { |
| | | locations[i].LocationStatus = locationStatus.ObjToInt(); |
| | | locations[i].LocationType = palletType.ObjToInt(); |
| | | } |
| | | |
| | | Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column + 1); |
| | | if (nearLocation != null) |
| | | { |
| | | List<Dt_LocationInfo> nearLocations = GetGroupLocations(locationInfos, nearLocation); |
| | | for (int i = 0; i < nearLocations.Count; i++) |
| | | { |
| | | nearLocations[i].LocationType = palletType.ObjToInt(); |
| | | if (palletType == PalletTypeEnum.LargePallet) |
| | | { |
| | | nearLocations[i].LocationStatus = locationStatus.ObjToInt(); |
| | | } |
| | | } |
| | | locations.AddRange(nearLocations); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < locations.Count; i++) |
| | | { |
| | | locations[i].LocationStatus = locationStatus.ObjToInt(); |
| | | locations[i].LocationType = palletType.ObjToInt(); |
| | | } |
| | | } |
| | | Repository.UpdateData(locations); |
| | | } |
| | | |
| | | private List<Dt_LocationInfo> GetGroupLocations(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo location) |
| | | { |
| | | List<Dt_LocationInfo> groupLocations = new List<Dt_LocationInfo>() { location }; |
| | | int maxDepth = locationInfos.Max(x => x.Depth); |
| | | for (int j = location.Depth + 1; j <= maxDepth; j++) |
| | | { |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer); |
| | | if (locationInfo != null) |
| | | { |
| | | groupLocations.Add(locationInfo); |
| | | } |
| | | } |
| | | |
| | | for (int j = location.Depth - 1; j >= 1; j--) |
| | | { |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer); |
| | | if (locationInfo != null) |
| | | { |
| | | groupLocations.Add(locationInfo); |
| | | } |
| | | } |
| | | return groupLocations; |
| | | } |
| | | } |
| | | |
| | | public class LocationCache |
| | | { |
| | | public string LocationCode { get; set; } |
| | | |
| | | public DateTime DateTime { get; set; } |
| | | } |
| | | } |
ÎļþÃû´Ó ´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ManageEnum.cs ÐÞ¸Ä |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Core.Enums |
| | | namespace WIDESEA_Common.CommonEnum |
| | | { |
| | | /// <summary> |
| | | /// å¯ç¦ç¶æ |
| | |
| | | /// </summary> |
| | | [Description("å¯ç¨")] |
| | | Enable = 1, |
| | | } |
| | | |
| | | |
| | | #region åºåç¶æ |
| | | |
| | | |
| | | |
| | | #endregion åºåç¶æ |
| | | |
| | | public enum OperateType |
| | | { |
| | | 人工å é¤ = 1, |
| | | èªå¨å é¤ = 2, |
| | | 人工æ¢å¤ = 3, |
| | | èªå¨æ¢å¤ = 4, |
| | | äººå·¥å®æ = 5, |
| | | èªå¨å®æ = 6, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.CommonEnum |
| | | { |
| | | public enum PalletTypeEnum |
| | | { |
| | | SmallPallet = 1, |
| | | MediumPallet = 2, |
| | | LargePallet = 3, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.LocationEnum |
| | | { |
| | | /// <summary> |
| | | /// è´§ä½ç¦ç¨ç¶æ |
| | | /// </summary> |
| | | public enum EnableStatusEnum |
| | | { |
| | | /// <summary> |
| | | /// æ£å¸¸ |
| | | /// </summary> |
| | | [Description("æ£å¸¸")] |
| | | Normal = 0, |
| | | |
| | | /// <summary> |
| | | /// åªå
¥ |
| | | /// </summary> |
| | | [Description("åªå
¥")] |
| | | OnlyIn = 1, |
| | | |
| | | /// <summary> |
| | | /// åªåº |
| | | /// </summary> |
| | | [Description("åªåº")] |
| | | OnlyOut = 2, |
| | | |
| | | /// <summary> |
| | | /// ç¦ç¨ |
| | | /// </summary> |
| | | [Description("ç¦ç¨")] |
| | | Disable = 3 |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.LocationEnum |
| | | { |
| | | /// <summary> |
| | | /// è´§ä½ç¶æåæ´ç±»å |
| | | /// </summary> |
| | | public enum LocationChangeType |
| | | { |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.LocationEnum |
| | | { |
| | | /// <summary> |
| | | /// è´§ä½ç¶æ |
| | | /// </summary> |
| | | public enum LocationStatusEnum |
| | | { |
| | | /// <summary> |
| | | /// ç©ºé² |
| | | /// </summary> |
| | | [Description("空é²")] |
| | | Free = 0, |
| | | |
| | | /// <summary> |
| | | /// éå® |
| | | /// </summary> |
| | | [Description("éå®")] |
| | | Lock = 1, |
| | | |
| | | /// <summary> |
| | | /// æè´§ |
| | | /// </summary> |
| | | [Description("æè´§")] |
| | | InStock = 2, |
| | | |
| | | /// <summary> |
| | | /// 空æéå® |
| | | /// </summary> |
| | | [Description("空æéå®")] |
| | | PalletLock = 98, |
| | | |
| | | /// <summary> |
| | | /// 空æç |
| | | /// </summary> |
| | | [Description("空æç")] |
| | | Pallet = 99 |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.LocationEnum |
| | | { |
| | | /// <summary> |
| | | /// è´§ä½ç±»å |
| | | /// </summary> |
| | | public enum LocationTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// æªå®ä¹ |
| | | /// </summary> |
| | | [Description("æªå®ä¹")] |
| | | Undefined = 0, |
| | | |
| | | /// <summary> |
| | | /// å°æç |
| | | /// </summary> |
| | | [Description("å°æç")] |
| | | SmallPallet = 1, |
| | | |
| | | /// <summary> |
| | | /// 䏿ç |
| | | /// </summary> |
| | | [Description("䏿ç")] |
| | | MediumPallet = 2, |
| | | |
| | | /// <summary> |
| | | /// 大æç |
| | | /// </summary> |
| | | [Description("大æç")] |
| | | LargePallet = 3, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.OrderEnum |
| | | { |
| | | /// <summary> |
| | | /// å
¥åºåæ®ç¶æ 0ï¼æªå¼å§ 1ï¼å
¥åºä¸ 2ï¼å
¥åºå®æ |
| | | /// </summary> |
| | | public enum InOrderStatusEnum |
| | | { |
| | | /// <summary> |
| | | /// æªå¼å§ |
| | | /// </summary> |
| | | [Description("æªå¼å§")] |
| | | æªå¼å§ = 0, |
| | | |
| | | /// <summary> |
| | | /// å
¥åºä¸ |
| | | /// </summary> |
| | | [Description("å
¥åºä¸")] |
| | | å
¥åºä¸ = 1, |
| | | |
| | | /// <summary> |
| | | /// å
¥åºå®æ |
| | | /// </summary> |
| | | [Description("å
¥åºå®æ")] |
| | | å
¥åºå®æ = 2, |
| | | |
| | | /// <summary> |
| | | /// å
³é |
| | | /// </summary> |
| | | [Description("å
³é")] |
| | | å
³é = 99, |
| | | |
| | | /// <summary> |
| | | /// åæ¶ |
| | | /// </summary> |
| | | [Description("åæ¶")] |
| | | åæ¶ = 98 |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.OrderEnum |
| | | { |
| | | /// <summary> |
| | | /// å
¥åºåç±»å 100 ç产å
¥åºå;200 ç产éæå;300 éè´å
¥åºå;400 è°æ¨å
¥åºå;500 éå®éè´§å;600 空çå
¥åºå;700 å
¶ä»å
¥åºå |
| | | /// </summary> |
| | | public enum InOrderTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// ç产å
¥åºå |
| | | /// </summary> |
| | | [Description("ç产å
¥åºå")] |
| | | Product = 100, |
| | | |
| | | /// <summary> |
| | | /// ç产éæå |
| | | /// </summary> |
| | | [Description("ç产éæå")] |
| | | Return = 105, |
| | | |
| | | /// <summary> |
| | | /// éè´å
¥åºå |
| | | /// </summary> |
| | | [Description("éè´å
¥åºå")] |
| | | Purchase = 110, |
| | | |
| | | /// <summary> |
| | | /// è°æ¨å
¥åºå |
| | | /// </summary> |
| | | [Description("è°æ¨å
¥åºå")] |
| | | Allocat = 115, |
| | | |
| | | /// <summary> |
| | | /// éå®éè´§å |
| | | /// </summary> |
| | | [Description("éå®éè´§å")] |
| | | SaleReturn = 120, |
| | | |
| | | /// <summary> |
| | | /// 空çå
¥åºå |
| | | /// </summary> |
| | | [Description("空çå
¥åºå")] |
| | | EmptyDisk = 125, |
| | | |
| | | /// <summary> |
| | | /// å
¶ä»å
¥åºå |
| | | /// </summary> |
| | | [Description("å
¶ä»å
¥åºå")] |
| | | Other = 130 |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.OrderEnum |
| | | { |
| | | public enum OrderCreateTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// ç³»ç»å
å建 |
| | | /// </summary> |
| | | [Description("ç³»ç»å
å建")] |
| | | CreateInSystem, |
| | | |
| | | /// <summary> |
| | | /// 䏿¸¸ç³»ç»æ¨é |
| | | /// </summary> |
| | | [Description("䏿¸¸ç³»ç»æ¨é")] |
| | | UpperSystemPush |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.OrderEnum |
| | | { |
| | | public enum OrderDetailStatusEnum |
| | | { |
| | | /// <summary> |
| | | /// æ°å»º |
| | | /// </summary> |
| | | [Description("æ°å»º")] |
| | | New = 0, |
| | | |
| | | /// <summary> |
| | | /// ç»çå
¥åº |
| | | /// </summary> |
| | | [Description("ç»çå
¥åº")] |
| | | GroupAndInbound = 10, |
| | | |
| | | /// <summary> |
| | | /// åºåºé¨ååé
宿 |
| | | /// </summary> |
| | | [Description("åºåºé¨ååé
宿")] |
| | | AssignOverPartial = 60, |
| | | |
| | | /// <summary> |
| | | /// åºåºåé
宿 |
| | | /// </summary> |
| | | [Description("åºåºåé
宿")] |
| | | AssignOver = 70, |
| | | |
| | | /// <summary> |
| | | /// åºåºä¸ |
| | | /// </summary> |
| | | [Description("åºåºä¸")] |
| | | Outbound = 80, |
| | | |
| | | /// <summary> |
| | | /// 宿 |
| | | /// </summary> |
| | | [Description("宿")] |
| | | Over = 100 |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.OrderEnum |
| | | { |
| | | public enum OutOrderStatusEnum |
| | | { |
| | | /// <summary> |
| | | /// æªå¼å§ |
| | | /// </summary> |
| | | [Description("æªå¼å§")] |
| | | æªå¼å§ = 0, |
| | | |
| | | /// <summary> |
| | | /// åºåºä¸ |
| | | /// </summary> |
| | | [Description("åºåºä¸")] |
| | | åºåºä¸ = 1, |
| | | |
| | | /// <summary> |
| | | /// åºåºå®æ |
| | | /// </summary> |
| | | [Description("åºåºå®æ")] |
| | | åºåºå®æ = 2, |
| | | |
| | | /// <summary> |
| | | /// å
³é |
| | | /// </summary> |
| | | [Description("å
³é")] |
| | | å
³é = 99, |
| | | |
| | | /// <summary> |
| | | /// åæ¶ |
| | | /// </summary> |
| | | [Description("åæ¶")] |
| | | åæ¶ = 98 |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.OrderEnum |
| | | { |
| | | /// <summary> |
| | | /// åºåºåç±»å |
| | | /// </summary> |
| | | public enum OutOrderTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// ç产è¿å·¥å |
| | | /// </summary> |
| | | [Description("ç产è¿å·¥å")] |
| | | Rework = 200, |
| | | |
| | | /// <summary> |
| | | /// ç产åæå |
| | | /// </summary> |
| | | [Description("ç产åæå")] |
| | | Issue = 205, |
| | | |
| | | /// <summary> |
| | | /// éè´éè´§å |
| | | /// </summary> |
| | | [Description("éè´éè´§å")] |
| | | ProcureReturn = 210, |
| | | |
| | | /// <summary> |
| | | /// è°æ¨åºåºå |
| | | /// </summary> |
| | | [Description("è°æ¨åºåºå")] |
| | | Allocate = 215, |
| | | |
| | | /// <summary> |
| | | /// éå®åºåºå |
| | | /// </summary> |
| | | [Description("éå®åºåºå")] |
| | | SaleOut = 220, |
| | | |
| | | /// <summary> |
| | | /// 空çåºåºå |
| | | /// </summary> |
| | | [Description("空çåºåºå")] |
| | | EmptyDisk = 225, |
| | | |
| | | /// <summary> |
| | | /// è´¨æ£åºåºå |
| | | /// </summary> |
| | | [Description("è´¨æ£åºåºå")] |
| | | Quality = 230, |
| | | |
| | | /// <summary> |
| | | /// å
¶ä»åºåºå |
| | | /// </summary> |
| | | [Description("å
¶ä»åºåºå")] |
| | | Other = 235 |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.OrderEnum |
| | | { |
| | | /// <summary> |
| | | /// 忥æ å¿ 0:æªåæ¥ 1ï¼åæ¥æå 2ï¼åæ¥å¤±è´¥ |
| | | /// </summary> |
| | | public enum SynchronizationFlagEmun |
| | | { |
| | | /// <summary> |
| | | /// 宿 |
| | | /// </summary> |
| | | [Description("æªåæ¥")] |
| | | æªåæ¥ = 0, |
| | | |
| | | /// <summary> |
| | | /// 宿 |
| | | /// </summary> |
| | | [Description("忥æå")] |
| | | 忥æå = 1, |
| | | |
| | | /// <summary> |
| | | /// 宿 |
| | | /// </summary> |
| | | [Description("åæ¥å¤±è´¥")] |
| | | åæ¥å¤±è´¥ = 2 |
| | | } |
| | | } |
ÎļþÃû´Ó ´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/SequenceEnum.cs ÐÞ¸Ä |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Core.Enums |
| | | namespace WIDESEA_Common.OtherEnum |
| | | { |
| | | public enum SequenceEnum |
| | | { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.StockEnum |
| | | { |
| | | public enum OutLockStockStatusEnum |
| | | { |
| | | [Description("å·²åé
")] |
| | | å·²åé
= 0, |
| | | |
| | | [Description("åºåºä¸")] |
| | | åºåºä¸ = 1, |
| | | |
| | | [Description("åºåºå®æ")] |
| | | åºåºå®æ = 2, |
| | | |
| | | [Description("æ¤é")] |
| | | æ¤é = 99 |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.StockEnum |
| | | { |
| | | public enum StockChangeTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// ç»ç |
| | | /// </summary> |
| | | [Description("ç»ç")] |
| | | MaterielGroup, |
| | | |
| | | /// <summary> |
| | | /// å
¥åº |
| | | /// </summary> |
| | | [Description("å
¥åº")] |
| | | Inbound, |
| | | |
| | | /// <summary> |
| | | /// åºåº |
| | | /// </summary> |
| | | [Description("åºåº")] |
| | | Outbound, |
| | | /// <summary> |
| | | /// ç§»åº |
| | | /// </summary> |
| | | [Description("ç§»åº")] |
| | | Relocation, |
| | | |
| | | /// <summary> |
| | | /// å
¥åºéå® |
| | | /// </summary> |
| | | [Description("éå®")] |
| | | Lock, |
| | | |
| | | /// <summary> |
| | | /// åºåéå® |
| | | /// </summary> |
| | | [Description("åºåéå®")] |
| | | StockLock, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.StockEnum |
| | | { |
| | | /// <summary> |
| | | /// åºåç¶æï¼ 1ï¼ç»çæå 2ï¼ç»çæ¤é 3ï¼å
¥åºç¡®è®¤ 4ï¼å
¥åºæ¤é 5ï¼å·²å
¥åº 6ï¼å·²åºåº |
| | | /// </summary> |
| | | public enum StockStatusEmun |
| | | { |
| | | [Description("ç»çæå")] |
| | | ç»çæå = 1, |
| | | |
| | | [Description("ç»çæ¤é")] |
| | | ç»çæ¤é = 2, |
| | | |
| | | [Description("å
¥åºç¡®è®¤")] |
| | | å
¥åºç¡®è®¤ = 3, |
| | | |
| | | [Description("å
¥åºæ¤é")] |
| | | å
¥åºæ¤é = 4, |
| | | |
| | | [Description("å·²å
¥åº")] |
| | | å·²å
¥åº = 5, |
| | | |
| | | [Description("å
¥åºå®æ")] |
| | | å
¥åºå®æ = 6, |
| | | |
| | | [Description("åºåºéå®")] |
| | | åºåºéå® = 7, |
| | | |
| | | [Description("åºåºå®æ")] |
| | | åºåºå®æ = 8, |
| | | |
| | | [Description("ç§»åºéå®")] |
| | | ç§»åºéå® = 9, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.TaskEnum |
| | | { |
| | | /// <summary> |
| | | /// å
¥åºä»»å¡ç¶æ |
| | | /// </summary> |
| | | public enum InTaskStatusEnum |
| | | { |
| | | /// <summary> |
| | | /// æ°å»ºå
¥åºä»»å¡ |
| | | /// </summary> |
| | | [Description("æ°å»º")] |
| | | InNew = 200, |
| | | |
| | | /// <summary> |
| | | /// å åæºå
¥åºæ§è¡ä¸ |
| | | /// </summary> |
| | | [Description("å åæºå
¥åºæ§è¡ä¸")] |
| | | SC_InExecuting = 230, |
| | | |
| | | /// <summary> |
| | | /// å åæºå
¥åºå®æ |
| | | /// </summary> |
| | | [Description("å åæºå
¥åºå®æ")] |
| | | SC_InFinish = 235, |
| | | |
| | | /// <summary> |
| | | /// å
¥åºä»»å¡å®æ |
| | | /// </summary> |
| | | [Description("å
¥åºä»»å¡å®æ")] |
| | | InFinish = 290, |
| | | |
| | | /// <summary> |
| | | /// å
¥åºä»»å¡åæ¶ |
| | | /// </summary> |
| | | [Description("å
¥åºä»»å¡åæ¶")] |
| | | InCancel = 298, |
| | | |
| | | /// <summary> |
| | | /// å
¥åºä»»å¡å¼å¸¸ |
| | | /// </summary> |
| | | [Description("å
¥åºä»»å¡å¼å¸¸")] |
| | | InException = 299, |
| | | |
| | | /// <summary> |
| | | /// æ°å»ºç§»åºä»»å¡ |
| | | /// </summary> |
| | | [Description("æ°å»ºç§»åºä»»å¡")] |
| | | RelocationNew = 300, |
| | | |
| | | /// <summary> |
| | | /// ç§»åºä»»å¡å®æ |
| | | /// </summary> |
| | | [Description("ç§»åºä»»å¡å®æ")] |
| | | RelocationFinish = 310, |
| | | |
| | | /// <summary> |
| | | /// ç§»åºä»»å¡æ§è¡ä¸ |
| | | /// </summary> |
| | | [Description("ç§»åºä»»å¡æ§è¡ä¸")] |
| | | RelocationExecuting = 320, |
| | | |
| | | /// <summary> |
| | | /// ç§»åºä»»å¡åæ¶ |
| | | /// </summary> |
| | | [Description("ç§»åºä»»å¡åæ¶")] |
| | | RelocationCancel = 330, |
| | | |
| | | /// <summary> |
| | | /// ç§»åºä»»å¡å¼å¸¸ |
| | | /// </summary> |
| | | [Description("ç§»åºä»»å¡å¼å¸¸")] |
| | | RelocationException = 340, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.TaskEnum |
| | | { |
| | | /// <summary> |
| | | /// åºåºä»»å¡ç¶æ |
| | | /// </summary> |
| | | public enum OutTaskStatusEnum |
| | | { |
| | | /// <summary> |
| | | /// æ°å»ºä»»å¡ |
| | | /// </summary> |
| | | [Description("æ°å»º")] |
| | | OutNew = 100, |
| | | |
| | | /// <summary> |
| | | /// å åæºåºåºæ§è¡ä¸ |
| | | /// </summary> |
| | | [Description("å åæºåºåºæ§è¡ä¸")] |
| | | SC_OutExecuting = 130, |
| | | |
| | | /// <summary> |
| | | /// å åæºåºåºå®æ |
| | | /// </summary> |
| | | [Description("å åæºåºåºå®æ")] |
| | | SC_OutFinish = 135, |
| | | |
| | | /// <summary> |
| | | /// åºåºä»»å¡å®æ |
| | | /// </summary> |
| | | [Description("åºåºä»»å¡å®æ")] |
| | | OutFinish = 190, |
| | | |
| | | /// <summary> |
| | | /// åºåºä»»å¡åæ¶ |
| | | /// </summary> |
| | | [Description("åºåºä»»å¡åæ¶")] |
| | | OutCancel = 198, |
| | | |
| | | /// <summary> |
| | | /// åºåºä»»å¡å¼å¸¸ |
| | | /// </summary> |
| | | [Description("åºåºä»»å¡å¼å¸¸")] |
| | | OutException = 199 |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.TaskEnum |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å |
| | | /// </summary> |
| | | public enum TaskTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// åºåº =100 |
| | | /// </summary> |
| | | [Description("åºåº")] |
| | | Outbound = 100, |
| | | |
| | | /// <summary> |
| | | /// çç¹åºåº |
| | | /// </summary> |
| | | [Description("çç¹åºåº")] |
| | | OutInventory = 101, |
| | | |
| | | /// <summary> |
| | | /// 忣åºåº |
| | | /// </summary> |
| | | [Description("忣åºåº")] |
| | | OutPick = 102, |
| | | |
| | | /// <summary> |
| | | /// è´¨æ£åºåº |
| | | /// </summary> |
| | | [Description("è´¨æ£åºåº")] |
| | | OutQuality = 103, |
| | | |
| | | /// <summary> |
| | | /// åºç©º |
| | | /// </summary> |
| | | [Description("åºç©º")] |
| | | PalletOutbound = 104, |
| | | |
| | | /// <summary> |
| | | /// 补空 |
| | | /// </summary> |
| | | [Description("补空")] |
| | | PalletFillOutbound = 105, |
| | | |
| | | /// <summary> |
| | | /// å
¥åº |
| | | /// </summary> |
| | | [Description("å
¥åº")] |
| | | Inbound = 200, |
| | | |
| | | /// <summary> |
| | | /// çç¹å
¥åº |
| | | /// </summary> |
| | | [Description("çç¹å
¥åº")] |
| | | InInventory = 201, |
| | | |
| | | /// <summary> |
| | | /// 忣å
¥åº |
| | | /// </summary> |
| | | [Description("忣å
¥åº")] |
| | | InPick = 202, |
| | | |
| | | /// <summary> |
| | | /// è´¨æ£å
¥åº |
| | | /// </summary> |
| | | [Description("è´¨æ£å
¥åº")] |
| | | InQuality = 203, |
| | | |
| | | /// <summary> |
| | | /// å
¥ç©º |
| | | /// </summary> |
| | | [Description("å
¥ç©º")] |
| | | PalletInbound = 204, |
| | | |
| | | /// <summary> |
| | | /// å空 |
| | | /// </summary> |
| | | [Description("å空")] |
| | | PalletReturnInbound = 205, |
| | | |
| | | /// <summary> |
| | | /// ç§»åº |
| | | /// </summary> |
| | | [Description("ç§»åº")] |
| | | Relocation = 300, |
| | | |
| | | /// <summary> |
| | | /// åºå
ç§»åº |
| | | /// </summary> |
| | | [Description("åºå
ç§»åº")] |
| | | RelocationIn = 301, |
| | | |
| | | /// <summary> |
| | | /// åºå¤ç§»åº |
| | | /// </summary> |
| | | [Description("åºå¤ç§»åº")] |
| | | RelocationOut = 302, |
| | | |
| | | [Description("AGVæ¬è¿")] |
| | | AGVCarry = 500, |
| | | } |
| | | } |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | using WIDESEA_Core.CodeConfigEnum; |
| | | using WIDESEA_Core.Const; |
| | | using WIDESEA_Core.DB; |
| | | using WIDESEA_Core.DB.Models; |
| | |
| | | } |
| | | |
| | | |
| | | if (App.User?.UserId > 0) |
| | | //if (App.User?.UserId > 0) |
| | | { |
| | | switch (entityInfo.OperationType) |
| | | { |
| | |
| | | ruleConfig.ModifyDate = DateTime.Now; |
| | | |
| | | code = ruleConfig.Format; |
| | | code = code.Replace($"[{CodeFormat.YYYY}]", now.Year.ToString().PadLeft(4, '0')); |
| | | code = code.Replace($"[{CodeFormat.MM}]", now.Month.ToString().PadLeft(2, '0')); |
| | | code = code.Replace($"[{CodeFormat.DD}]", now.Day.ToString().PadLeft(2, '0')); |
| | | code = code.Replace($"[{CodeFormat.ST}]", ruleConfig.StartStr.ToString()); |
| | | code = code.Replace($"[{CodeFormat.NUM}]", ruleConfig.CurrentVal.ToString().PadLeft(ruleConfig.Length ?? 0, '0')); |
| | | code = code.Replace($"[{CodeFormatTypeEnum.YYYY}]", now.Year.ToString().PadLeft(4, '0')); |
| | | code = code.Replace($"[{CodeFormatTypeEnum.MM}]", now.Month.ToString().PadLeft(2, '0')); |
| | | code = code.Replace($"[{CodeFormatTypeEnum.DD}]", now.Day.ToString().PadLeft(2, '0')); |
| | | code = code.Replace($"[{CodeFormatTypeEnum.ST}]", ruleConfig.StartStr.ToString()); |
| | | code = code.Replace($"[{CodeFormatTypeEnum.NUM}]", ruleConfig.CurrentVal.ToString().PadLeft(ruleConfig.Length ?? 0, '0')); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.CodeConfigEnum; |
| | | using WIDESEA_Core.Enums; |
| | | |
| | | namespace WIDESEA_Core.Attributes |
| | |
| | | [AttributeUsage(AttributeTargets.Property)] |
| | | public class AnalysisItemRuleAttribute : Attribute |
| | | { |
| | | public AnalysisFormatType AnalysisFormaType { get; set; } |
| | | public AnalysisFormatTypeEnum AnalysisFormaType { get; set; } |
| | | |
| | | public int Length { get; set; } |
| | | |
| | | public AnalysisItemRuleAttribute(AnalysisFormatType analysisFormaType) |
| | | public AnalysisItemRuleAttribute(AnalysisFormatTypeEnum analysisFormaType) |
| | | { |
| | | AnalysisFormaType = analysisFormaType; |
| | | } |
| | |
| | | [AttributeUsage(AttributeTargets.Class)] |
| | | public class AnalysisRuleAttribute : Attribute |
| | | { |
| | | public AnalysisRule AnalysisRule { get; set; } = AnalysisRule.Split; |
| | | public AnalysisRuleEnum AnalysisRule { get; set; } = AnalysisRuleEnum.Split; |
| | | |
| | | public AnalysisRuleAttribute() |
| | | { |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.CodeConfigEnum; |
| | | using WIDESEA_Core.Enums; |
| | | |
| | | namespace WIDESEA_Core.Attributes |
| | |
| | | [AttributeUsage(AttributeTargets.Property)] |
| | | public class CodeRuleAttribute : Attribute |
| | | { |
| | | public RuleCode RuleCode { get; set; } |
| | | public CodeRuleAttribute(RuleCode ruleCode) |
| | | public RuleCodeEnum RuleCode { get; set; } |
| | | public CodeRuleAttribute(RuleCodeEnum ruleCode) |
| | | { |
| | | RuleCode = ruleCode; |
| | | } |
| | |
| | | /// <returns></returns> |
| | | public static string IssueJwt(TokenModelJwt tokenModel) |
| | | { |
| | | string exp = $"{new DateTimeOffset(DateTime.Now.AddMinutes(/*tokenModel.UserId == 1 ? 43200 : */AppSettings.app("ExpMinutes").ObjToInt())).ToUnixTimeSeconds()}"; |
| | | string exp = $"{new DateTimeOffset(DateTime.Now.AddMinutes(/*tokenModel.UserId == 1 ? 43200 : */AppSettings.Get("ExpMinutes").ObjToInt())).ToUnixTimeSeconds()}"; |
| | | List<Claim> claims = new List<Claim> |
| | | { |
| | | new Claim(JwtRegisteredClaimNames.Jti, tokenModel.UserId.ToString()), |
| | |
| | | |
| | | Task<bool> DeleteDataByIdAsync(object id); |
| | | |
| | | bool DeleteAndMoveIntoHty(TEntity entity, OperateType operateType); |
| | | bool DeleteAndMoveIntoHty(TEntity entity, OperateTypeEnum operateType); |
| | | |
| | | bool DeleteAndMoveIntoHty(List<TEntity> entities, OperateType operateType); |
| | | bool DeleteAndMoveIntoHty(List<TEntity> entities, OperateTypeEnum operateType); |
| | | |
| | | /// <summary> |
| | | /// éè¿ä¸»é®æ°æ®å é¤å¤æ¡æ°æ® |
| | |
| | | .WhereIF(whereExpression != null, whereExpression).ToListAsync(); |
| | | } |
| | | |
| | | public bool DeleteAndMoveIntoHty(TEntity entity, OperateType operateType) |
| | | public bool DeleteAndMoveIntoHty(TEntity entity, OperateTypeEnum operateType) |
| | | { |
| | | Type type = entity.GetType(); |
| | | Assembly assembly = type.Assembly; |
| | |
| | | { |
| | | object? obj = Activator.CreateInstance(htyType); |
| | | PropertyInfo keyPro = typeof(TEntity).GetKeyProperty(); |
| | | PropertyInfo? operateTypePro = htyType.GetProperty(nameof(OperateType)); |
| | | PropertyInfo? operateTypePro = htyType.GetProperty(nameof(OperateTypeEnum)); |
| | | PropertyInfo? sourceIdPro = htyType.GetProperty("SourceId"); |
| | | if (obj != null && keyPro != null && operateTypePro != null && sourceIdPro != null) |
| | | { |
| | |
| | | return DeleteData(entity); |
| | | } |
| | | |
| | | public bool DeleteAndMoveIntoHty(List<TEntity> entities, OperateType operateType) |
| | | public bool DeleteAndMoveIntoHty(List<TEntity> entities, OperateTypeEnum operateType) |
| | | { |
| | | Type type = typeof(TEntity); |
| | | Assembly assembly = type.Assembly; |
| | |
| | | { |
| | | object? obj2 = Activator.CreateInstance(htyType); |
| | | PropertyInfo keyPro = typeof(TEntity).GetKeyProperty(); |
| | | PropertyInfo? operateTypePro = htyType.GetProperty(nameof(OperateType)); |
| | | PropertyInfo? operateTypePro = htyType.GetProperty(nameof(OperateTypeEnum)); |
| | | PropertyInfo? sourceIdPro = htyType.GetProperty("SourceId"); |
| | | if (obj2 != null && keyPro != null && operateTypePro != null && sourceIdPro != null) |
| | | { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Core.CodeConfigEnum |
| | | { |
| | | /// <summary> |
| | | /// è§£æè§åç¼å· |
| | | /// </summary> |
| | | public enum AnalysisCodeEnum |
| | | { |
| | | /// <summary> |
| | | /// å
ç®±ç |
| | | /// </summary> |
| | | [Description("å
ç®±ç ")] |
| | | InnerCode, |
| | | |
| | | /// <summary> |
| | | /// å¤ç®±ç |
| | | /// </summary> |
| | | [Description("å¤ç®±ç ")] |
| | | OutterCode |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Core.CodeConfigEnum |
| | | { |
| | | /// <summary> |
| | | /// è§£ææ ¼å¼ç±»å |
| | | /// </summary> |
| | | public enum AnalysisFormatTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// ç©æç¼å· |
| | | /// </summary> |
| | | [Description("ç©æç¼å·")] |
| | | MTC, |
| | | /// <summary> |
| | | /// çäº§æ¥æ |
| | | /// </summary> |
| | | [Description("çäº§æ¥æ")] |
| | | MTPT, |
| | | /// <summary> |
| | | /// æ¹æ¬¡å· |
| | | /// </summary> |
| | | [Description("æ¹æ¬¡å·")] |
| | | BHN, |
| | | /// <summary> |
| | | /// æ°é |
| | | /// </summary> |
| | | [Description("æ°é")] |
| | | MTQ, |
| | | /// <summary> |
| | | /// 订åå· |
| | | /// </summary> |
| | | [Description("订åå·")] |
| | | ODN, |
| | | /// <summary> |
| | | /// åå§æ°æ® |
| | | /// </summary> |
| | | [Description("åå§æ°æ®")] |
| | | BD, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Core.CodeConfigEnum |
| | | { |
| | | /// <summary> |
| | | /// è§£æè§å |
| | | /// </summary> |
| | | public enum AnalysisRuleEnum |
| | | { |
| | | /// <summary> |
| | | /// åå²å符串åå² |
| | | /// </summary> |
| | | [Description("åå²å符串åå²")] |
| | | Split, |
| | | |
| | | /// <summary> |
| | | /// é¿åº¦åå² |
| | | /// </summary> |
| | | [Description("é¿åº¦åå²")] |
| | | Length |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Core.CodeConfigEnum |
| | | { |
| | | /// <summary> |
| | | /// ç¼ç æ ¼å¼ç±»å |
| | | /// </summary> |
| | | public enum CodeFormatTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// èµ·å§å符串 |
| | | /// </summary> |
| | | [Description("èµ·å§å符串")] |
| | | ST, |
| | | |
| | | /// <summary> |
| | | /// 4使°å¹´ |
| | | /// </summary> |
| | | [Description("4使°å¹´")] |
| | | YYYY, |
| | | |
| | | /// <summary> |
| | | /// 2使°æ |
| | | /// </summary> |
| | | [Description("2使°æ")] |
| | | MM, |
| | | |
| | | /// <summary> |
| | | /// 2使°æ¥ |
| | | /// </summary> |
| | | [Description("2使°æ¥")] |
| | | DD, |
| | | |
| | | /// <summary> |
| | | /// æµæ°´å· |
| | | /// </summary> |
| | | [Description("æµæ°´å·")] |
| | | NUM, |
| | | |
| | | /// <summary> |
| | | /// ç»æå符串 |
| | | /// </summary> |
| | | [Description("ç»æå符串")] |
| | | ED |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Core.CodeConfigEnum |
| | | { |
| | | /// <summary> |
| | | /// ç¼ç è§åç¼å· |
| | | /// </summary> |
| | | public enum RuleCodeEnum |
| | | { |
| | | /// <summary> |
| | | /// å
¥åºåå·ç¼ç è§åç¼å· |
| | | /// </summary> |
| | | [Description("å
¥åºåå·ç¼ç è§åç¼å·")] |
| | | InboundOrderRule, |
| | | |
| | | /// <summary> |
| | | /// åºåºåå·ç¼ç è§åç¼å· |
| | | /// </summary> |
| | | [Description("åºåºåå·ç¼ç è§åç¼å·")] |
| | | OutboundOrderRule |
| | | } |
| | | } |
| | |
| | | SqlSugarClient sqlSugarClient = new SqlSugarClient(new ConnectionConfig |
| | | { |
| | | ConfigId = MainDb.CurrentDbConnId, |
| | | ConnectionString = AppSettings.app(MainDb.ConnectionString).DecryptDES(AppSecret.DB), |
| | | ConnectionString = AppSettings.Get(MainDb.ConnectionString).DecryptDES(AppSecret.DB), |
| | | IsAutoCloseConnection = true, |
| | | DbType = MainDb.DbType, |
| | | AopEvents = new AopEvents |
| | |
| | | List<MutiDBOperate> listdatabaseSlaveDB = new List<MutiDBOperate>(); |
| | | MutiDBOperate mainDb = new MutiDBOperate() |
| | | { |
| | | Connection = AppSettings.app(MainDb.ConnectionString).DecryptDES(AppSecret.DB), |
| | | Connection = AppSettings.Get(MainDb.ConnectionString).DecryptDES(AppSecret.DB), |
| | | ConnId = MainDb.CurrentDbConnId, |
| | | DbType = DataBaseType.SqlServer |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Core.Enums |
| | | { |
| | | public enum OperateTypeEnum |
| | | { |
| | | 人工å é¤ = 1, |
| | | èªå¨å é¤ = 2, |
| | | 人工æ¢å¤ = 3, |
| | | èªå¨æ¢å¤ = 4, |
| | | äººå·¥å®æ = 5, |
| | | èªå¨å®æ = 6, |
| | | } |
| | | } |
| | |
| | | |
| | | services.AddCors(c => |
| | | { |
| | | if (!AppSettings.app(new string[] { "Cors", "EnableAllIPs" }).ObjToBool()) |
| | | if (!AppSettings.Get(new string[] { "Cors", "EnableAllIPs" }).ObjToBool()) |
| | | { |
| | | c.AddPolicy(AppSettings.app(new string[] {"Cors", "PolicyName" }), |
| | | c.AddPolicy(AppSettings.Get(new string[] {"Cors", "PolicyName" }), |
| | | |
| | | policy => |
| | | { |
| | | policy |
| | | .WithOrigins(AppSettings.app(new string[] { "Cors", "IPs" }).Split(',')) |
| | | .WithOrigins(AppSettings.Get(new string[] { "Cors", "IPs" }).Split(',')) |
| | | .AllowAnyHeader()//Ensures that the policy allows any header. |
| | | .AllowAnyMethod(); |
| | | }); |
| | |
| | | else |
| | | { |
| | | //å
许任æè·¨åè¯·æ± |
| | | c.AddPolicy(AppSettings.app(new string[] { "Cors", "PolicyName" }), |
| | | c.AddPolicy(AppSettings.Get(new string[] { "Cors", "PolicyName" }), |
| | | policy => |
| | | { |
| | | policy |
| | |
| | | |
| | | var basePath = AppContext.BaseDirectory; |
| | | //var basePath2 = Microsoft.DotNet.PlatformAbstractions.ApplicationEnvironment.ApplicationBasePath; |
| | | var ApiName = AppSettings.app(new string[] { "ApiName" }); |
| | | var ApiName = AppSettings.Get(new string[] { "ApiName" }); |
| | | |
| | | services.AddSwaggerGen(c => |
| | | { |
| | |
| | | { |
| | | DateTime? expDate = context.HttpContext.User.Claims.Where(x => x.Type == JwtRegisteredClaimNames.Exp).Select(x => x.Value).FirstOrDefault()?.GetTimeSpmpToDate(); |
| | | //卿æ è¯å·æ°token(2021.05.01) |
| | | int ExpMinutes = AppSettings.app("ExpMinutes").ObjToInt(); |
| | | int ExpMinutes = AppSettings.Get("ExpMinutes").ObjToInt(); |
| | | if ((expDate.GetValueOrDefault() - DateTime.Now).TotalMinutes > ExpMinutes) |
| | | { |
| | | context.Unauthorized("ç»éå·²è¿æ"); |
| | |
| | | { |
| | | DateTime? expDate = context.HttpContext.User.Claims.Where(x => x.Type == JwtRegisteredClaimNames.Exp).Select(x => x.Value).FirstOrDefault()?.GetTimeSpmpToDate(); |
| | | //卿æ è¯å·æ°token(2021.05.01) |
| | | int ExpMinutes = AppSettings.app("ExpMinutes").ObjToInt(); |
| | | int ExpMinutes = AppSettings.Get("ExpMinutes").ObjToInt(); |
| | | if ((expDate.GetValueOrDefault() - DateTime.Now).TotalMinutes < ExpMinutes / 3 && context.HttpContext.Request.Path != replaceTokenPath) |
| | | { |
| | | context.HttpContext.Response.Headers.Add("widesea_exp", "1"); |
| | |
| | | /// </summary> |
| | | /// <param name="sections">èç¹é
ç½®</param> |
| | | /// <returns></returns> |
| | | public static string app(params string[] sections) |
| | | public static string Get(params string[] sections) |
| | | { |
| | | try |
| | | { |
| | |
| | | /// <typeparam name="T"></typeparam> |
| | | /// <param name="sections"></param> |
| | | /// <returns></returns> |
| | | public static List<T> app<T>(params string[] sections) |
| | | public static List<T> Get<T>(params string[] sections) |
| | | { |
| | | List<T> list = new List<T>(); |
| | | // å¼ç¨ Microsoft.Extensions.Configuration.Binder å
|
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | using WIDESEA_Core.CodeConfigEnum; |
| | | using WIDESEA_Core.DB; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Seed; |
| | |
| | | /// <param name="analysisCode">è§åç¼å·</param> |
| | | /// <param name="code">éè§£æçå符串</param> |
| | | /// <returns></returns> |
| | | public static T CodeAnalysis<T>(AnalysisCode analysisCode, string code) |
| | | public static T CodeAnalysis<T>(AnalysisCodeEnum analysisCode, string code) |
| | | { |
| | | Type type = typeof(T); |
| | | object? obj = Activator.CreateInstance(type); |
| | |
| | | if (items.Count == codes.Count) |
| | | { |
| | | PropertyInfo[] propertyInfos = type.GetProperties(); |
| | | if (AnalysisRule.Split == analysisRule.AnalysisRule) |
| | | if (AnalysisRuleEnum.Split == analysisRule.AnalysisRule) |
| | | { |
| | | for (int i = 0; i < propertyInfos.Length; i++) |
| | | { |
| | |
| | | /// <param name="analysisCode">è§åç¼å·</param> |
| | | /// <param name="codeList">éè§£æçå符串éå</param> |
| | | /// <returns></returns> |
| | | public static List<T> CodeAnalysis<T>(AnalysisCode analysisCode, List<string> codeList) |
| | | public static List<T> CodeAnalysis<T>(AnalysisCodeEnum analysisCode, List<string> codeList) |
| | | { |
| | | Type type = typeof(T); |
| | | List<T> list = new List<T>(); |
| | |
| | | if (items.Count == codes.Count) |
| | | { |
| | | PropertyInfo[] propertyInfos = type.GetProperties(); |
| | | if (AnalysisRule.Split == analysisRule.AnalysisRule) |
| | | if (AnalysisRuleEnum.Split == analysisRule.AnalysisRule) |
| | | { |
| | | for (int i = 0; i < propertyInfos.Length; i++) |
| | | { |
| | |
| | | AnalysisItemRuleAttribute? analysisItemRule = propertyInfo.GetCustomAttribute<AnalysisItemRuleAttribute>(); |
| | | if (analysisItemRule != null) |
| | | { |
| | | if(analysisItemRule.AnalysisFormaType == AnalysisFormatType.BD) |
| | | if(analysisItemRule.AnalysisFormaType == AnalysisFormatTypeEnum.BD) |
| | | { |
| | | propertyInfo.SetValue(result, code.ChangeType(propertyInfo.PropertyType)); |
| | | } |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static T Post<T>(string url, object parm, string rquestName = "") where T : class |
| | | { |
| | | HttpWebResponse response = null; |
| | | StreamReader resultReader = null; |
| | | string responseContent = string.Empty; |
| | | try |
| | | { |
| | | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); |
| | | request.Timeout = 10 * 1000; |
| | | request.Method = "POST"; |
| | | request.ContentType = "application/json; charset=UTF-8"; |
| | | parm = parm ?? ""; |
| | | byte[] data = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(parm)); |
| | | request.ContentLength = data.Length; |
| | | using (Stream newStream = request.GetRequestStream()) |
| | | { |
| | | newStream.Write(data, 0, data.Length); |
| | | }; |
| | | |
| | | response = (HttpWebResponse)request.GetResponse(); |
| | | Stream webStream = response.GetResponseStream(); |
| | | if (webStream == null) |
| | | { |
| | | throw new Exception("Network error"); |
| | | } |
| | | |
| | | int statsCode = (int)response.StatusCode; |
| | | resultReader = new StreamReader(webStream, Encoding.UTF8); |
| | | responseContent = resultReader.ReadToEnd(); |
| | | |
| | | if (response != null) |
| | | response.Close(); |
| | | if (resultReader != null) |
| | | resultReader.Close(); |
| | | |
| | | if (statsCode != 200) |
| | | { |
| | | throw new Exception("å¼å¸¸ï¼ååºç ï¼" + statsCode.ToString()); |
| | | } |
| | | |
| | | Logger.Write_Log("System/API请æ±", rquestName, "è¯·æ±æå", new { è¯·æ±æ¥æ = parm, æ¥æ¶æ¥æ = responseContent }); |
| | | return JsonConvert.DeserializeObject<T>(responseContent); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Write_Log("System/API请æ±", rquestName, "请æ±å¼å¸¸", new { è¯·æ±æ¥æ = parm, æ¥æ¶æ¥æ = responseContent, é误 = ex.Message }); |
| | | throw ex; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | public static string DecryptDES(this string decryptString, string decryptKey) |
| | | { |
| | | if (decryptKey == AppSecret.DB && !AppSettings.app(MainDb.ConnectionStringsEncryption).ObjToBool()) |
| | | if (decryptKey == AppSecret.DB && !AppSettings.Get(MainDb.ConnectionStringsEncryption).ObjToBool()) |
| | | return decryptString; |
| | | |
| | | byte[] rgbKey = Encoding.UTF8.GetBytes(decryptKey.Substring(0, 16)); |
| | |
| | | { |
| | | public class Logger |
| | | { |
| | | |
| | | public static void Debug(string message) |
| | | /// <summary> |
| | | /// åå
¥è°è¯æ¥å¿ |
| | | /// </summary> |
| | | /// <param name="fileName"></param> |
| | | /// <param name="msg"></param> |
| | | public void WriteDebug(string fileName, string msg) |
| | | { |
| | | |
| | | if (AppSettings.Get(new string[] { "LogDeubgEnable" }).ObjToBool()) |
| | | { |
| | | StringBuilder builder = new StringBuilder(msg); |
| | | builder.Append(Environment.NewLine); |
| | | builder.Append(Environment.NewLine); |
| | | WriteLogToFile($"Debug_{fileName}", builder.ToString()); |
| | | } |
| | | } |
| | | |
| | | public static void Debug(string message, Exception exception) |
| | | /// <summary> |
| | | /// åå
¥ä¿¡æ¯æ¥å¿ |
| | | /// </summary> |
| | | /// <param name="fileName"></param> |
| | | /// <param name="msg"></param> |
| | | public void WriteInfo(string fileName, string msg) |
| | | { |
| | | |
| | | StringBuilder builder = new StringBuilder(msg); |
| | | builder.Append(Environment.NewLine); |
| | | builder.Append(Environment.NewLine); |
| | | WriteLogToFile($"Info_{fileName}", builder.ToString()); |
| | | } |
| | | |
| | | public static void Info(string message) |
| | | /// <summary> |
| | | /// åå
¥é误æ¥å¿ |
| | | /// </summary> |
| | | /// <param name="fileName"></param> |
| | | /// <param name="msg"></param> |
| | | /// <param name="ex"></param> |
| | | public void WriteError(string fileName, string msg, Exception ex) |
| | | { |
| | | |
| | | StringBuilder builder = new StringBuilder(msg); |
| | | builder.Append(Environment.NewLine); |
| | | builder.Append("é误信æ¯ï¼"); |
| | | builder.Append(ex.Message); |
| | | builder.Append(Environment.NewLine); |
| | | builder.Append("é误æºï¼"); |
| | | builder.Append(ex.Source); |
| | | builder.Append(Environment.NewLine); |
| | | builder.Append("éè¯¯å æ ï¼"); |
| | | builder.Append(ex.StackTrace); |
| | | builder.Append(Environment.NewLine); |
| | | builder.Append("é误类åï¼"); |
| | | builder.Append(ex.GetType().ToString()); |
| | | builder.Append(Environment.NewLine); |
| | | builder.Append("éè¯¯æ¹æ³ï¼"); |
| | | builder.Append(ex.TargetSite?.ToString()); |
| | | builder.Append(Environment.NewLine); |
| | | builder.Append(Environment.NewLine); |
| | | WriteLogToFile($"Error_{fileName}", builder.ToString()); |
| | | } |
| | | |
| | | public static void Info(string message, Exception exception) |
| | | |
| | | ReaderWriterLockSlim LogWriteLock = new ReaderWriterLockSlim(); |
| | | string folderPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Log\\{DateTime.Now.ToString("yyyy-MM-dd")}"); |
| | | |
| | | private void WriteLogToFile(string fileName, string log) |
| | | { |
| | | |
| | | } |
| | | |
| | | public static void Warn(string message) |
| | | { |
| | | |
| | | } |
| | | |
| | | public static void Warning(string message, Exception exception) |
| | | { |
| | | |
| | | } |
| | | |
| | | public static void Error(string message) |
| | | { |
| | | |
| | | } |
| | | |
| | | public static void Error(string message, Exception exception) |
| | | { |
| | | |
| | | } |
| | | |
| | | public static void Fatal(string message) |
| | | { |
| | | |
| | | } |
| | | |
| | | public static void Fatal(string message, Exception exception) |
| | | { |
| | | |
| | | } |
| | | public static void Write_Log(string groupName, string logName, string content, object data = null) |
| | | { |
| | | DateTime nowTime = DateTime.Now; |
| | | string basePath = System.Environment.CurrentDirectory + "/Log/" + $"/{groupName}/{nowTime.ToString("yyyy-MM-dd")}"; |
| | | //妿æ¥å¿æä»¶ç®å½ä¸åå¨,åå建 |
| | | if (!Directory.Exists(basePath)) |
| | | { |
| | | Directory.CreateDirectory(basePath); |
| | | } |
| | | try |
| | | { |
| | | FileStream fs = new FileStream(basePath + "/" + logName + $"{nowTime.ToString("yyMMdd")}.txt", FileMode.Append); |
| | | StreamWriter strwriter = new StreamWriter(fs); |
| | | try |
| | | // è¿å
¥åé |
| | | LogWriteLock.EnterWriteLock(); |
| | | |
| | | // 妿æä»¶å¤¹ä¸åå¨ï¼åå建æä»¶å¤¹ |
| | | if (!Directory.Exists(folderPath)) |
| | | { |
| | | strwriter.WriteLine(nowTime.ToString() + "." + nowTime.Millisecond); |
| | | strwriter.WriteLine(content); |
| | | if (data != null) |
| | | { |
| | | strwriter.WriteLine(JsonConvert.SerializeObject(data)); |
| | | Directory.CreateDirectory(folderPath); |
| | | } |
| | | strwriter.WriteLine("-------------------------------"); |
| | | strwriter.WriteLine(); |
| | | strwriter.Flush(); |
| | | // è·åæ¥å¿æä»¶è·¯å¾ |
| | | string logFilePath = Path.Combine(folderPath, GetLastAccessFileName(fileName)); |
| | | // è·åå½åæ¶é´ |
| | | DateTime now = DateTime.Now; |
| | | // æé æ¥å¿å
容 |
| | | string logContent = $"ã{now}ã{Environment.NewLine}{log}"; |
| | | |
| | | // å°æ¥å¿å
容追å å°æ¥å¿æä»¶ä¸ |
| | | File.AppendAllText(logFilePath, logContent); |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | strwriter.Close(); |
| | | fs.Close(); |
| | | // éåºåé |
| | | LogWriteLock.ExitWriteLock(); |
| | | } |
| | | } |
| | | catch { } |
| | | } |
| | | |
| | | public static void WriteApiLog2DB(HttpContext context, string requestParameter, DateTime beginDate, string responseParameter, DateTime endDate, LoggerStatus loggerStatus) |
| | | int size = 10 * 1024 * 1024; |
| | | string ext = ".log"; |
| | | private string GetLogFilePath(string folderPath, string fileName) |
| | | { |
| | | try |
| | | { |
| | | if (context.Request.Method == "OPTIONS") return; |
| | | // è·åæå®æä»¶å¤¹ä¸çæææä»¶ |
| | | var allFiles = new DirectoryInfo(folderPath); |
| | | // è·åç¬¦åæ¡ä»¶çæä»¶ï¼ææä»¶åéåºæå |
| | | var selectFiles = allFiles.GetFiles().Where(fi => fi.Name.ToLower().Contains(fileName.ToLower()) && fi.Extension.ToLower() == ext.ToLower() && fi.Length < size).OrderByDescending(d => d.Name).ToList(); |
| | | |
| | | if (context == null) |
| | | FileInfo? file = selectFiles.FirstOrDefault(); |
| | | // 妿æç¬¦åæ¡ä»¶çæä»¶ï¼è¿å第ä¸ä¸ªæä»¶ç宿´è·¯å¾ |
| | | if (file != null) |
| | | { |
| | | Console.WriteLine($"æªè·åå°httpcontextä¿¡æ¯,reqParam:{requestParameter},respParam:{responseParameter},success:{loggerStatus}"); |
| | | return; |
| | | return file.FullName; |
| | | } |
| | | |
| | | Dictionary<string, object> dic = new Dictionary<string, object> |
| | | // å¦ææ²¡æç¬¦åæ¡ä»¶çæä»¶ï¼è¿åä¸ä¸ªæ°çæä»¶è·¯å¾ï¼æä»¶å为åæä»¶åå ä¸å½åæ¶é´ |
| | | return Path.Combine(folderPath, $@"{fileName}_{DateTime.Now.ToString("HH-mm-ss")}.log"); |
| | | } |
| | | |
| | | private string GetLastAccessFileName(string fileName) |
| | | { |
| | | {"BeginDate",beginDate }, |
| | | {"ElapsedTime",(endDate - beginDate).TotalMilliseconds.DoubleToInt() }, |
| | | {"EndDate",endDate }, |
| | | {"RequestParam",requestParameter }, |
| | | {"ResponseParam",responseParameter }, |
| | | {"Success",1 }, |
| | | {"Url",context.Request.Path.Value??"" }, |
| | | {"UserIP",context.GetUserIp() }, |
| | | {"UserName","App.User?.Name" }, |
| | | {"User_Id","0" } |
| | | |
| | | //{"BeginDate",beginDate }, |
| | | //{"ElapsedTime",(endDate - beginDate).TotalMilliseconds.ObjToInt() }, |
| | | //{"EndDate",endDate }, |
| | | //{"RequestParam",requestParameter }, |
| | | //{"ResponseParam",responseParameter }, |
| | | //{"Success",1 }, |
| | | //{"Url",context.Request.Path.Value??"" }, |
| | | //{"UserIP",context.GetUserIp() }, |
| | | //{"UserName","App.User?.Name" }, |
| | | //{"User_Id","App.User?.ID" } |
| | | }; |
| | | |
| | | |
| | | SqlSugarClient sqlSugarClient = DBContext.GetCustomDB(DBContext.GetConnectionConfig()); |
| | | sqlSugarClient.Insertable(dic).AS("Sys_Log").ExecuteCommand(); |
| | | } |
| | | catch (Exception ex) |
| | | foreach (var m in GetExistLogFileNames(fileName)) |
| | | { |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | public enum LoggerStatus |
| | | FileInfo fileInfo = new FileInfo(m); |
| | | if (fileInfo.Length < size) |
| | | { |
| | | Success = 1, |
| | | Error = 2, |
| | | Info = 3 |
| | | return m; |
| | | } |
| | | } |
| | | |
| | | // è¿åä¸ä¸ªæ°çé»è®¤å½åæ¶é´çæ¥å¿åç§° |
| | | return $@"{fileName}_{DateTime.Now.ToString("HH-mm-ss")}.log"; |
| | | } |
| | | |
| | | private string[] GetExistLogFileNames(string fileName) |
| | | { |
| | | string[] fileNames = Directory.GetFiles(folderPath, fileName + "*.log"); |
| | | return fileNames; |
| | | } |
| | | } |
| | | } |
| | |
| | | app.UseSwaggerUI(c => |
| | | { |
| | | //æ ¹æ®çæ¬åç§°ååº éåå±ç¤º |
| | | var apiName = AppSettings.app(new string[] { "ApiName" }); |
| | | var apiName = AppSettings.Get(new string[] { "ApiName" }); |
| | | typeof(ApiVersions).GetEnumNames().OrderByDescending(e => e).ToList().ForEach(version => |
| | | { |
| | | c.SwaggerEndpoint($"/swagger/{version}/swagger.json", $"{apiName} {version}"); |
| | |
| | | { |
| | | MutiDBOperate mainDb = new MutiDBOperate() |
| | | { |
| | | Connection = AppSettings.app(MainDb.ConnectionString).DecryptDES(AppSecret.DB), |
| | | Connection = AppSettings.Get(MainDb.ConnectionString).DecryptDES(AppSecret.DB), |
| | | ConnId = MainDb.CurrentDbConnId, |
| | | DbType = DataBaseType.SqlServer |
| | | }; |
| | |
| | | /// <summary> |
| | | /// è¡ |
| | | /// </summary> |
| | | [PropertyValidate("è¡", MinValue = 0, IsContainMinValue = false)] |
| | | [PropertyValidate("è¡", MinValue = 1, IsContainMinValue = false)] |
| | | public int MaxRow { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å |
| | | /// </summary> |
| | | [PropertyValidate("å", MinValue = 0, IsContainMinValue = false)] |
| | | [PropertyValidate("å", MinValue = 1, IsContainMinValue = false)] |
| | | public int MaxColumn { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å± |
| | | /// </summary> |
| | | [PropertyValidate("å±", MinValue = 0, IsContainMinValue = false)] |
| | | [PropertyValidate("å±", MinValue = 1, IsContainMinValue = false)] |
| | | public int MaxLayer { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦åæ·±è´§ä½ |
| | | /// </summary> |
| | | [PropertyValidate("æ¯å¦å深货ä½", NotNullAndEmpty = true)] |
| | | public bool IsSingleDepth { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 䏿·±è¡å· |
| | | /// </summary> |
| | | [PropertyValidate("䏿·±è¡å·", NotNullAndEmptyWithPropertyAndValue = new string[] { nameof(IsSingleDepth), "false" })] |
| | | public List<int> FirstDepthRows { get; set; } |
| | | [PropertyValidate("深度", MinValue = 1, NotNullAndEmpty = true)] |
| | | public int Depth { get; set; } |
| | | } |
| | | } |
| | |
| | | [AnalysisRule, ModelValidate] |
| | | public class MatSerialNumberDTO |
| | | { |
| | | [AnalysisItemRule(WIDESEA_Core.Enums.AnalysisFormatType.MTC), PropertyValidate("ç©æç¼å·", NotNullAndEmpty = true)] |
| | | [AnalysisItemRule(WIDESEA_Core.CodeConfigEnum.AnalysisFormatTypeEnum.MTC), PropertyValidate("ç©æç¼å·", NotNullAndEmpty = true)] |
| | | public string MaterielCode { get; set; } |
| | | |
| | | [AnalysisItemRule(WIDESEA_Core.Enums.AnalysisFormatType.MTPT), PropertyValidate("çäº§æ¥æ", NotNullAndEmpty = true)] |
| | | [AnalysisItemRule(WIDESEA_Core.CodeConfigEnum.AnalysisFormatTypeEnum.MTPT), PropertyValidate("çäº§æ¥æ", NotNullAndEmpty = true)] |
| | | public string ProductionDate { get; set; } |
| | | |
| | | [AnalysisItemRule(WIDESEA_Core.Enums.AnalysisFormatType.BHN), PropertyValidate("æ¹æ¬¡å·", NotNullAndEmpty = true)] |
| | | [AnalysisItemRule(WIDESEA_Core.CodeConfigEnum.AnalysisFormatTypeEnum.BHN), PropertyValidate("æ¹æ¬¡å·", NotNullAndEmpty = true)] |
| | | public string BatchNo { get; set; } |
| | | |
| | | [AnalysisItemRule(WIDESEA_Core.Enums.AnalysisFormatType.MTQ), PropertyValidate("æ°é", NotNullAndEmpty = true)] |
| | | [AnalysisItemRule(WIDESEA_Core.CodeConfigEnum.AnalysisFormatTypeEnum.MTQ), PropertyValidate("æ°é", NotNullAndEmpty = true)] |
| | | public decimal MaterielQuantity { get; set; } |
| | | |
| | | [AnalysisItemRule(WIDESEA_Core.Enums.AnalysisFormatType.ODN), PropertyValidate("订åç¼å·", NotNullAndEmpty = true)] |
| | | [AnalysisItemRule(WIDESEA_Core.CodeConfigEnum.AnalysisFormatTypeEnum.ODN), PropertyValidate("订åç¼å·", NotNullAndEmpty = true)] |
| | | public string OrderNo { get; set; } |
| | | |
| | | [AnalysisItemRule(WIDESEA_Core.Enums.AnalysisFormatType.BD), PropertyValidate("åºåå·", NotNullAndEmpty = true)] |
| | | [AnalysisItemRule(WIDESEA_Core.CodeConfigEnum.AnalysisFormatTypeEnum.BD), PropertyValidate("åºåå·", NotNullAndEmpty = true)] |
| | | public string SerialNumber { get; set; } |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_DTO.Basic; |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_DTO.Basic; |
| | |
| | | { |
| | | ILocationInfoRepository Repository { get; } |
| | | |
| | | WebResponseContent InitializationLocation(InitializationLocationDTO initializationLocationDTO); |
| | | |
| | | Dt_LocationInfo? AssignLocation(string roadwayNo, PalletTypeEnum palletType); |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_IOutboundRepository; |
| | |
| | | |
| | | List<Dt_OutStockLockInfo> GetByOrderDetailId(int orderDetailId); |
| | | |
| | | List<Dt_OutStockLockInfo> GetByOrderDetailId(int orderDetailId, OutStockStatus outStockStatus); |
| | | List<Dt_OutStockLockInfo> GetByOrderDetailId(int orderDetailId, OutLockStockStatusEnum outStockStatus); |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_IRecordRepository; |
| | |
| | | { |
| | | IStockQuantityChangeRecordRepository Repository { get; } |
| | | |
| | | void AddStockChangeRecord(Dt_StockInfo stockInfo, List<Dt_StockInfoDetail> stockInfoDetails, decimal beforeQuantity, decimal totalQuantity, StockChangeType changeType,int taskNum); |
| | | void AddStockChangeRecord(Dt_StockInfo stockInfo, List<Dt_StockInfoDetail> stockInfoDetails, decimal beforeQuantity, decimal totalQuantity, StockChangeTypeEnum changeType,int taskNum); |
| | | } |
| | | } |
| | |
| | | using System.Reflection.Metadata; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | |
| | | #endregion |
| | | |
| | | Dt_InboundOrder inboundOrder = _mapper.Map<Dt_InboundOrder>(orderAddDTO); |
| | | inboundOrder.OrderStatus = InboundStatusEnum.æªå¼å§.ObjToInt(); |
| | | inboundOrder.OrderStatus = InOrderStatusEnum.æªå¼å§.ObjToInt(); |
| | | bool a = BaseDal.Db.InsertNav(inboundOrder).Include(x => x.Details).ExecuteCommand(); |
| | | content = WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | { |
| | | expressionOrder = x => x.OrderNo.Contains(inboundOrderGetDTO.OrderNo); |
| | | } |
| | | int count = BaseDal.QueryData(x => x.OrderStatus == InboundStatusEnum.æªå¼å§.ObjToInt()).ToList().Count(); |
| | | int count = BaseDal.QueryData(x => x.OrderStatus == InOrderStatusEnum.æªå¼å§.ObjToInt()).ToList().Count(); |
| | | int maxPage = Convert.ToInt32(Math.Ceiling(count / 10.0)); |
| | | if (inboundOrderGetDTO.pageNo <= maxPage) |
| | | { |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | using WIDESEA_Core.CodeConfigEnum; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | [CodeRule(WIDESEA_Core.Enums.RuleCode.InboundOrderRule)] |
| | | [CodeRule(RuleCodeEnum.InboundOrderRule)] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "åæ®ç¼å·")] |
| | | public string OrderNo { get; set; } |
| | | |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | using WIDESEA_Core.CodeConfigEnum; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | [CodeRule(WIDESEA_Core.Enums.RuleCode.InboundOrderRule)] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "åæ®ç¼å·")] |
| | | public string OrderNo { get; set; } |
| | | |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | using WIDESEA_Core.CodeConfigEnum; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | [CodeRule(WIDESEA_Core.Enums.RuleCode.OutboundOrderRule)] |
| | | [CodeRule(RuleCodeEnum.OutboundOrderRule)] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "åæ®ç¼å·", IsOnlyIgnoreUpdate = true)] |
| | | public string OrderNo { get; set; } |
| | | |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | using WIDESEA_Core.CodeConfigEnum; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | [CodeRule(WIDESEA_Core.Enums.RuleCode.OutboundOrderRule)] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "åæ®ç¼å·", IsOnlyIgnoreUpdate = true)] |
| | | public string OrderNo { get; set; } |
| | | |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.OtherEnum; |
| | | using WIDESEA_Core.Attributes; |
| | | using WIDESEA_Core.DB.Models; |
| | | using WIDESEA_Core.Enums; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.OtherEnum; |
| | | using WIDESEA_Core.Attributes; |
| | | using WIDESEA_Core.Enums; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | |
| | | OrderNo = outboundOrder.OrderNo, |
| | | OrderType = outboundOrder.OrderType, |
| | | OriginalQuantity = item.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).Sum(x => x.StockQuantity), |
| | | Status = taskNum == null ? OutStockStatus.å·²åé
.ObjToInt() : OutStockStatus.åºåºä¸.ObjToInt(), |
| | | Status = taskNum == null ? OutLockStockStatusEnum.å·²åé
.ObjToInt() : OutLockStockStatusEnum.åºåºä¸.ObjToInt(), |
| | | StockId = item.Id, |
| | | TaskNum = taskNum |
| | | }; |
| | |
| | | return BaseDal.QueryData(x => x.OrderDetailId == orderDetailId); |
| | | } |
| | | |
| | | public List<Dt_OutStockLockInfo> GetByOrderDetailId(int orderDetailId, OutStockStatus outStockStatus) |
| | | public List<Dt_OutStockLockInfo> GetByOrderDetailId(int orderDetailId, OutLockStockStatusEnum outStockStatus) |
| | | { |
| | | return BaseDal.QueryData(x => x.OrderDetailId == orderDetailId && x.Status == outStockStatus.ObjToInt()); |
| | | } |
| | |
| | | using System.Linq.Expressions; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | |
| | | #endregion |
| | | |
| | | Dt_OutboundOrder outboundOrder = _mapper.Map<Dt_OutboundOrder>(orderAddDTO); |
| | | outboundOrder.OrderStatus = InboundStatusEnum.æªå¼å§.ObjToInt(); |
| | | outboundOrder.OrderStatus = OutOrderStatusEnum.æªå¼å§.ObjToInt(); |
| | | bool a = BaseDal.Db.InsertNav(outboundOrder).Include(x => x.Details).ExecuteCommand(); |
| | | content = WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | { |
| | | expressionOrder = x => x.OrderNo.Contains(outboundOrderGetDTO.OrderNo); |
| | | } |
| | | int count = BaseDal.QueryData(x => x.OrderStatus == OutboundStatusEnum.æªå¼å§.ObjToInt()).ToList().Count(); |
| | | int count = BaseDal.QueryData(x => x.OrderStatus == OutOrderStatusEnum.æªå¼å§.ObjToInt()).ToList().Count(); |
| | | int maxPage = Convert.ToInt32(Math.Ceiling(count / 10.0)); |
| | | if (outboundOrderGetDTO.pageNo <= maxPage) |
| | | { |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | |
| | | { |
| | | public partial class StockQuantityChangeRecordService : ServiceBase<Dt_StockQuantityChangeRecord, IStockQuantityChangeRecordRepository>, IStockQuantityChangeRecordService |
| | | { |
| | | public void AddStockChangeRecord(Dt_StockInfo stockInfo, List<Dt_StockInfoDetail> stockInfoDetails, decimal beforeQuantity, decimal totalQuantity, StockChangeType changeType,int taskNum) |
| | | public void AddStockChangeRecord(Dt_StockInfo stockInfo, List<Dt_StockInfoDetail> stockInfoDetails, decimal beforeQuantity, decimal totalQuantity, StockChangeTypeEnum changeType,int taskNum) |
| | | { |
| | | try |
| | | { |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_DTO.Stock; |
| | |
| | | |
| | | ISugarQueryable<Dt_StockInfo> sugarQueryable1 = _dbBase.Queryable<Dt_StockInfo>(); |
| | | ISugarQueryable<Dt_LocationInfo> sugarQueryable = _dbBase.Queryable<Dt_LocationInfo>(); |
| | | ISugarQueryable<Dt_StockInfoDetail> sugarQueryable2 = _dbBase.Queryable<Dt_StockInfoDetail>(); |
| | | |
| | | |
| | | List<StockViewDTO> list = sugarQueryable1.InnerJoin(sugarQueryable, (b, a) => a.LocationCode == b.LocationCode).WhereIF(!string.IsNullOrEmpty(where), where).Select((b, a) => new StockViewDTO |
| | | { |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | |
| | | |
| | | } |
| | | stockInfo.Details = details; |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, StockChangeType.MaterielGroup,0); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, StockChangeTypeEnum.MaterielGroup,0); |
| | | } |
| | | |
| | | |
| | |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Common.TaskEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | |
| | | case "inboundState": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | Type type = typeof(InboundStatusEnum); |
| | | List<int> enums = Enum.GetValues(typeof(InboundStatusEnum)).Cast<int>().ToList(); |
| | | Type type = typeof(InOrderStatusEnum); |
| | | List<int> enums = Enum.GetValues(typeof(InOrderStatusEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(InboundStatusEnum).GetField(((InboundStatusEnum)item).ToString()); |
| | | FieldInfo? fieldInfo = typeof(InOrderStatusEnum).GetField(((InOrderStatusEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | |
| | | case "outboundStatusEnum": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | Type type = typeof(OutboundStatusEnum); |
| | | List<int> enums = Enum.GetValues(typeof(OutboundStatusEnum)).Cast<int>().ToList(); |
| | | Type type = typeof(OutOrderStatusEnum); |
| | | List<int> enums = Enum.GetValues(typeof(OutOrderStatusEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(OutboundStatusEnum).GetField(((OutboundStatusEnum)item).ToString()); |
| | | FieldInfo? fieldInfo = typeof(OutOrderStatusEnum).GetField(((OutOrderStatusEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | |
| | | List<object> data = new List<object>(); |
| | | |
| | | { |
| | | Type type = typeof(CreateType); |
| | | List<int> enums = Enum.GetValues(typeof(CreateType)).Cast<int>().ToList(); |
| | | Type type = typeof(OrderCreateTypeEnum); |
| | | List<int> enums = Enum.GetValues(typeof(OrderCreateTypeEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(CreateType).GetField(((CreateType)item).ToString()); |
| | | FieldInfo? fieldInfo = typeof(OrderCreateTypeEnum).GetField(((OrderCreateTypeEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | |
| | | index++; |
| | | } |
| | | } |
| | | |
| | | { |
| | | Type type = typeof(AGVTaskStatusEnum); |
| | | List<int> enums = Enum.GetValues(typeof(AGVTaskStatusEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(AGVTaskStatusEnum).GetField(((AGVTaskStatusEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | |
| | | case "stockChangeType": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | Type type = typeof(StockChangeType); |
| | | List<int> enums = Enum.GetValues(typeof(StockChangeType)).Cast<int>().ToList(); |
| | | Type type = typeof(StockChangeTypeEnum); |
| | | List<int> enums = Enum.GetValues(typeof(StockChangeTypeEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(StockChangeType).GetField(((StockChangeType)item).ToString()); |
| | | FieldInfo? fieldInfo = typeof(StockChangeTypeEnum).GetField(((StockChangeTypeEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | |
| | | case "outStockStatus": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | Type type = typeof(OutStockStatus); |
| | | List<int> enums = Enum.GetValues(typeof(OutStockStatus)).Cast<int>().ToList(); |
| | | Type type = typeof(OutLockStockStatusEnum); |
| | | List<int> enums = Enum.GetValues(typeof(OutLockStockStatusEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(OutStockStatus).GetField(((OutStockStatus)item).ToString()); |
| | | FieldInfo? fieldInfo = typeof(OutLockStockStatusEnum).GetField(((OutLockStockStatusEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System.Collections.Generic; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_Core.Enums; |
| | |
| | | { |
| | | _repository = repository; |
| | | } |
| | | |
| | | [HttpPost, Route("InitializationLocation"), AllowAnonymous] |
| | | public WebResponseContent InitializationLocation([FromBody] InitializationLocationDTO initializationLocationDTO) |
| | | { |
| | | return Service.InitializationLocation(initializationLocationDTO); |
| | | } |
| | | |
| | | [HttpPost, HttpGet, Route("AssignLocation"), AllowAnonymous] |
| | | public Dt_LocationInfo? AssignLocation(string roadwayNo, PalletTypeEnum palletType) |
| | | { |
| | | return Service.AssignLocation(roadwayNo, palletType); |
| | | } |
| | | } |
| | | } |
| | |
| | | //todo |
| | | //app.UseRecordAccessLogsMiddle(); |
| | | |
| | | app.UseCors(AppSettings.app(new string[] { "Cors", "PolicyName" })); |
| | | app.UseCors(AppSettings.Get(new string[] { "Cors", "PolicyName" })); |
| | | |
| | | DefaultFilesOptions defaultFilesOptions = new DefaultFilesOptions(); |
| | | defaultFilesOptions.DefaultFileNames.Clear(); |
| | |
| | | "MainDB": "DB_WIDESEA", //å½å项ç®ç主åºï¼æå¯¹åºçè¿æ¥å符串çEnabledå¿
须为true |
| | | //è¿æ¥å符串 |
| | | //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=", |
| | | "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_HUAIAN;User ID=sa;Password=sa123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_HUAIAN;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //è·¨å |
| | | "Cors": { |
| | | "PolicyName": "CorsIpAccess", //çç¥åç§° |