| | |
| | | using Autofac.Core; |
| | | using Microsoft.IdentityModel.Tokens; |
| | | using Newtonsoft.Json; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; |
| | | using SqlSugar; |
| | | using System; |
| | |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_DTO.ERP; |
| | | using WIDESEA_DTO.MES; |
| | | using WIDESEA_DTO.Task; |
| | | using WIDESEA_External.Model; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_TaskInfoRepository; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | |
| | | { |
| | | return content.Error($"该ç«ç¹å·²ææªæ§è¡çä»»å¡"); |
| | | } |
| | | if (stockInfo.StockStatus != StockStatusEmun.æå¨ç»çæå.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.ç»çæå.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.èåéåº.ObjToInt()) |
| | | if (stockInfo.StockStatus != StockStatusEmun.æå¨ç»çæå.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.ç»çæå.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.èåéåº.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.åæéç»çæå.ObjToInt()) |
| | | { |
| | | return content.Error($"该æçç¶æä¸æ£ç¡®,ä¸å¯ç³è¯·å
¥åº"); |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="palletCode">RFIDä¿¡æ¯</param> |
| | | /// <returns></returns> |
| | | public WebResponseContent YLPurchaseBoxing(string palletCode) |
| | | public WebResponseContent YLPurchaseBoxing(string palletCode, decimal weight = 0, decimal thickness = 0, decimal wide = 0) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | |
| | | Dt_StockInfo stockInfoOld = _stockRepository.StockInfoRepository.QueryFirst(x => x.RfidCode == palletCode); |
| | | if (stockInfoOld != null && stockInfoOld.StockStatus == StockStatusEmun.æå¨ç»çæå.ObjToInt()) |
| | | { |
| | | UpdateStock(stockInfoOld, weight, thickness, wide); |
| | | return content.OK($"临æ¶å
¥åº{stockInfoOld.RfidCode}"); |
| | | } |
| | | else if (stockInfoOld != null && stockInfoOld.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt() && stockInfoOld.StockStatus == StockStatusEmun.èåéåº.ObjToInt()) |
| | | { |
| | | UpdateStock(stockInfoOld, weight, thickness, wide); |
| | | return content.OK($"èåéåº{stockInfoOld.RfidCode}"); |
| | | } |
| | | else if (stockInfoOld != null) |
| | |
| | | if (yLInboundCache.BindStatus == WhetherEnum.True.ObjToInt()) |
| | | { |
| | | return content.Error($"åæç¼åæ¡ç {yLInboundCache.BarCode}å·²ç»å®RFID{yLInboundCache.RfidCode}"); |
| | | } |
| | | else |
| | | { |
| | | Dt_StockInfo ExistStockInfo = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == yLInboundCache.BarCode); |
| | | if (ExistStockInfo != null && ExistStockInfo.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt() && ExistStockInfo.StockStatus == StockStatusEmun.åæéç»çæå.ObjToInt()) |
| | | { |
| | | yLInboundCache.RfidCode = palletCode; |
| | | yLInboundCache.BindStatus = WhetherEnum.True.ObjToInt(); |
| | | ExistStockInfo.RfidCode = palletCode; |
| | | _unitOfWorkManage.BeginTran(); |
| | | //æ´æ°ç»çä¿¡æ¯ |
| | | UpdateStock(ExistStockInfo, weight, thickness, wide); |
| | | _inboundRepository.YLInboundCacheRepository.UpdateData(yLInboundCache); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK($"åæéåºå转å{ExistStockInfo.RfidCode}"); |
| | | } |
| | | else |
| | | { |
| | |
| | | MaterielThickness = purchaseBSTOrderDetail.MaterialThick, |
| | | MaterielWide = purchaseBSTOrderDetail.MaterialWide, |
| | | MaterielWeight = purchaseBSTOrderDetail.DeliveryQty, |
| | | CheckWeight=weight, |
| | | CheckThickness=thickness, |
| | | CheckWide=wide, |
| | | MaterielCode = materielInfo.MaterielCode, |
| | | MaterielName = materielInfo.MaterielName, |
| | | StockLength = purchaseBSTOrderDetail.ProcurementLength, |
| | |
| | | _purchaseBSTOrderDetailRepository.UpdateData(purchaseBSTOrderDetail); |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | | } |
| | | #endregion |
| | | content.OK("ç»å®æå"); |
| | | } |
| | |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | public void UpdateStock(Dt_StockInfo stockInfo, decimal weight = 0, decimal thickness = 0, decimal wide = 0) |
| | | { |
| | | stockInfo.CheckWeight = weight; |
| | | stockInfo.CheckThickness = thickness; |
| | | stockInfo.CheckWide = wide; |
| | | _stockRepository.StockInfoRepository.UpdateData(stockInfo); |
| | | } |
| | | /// <summary> |
| | | /// åæéè´ç»å®RFID |
| | | /// </summary> |
| | |
| | | Dt_PurchaseBSTOrderDetail purchaseBSTOrderDetail = _purchaseBSTOrderDetailRepository.QueryFirst(x => x.Barcode == palletCode); |
| | | if (purchaseBSTOrderDetail == null) |
| | | { |
| | | return content.Error($"æªæ¾å°æ¡ç {palletCode}éè´ä¿¡æ¯"); |
| | | BSTResponse<BSTStockInfoDTO> bSTResponse = _invokeERPService.BSTStockAsync(palletCode).DeserializeObject<BSTResponse<BSTStockInfoDTO>>(); |
| | | if (bSTResponse.Code == 500) |
| | | { |
| | | return content.Error($"æªæ¾å°æ¡ç {palletCode}éè´ä¿¡æ¯å¹¶ä¸æERPåºåä¹ä¸åå¨"); |
| | | } |
| | | BSTStockInfoDTO bSTStockInfoDTO=bSTResponse.Data; |
| | | if (bSTStockInfoDTO==null) |
| | | { |
| | | return content.Error($"䏿ERPæªè¿å{palletCode}çåºåä¿¡æ¯"); |
| | | } |
| | | Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterialSourceId == bSTStockInfoDTO.MaterialId); |
| | | if (materielInfo==null) |
| | | { |
| | | return content.Error($"æªæ¾å°æ¡ç {palletCode}ç©æä¿¡æ¯{bSTStockInfoDTO.MaterialNo}"); |
| | | } |
| | | //çæåºåç»çä¿¡æ¯ |
| | | Dt_StockInfo stockInfo = new Dt_StockInfo() |
| | | { |
| | | MaterielInvOrgId = materielInfo.MaterielInvOrgId, |
| | | PalletCode = palletCode, |
| | | RfidCode = "", |
| | | LocationCode = "", |
| | | PalletType = 1, |
| | | WarehouseId = materielInfo.WarehouseId, |
| | | StockAttribute = materielInfo.MaterielSourceType, |
| | | StockStatus = StockStatusEmun.åæéç»çæå.ObjToInt(), |
| | | MaterielSpec = materielInfo.MaterielSpec, |
| | | Unit = materielInfo.MaterielUnit, |
| | | MaterielThickness = bSTStockInfoDTO.Thick, |
| | | MaterielWide = bSTStockInfoDTO.W, |
| | | MaterielWeight = bSTStockInfoDTO.Qty, |
| | | MaterielCode = materielInfo.MaterielCode, |
| | | MaterielName = materielInfo.MaterielName, |
| | | StockLength = bSTStockInfoDTO.StockMeter, |
| | | MaterielId = materielInfo.MaterialSourceId |
| | | }; |
| | | if (bSTStockInfoDTO.W > 1200) |
| | | { |
| | | stockInfo.PalletType = 2; |
| | | } |
| | | Dt_YLInboundCache? yLInboundCache = _inboundRepository.YLInboundCacheRepository.QueryData(x => x.InvOrg == MaterielInvOrgEnum.èå.ToString()).FirstOrDefault(); |
| | | if (yLInboundCache == null) |
| | | { |
| | | return content.Error("æªæ¾å°åææ¡ç ç¼åä¿¡æ¯"); |
| | | } |
| | | int Id = yLInboundCache.Id; |
| | | if (yLInboundCache.BarCode == palletCode) |
| | | { |
| | | return content.Error($"æ¡ç {palletCode}å·²æ«ç "); |
| | | } |
| | | else if (yLInboundCache.BarCode != palletCode && yLInboundCache.BindStatus == WhetherEnum.True.ObjToInt()) |
| | | { |
| | | yLInboundCache = _mapper.Map<Dt_YLInboundCache>(stockInfo); |
| | | yLInboundCache.Id = Id; |
| | | _unitOfWorkManage.BeginTran(); |
| | | //æ°å¢ç»çä¿¡æ¯ |
| | | _stockRepository.StockInfoRepository.AddData(stockInfo); |
| | | _inboundRepository.YLInboundCacheRepository.UpdateData(yLInboundCache); |
| | | WebResponseContent webResponse = YLPurchasePush(); |
| | | if (!webResponse.Status) |
| | | { |
| | | throw new Exception(webResponse.Message); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK("æå", yLInboundCache); |
| | | } |
| | | else |
| | | { |
| | | return content.Error($"ä¸å·æ¡ç {yLInboundCache.BarCode}è¿æªè¿è¡ç»å®"); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | if (purchaseBSTOrderDetail.PurchaseBSTOrderDetailStatus != InOrderStatusEnum.æªå¼å§.ObjToInt()) |
| | | { |
| | | return content.Error($"æ¡ç {palletCode}éè´ä¿¡æ¯å·²å
¥åºæå
¥åºä¸"); |
| | |
| | | { |
| | | yLInboundCache = _mapper.Map<Dt_YLInboundCache>(purchaseBSTOrderDetail); |
| | | yLInboundCache.Id = Id; |
| | | _unitOfWorkManage.BeginTran(); |
| | | _inboundRepository.YLInboundCacheRepository.UpdateData(yLInboundCache); |
| | | WebResponseContent webResponse = YLPurchasePush(); |
| | | if (!webResponse.Status) |
| | | { |
| | | throw new Exception(webResponse.Message); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK("æå", yLInboundCache); |
| | | } |
| | | else |
| | | { |
| | | return content.Error($"ä¸å·æ¡ç {yLInboundCache.BarCode}è¿æªè¿è¡ç»å®"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | |
| | | } |
| | | /// <summary> |
| | | /// æ¨éè³WCSåæçº¿ä½å¯å¨ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent YLPurchasePush() |
| | | { |
| | | try |
| | | { |
| | | string url = AppSettings.Get("WCS"); |
| | | if (string.IsNullOrEmpty(url)) |
| | | { |
| | | throw new Exception($"æªæ¾å°WCSAApiå°å,è¯·æ£æ¥é
ç½®æä»¶"); |
| | | } |
| | | string response = HttpHelper.Post($"{url}/api/Task/YLPurchasePush?code=406"); |
| | | |
| | | return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("è¿åé误"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// åæåé
å··é |
| | |
| | | } |
| | | stockInfo.LocationCode = locationInfoEnd.LocationCode; |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | | if (task.TaskType!=TaskTypeEnum.Inbound.ObjToInt()) |
| | | { |
| | | stockInfo.IsFull = WhetherEnum.True.ObjToInt(); |
| | | } |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfoEnd, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | |
| | | Rfid = stockInfo.RfidCode, |
| | | RfidUpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") |
| | | }; |
| | | BSTResponse bSTResponse = _invokeERPService.BSTPurchaseUp(bSTPurchaseUpModel).DeserializeObject<BSTResponse>(); |
| | | BSTResponse<object> bSTResponse = _invokeERPService.BSTPurchaseUp(bSTPurchaseUpModel).DeserializeObject<BSTResponse<object>>(); |
| | | if (bSTResponse.Code == 500) |
| | | { |
| | | throw new Exception($"BST䏿ERP忥å
¥åºä¿¡æ¯å¤±è´¥,é误信æ¯ï¼{bSTResponse.Msg}"); |
| | | } |
| | | content.Message = bSTResponse.Msg; |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | if (matCount<1 || oneCount < 1) |
| | | { |
| | | return content.Error("ç©ææ»æ°æå个æ°éä¸è½å°äº1"); |
| | | } |
| | | //string palletCode = @"^C\d{5}$"; // æ£åè¡¨è¾¾å¼ |
| | | //bool isValid = Regex.IsMatch(barCode, palletCode); |
| | | //if (!isValid) |
| | |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// æå/åæåä¿¡æ¯åæ¥æ¥å£ |
| | | /// </summary> |
| | | public WebResponseContent ReceiveProCodeInfo(List<MESProInDTO> proInDTOs) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | if (proInDTOs == null || proInDTOs.Count <= 0) |
| | | { |
| | | return content.Error("ä¼ å
¥ä¿¡æ¯ä¸ºç©º"); |
| | | } |
| | | //è·åæææåï¼åæåä¿¡æ¯ |
| | | List<Dt_MESProInOrderInfo> proInOrderInfos = _inboundRepository.MESProInOrderInfoRepository.QueryData(); |
| | | //è·åææç©æä¿¡æ¯ |
| | | List<Dt_MaterielInfo> materielInfos = _basicRepository.MaterielInfoRepository.QueryData(x => x.MaterielInvOrgId == MaterielInvOrgEnum.æ°å.ObjToInt()); |
| | | |
| | | MESProInDTO? CheckMaterialCode = proInDTOs.FirstOrDefault(x => !materielInfos.Select(x => x.MaterielCode).Contains(x.MaterialCode)); |
| | | if (CheckMaterialCode != null) |
| | | { |
| | | return content.Error($"ç©æç¼ç {nameof(MESProInDTO.MaterialCode)}:{CheckMaterialCode.MaterialCode}ä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | //è·åææAGVç¹ä½ |
| | | List<Dt_AGVStationInfo> aGVStationInfos = _agvStationInfoRepository.QueryData(x => !string.IsNullOrEmpty(x.MESPointCode)); |
| | | |
| | | //夿æ¯å¦åå¨éå¤ |
| | | MESProInDTO? proInDTO = proInDTOs.FirstOrDefault(x => x.IsMantissa == false && proInOrderInfos.Select(x => x.BarCode).Contains(x.BarCode)); |
| | | if (proInDTO != null) |
| | | { |
| | | return content.Error($"{proInDTO.ProductOrderNo}ç产工å{proInDTO.BarCode}æ¡ç å·²åå¨"); |
| | | } |
| | | Dt_MESProInOrderInfo? proInOrderInfo = proInOrderInfos.FirstOrDefault(x => x.MESProInStatus == InOrderStatusEnum.å
³é.ObjToInt() && proInDTOs.Select(x => x.ProductOrderNo).Distinct().Contains(x.ProductOrderNo)); |
| | | if (proInOrderInfo != null) |
| | | { |
| | | return content.Error($"{proInOrderInfo.ProductOrderNo}ç产工åå·²å
³é"); |
| | | } |
| | | List<Dt_MESProInOrderInfo> AddMESProInOrders = new List<Dt_MESProInOrderInfo>(); |
| | | foreach (var item in proInDTOs) |
| | | { |
| | | Dt_MaterielInfo materielInfo = materielInfos.FirstOrDefault(x => x.MaterielCode == item.MaterialCode); |
| | | if (materielInfo.MaterielSourceType != MaterielTypeEnum.æå.ObjToInt()) |
| | | { |
| | | Dt_AGVStationInfo? CheckPointCode = aGVStationInfos.FirstOrDefault(x => x.MESPointCode == item?.PointCode); |
| | | if (CheckPointCode == null) |
| | | { |
| | | return content.Error($"å¨è½¬ä½{nameof(MESReturnIssueDTO.PointCode)}{item?.PointCode}ä¸åå¨,ä»
æåç©æå¯ä¸ä¼ "); |
| | | } |
| | | } |
| | | Dt_MESProInOrderInfo AddproInOrderInfo = _mapper.Map<Dt_MESProInOrderInfo>(item); |
| | | AddproInOrderInfo.WarehouseId = materielInfo.WarehouseId; |
| | | AddproInOrderInfo.MESProOrderType = materielInfo.MaterielSourceType; |
| | | AddMESProInOrders.Add(AddproInOrderInfo); |
| | | } |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | _inboundRepository.MESProInOrderInfoRepository.AddData(AddMESProInOrders); |
| | | if (AddMESProInOrders.Where(x => x.MESProOrderType == MaterielTypeEnum.åæå.ObjToInt()).Count() > 0) |
| | | { |
| | | //çæåæåå
¥åº |
| | | WebResponseContent webResponse = PrintInbound(AddMESProInOrders.Where(x => x.MESProOrderType == MaterielTypeEnum.åæå.ObjToInt()).ToList()); |
| | | if (!webResponse.Status) |
| | | { |
| | | throw new Exception(webResponse.Message); |
| | | } |
| | | tasks = webResponse.Data as List<Dt_Task>; |
| | | WebResponseContent taskResponse = PushTasksToWCS(tasks); |
| | | if (taskResponse.Status) |
| | | { |
| | | throw new Exception(taskResponse.Message); |
| | | } |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | content.OK("æ¥æ¶æå"); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// å°å·ä¸æMESä»»å¡ |
| | | /// </summary> |
| | | public WebResponseContent PrintInbound(List<Dt_MESProInOrderInfo> mESProInOrderInfos) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | if (mESProInOrderInfos.Count <= 0) |
| | | { |
| | | return content.Error("ä¼ å
¥ä¿¡æ¯ä¸ºç©º"); |
| | | } |
| | | |
| | | List<Dt_MaterielInfo> materielInfos = _basicRepository.MaterielInfoRepository.QueryData(); |
| | | List<Dt_StockInfo> stockInfos = new List<Dt_StockInfo>(); |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | //è·åææAGVç¹ä½ |
| | | List<Dt_AGVStationInfo> aGVStationInfos = _agvStationInfoRepository.QueryData(x => !string.IsNullOrEmpty(x.MESPointCode)); |
| | | //æ ¹æ®åæåä¿¡æ¯å¼å«å¯¹åºä»»å¡ |
| | | foreach (var item in mESProInOrderInfos) |
| | | { |
| | | Dt_AGVStationInfo? CheckPointCode = aGVStationInfos.FirstOrDefault(x => x.MESPointCode == item?.PointCode); |
| | | Dt_MaterielInfo? materielInfo = materielInfos.FirstOrDefault(x => x.MaterielCode == item.MaterialCode); |
| | | if (materielInfo == null) |
| | | { |
| | | return content.Error("æªæ¾å°ç©æä¿¡æ¯"); |
| | | } |
| | | if (materielInfo.MaterielSourceType != MaterielTypeEnum.åæå.ObjToInt()) |
| | | { |
| | | return content.Error($"æªæ¾å°ç©æ{materielInfo.MaterielCode}åæåä¿¡æ¯"); |
| | | } |
| | | Dt_StockInfo stockInfoOld = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == item.BarCode); |
| | | if (stockInfoOld != null) |
| | | { |
| | | return content.Error("æçä¿¡æ¯å·²åå¨"); |
| | | } |
| | | //çæåºåç»çä¿¡æ¯ |
| | | Dt_StockInfo stockInfo = new Dt_StockInfo() |
| | | { |
| | | MaterielInvOrgId = materielInfo.MaterielInvOrgId, |
| | | PalletCode = item.BarCode, |
| | | LocationCode = "", |
| | | PalletType = 1, |
| | | WarehouseId = materielInfo.WarehouseId, |
| | | StockAttribute = materielInfo.MaterielSourceType, |
| | | StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(), |
| | | MaterielSpec = materielInfo.MaterielSpec, |
| | | Unit = materielInfo.MaterielUnit, |
| | | MaterielThickness = item.Thickness, |
| | | MaterielWide = item.Wide, |
| | | MaterielWeight = item.Weight, |
| | | MaterielCode = materielInfo.MaterielCode, |
| | | MaterielName = materielInfo.MaterielName, |
| | | StockLength=item.ProQuantity |
| | | }; |
| | | if (item.Wide > 1200) |
| | | { |
| | | stockInfo.PalletType = 2; |
| | | } |
| | | |
| | | //åæåå
¥åºä»»å¡ |
| | | Dt_Task newTask = new Dt_Task() |
| | | { |
| | | CurrentAddress = CheckPointCode.AGVStationCode, |
| | | Grade = 0, |
| | | NextAddress = "", |
| | | PalletCode = item.BarCode, |
| | | Roadway = "", |
| | | SourceAddress = CheckPointCode.AGVStationCode, |
| | | TargetAddress = "", |
| | | TaskType = 0, |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = materielInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType, |
| | | TaskLength = (int)item.Wide |
| | | }; |
| | | TaskTypeEnum taskTypeEnum = CheckPointCode.StationArea switch |
| | | { |
| | | nameof(AGVStationAreaEnum.䏿¥¼å°å·) => TaskTypeEnum.PrintYLInbound, |
| | | _ => throw new Exception("æªæ¾å°å¯¹åºä»»å¡") |
| | | }; |
| | | newTask.TaskType = taskTypeEnum.ObjToInt(); |
| | | stockInfos.Add(stockInfo); |
| | | tasks.Add(newTask); |
| | | } |
| | | //æä½å
¥åºæ°æ® |
| | | BaseDal.AddData(tasks); |
| | | _stockRepository.StockInfoRepository.AddData(stockInfos); |
| | | //æ¨éä»»å¡ |
| | | content.OK("åéæå",data:tasks); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |