已删除3个文件
已修改18个文件
已添加5个文件
已重命名1个文件
| | |
| | | builder.Services.AddInitializationHostServiceSetup();//åºç¨åå§åæå¡æ³¨å
¥ |
| | | builder.Services.AddDbSetup();//Db å¯å¨æå¡ |
| | | |
| | | //builder.Services.AddScoped<QuartzJobCreateDataTabel>(); |
| | | builder.Services.AddScoped<QuartzJobCreateDataTabel>(); |
| | | builder.Services.AddHostedService<WarehouseHostedService>(); |
| | | //builder.Services.AddHostedService<QuartzJobDataTableHostedService>(); |
| | | builder.Services.AddHostedService<QuartzJobDataTableHostedService>(); |
| | | |
| | | builder.Services.AddAutoMapperSetup(); |
| | | |
| | |
| | | <Content Remove="wwwroot\WIDESEAWCS_DB.DBSeed.Json\Dt_DeviceProtocolDetail.tsv" /> |
| | | <Content Remove="wwwroot\WIDESEAWCS_DB.DBSeed.Json\Dt_DispatchInfo.tsv" /> |
| | | <Content Remove="wwwroot\WIDESEAWCS_DB.DBSeed.Json\Dt_Router.tsv" /> |
| | | <Content Remove="wwwroot\WIDESEAWCS_DB.DBSeed.Json\Dt_Task.tsv" /> |
| | | <Content Remove="wwwroot\WIDESEAWCS_DB.DBSeed.Json\Dt_TaskExecuteDetail.tsv" /> |
| | | <Content Remove="wwwroot\WIDESEAWCS_DB.DBSeed.Json\Sys_Dictionary.tsv" /> |
| | | <Content Remove="wwwroot\WIDESEAWCS_DB.DBSeed.Json\Sys_DictionaryList.tsv" /> |
| | | <Content Remove="wwwroot\WIDESEAWCS_DB.DBSeed.Json\Sys_Menu.tsv" /> |
| | |
| | | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
| | | </EmbeddedResource> |
| | | <EmbeddedResource Include="wwwroot\WIDESEAWCS_DB.DBSeed.Json\Dt_Router.tsv"> |
| | | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
| | | </EmbeddedResource> |
| | | <EmbeddedResource Include="wwwroot\WIDESEAWCS_DB.DBSeed.Json\Dt_Task.tsv"> |
| | | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
| | | </EmbeddedResource> |
| | | <EmbeddedResource Include="wwwroot\WIDESEAWCS_DB.DBSeed.Json\Dt_TaskExecuteDetail.tsv"> |
| | | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
| | | </EmbeddedResource> |
| | | <EmbeddedResource Include="wwwroot\WIDESEAWCS_DB.DBSeed.Json\Sys_Dictionary.tsv"> |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | string apiAddress = "http://10.30.4.19:8182/rcms/services/rest/hikRpcService/genAgvSchedulingTask";// AppSettings.Get(APIEnum.AgvSendTask.ToString()); |
| | | string apiAddress = "http://10.30.4.29:8182/rcms/services/rest/hikRpcService/genAgvSchedulingTask";// AppSettings.Get(APIEnum.AgvSendTask.ToString()); |
| | | string response = HttpHelper.Post(apiAddress, taskModel.Serialize()); |
| | | AgvResponseContent agvContent = response.DeserializeObject<AgvResponseContent>(); |
| | | if (agvContent.Code == "0") |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | string apiAddress = "http://10.30.4.19:8182/rcms/services/rest/hikRpcService/continueTask";// AppSettings.Get(APIEnum.AgvSecureReply.ToString()); |
| | | string apiAddress = "http://10.30.4.29:8182/rcms/services/rest/hikRpcService/continueTask";// AppSettings.Get(APIEnum.AgvSecureReply.ToString()); |
| | | string response = HttpHelper.Post(apiAddress, secureReplyModel.Serialize()); |
| | | AgvResponseContent agvContent = response.DeserializeObject<AgvResponseContent>(); |
| | | if (agvContent.Code == "0") |
| | |
| | | if (routers.Count == 1) |
| | | { |
| | | task.NextAddress = router?.NextPosi ?? ""; |
| | | task.DeviceCode = stationManger.StationDeviceCode; |
| | | } |
| | | else |
| | | { |
| | | task.NextAddress = ""; |
| | | task.DeviceCode = ""; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && item.AGVArea == x.StartPosi); |
| | | if (routers.FirstOrDefault() == null) |
| | | if(item.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è·¯ç±é
置信æ¯"); |
| | | } |
| | | router = routers.FirstOrDefault(); |
| | | List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && item.AGVArea == x.NextPosi); |
| | | if (routers.FirstOrDefault() == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è·¯ç±é
置信æ¯"); |
| | | } |
| | | router = routers.FirstOrDefault(); |
| | | |
| | | task.NextAddress = router?.NextPosi ?? ""; |
| | | task.NextAddress = router?.StartPosi ?? ""; |
| | | task.DeviceCode = item.RoadWay; |
| | | } |
| | | else |
| | | { |
| | | List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && item.AGVArea == x.StartPosi); |
| | | if (routers.FirstOrDefault() == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è·¯ç±é
置信æ¯"); |
| | | } |
| | | router = routers.FirstOrDefault(); |
| | | |
| | | task.NextAddress = router?.NextPosi ?? ""; |
| | | task.DeviceCode = "AGV"; |
| | | } |
| | | } |
| | | |
| | | tasks.Add(task); |
| | |
| | | { |
| | | try |
| | | { |
| | | var newTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt() || x.TaskState == TaskStatusEnum.New.ObjToInt()).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList(); |
| | | var newTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt()).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList(); |
| | | foreach (var agvTask in newTasks) |
| | | { |
| | | AgvTaskDTO taskDTO = new AgvTaskDTO() |
| | |
| | | case PalletTypeEnum.LargePallet: |
| | | { |
| | | List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); |
| | | moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && x.LocationStatus != LocationStatusEnum.PalletLock.ObjToInt()) == null;//æ¥è¯¢å¤§äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºæè´§çè´§ä½ï¼å¦ææ¯trueï¼åè¡¨ç¤ºæ·±è´§ä½ææªè¢«ä½¿ç¨çæ
åµ |
| | | moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && x.LocationStatus != LocationStatusEnum.PalletLock.ObjToInt() && x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) == null;//æ¥è¯¢å¤§äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºæè´§çè´§ä½ï¼å¦ææ¯trueï¼åè¡¨ç¤ºæ·±è´§ä½ææªè¢«ä½¿ç¨çæ
åµ |
| | | |
| | | List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); |
| | | littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.OnlyIn.ObjToInt() && x.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) == null; //æ¥è¯¢å°äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºç©ºï¼ä¸ç¦ç¨ç¶æä¸ä¸ºç¦ç¨ä»¥ååªå
¥çè´§ä½ï¼å¦ææ¯trueï¼å表示æµ
è´§ä½è¢«ä½¿ç¨æè
被ç¦ç¨çæ
åµ |
| | | littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) == null; //æ¥è¯¢å°äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºç©ºï¼ä¸ç¦ç¨ç¶æä¸ä¸ºç¦ç¨ä»¥ååªå
¥çè´§ä½ï¼å¦ææ¯trueï¼å表示æµ
è´§ä½è¢«ä½¿ç¨æè
被ç¦ç¨çæ
åµ |
| | | } |
| | | break; |
| | | case PalletTypeEnum.MediumPallet: |
| | | case PalletTypeEnum.SmallPallet: |
| | | { |
| | | List<Dt_LocationInfo> moreDepth = locations.Where(x => x.Depth > emptyLocation.Depth).ToList(); |
| | | moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt()) == null;//æ¥è¯¢å¤§äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºæè´§çè´§ä½ï¼å¦ææ¯trueï¼åè¡¨ç¤ºæ·±è´§ä½ææªè¢«ä½¿ç¨çæ
åµ |
| | | moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) == null;//æ¥è¯¢å¤§äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºæè´§çè´§ä½ï¼å¦ææ¯trueï¼åè¡¨ç¤ºæ·±è´§ä½ææªè¢«ä½¿ç¨çæ
åµ |
| | | |
| | | List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList(); |
| | | littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.OnlyIn.ObjToInt() && x.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) == null; //æ¥è¯¢å°äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºç©ºï¼ä¸ç¦ç¨ç¶æä¸ä¸ºç¦ç¨ä»¥ååªå
¥çè´§ä½ï¼å¦ææ¯trueï¼å表示æµ
è´§ä½è¢«ä½¿ç¨æè
被ç¦ç¨çæ
åµ |
| | | littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) == null; //æ¥è¯¢å°äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºç©ºï¼ä¸ç¦ç¨ç¶æä¸ä¸ºç¦ç¨ä»¥ååªå
¥çè´§ä½ï¼å¦ææ¯trueï¼å表示æµ
è´§ä½è¢«ä½¿ç¨æè
被ç¦ç¨çæ
åµ |
| | | } |
| | | |
| | | break; |
| | |
| | | |
| | | using HttpClient httpClient = new HttpClient(); |
| | | httpClient.Timeout = new TimeSpan(0, 0, 60); |
| | | long currentTimestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds(); |
| | | string key = $"appkey=1830415116987195392×tamp={currentTimestamp}"; |
| | | string authorization = "Open " + GetStr(key); |
| | | string authorization = "AppKey 1830415116987195392"; |
| | | headers = new Dictionary<string, string> |
| | | { |
| | | { "Appkey", "1830415116987195392" }, |
| | | { "Authorization", authorization }, |
| | | { "site_tenant_id", "ced19269-2b83-4577-be43-8cc2f700251e" } |
| | | { "Site_tenant_id", "0dc2d164-8a62-417e-8a00-808007464feb" } |
| | | }; |
| | | if (headers != null) |
| | | { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_DTO.MES |
| | | { |
| | | public class RootList |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string From { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string DateTime { get; set; } |
| | | |
| | | public List<TestToolScrap> Content { get; set; } |
| | | } |
| | | } |
| | |
| | | /// æµè¯æ¶æ¹æ¬¡å· |
| | | /// </summary> |
| | | [PropertyValidate("æµè¯æ¶æ¹æ¬¡å·", NotNullAndEmpty = true)] |
| | | public string ToolCode { get; set; } |
| | | public List<string> ToolCodes { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | WebResponseContent FeedbackInboundOrder(int id); |
| | | |
| | | WebResponseContent MaterielGroup(SaveModel saveModel); |
| | | //å
¥åºå®æä¸æ¥ |
| | | WebResponseContent FeedbackInboundOrder(Dt_StockInfo stockInfo); |
| | | /// <summary> |
| | | /// å
¥åºå®æä¸æ¥ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | WebResponseContent FeedbackInboundOrder(Dt_StockInfo stockInfo,Dt_InboundOrder inboundOrder); |
| | | } |
| | | } |
| | |
| | | IOutboundOrderRepository Repository { get; } |
| | | |
| | | WebResponseContent ReceiveOutOrder(ErpOutOrderDTO model); |
| | | WebResponseContent TestOutUpload(int id); |
| | | WebResponseContent TestOutUpload(int id,Dt_StockInfo stockInfo=null); |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="toolScrap"></param> |
| | | /// <returns></returns> |
| | | MesResponseContent TestScrap(TestToolScrap toolScrap); |
| | | MesResponseContent TestScrap(TestToolScrap toolScraps); |
| | | WebResponseContent IsRelocation(int taskNum, string locationCode); |
| | | WebResponseContent TestSynStock(TestToolSynInfo toolSynInfo); |
| | | } |
| | |
| | | using AutoMapper; |
| | | using HslCommunication.WebSocket; |
| | | using Newtonsoft.Json; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å
¥åºåæç»ä¿¡æ¯"); |
| | | } |
| | | MatSerNumAnalysisModel model = new MatSerNumAnalysisModel() |
| | | { |
| | | MaterielCode = "504907335", |
| | | LotNo = "20241217001", |
| | | ProductionDate = "2024-12-17", |
| | | EffectiveDate = "2025-12-17", |
| | | PurchaseOrderNo = "POHA02241227285", |
| | | Quantity = 1, |
| | | SerialNumber = "M:504907335,BS:20241217001,DM:2024-12-17,DE:2025-12-17,Q:1,PO:POHA02241227285" |
| | | };//æµè¯ |
| | | //CodeAnalysisHelper.CodeAnalysis<MatSerNumAnalysisModel>(AnalysisCodeEnum.MatSerNumAnalysis, serNum); |
| | | MatSerNumAnalysisModel model = CodeAnalysisHelper.CodeAnalysis<MatSerNumAnalysisModel>(AnalysisCodeEnum.MatSerNumAnalysis, serNum); |
| | | Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterielCode == model.MaterielCode); |
| | | if (materielInfo == null) |
| | | { |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | public WebResponseContent FeedbackInboundOrder(Dt_StockInfo stockInfo) |
| | | /// <summary> |
| | | /// å
¥åºå®æä¸æ¥ERP |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent FeedbackInboundOrder(Dt_StockInfo stockInfo,Dt_InboundOrder inboundOrder) |
| | | { |
| | | WebResponseContent content=new WebResponseContent(); |
| | | try |
| | | { |
| | | |
| | | if (inboundOrder.Details.Count == 0) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å
¥åºåæç»ä¿¡æ¯"); |
| | | } |
| | | if (inboundOrder.OrderStatus == InOrderStatusEnum.å
¥åºå®æ.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"å
¥åºåæ®å·²å®æ"); |
| | | } |
| | | List<ERPInboundDetailModel> detailModels = new List<ERPInboundDetailModel>(); |
| | | Dt_Warehouse warehouse = _warehouseService.Repository.QueryFirst(x => x.WarehouseId == stockInfo.WarehouseId); |
| | | if (warehouse == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°ä»åºä¿¡æ¯"); |
| | | } |
| | | List<Dt_InboundOrderDetail> inboundOrderDetails = new List<Dt_InboundOrderDetail>(); |
| | | foreach (var item in stockInfo.Details) |
| | | { |
| | | Dt_InboundOrderDetail? inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x=>x.RowNo==item.InboundOrderRowNo); |
| | | if (inboundOrderDetail == null) |
| | | { |
| | | continue; |
| | | } |
| | | ERPInboundDetailModel detailModel = new ERPInboundDetailModel() |
| | | { |
| | | ExpiryDate = item.EffectiveDate ?? "", |
| | | LocationCode = warehouse.WarehouseCode, |
| | | MaterialsCode = item.MaterielCode, |
| | | MfgDate = item.ProductionDate ?? "", |
| | | QtyCustoms = "0", |
| | | Quantity = item.StockQuantity.ToString(), |
| | | Rack = stockInfo.LocationCode, |
| | | ReceiptCode = inboundOrder.UpperOrderNo, |
| | | ReceiptSerNo = item.InboundOrderRowNo.ToString() |
| | | }; |
| | | inboundOrderDetail.OverInQuantity += detailModel.Quantity.ObjToInt(); |
| | | if (inboundOrderDetail.OverInQuantity== inboundOrderDetail.OrderQuantity) |
| | | { |
| | | inboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt(); |
| | | } |
| | | inboundOrderDetails.Add(inboundOrderDetail); |
| | | detailModels.Add(detailModel); |
| | | } |
| | | ERPInboundModel model = new ERPInboundModel() |
| | | { |
| | | Code = inboundOrder.InboundOrderNo, |
| | | CreatorCode = "TC20082",//æµè¯ |
| | | EntDate = inboundOrder.CreateDate.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | StockDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | SuppliersId = inboundOrder.SupplierId, |
| | | Type = "S", |
| | | UniqueTag = inboundOrder.Id.ToString(), |
| | | WarehouseCode = warehouse.WarehouseCode, |
| | | Way = 1, |
| | | Details = detailModels |
| | | }; |
| | | //å
¥åºæç»æ°å¢å®ææ°é |
| | | int newCount = inboundOrderDetails.Select(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()).ToList().Count; |
| | | //å
¥åºæç»å宿æ°é |
| | | int oldCount = inboundOrder.Details.Select(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()).ToList().Count; |
| | | string response = _invokeERPService.InvokeInboundOrderApi(model); |
| | | ErpRequestContent requestContent = JsonConvert.DeserializeObject<ErpRequestContent>(response); |
| | | if (requestContent==null) |
| | | { |
| | | return WebResponseContent.Instance.Error(); |
| | | } |
| | | if (requestContent.res==0) |
| | | { |
| | | return WebResponseContent.Instance.Error(requestContent.Data); |
| | | } |
| | | _unitOfWorkManage.BeginTran(); |
| | | _inboundRepository.InboundOrderDetailRepository.UpdateData(inboundOrderDetails); |
| | | if (inboundOrder.Details.Count == (newCount + oldCount)) |
| | | { |
| | | inboundOrder.OrderStatus = InOrderStatusEnum.å
¥åºå®æ.ObjToInt(); |
| | | _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å
¥åºåæç»ä¿¡æ¯"); |
| | | } |
| | | if (inboundOrder.OrderStatus != InOrderStatusEnum.å
¥åºå®æ.ObjToInt()) |
| | | if (inboundOrder.OrderStatus == InOrderStatusEnum.å
¥åºå®æ.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"å
¥åºåæ®æªå®æ"); |
| | | } |
| | | if (inboundOrder.Details.FirstOrDefault(x => x.OrderDetailStatus != OrderDetailStatusEnum.Over.ObjToInt()) != null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"å
¥åºæç»æªå®æ"); |
| | | return WebResponseContent.Instance.Error($"å
¥åºåæ®å·²å®æ"); |
| | | } |
| | | |
| | | List<Dt_StockInfo> stockInfos = Db.Queryable<Dt_StockInfo>().Where(x => x.Details.Any(v => v.OrderNo == inboundOrder.InboundOrderNo)).Includes(x => x.Details).ToList(); |
| | |
| | | Way = 1, |
| | | Details = detailModels |
| | | }; |
| | | |
| | | string response = _invokeERPService.InvokeInboundOrderApi(model); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | |
| | | Dt_InboundOrder inboundOrder = new Dt_InboundOrder() |
| | | { |
| | | InboundOrderNo = "TestInboundNo21",//æµè¯ |
| | | InboundOrderNo="IN"+DateTime.Now.ToString("yyyyMMddHHmmss"),//æµè¯ |
| | | UpperOrderNo = receiveOrder.ReceiveOrderNo, |
| | | CreateType = OrderCreateTypeEnum.UpperSystemPush.ObjToInt(), |
| | | OrderStatus = InOrderStatusEnum.æªå¼å§.ObjToInt(), |
| | |
| | | } |
| | | receiveOrder = new Dt_ReceiveOrder() |
| | | { |
| | | ReceiveOrderNo = "TestReceiveOrderNo21",//æµè¯ |
| | | ReceiveOrderNo= "RE"+DateTime.Now.ToString("yyyyMMddHHmmss"),//æµè¯ |
| | | ReceiveOrderStatus = ReceiveOrderStatusEnum.Receiving.ObjToInt(), |
| | | CustomerId = "", |
| | | DeliveryCode = "/", |
| | |
| | | rowNo += 1; |
| | | receiveOrderDetails.Add(receiveOrderDetail); |
| | | |
| | | if (materielInfo.IsCheck == WhetherEnum.True) |
| | | { |
| | | Dt_CheckOrder checkOrder = _mapper.Map<Dt_CheckOrder>(receiveOrderDetail); |
| | | checkOrder.CheckOrderNo = "Test-CheckNo1";//æµè¯ |
| | | checkOrder.QualifiedQuantity = receiveOrderDetail.ReceivedQuantity; |
| | | checkOrder.ScrappedQuantity = 0; |
| | | checkOrder.ReceiveOrderNo = receiveOrder.ReceiveOrderNo; |
| | | checkOrder.ReturnQuantity = 0; |
| | | checkOrder.DefectedQuantity = 0; |
| | | checkOrder.ReceiveDetailRowNo = rowNo; |
| | | checkOrder.UploadStatus = CheckUploadEnum.UploadNo.ObjToInt(); |
| | | checkOrders.Add(checkOrder); |
| | | } |
| | | //if (materielInfo.IsCheck == WhetherEnum.True) |
| | | //{ |
| | | // Dt_CheckOrder checkOrder = _mapper.Map<Dt_CheckOrder>(receiveOrderDetail); |
| | | // checkOrder.CheckOrderNo = "Test-CheckNo1";//æµè¯ |
| | | // checkOrder.QualifiedQuantity = receiveOrderDetail.ReceivedQuantity; |
| | | // checkOrder.ScrappedQuantity = 0; |
| | | // checkOrder.ReceiveOrderNo = receiveOrder.ReceiveOrderNo; |
| | | // checkOrder.ReturnQuantity = 0; |
| | | // checkOrder.DefectedQuantity = 0; |
| | | // checkOrder.ReceiveDetailRowNo = rowNo; |
| | | // checkOrder.UploadStatus = CheckUploadEnum.UploadNo.ObjToInt(); |
| | | // checkOrders.Add(checkOrder); |
| | | //} |
| | | } |
| | | } |
| | | |
| | |
| | | Db.InsertNav(receiveOrder).Include(x => x.Details).ExecuteCommand(); |
| | | checkOrders.ForEach(x => x.ReceiveOrderNo = receiveOrder.ReceiveOrderNo); |
| | | } |
| | | if (checkOrders.Count > 0) |
| | | { |
| | | _checkOrderRepository.AddData(checkOrders); |
| | | } |
| | | //if (checkOrders.Count > 0) |
| | | //{ |
| | | // _checkOrderRepository.AddData(checkOrders); |
| | | //} |
| | | _inboundRepository.PurchaseOrderRepository.UpdateData(purchaseOrder); |
| | | _inboundRepository.PurchaseOrderDetailRepository.UpdateData(purchaseOrder.Details); |
| | | _unitOfWorkManage.CommitTran(); |
| | |
| | | /// <summary> |
| | | /// æ¹æ¬¡å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "æ¹æ¬¡å·")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æ¹æ¬¡å·")] |
| | | public string BatchNo { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | //䏿¥åºåºå®æ æµè¯æ¶ |
| | | public WebResponseContent TestOutUpload(int id) |
| | | //䏿¥åºåºå®æ |
| | | public WebResponseContent TestOutUpload(int id,Dt_StockInfo stockInfo) |
| | | { |
| | | try |
| | | { |
| | | Dt_OutboundOrder outboundOrder = Db.Queryable<Dt_OutboundOrder>().Where(x=>x.Id==id).Includes(x=>x.Details).First(); |
| | | Dt_Warehouse warehouse = _basicService.WarehouseService.Repository.QueryFirst(x => x.WarehouseId == outboundOrder.WarehouseId); |
| | | //æµè¯æ¶åºç»ERP䏿¥åºåºå®æ |
| | | ERPPickItemModel eRPOutPick = new ERPPickItemModel() |
| | | ERPIssueModel issueModel = new ERPIssueModel(); |
| | | List<Dt_StockInfo> stockInfos = new List<Dt_StockInfo>(); |
| | | if (stockInfo==null) |
| | | { |
| | | Lotno = "20241227001", |
| | | Qty = "1", |
| | | Location = warehouse.WarehouseCode |
| | | }; |
| | | ERPPickModel pickModel = new ERPPickModel() |
| | | stockInfos = TestOutStocksUpdate(warehouse).Data as List<Dt_StockInfo> ?? new List<Dt_StockInfo>(); |
| | | List<ERPPickItemModel> eRPOutPick =new List<ERPPickItemModel>(); |
| | | for (int i = 0; i < stockInfos.Count; i++) |
| | | { |
| | | ERPPickItemModel pickItemModel = new ERPPickItemModel() |
| | | { |
| | | Lotno= stockInfos[i].Details[0].BatchNo, |
| | | Qty= stockInfos[i].Details[0].StockQuantity.ObjToInt().ToString(), |
| | | Location= warehouse.WarehouseCode |
| | | }; |
| | | eRPOutPick.Add(pickItemModel); |
| | | } |
| | | |
| | | ERPPickModel pickModel = new ERPPickModel() |
| | | { |
| | | Rowindex = outboundOrder.Details[0].RowNo, |
| | | Material = outboundOrder.Details[0].MaterielCode, |
| | | Qty = (outboundOrder.Details[0].OrderQuantity.ObjToInt()).ToString(), |
| | | Dataitem = eRPOutPick |
| | | }; |
| | | |
| | | ERPIssueItemModel issueItemModel = new ERPIssueItemModel() |
| | | { |
| | | Pickcode = outboundOrder.UpperOrderNo, |
| | | PickList = new List<ERPPickModel>() { pickModel } |
| | | }; |
| | | issueModel = new ERPIssueModel() |
| | | { |
| | | UniqueTag = id.ToString(), |
| | | Code = "OT" + DateTime.Now.ToString("yyyyMMddHHmmss"),//æµè¯ |
| | | WarehouseCode = warehouse.WarehouseCode, |
| | | Docremark = "", |
| | | Deptno = outboundOrder.DepartmentCode, |
| | | Deptname = outboundOrder.DepartmentName, |
| | | Createtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | Createuser = "TC20082", |
| | | Issitem = new List<ERPIssueItemModel>() { issueItemModel }, |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | Rowindex = outboundOrder.Details[0].RowNo, |
| | | Material = outboundOrder.Details[0].MaterielCode, |
| | | Qty = (outboundOrder.Details[0].OrderQuantity.ObjToInt()).ToString(), |
| | | Dataitem=new List<ERPPickItemModel> { eRPOutPick } |
| | | }; |
| | | Dt_OutboundOrderDetail orderDetail = outboundOrder.Details.FirstOrDefault(x => x.MaterielCode == stockInfo.Details[0].MaterielCode); |
| | | |
| | | ERPPickItemModel pickItemModel = new ERPPickItemModel() |
| | | { |
| | | Lotno = stockInfo.Details[0].BatchNo, |
| | | Qty = stockInfo.Details[0].StockQuantity.ObjToInt().ToString(), |
| | | Location = stockInfo.LocationCode |
| | | }; |
| | | ERPPickModel pickModel = new ERPPickModel() |
| | | { |
| | | Rowindex = outboundOrder.Details[0].RowNo, |
| | | Material = outboundOrder.Details[0].MaterielCode, |
| | | Qty = (outboundOrder.Details[0].OrderQuantity.ObjToInt()).ToString(), |
| | | Dataitem = new List<ERPPickItemModel> { pickItemModel } |
| | | }; |
| | | ERPIssueItemModel issueItemModel = new ERPIssueItemModel() |
| | | { |
| | | Pickcode = outboundOrder.UpperOrderNo, |
| | | PickList = new List<ERPPickModel>() { pickModel } |
| | | }; |
| | | issueModel = new ERPIssueModel() |
| | | { |
| | | UniqueTag = id.ToString(), |
| | | Code = "OT" + DateTime.Now.ToString("yyyyMMddHHmmss"),//æµè¯ |
| | | WarehouseCode = warehouse.WarehouseCode, |
| | | Docremark = "", |
| | | Deptno = outboundOrder.DepartmentCode, |
| | | Deptname = outboundOrder.DepartmentName, |
| | | Createtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | Createuser = "TC20082", |
| | | Issitem = new List<ERPIssueItemModel>() { issueItemModel }, |
| | | }; |
| | | } |
| | | |
| | | ERPIssueItemModel issueItemModel = new ERPIssueItemModel() |
| | | { |
| | | Pickcode = outboundOrder.UpperOrderNo, |
| | | PickList = new List<ERPPickModel>() { pickModel } |
| | | }; |
| | | ERPIssueModel issueModel = new ERPIssueModel() |
| | | { |
| | | UniqueTag = id.ToString(), |
| | | Code = "FL20241227001",//æµè¯ |
| | | WarehouseCode = warehouse.WarehouseCode, |
| | | Docremark = "", |
| | | Deptno = outboundOrder.DepartmentCode, |
| | | Deptname = outboundOrder.DepartmentName, |
| | | Createtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | Createuser = "TC20082", |
| | | Issitem = new List<ERPIssueItemModel>() { issueItemModel }, |
| | | }; |
| | | string response = _invokeERPService.InvokeOutStandardsApi(issueModel); |
| | | ErpRequestContent requestContent = response.DeserializeObject<ErpRequestContent>(); |
| | | if (requestContent.res == 1) |
| | | { |
| | | |
| | | if (stockInfos.Count>0) |
| | | { |
| | | _stockInfoRepository.UpdateData(stockInfos); |
| | | } |
| | | return WebResponseContent.Instance.OK(requestContent.Data); |
| | | } |
| | | else |
| | |
| | | /// <param name="warehouse"></param> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent TestOutStocksUpdate(Dt_Warehouse warehouse, ErpOutOrderDTO model) |
| | | public WebResponseContent TestOutStocksUpdate(Dt_Warehouse warehouse) |
| | | { |
| | | try |
| | | { |
| | | //è·ååºåºååºå |
| | | List<Dt_StockInfo> stockInfos = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId).Includes(x => x.Details).ToList(); |
| | | if (model.Qty > stockInfos.Count) |
| | | if (stockInfos.Count<=0) |
| | | { |
| | | return WebResponseContent.Instance.Error($"ç©æ:{model.MCode}åºåä¸è¶³"); |
| | | return WebResponseContent.Instance.Error($"åºåä¸è¶³"); |
| | | } |
| | | //æ´æ¹ç¶æ |
| | | stockInfos.ForEach(x => |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | ///æ¨éæµè¯æ¶åºåº |
| | | //public WebResponseContent TestOutBack(int id,List<string> locationIds) |
| | | //{ |
| | | // try |
| | | // { |
| | | |
| | | // string response = _invokeERPService.InvokeOutStandardsApi(issueModel); |
| | | // ErpRequestContent requestContent = response.DeserializeObject<ErpRequestContent>(); |
| | | // if (requestContent.res == 1) |
| | | // { |
| | | |
| | | // return WebResponseContent.Instance.OK(requestContent.Data); |
| | | // } |
| | | // else |
| | | // { |
| | | // return WebResponseContent.Instance.Error(requestContent.Data); |
| | | // } |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // return WebResponseContent.Instance.Error(ex.Message); |
| | | // } |
| | | //} |
| | | |
| | | //public WebResponseContent FeedbackOutbondIssue(List<Dt_OutStockLockInfo> outStockLockInfos) |
| | | //{ |
| | | // ERPPickItemModel |
| | | //} |
| | | } |
| | | } |
| | |
| | | stockInfo.StockStatus = (int)StockStatusEmun.åºåºéå®; |
| | | LocationStatusEnum locationStatus = (LocationStatusEnum)locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = (int)LocationStatusEnum.Lock; |
| | | //å°ä»»å¡æ¨éå°WCS |
| | | WebResponseContent content = PushTasksToWCS(new List<Dt_Task>() { taskOut }, "AGV"); |
| | | if (!content.Status) |
| | | { |
| | | return responseContent.Error(); |
| | | } |
| | | //夿æ¯å¦æåºåºåä¿¡æ¯ |
| | | _unitOfWorkManage.BeginTran(); |
| | | //æ´æ°åºåç¶æ |
| | |
| | | //å å
¥åºååå¨è®°å½ |
| | | //_recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfoDetails, beforeQuantity, totalQuantity, StockChangeTypeEnum.StockLock); |
| | | _unitOfWorkManage.CommitTran(); |
| | | //å°ä»»å¡æ¨éå°WCS |
| | | PushTasksToWCS(new List<Dt_Task>() { taskOut }, "AGV"); |
| | | responseContent.OK(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | }; |
| | | //æ´æ¹åºåç¶æ |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(); |
| | | //å°ä»»å¡æ¨éå°WCS |
| | | PushTasksToWCS(new List<Dt_Task>() { taskIn }, "AGV"); |
| | | BaseDal.AddData(taskIn); |
| | | _stockRepository.StockInfoRepository.UpdateData(stockInfo); |
| | | //å°ä»»å¡æ¨éå°WCS |
| | | WebResponseContent content = PushTasksToWCS(new List<Dt_Task>() { taskIn }, "AGV"); ; |
| | | if (!content.Status) |
| | | { |
| | | return responseContent.Error(); |
| | | } |
| | | responseContent.OK(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | /// æµè¯æ¶æ¥åº |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public MesResponseContent TestScrap(TestToolScrap toolScrap) |
| | | public MesResponseContent TestScrap(TestToolScrap toolScraps) |
| | | { |
| | | MesResponseContent responseContent = new MesResponseContent(); |
| | | try |
| | |
| | | //è·åæµè¯æ¶æ¹æ¬¡å·åºå |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA64.ToString()); |
| | | //è·ååºåè®°å½ |
| | | //è·ååºåè®°å½ |
| | | List<Dt_StockInfo> stockInfos = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => |
| | | x.WarehouseId == warehouse.WarehouseId && |
| | | x.StockStatus == (int)StockStatusEmun.åºåºå®æ).Includes(x => x.Details).ToList(); |
| | | Dt_StockInfo? stockInfo = stockInfos.FirstOrDefault(x => x.Details.Any(x => x.BatchNo == toolScrap.ToolCode)); |
| | | |
| | | if (stockInfo == null) |
| | | List<Dt_StockInfo> stockInfoUpdates = new List<Dt_StockInfo>(); |
| | | List<Dt_StockInfoDetail> stockInfoDetails = new List<Dt_StockInfoDetail>(); |
| | | foreach (var item in toolScraps.ToolCodes) |
| | | { |
| | | return responseContent.Error($"{toolScrap.ToolCode}åºåä¿¡æ¯ä¸åå¨"); |
| | | Dt_StockInfo stockInfo = stockInfos.Find(x => x.Details.Any(x => x.BatchNo == item)); |
| | | if (stockInfo == null) |
| | | { |
| | | return responseContent.Error($"{item}åºåä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | stockInfoUpdates.Add(stockInfo); |
| | | } |
| | | //æ¸
é¤åºåä¿¡æ¯ |
| | | _unitOfWorkManage.BeginTran(); |
| | | _stockRepository.StockInfoRepository.DeleteAndMoveIntoHty(stockInfo,OperateTypeEnum.èªå¨å é¤); |
| | | _stockRepository.StockInfoDetailRepository.DeleteAndMoveIntoHty(stockInfo.Details, OperateTypeEnum.èªå¨å é¤); |
| | | _stockRepository.StockInfoRepository.DeleteAndMoveIntoHty(stockInfoUpdates, OperateTypeEnum.èªå¨å é¤); |
| | | _unitOfWorkManage.CommitTran(); |
| | | responseContent.OK($"æ¥åºæå"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | private readonly IApiInfoRepository _apiInfoRepository; |
| | | private readonly IInvokeERPService _invokeERPService; |
| | | private readonly IInboundRepository _inboundRepository; |
| | | private readonly IInboundOrderService _inboundOrderService; |
| | | |
| | | public ITaskRepository Repository => BaseDal; |
| | | |
| | |
| | | |
| | | public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList(); |
| | | |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IStockRepository stockRepository, IBasicService basicService, IRecordService recordService, IOutboundService outboundService, IStockService stockService, IBasicRepository basicRepository, IApiInfoRepository apiInfoRepository, IInvokeERPService invokeERPService, IInboundRepository inboundRepository) : base(BaseDal) |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IStockRepository stockRepository, IBasicService basicService, IRecordService recordService, IOutboundService outboundService, IStockService stockService, IBasicRepository basicRepository, IApiInfoRepository apiInfoRepository, IInvokeERPService invokeERPService, IInboundRepository inboundRepository, IInboundOrderService inboundOrderService) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _apiInfoRepository = apiInfoRepository; |
| | | _invokeERPService = invokeERPService; |
| | | _inboundRepository = inboundRepository; |
| | | _inboundOrderService = inboundOrderService; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥ä»»å¡ä¿¡æ¯"); |
| | | } |
| | | |
| | | if (task.TaskType != TaskTypeEnum.Inbound.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"ä»»å¡ç±»åé误"); |
| | | } |
| | | //if (task.TaskType != TaskTypeEnum.Inbound.ObjToInt()) |
| | | //{ |
| | | // return WebResponseContent.Instance.Error($"ä»»å¡ç±»åé误"); |
| | | //} |
| | | |
| | | Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == task.PalletCode && x.WarehouseId==task.WarehouseId).Includes(x => x.Details).First(); |
| | | if (stockInfo == null) |
| | |
| | | }); |
| | | stockInfo.LocationCode = locationInfo.LocationCode; |
| | | //æ¨éå
¥åºå®æç»Erp |
| | | //è·åå
¥åºåæ´æ°å
¥åºå |
| | | //Dt_InboundOrder inboundOrder = _inboundRepository.InboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x=>x.InboundOrderNo); |
| | | if (true) |
| | | Dt_InboundOrder? inboundOrder = _inboundRepository.InboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x => x.InboundOrderNo == stockInfo.Details.FirstOrDefault().OrderNo).Includes(x=>x.Details).First(); |
| | | if (inboundOrder == null) |
| | | { |
| | | |
| | | return WebResponseContent.Instance.Error($"对åºå
¥åºåä¸åå¨"); |
| | | } |
| | | if (!_inboundOrderService.FeedbackInboundOrder(stockInfo, inboundOrder).Status) |
| | | { |
| | | return WebResponseContent.Instance.Error($"å
¥åºåæ¥Erp失败"); |
| | | } |
| | | _unitOfWorkManage.BeginTran(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.äººå·¥å®æ : OperateTypeEnum.èªå¨å®æ); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, (PalletTypeEnum)stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId); |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è´§ä½ä¿¡æ¯"); |
| | | } |
| | | |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x=>x.WarehouseId== task.WarehouseId); |
| | | List<Dt_OutStockLockInfo> outStockLockInfos = _outboundService.OutboundStockLockInfoService.Repository.QueryData(x => x.TaskNum == taskNum); |
| | | if (outStockLockInfos == null || outStockLockInfos.Count == 0) |
| | | |
| | | if ((outStockLockInfos == null || outStockLockInfos.Count == 0) && warehouse.WarehouseCode != WarehouseEnum.HA64.ToString()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°åºåºè¯¦æ
ä¿¡æ¯"); |
| | | } |
| | |
| | | outboundOrderDetails.Add(outboundOrderDetail); |
| | | } |
| | | } |
| | | |
| | | if (warehouse.WarehouseCode != WarehouseEnum.HA64.ToString()) |
| | | { |
| | | //æ¨éåºåºå®æ |
| | | WebResponseContent webResponse = _outboundService.OutboundOrderService.TestOutUpload(outboundOrderDetails.FirstOrDefault().Id,stockInfo); |
| | | if (!webResponse.Status) |
| | | { |
| | | return webResponse; |
| | | } |
| | | } |
| | | _unitOfWorkManage.BeginTran(); |
| | | _outboundService.OutboundOrderDetailService.Repository.UpdateData(outboundOrderDetails); |
| | | |
| | | if (outboundOrderDetails.Count>0) |
| | | { |
| | | _outboundService.OutboundOrderDetailService.Repository.UpdateData(outboundOrderDetails); |
| | | } |
| | | stockInfo.LocationCode = locationInfo.LocationCode; |
| | | stockInfo.StockStatus = StockStatusEmun.åºåºå®æ.ObjToInt(); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, (PalletTypeEnum)stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId); |
| | |
| | | |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, (LocationStatusEnum)beforeStatus, LocationChangeType.OutboundCompleted, stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | | _unitOfWorkManage.CommitTran(); |
| | | //æ¨éåºåºå®æ |
| | | |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | _taskService = taskService; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¸è½½PDA |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("DownLoadApp"), AllowAnonymous] |
| | | public virtual ActionResult DownLoadApp() |
| | | { |
| | | string path = $"{AppDomain.CurrentDomain.BaseDirectory}Upload/App/"; |
| | | if (!Directory.Exists(path)) Directory.CreateDirectory(path); |
| | | path += "WMS-PDA.apk"; |
| | | |
| | | if(System.IO.File.Exists(path)) |
| | | |
| | | if (System.IO.File.Exists(path)) |
| | | { |
| | | byte[] fileBytes = System.IO.File.ReadAllBytes(path); |
| | | return File( |
| | |
| | | { |
| | | return Json(WebResponseContent.Instance.Error($"æªæ¾å°å®è£
å
")); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¸ä¼ PDA |
| | | /// </summary> |
| | | /// <param name="fileInput"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("UploadApp"), AllowAnonymous] |
| | | [Consumes("multipart/form-data")] |
| | | public WebResponseContent UploadApp(IEnumerable<IFormFile> fileInput) |
| | |
| | | if (!Directory.Exists(dicPath)) Directory.CreateDirectory(dicPath); |
| | | string path = $"{dicPath}WMS-PDA{DateTime.Now:yyyyMMddhhmmss}.apk"; |
| | | dicPath = $"{dicPath}WMS-PDA.apk"; |
| | | System.IO.File.Move(dicPath, path); |
| | | if (System.IO.File.Exists(dicPath)) |
| | | System.IO.File.Move(dicPath, path); |
| | | |
| | | using (var stream = new FileStream(dicPath, FileMode.Create)) |
| | | { |