| | |
| | | public int WarehouseId { get; set; } |
| | | |
| | | public string AGVArea { get; set; } |
| | | |
| | | public int PalletType { get; set; } |
| | | } |
| | | } |
| | |
| | | if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt()) |
| | | { |
| | | var content = TakeRequest(task.CurrentAddress); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | if (!content.Status) |
| | | { |
| | | throw new Exception(content.Message); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var content = PutRequest(task.NextAddress, task.PalletType); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | if (!content.Status) |
| | | { |
| | | throw new Exception(content.Message); |
| | | } |
| | | } |
| | | task.TaskState = TaskStatusEnum.AGV_WaitToExecute.ObjToInt(); |
| | | var up = _taskRepository.UpdateData(task); |
| | |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | task.TaskState = TaskStatusEnum.AGV_Finish.ObjToInt(); |
| | | var up = _taskRepository.DeleteAndMoveIntoHty(task, OperateTypeEnum.èªå¨å®æ); |
| | | _taskService.TaskCompleted(task.TaskNum); |
| | | agvResponseContent.Code = up ? "0" : "1"; |
| | | agvResponseContent.Message = up ? "æå" : "失败"; |
| | | return agvResponseContent; |
| | |
| | | case "end"://å
¥åºæ ¹æ®è¿ä¸ªä¿¡å·å¤ææ¾è´§å®æ |
| | | if (task.TaskType != TaskTypeEnum.Outbound.ObjToInt()) |
| | | { |
| | | var content = PutFinish(task.CurrentAddress); |
| | | var content = PutFinish(task.NextAddress); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | task.CurrentAddress = task.NextAddress; |
| | | task.NextAddress = ""; |
| | | task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); |
| | | var up = _taskRepository.UpdateData(task); |
| | | agvResponseContent.Code = up ? "0" : "1"; |
| | |
| | | else |
| | | { |
| | | otherDevice.SetValue(GroundStationDBName.W_PutRequest, true, stationManger.StationCode); |
| | | otherDevice.SetValue(GroundStationDBName.W_PutPalletType, (short)palletType, stationManger.StationCode); |
| | | Thread.Sleep(1000); |
| | | canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode); |
| | | if (canPut) |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | string apiAddress = "http://10.30.4.29:8182/rcms/services/rest/hikRpcService/genAgvSchedulingTask";// AppSettings.Get(APIEnum.AgvSendTask.ToString()); |
| | | string? apiAddress = apiInfos.FirstOrDefault(x => x.ApiCode == APIEnum.AgvSendTask.ToString())?.ApiAddress; |
| | | if (string.IsNullOrEmpty(apiAddress)) |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°åéAGV任塿¥å£,è¯·æ£æ¥æ¥å£é
ç½®"); // 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.29:8182/rcms/services/rest/hikRpcService/continueTask";// AppSettings.Get(APIEnum.AgvSecureReply.ToString()); |
| | | string? apiAddress = apiInfos.FirstOrDefault(x => x.ApiCode == APIEnum.AgvSecureReply.ToString())?.ApiAddress; |
| | | if (string.IsNullOrEmpty(apiAddress)) |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°åéAGV任塿¥å£,è¯·æ£æ¥æ¥å£é
ç½®"); // AppSettings.Get(APIEnum.AgvSendTask.ToString());// AppSettings.Get(APIEnum.AgvSecureReply.ToString()); |
| | | string response = HttpHelper.Post(apiAddress, secureReplyModel.Serialize()); |
| | | AgvResponseContent agvContent = response.DeserializeObject<AgvResponseContent>(); |
| | | if (agvContent.Code == "0") |
| | |
| | | } |
| | | else |
| | | { |
| | | if(item.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | if (item.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && item.AGVArea == x.NextPosi); |
| | | if (routers.FirstOrDefault() == null) |
| | |
| | | |
| | | task.NextAddress = router?.StartPosi ?? ""; |
| | | task.DeviceCode = item.RoadWay; |
| | | task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); |
| | | } |
| | | else |
| | | { |
| | |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è·¯ç±é
置信æ¯"); |
| | | } |
| | | router = routers.FirstOrDefault(); |
| | | string stationCode = router?.NextPosi ?? ""; |
| | | Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == stationCode); |
| | | if (stationManger == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°ç«å°é
置信æ¯"); |
| | | } |
| | | |
| | | task.NextAddress = router?.NextPosi ?? ""; |
| | | task.NextAddress = stationManger?.AGVStationCode ?? ""; |
| | | task.DeviceCode = "AGV"; |
| | | task.TaskState = TaskStatusEnum.AGV_Execute.ObjToInt(); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | switch (DeviceCode) |
| | | { |
| | | case "SC01_CSJ": |
| | | case "AGV_CSJ": |
| | | { |
| | | return TaskType == TaskTypeEnum.ProductionReturn.ObjToInt() ? "23" : "24"; |
| | | } |
| | | case "SC01_ZH": |
| | | case "AGV_ZH": |
| | | { |
| | | if (TaskType == TaskTypeEnum.InboundXB.ObjToInt()) |
| | | return "20"; |
| | |
| | | task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); |
| | | _taskRepository.UpdateData(task); |
| | | |
| | | bool isWrite = hoister.SetValue(HoisterDBName.RequestIn, false, deviceChildCode); |
| | | bool isWrite = hoister.SetValue(HoisterDBName.RequestOut, false, deviceChildCode); |
| | | } |
| | | else |
| | | { |
| | |
| | | int oldState = task.TaskState; |
| | | task.TaskState = TaskStatusEnum.SC_Executing.ObjToInt(); |
| | | task.ExceptionMessage = ""; |
| | | task.Dispatchertime = DateTime.Now; |
| | | _taskRepository.UpdateData(task); |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"ç³»ç»èªå¨æµç¨ï¼ä»»å¡ç¶æä»ã{oldState}ã转å°ã{task.TaskState}ã"); |
| | | } |
| | |
| | | { |
| | | if (commonStackerCrane != null) |
| | | { |
| | | WriteInfo(commonStackerCrane.DeviceName, $"读åå°ä»»å¡å®æä¿¡å·,{e.TaskNum}"); |
| | | if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) |
| | | { |
| | | WriteInfo(commonStackerCrane.DeviceName, $"读åå°ä»»å¡å®æä¿¡å·,{e.TaskNum}"); |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == e.TaskNum); |
| | | if (task != null) |
| | | { |
| | |
| | | |
| | | if (item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt()) |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.DeviceCode == item.StackerCraneCode && x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.NextAddress)); |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.DeviceCode == item.StackerCraneCode && x.TaskState == TaskStatusEnum.SC_Execute.ObjToInt() && string.IsNullOrEmpty(x.NextAddress)); |
| | | if (task != null && isCanPut && !isCanTake && !putRequest && !putFinish && !takeRequest && !takeFinish) |
| | | { |
| | | string oldAddress = task.NextAddress; |
| | |
| | | } |
| | | if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt()) |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TargetAddress == item.StackerCraneCode && x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.NextAddress)); |
| | | if (task != null && isCanPut && !isCanTake && !putRequest && !putFinish && !takeRequest && !takeFinish) |
| | | Dt_Task task = _taskRepository.QueryFirst(x => (x.TargetAddress == item.StackerCraneCode || string.IsNullOrEmpty(x.TargetAddress) || x.NextAddress == item.StackerCraneCode || string.IsNullOrEmpty(x.NextAddress)) && (x.TaskState == TaskStatusEnum.New.ObjToInt() || x.TaskState == TaskStatusEnum.SC_Execute.ObjToInt()) && x.SourceAddress == item.StationCode); |
| | | if (task != null) |
| | | { |
| | | string oldAddress = task.NextAddress; |
| | | int oldStatus = task.TaskState; |
| | | task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); |
| | | task.NextAddress = item.StationCode; |
| | | Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode); |
| | | if (stationManger == null) |
| | | { |
| | | WriteInfo(item.StationName, $"æªæ¾å°å¯¹åºç«å°ä¿¡æ¯,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | break; |
| | | } |
| | | string? locationCode = _taskService.RequestAssignLocation(task.TaskNum, stationManger.StackerCraneCode); |
| | | if (string.IsNullOrEmpty(locationCode)) |
| | | { |
| | | WriteInfo(item.StationName, $"请æ±åé
è´§ä½è¿åä¿¡æ¯é误,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | break; |
| | | } |
| | | task.CurrentAddress = stationManger.StackerCraneStationCode; |
| | | task.TargetAddress = locationCode; |
| | | task.NextAddress = locationCode; |
| | | task.DeviceCode = stationManger.StackerCraneCode; |
| | | _taskRepository.UpdateData(task); |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"ç³»ç»èªå¨æµç¨,ç®æ å°åç±{oldAddress}åæ´ä¸º{task.NextAddress},ä»»å¡ç¶æç±{oldStatus}åæ´ä¸º{task.TaskState}"); |
| | | } |
| | |
| | | WriteInfo(item.StationName, $"请æ±åé
è´§ä½è¿åä¿¡æ¯é误,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | break; |
| | | } |
| | | string oldAddress = task.NextAddress; |
| | | int oldStatus = task.TaskState; |
| | | task.CurrentAddress = stationManger.StackerCraneStationCode; |
| | | task.TargetAddress = locationCode; |
| | | task.NextAddress = locationCode; |
| | | task.DeviceCode = stationManger.StackerCraneCode; |
| | | task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); |
| | | _taskRepository.UpdateData(task); |
| | | |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"ç³»ç»èªå¨æµç¨,ç®æ å°åç±{oldAddress}åæ´ä¸º{task.NextAddress},ä»»å¡ç¶æç±{oldStatus}åæ´ä¸º{task.TaskState}"); |
| | | } |
| | | } |
| | | catch(Exception ex) |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | } |
| | |
| | | commonStackerCrane.LastTaskType = task.TaskType; |
| | | int oldState = task.TaskState; |
| | | task.TaskState = TaskStatusEnum.SC_Executing.ObjToInt(); |
| | | task.Dispatchertime = DateTime.Now; |
| | | task.ExceptionMessage = ""; |
| | | _taskRepository.UpdateData(task); |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"ç³»ç»èªå¨æµç¨ï¼ä»»å¡ç¶æä»ã{oldState}ã转å°ã{task.TaskState}ã"); |
| | | } |
| | |
| | | { |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneStationCode == task.NextAddress); |
| | | if(stationManger == null) |
| | | { |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"AGVç«ç¹æªé
ç½®,{task.NextAddress}"); |
| | | _taskService.UpdateTaskExceptionMessage(taskNum, $"AGVç«ç¹æªé
ç½®,{task.NextAddress}"); |
| | | return WebResponseContent.Instance.Error($"AGVç«ç¹æªé
ç½®,{task.NextAddress}"); |
| | | } |
| | | int oldStatus = task.TaskState; |
| | | task.DeviceCode = "AGV"; |
| | | task.DeviceCode = "AGV_CSJ"; |
| | | task.TaskState = TaskStatusEnum.AGV_Execute.ObjToInt(); |
| | | task.CurrentAddress = task.NextAddress; |
| | | task.CurrentAddress = stationManger.AGVStationCode; |
| | | task.NextAddress = task.TargetAddress; |
| | | _taskRepository.UpdateData(task); |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"ç³»ç»èªå¨æµç¨,ï¼ä»»å¡ç¶æä»ã{oldStatus}ã转å°ã{task.TaskState}ã"); |
| | |
| | | |
| | | if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | if (OutTaskStationIsOccupied(task) != null || true) |
| | | if (OutTaskStationIsOccupied(task) != null) |
| | | { |
| | | return task; |
| | | } |
| | |
| | | else |
| | | { |
| | | //æ°æ®é
ç½®é误 |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"åºåºä»»å¡ç»ç¹é误ï¼èµ·ç¹ï¼ã{task.NextAddress}ã"); |
| | | WriteInfo(task.DeviceCode, $"åºåºä»»å¡ç»ç¹é误ï¼èµ·ç¹ï¼ã{task.NextAddress}ã"); |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"åºåºä»»å¡ç»ç¹é误ï¼ç»ç¹ï¼ã{task.NextAddress}ã"); |
| | | WriteInfo(task.DeviceCode, $"åºåºä»»å¡ç»ç¹é误ï¼ç»ç¹ï¼ã{task.NextAddress}ã"); |
| | | return null; |
| | | } |
| | | |
| | |
| | | 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() && x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) == null;//æ¥è¯¢å¤§äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºæè´§çè´§ä½ï¼å¦ææ¯trueï¼åè¡¨ç¤ºæ·±è´§ä½ææªè¢«ä½¿ç¨çæ
åµ |
| | | moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && x.LocationStatus != LocationStatusEnum.PalletLock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.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()) == null; //æ¥è¯¢å°äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºç©ºï¼ä¸ç¦ç¨ç¶æä¸ä¸ºç¦ç¨ä»¥ååªå
¥çè´§ä½ï¼å¦ææ¯trueï¼å表示æµ
è´§ä½è¢«ä½¿ç¨æè
被ç¦ç¨çæ
åµ |
| | | littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.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() && x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) == null;//æ¥è¯¢å¤§äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºæè´§çè´§ä½ï¼å¦ææ¯trueï¼åè¡¨ç¤ºæ·±è´§ä½ææªè¢«ä½¿ç¨çæ
åµ |
| | | moreDepthFlag = moreDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.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.Normal.ObjToInt()) == null; //æ¥è¯¢å°äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºç©ºï¼ä¸ç¦ç¨ç¶æä¸ä¸ºç¦ç¨ä»¥ååªå
¥çè´§ä½ï¼å¦ææ¯trueï¼å表示æµ
è´§ä½è¢«ä½¿ç¨æè
被ç¦ç¨çæ
åµ |
| | | littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())) == null; //æ¥è¯¢å°äºå½åè´§ä½æ·±åº¦çéåéæ¯å¦æç¶æä¸ä¸ºç©ºï¼ä¸ç¦ç¨ç¶æä¸ä¸ºç¦ç¨ä»¥ååªå
¥çè´§ä½ï¼å¦ææ¯trueï¼å表示æµ
è´§ä½è¢«ä½¿ç¨æè
被ç¦ç¨çæ
åµ |
| | | } |
| | | |
| | | break; |
| | | default: |
| | | throw new Exception($"æçç±»åé误"); |
| | | } |
| | | |
| | | if (moreDepthFlag && littleDepthFlag) |
| | |
| | | /// 1ï¼ç»çæå<br/> |
| | | /// 2ï¼ç»çæ¤é<br/> |
| | | /// 3ï¼å
¥åºç¡®è®¤<br/> |
| | | /// 4ï¼å
¥åºæ¤é<br/> |
| | | /// 5ï¼å·²å
¥åº<br/> |
| | | /// 4ï¼å
¥åºæ¤é<br/> |
| | | /// 6ï¼å
¥åºå®æ<br/> |
| | | /// 7ï¼åºåºéå®<br/> |
| | | /// 8ï¼åºåºå®æ<br/> |
| | |
| | | [Description("å
¥åºæ¤é")] |
| | | å
¥åºæ¤é = 4, |
| | | |
| | | [Description("å·²å
¥åº")] |
| | | å·²å
¥åº = 5, |
| | | |
| | | [Description("å
¥åºå®æ")] |
| | | å
¥åºå®æ = 6, |
| | | |
| | |
| | | ç§»åºéå® = 9, |
| | | |
| | | [Description("å
¥åºå®ææªå»ºåºåºå")] |
| | | å
¥åºå®ææªå»ºåºåºå = 10 |
| | | å
¥åºå®ææªå»ºåºåºå = 10, |
| | | |
| | | [Description("éåº")] |
| | | éåº = 11, |
| | | } |
| | | } |
| | |
| | | Parallel.For(0, 1, e => |
| | | { |
| | | MiniProfiler.Current.CustomTiming("SQLï¼", GetParas(p) + "ãSQLè¯å¥ãï¼" + sql); |
| | | Console.Out.WriteLine(sql); |
| | | Console.Out.WriteLine(); |
| | | |
| | | }); |
| | | if(AppSettings.GetValue("PrintSql").ObjToBool()) |
| | | { |
| | | Console.Out.WriteLine(GetParas(p)); |
| | | Console.Out.WriteLine(sql); |
| | | Console.Out.WriteLine(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | // row["Id"] = log.Id; |
| | | // å°RequestParamä¸çæ¢è¡ç¬¦æ¿æ¢ä¸ºç©ºå符串 |
| | | row["RequestParam"] = log.RequestParam?.Replace("\r\n", ""); |
| | | row["RequestParam"] = log.RequestParam?.Replace("\r\n", "").Replace("\n", ""); |
| | | // å°ResponseParamä¸çæ¢è¡ç¬¦æ¿æ¢ä¸ºç©ºå符串 |
| | | row["ResponseParam"] = log.ResponseParam?.Replace("\r\n", ""); |
| | | row["ResponseParam"] = log.ResponseParam?.Replace("\r\n", "").Replace("\n", ""); |
| | | //row["Success"] = log.Success ?? -1; |
| | | // å°BeginDate设置为logçBeginDate |
| | | row["BeginDate"] = log.BeginDate; |
| | |
| | | |
| | | public string AGVArea { get; set; } |
| | | |
| | | public int PalletType { get; set; } |
| | | |
| | | } |
| | | } |
| | |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_External.Model; |
| | | using WIDESEA_IInboundRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | /// å
¥åºå®æä¸æ¥ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | WebResponseContent FeedbackInboundOrder(Dt_StockInfo stockInfo,Dt_InboundOrder inboundOrder); |
| | | WebResponseContent FeedbackInboundOrder(Dt_StockInfo stockInfo,Dt_InboundOrder inboundOrder, List<ERPInboundDetailModel> detailModels); |
| | | } |
| | | } |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\WIDESEA_External\WIDESEA_External.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_InboundRepository\WIDESEA_InboundRepository.csproj" /> |
| | | </ItemGroup> |
| | | |
| | |
| | | try |
| | | { |
| | | //è·åä»åºä¿¡æ¯ |
| | | Dt_Warehouse warehouse = _warehouseService.Repository.QueryFirst(x=>x.WarehouseCode==erpInOrder.WaId); |
| | | if (warehouse==null) |
| | | Dt_Warehouse warehouse = _warehouseService.Repository.QueryFirst(x => x.WarehouseCode == erpInOrder.WaId); |
| | | if (warehouse == null) |
| | | { |
| | | return content.Error("æªæ¾å°ä»åºä¿¡æ¯"); |
| | | } |
| | | //è·åæ¯å¦åå¨è®¢å |
| | | Dt_InboundOrder inboundOrder = BaseDal.QueryFirst(x=>x.InboundOrderNo== erpInOrder.OrderNo); |
| | | if (erpInOrder.Way==1) |
| | | Dt_InboundOrder inboundOrder = BaseDal.QueryFirst(x => x.InboundOrderNo == erpInOrder.OrderNo); |
| | | if (erpInOrder.Way == 1) |
| | | { |
| | | if (inboundOrder!=null) |
| | | if (inboundOrder != null) |
| | | { |
| | | |
| | | } |
| | | } |
| | | else if(erpInOrder.Way==2) |
| | | else if (erpInOrder.Way == 2) |
| | | { |
| | | |
| | | } |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å
¥åºåä¿¡æ¯"); |
| | | } |
| | | if (inboundOrder.OrderStatus>=InOrderStatusEnum.å
¥åºå®æ.ObjToInt()) |
| | | if (inboundOrder.OrderStatus >= InOrderStatusEnum.å
¥åºå®æ.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"å
¥åºåå·²ç»æ"); |
| | | } |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªå¨å
¥åºåæç»ä¸æ¾å°è¯¥ç©æä¿¡æ¯"); |
| | | } |
| | | if (inboundOrderDetail.OrderDetailStatus>OrderDetailStatusEnum.GroupAndInbound.ObjToInt()) |
| | | if (inboundOrderDetail.OrderDetailStatus > OrderDetailStatusEnum.GroupAndInbound.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"对åºå
¥åºåæç»å·²ç»æ"); |
| | | } |
| | | float inboundDetailSum = inboundOrderDetail.OverInQuantity + inboundOrderDetail.ReceiptQuantity ; |
| | | float inboundDetailSum = inboundOrderDetail.OverInQuantity + inboundOrderDetail.ReceiptQuantity; |
| | | if (inboundDetailSum == inboundOrderDetail.OrderQuantity) |
| | | { |
| | | return WebResponseContent.Instance.Error($"è¯¥ç©æå
¥åºåæç»å·²å
¨é¨ç»ç宿"); |
| | |
| | | return WebResponseContent.Instance.Error($"ä¸è¯¥æ¶è´§åæç»æ¶è´§æ°éä¸ä¸è´"); |
| | | } |
| | | Dt_StockInfo oldStockinfo = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == palletCode); |
| | | if(oldStockinfo!=null) |
| | | if (oldStockinfo != null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æçéå¤"); |
| | | } |
| | |
| | | PalletCode = palletCode, |
| | | StockStatus = StockStatusEmun.ç»çæå.ObjToInt(), |
| | | WarehouseId = inboundOrder.WarehouseId, |
| | | Details=new List<Dt_StockInfoDetail> { stockInfoDetail } |
| | | Details = new List<Dt_StockInfoDetail> { stockInfoDetail } |
| | | }; |
| | | inboundOrderDetail.ReceiptQuantity += model.Quantity; |
| | | _unitOfWorkManage.BeginTran(); |
| | | if (inboundOrderDetail.OrderDetailStatus==OrderDetailStatusEnum.New.ObjToInt()) |
| | | if (inboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()) |
| | | { |
| | | inboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.GroupAndInbound.ObjToInt(); |
| | | } |
| | |
| | | /// å
¥åºå®æä¸æ¥ERP |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent FeedbackInboundOrder(Dt_StockInfo stockInfo,Dt_InboundOrder inboundOrder) |
| | | public WebResponseContent FeedbackInboundOrder(Dt_StockInfo stockInfo, Dt_InboundOrder inboundOrder, List<ERPInboundDetailModel> detailModels) |
| | | { |
| | | WebResponseContent content=new WebResponseContent(); |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | if (inboundOrder.Details.Count == 0) |
| | |
| | | { |
| | | 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",//æµè¯ |
| | | CreatorCode = inboundOrder.Creater,//æµè¯ |
| | | EntDate = inboundOrder.CreateDate.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | StockDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | SuppliersId = inboundOrder.SupplierId, |
| | |
| | | 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) |
| | | ErpRequestContent? requestContent = JsonConvert.DeserializeObject<ErpRequestContent>(response); |
| | | if (requestContent == null) |
| | | { |
| | | return WebResponseContent.Instance.Error(); |
| | | } |
| | | if (requestContent.res==0) |
| | | 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; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
¥åºå®æåä¼ å°ERP æµè¯ |
| | | /// å
¥åºå®æåä¼ å°ERP |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | |
| | | ERPInboundModel model = new ERPInboundModel() |
| | | { |
| | | Code = inboundOrder.InboundOrderNo, |
| | | CreatorCode = "TC20082",//æµè¯ |
| | | CreatorCode = inboundOrder.Creater,//æµè¯ |
| | | EntDate = inboundOrder.CreateDate.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | StockDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | SuppliersId = inboundOrder.SupplierId, |
| | |
| | | { |
| | | try |
| | | { |
| | | Dt_ReceiveOrder receiveOrder = _inboundRepository.ReceiveOrderRepository.Db.Queryable<Dt_ReceiveOrder>().Where(x => x.ReceiveOrderNo == orderNo).Includes(x=>x.Details).First(); |
| | | Dt_ReceiveOrder receiveOrder = _inboundRepository.ReceiveOrderRepository.Db.Queryable<Dt_ReceiveOrder>().Where(x => x.ReceiveOrderNo == orderNo).Includes(x => x.Details).First(); |
| | | if (receiveOrder == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥æ¶è´§å"); |
| | |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥ç©æçä¿¡æ¯"); |
| | | } |
| | | //该æ¶è´§åä»åºæ¯å¦æè¯¥ç©æ |
| | | if (materielInfo.WarehouseId!= receiveOrder.WarehouseId) |
| | | if (materielInfo.WarehouseId != receiveOrder.WarehouseId) |
| | | { |
| | | return WebResponseContent.Instance.Error($"è¯¥ç©æä¸å±äºè¯¥ä»åº"); |
| | | } |
| | | Dt_PurchaseOrder purchaseOrder = _inboundRepository.PurchaseOrderRepository.Db.Queryable<Dt_PurchaseOrder>().Where(x => x.PurchaseOrderNo == model.PurchaseOrderNo).Includes(x=>x.Details).First(); |
| | | Dt_PurchaseOrder purchaseOrder = _inboundRepository.PurchaseOrderRepository.Db.Queryable<Dt_PurchaseOrder>().Where(x => x.PurchaseOrderNo == model.PurchaseOrderNo).Includes(x => x.Details).First(); |
| | | if (purchaseOrder == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥éè´å"); |
| | |
| | | Dt_PurchaseOrderDetail? purchaseOrderDetail = purchaseOrder.Details.FirstOrDefault(x => x.MaterielCode == model.MaterielCode && (x.PurchaseDetailStatus == PurchaseOrderDetailStatusEnum.NotReceived.ObjToInt() || x.PurchaseDetailStatus == PurchaseOrderDetailStatusEnum.Receiving.ObjToInt())); |
| | | if (purchaseOrderDetail == null) |
| | | { |
| | | if (purchaseOrder.Details.Count > 0) |
| | | { |
| | | return WebResponseContent.Instance.Error($"该æç»æ¶è´§å·²å®æ"); |
| | | } |
| | | return WebResponseContent.Instance.Error($"该æç»æ¶è´§å·²å®æ"); |
| | | } |
| | | //夿æ¯å¦åå¨å¯¹åºéè´æç»çæ¶è´§æç» |
| | | Dt_ReceiveOrderDetail? detail = receiveOrder.Details.FirstOrDefault(x => x.PurchaseOrderNo == model.PurchaseOrderNo && x.PurchaseOrderDetailRowNo == purchaseOrderDetail.RowNo); |
| | |
| | | |
| | | lock (_rowNoLocker) |
| | | { |
| | | if (detail!=null) |
| | | if (detail != null) |
| | | { |
| | | //åææ¶è´§æç»å¢å æ¶è´§æ°é |
| | | detail.ReceivedQuantity += model.Quantity; |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"éè´åè¯¥ç©ææ°éåæ¶è´§æ°éä¸ä¸è´"); |
| | | } |
| | | if(purchaseOrderDetail.PurchaseDetailReceiveQty ==purchaseOrderDetail.PurchaseDetailQuantity) |
| | | if (purchaseOrderDetail.PurchaseDetailReceiveQty == purchaseOrderDetail.PurchaseDetailQuantity) |
| | | { |
| | | purchaseOrderDetail.PurchaseDetailStatus = PurchaseOrderDetailStatusEnum.Received.ObjToInt(); |
| | | } |
| | |
| | | receiveOrder.ReceiveOrderStatus = ReceiveOrderStatusEnum.Receiving.ObjToInt(); |
| | | } |
| | | //夿éè´æç»æ°é |
| | | if (purchaseOrderDetail.PurchaseDetailQuantity<model.Quantity) |
| | | if (purchaseOrderDetail.PurchaseDetailQuantity < model.Quantity) |
| | | { |
| | | return WebResponseContent.Instance.Error($"è¯·æ ¸å¯¹éè´åè¯¥ç©ææ°é"); |
| | | } |
| | | if (purchaseOrderDetail.PurchaseDetailReceiveQty>0) |
| | | if (purchaseOrderDetail.PurchaseDetailReceiveQty > 0) |
| | | { |
| | | purchaseOrderDetail.PurchaseDetailReceiveQty += model.Quantity; |
| | | } |
| | |
| | | { |
| | | purchaseOrderDetail.PurchaseDetailReceiveQty = model.Quantity; |
| | | } |
| | | if (purchaseOrderDetail.PurchaseDetailReceiveQty> purchaseOrderDetail.PurchaseDetailQuantity) |
| | | if (purchaseOrderDetail.PurchaseDetailReceiveQty > purchaseOrderDetail.PurchaseDetailQuantity) |
| | | { |
| | | return WebResponseContent.Instance.Error($"éè´åè¯¥ç©ææ°éåæ¶è´§æ°éä¸ä¸è´"); |
| | | } |
| | |
| | | #endregion |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | | |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | } |
| | |
| | | ERPReceiveModel receiveModel = new ERPReceiveModel() |
| | | { |
| | | Code = receiveOrder.ReceiveOrderNo, |
| | | CompanyId = "HATC", |
| | | DeliveryCode = receiveOrder.DeliveryCode, |
| | | CustomerId = receiveOrder.CustomerId, |
| | | CreatorId = "TC20082",//æµè¯ receiveOrder.Creater |
| | | CreatorId = receiveOrder.Creater, |
| | | EntDate = receiveOrder.CreateDate.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | ReceiveDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | PlantsId = "HA02", |
| | | SuppliersId = receiveOrder.SuppliersId, |
| | | Type = Enum.GetName(typeof(ReceiveOrderTypeEnum), receiveOrder.ReceiveOrderType), |
| | | Type = Enum.GetName(typeof(ReceiveOrderTypeEnum), receiveOrder.ReceiveOrderType) ?? throw new Exception($"éè´åç±»åé误"), |
| | | UniqueTag = receiveOrder.ReceiveOrderId.ToString(), |
| | | WarehouseCode = warehouse.WarehouseCode, |
| | | Way = 1, |
| | |
| | | |
| | | Dt_InboundOrder inboundOrder = new Dt_InboundOrder() |
| | | { |
| | | InboundOrderNo="IN"+DateTime.Now.ToString("yyyyMMddHHmmss"),//æµè¯ |
| | | UpperOrderNo = receiveOrder.ReceiveOrderNo, |
| | | CreateType = OrderCreateTypeEnum.UpperSystemPush.ObjToInt(), |
| | | OrderStatus = InOrderStatusEnum.æªå¼å§.ObjToInt(), |
| | |
| | | } |
| | | receiveOrder = new Dt_ReceiveOrder() |
| | | { |
| | | ReceiveOrderNo= "RE"+DateTime.Now.ToString("yyyyMMddHHmmss"),//æµè¯ |
| | | ReceiveOrderStatus = ReceiveOrderStatusEnum.Receiving.ObjToInt(), |
| | | CustomerId = "", |
| | | DeliveryCode = "/", |
| | |
| | | issueModel = new ERPIssueModel() |
| | | { |
| | | UniqueTag = id.ToString(), |
| | | Code = "OT" + DateTime.Now.ToString("yyyyMMddHHmmss"),//æµè¯ |
| | | Code = outboundOrder.OrderNo,//æµè¯ |
| | | WarehouseCode = warehouse.WarehouseCode, |
| | | Docremark = "", |
| | | Deptno = outboundOrder.DepartmentCode, |
| | | Deptname = outboundOrder.DepartmentName, |
| | | Createtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | Createuser = "TC20082", |
| | | Createuser = outboundOrder.Creater, |
| | | Issitem = new List<ERPIssueItemModel>() { issueItemModel }, |
| | | }; |
| | | } |
| | |
| | | issueModel = new ERPIssueModel() |
| | | { |
| | | UniqueTag = id.ToString(), |
| | | Code = "OT" + DateTime.Now.ToString("yyyyMMddHHmmss"),//æµè¯ |
| | | Code = outboundOrder.OrderNo,//æµè¯ |
| | | WarehouseCode = warehouse.WarehouseCode, |
| | | Docremark = "", |
| | | Deptno = outboundOrder.DepartmentCode, |
| | | Deptname = outboundOrder.DepartmentName, |
| | | Createtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | Createuser = "TC20082", |
| | | Createuser = outboundOrder.Creater, |
| | | Issitem = new List<ERPIssueItemModel>() { issueItemModel }, |
| | | }; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /*using AutoMapper; |
| | | using MailKit.Search; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Serialization; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Linq.Expressions; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Common.WareHouseEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.Utilities; |
| | | using WIDESEA_DTO.ERP; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_DTO.Outbound; |
| | | using WIDESEA_External.ERPService; |
| | | using WIDESEA_External.Model; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_IStockRepository; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_OutboundService |
| | | { |
| | | public class OutboundOrderService : ServiceBase<Dt_OutboundOrder, IOutboundOrderRepository>, IOutboundOrderService |
| | | { |
| | | private readonly IMapper _mapper; |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | private readonly IBasicService _basicService; |
| | | private readonly IOutboundOrderDetailRepository _outboundOrderDetailRepository; |
| | | private readonly IStockInfoService _stockInfoService; |
| | | private readonly IStockInfoRepository _stockInfoRepository; |
| | | public IOutboundOrderRepository Repository => BaseDal; |
| | | private readonly IInvokeERPService _invokeERPService; |
| | | private readonly IOutStockLockInfoService _outStockLockInfoService; |
| | | |
| | | public OutboundOrderService(IOutboundOrderRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IOutboundOrderDetailRepository outboundOrderDetailRepository, IStockInfoService stockInfoService, |
| | | IStockInfoRepository stockInfoRepository, IInvokeERPService invokeERPService, IOutStockLockInfoService outStockLockInfoService) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _basicService = basicService; |
| | | _outboundOrderDetailRepository = outboundOrderDetailRepository; |
| | | _stockInfoService = stockInfoService; |
| | | _stockInfoRepository = stockInfoRepository; |
| | | _invokeERPService = invokeERPService; |
| | | _outStockLockInfoService = outStockLockInfoService; |
| | | } |
| | | |
| | | public WebResponseContent ReceiveOutOrder(ErpOutOrderDTO model) |
| | | { |
| | | try |
| | | { |
| | | Dt_MaterielInfo materielInfo = _basicService.MaterielInfoService.Repository.QueryFirst(x => x.MaterielCode == model.MCode); |
| | | if (materielInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥ç©æä¿¡æ¯"); |
| | | } |
| | | |
| | | Dt_Warehouse warehouse = _basicService.WarehouseService.Repository.QueryFirst(x => x.WarehouseCode == model.WaId); |
| | | if (warehouse == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥ä»åºä¿¡æ¯"); |
| | | } |
| | | |
| | | Dt_OutboundOrder oldOutboundOrder = BaseDal.Db.Queryable<Dt_OutboundOrder>().Where(x => x.UpperOrderNo == model.OrderNo).Includes(x => x.Details).First(); |
| | | |
| | | if (model.Way == 1) |
| | | { |
| | | if (oldOutboundOrder != null) |
| | | { |
| | | if (oldOutboundOrder.Details.FirstOrDefault(x => x.RowNo == Convert.ToInt32(model.RowNo)) != null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"该æç»è¡å·å·²åå¨"); |
| | | } |
| | | if (oldOutboundOrder.WarehouseId != warehouse.WarehouseId) |
| | | { |
| | | return WebResponseContent.Instance.Error($"ä»åºä¸ä¸è´"); |
| | | } |
| | | else |
| | | { |
| | | Dt_OutboundOrderDetail outboundOrderDetail = new Dt_OutboundOrderDetail() |
| | | { |
| | | RowNo = Convert.ToInt32(model.RowNo), |
| | | BatchNo = model.MLot, |
| | | MaterielCode = model.MCode, |
| | | MaterielName = materielInfo.MaterielName, |
| | | OrderDetailStatus = OrderDetailStatusEnum.New.ObjToInt(), |
| | | OrderQuantity = model.Qty, |
| | | OrderId = oldOutboundOrder.Id |
| | | }; |
| | | |
| | | if (warehouse.WarehouseCode == WarehouseEnum.HA64.ToString()) |
| | | { |
| | | Dt_StockInfo stockInfo = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId).Includes(x => x.Details).Where(x => x.Details.Any(v => v.BatchNo == model.MLot)).First(); |
| | | if (stockInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"åºåä¸è¶³"); |
| | | } |
| | | //æ´æ¹ç¶æ |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | | stockInfo.Details.ForEach(x => { x.Remark = oldOutboundOrder.OrderNo; }); |
| | | |
| | | Db.Updateable(stockInfo.Details); |
| | | _stockInfoRepository.UpdateData(stockInfo); |
| | | } |
| | | _outboundOrderDetailRepository.AddData(outboundOrderDetail); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Dt_OutboundOrderDetail outboundOrderDetail = new Dt_OutboundOrderDetail() |
| | | { |
| | | RowNo = Convert.ToInt32(model.RowNo), |
| | | BatchNo = model.MLot, |
| | | MaterielCode = model.MCode, |
| | | MaterielName = materielInfo.MaterielName, |
| | | OrderDetailStatus = OrderDetailStatusEnum.New.ObjToInt(), |
| | | OrderQuantity = model.Qty, |
| | | }; |
| | | Dt_OutboundOrder outboundOrder = new Dt_OutboundOrder() |
| | | { |
| | | OrderNo = model.OrderNo, |
| | | UpperOrderNo = model.OrderNo, |
| | | OrderStatus = OutOrderStatusEnum.æªå¼å§.ObjToInt(), |
| | | OrderType = OutOrderTypeEnum.Issue.ObjToInt(), |
| | | CreateType = OrderCreateTypeEnum.UpperSystemPush.ObjToInt(), |
| | | WarehouseId = warehouse.WarehouseId, |
| | | DepartmentCode = model.DepartmentCode, |
| | | DepartmentName = model.DepartmentName, |
| | | Details = new List<Dt_OutboundOrderDetail> { outboundOrderDetail } |
| | | }; |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | Db.InsertNav(outboundOrder).Include(x => x.Details).ExecuteCommand(); |
| | | |
| | | if (warehouse.WarehouseCode == WarehouseEnum.HA64.ToString()) |
| | | { |
| | | Dt_StockInfo stockInfo = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId).Includes(x => x.Details).Where(x => x.Details.Any(v => v.BatchNo == model.MLot)).First(); |
| | | if (stockInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"åºåä¸è¶³"); |
| | | } |
| | | |
| | | //æ´æ¹ç¶æ |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | | stockInfo.Details.ForEach(x => { x.Remark = outboundOrder.OrderNo; }); |
| | | _stockInfoRepository.UpdateData(stockInfo); |
| | | Db.Updateable(stockInfo.Details); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | | } |
| | | else if (model.Way == 2) |
| | | { |
| | | if (oldOutboundOrder == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥åºåºå"); |
| | | } |
| | | Dt_OutboundOrderDetail? outboundOrderDetail = oldOutboundOrder.Details.FirstOrDefault(x => x.RowNo == Convert.ToInt32(model.RowNo)); |
| | | if (outboundOrderDetail == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥æç»è¡å·ä¿¡æ¯"); |
| | | } |
| | | if (outboundOrderDetail.OrderDetailStatus != OrderDetailStatusEnum.New.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"该æç»ä¸å¯ä¿®æ¹"); |
| | | } |
| | | outboundOrderDetail = new Dt_OutboundOrderDetail() |
| | | { |
| | | RowNo = Convert.ToInt32(model.RowNo), |
| | | BatchNo = model.MLot, |
| | | MaterielCode = model.MCode, |
| | | MaterielName = materielInfo.MaterielName, |
| | | OrderDetailStatus = OrderDetailStatusEnum.New.ObjToInt(), |
| | | OrderQuantity = model.Qty, |
| | | }; |
| | | |
| | | _outboundOrderDetailRepository.UpdateData(outboundOrderDetail); |
| | | } |
| | | else if (model.Way == 3) |
| | | { |
| | | if (oldOutboundOrder == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥åºåºå"); |
| | | } |
| | | } |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent TestOutUpload(Dt_OutboundOrder outboundOrder, Dt_StockInfo stockInfo, string warehouseCode) |
| | | { |
| | | try |
| | | { |
| | | List<ERPPickItemModel> eRPOutPick = new List<ERPPickItemModel>(); |
| | | ERPPickItemModel pickItemModel = new ERPPickItemModel() |
| | | { |
| | | Lotno = stockInfo.Details[0].BatchNo, |
| | | Qty = stockInfo.Details[0].StockQuantity.ObjToInt().ToString(), |
| | | Location = 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 } |
| | | }; |
| | | ERPIssueModel issueModel = new ERPIssueModel() |
| | | { |
| | | UniqueTag = outboundOrder.Id.ToString(), |
| | | Code = outboundOrder.OrderNo,//æµè¯ |
| | | WarehouseCode = warehouseCode, |
| | | Docremark = "", |
| | | Deptno = outboundOrder.DepartmentCode, |
| | | Deptname = outboundOrder.DepartmentName, |
| | | Createtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | Createuser = outboundOrder.Creater, |
| | | Issitem = new List<ERPIssueItemModel>() { issueItemModel }, |
| | | }; |
| | | |
| | | string response = _invokeERPService.InvokeOutStandardsApi(issueModel); |
| | | ErpRequestContent requestContent = response.DeserializeObject<ErpRequestContent>(); |
| | | if (requestContent.res == 1) |
| | | { |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | else |
| | | { |
| | | return WebResponseContent.Instance.Error(requestContent.Data); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | //䏿¥åºåºå®æ |
| | | 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䏿¥åºåºå®æ |
| | | ERPIssueModel issueModel = new ERPIssueModel(); |
| | | List<Dt_StockInfo> stockInfos = new List<Dt_StockInfo>(); |
| | | if (stockInfo == null) |
| | | { |
| | | 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(), |
| | | WarehouseCode = warehouse.WarehouseCode, |
| | | Docremark = "", |
| | | Deptno = outboundOrder.DepartmentCode, |
| | | Deptname = outboundOrder.DepartmentName, |
| | | Createtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | Createuser = outboundOrder.Creater, |
| | | Issitem = new List<ERPIssueItemModel>() { issueItemModel }, |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | 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 = outboundOrder.OrderNo,//æµè¯ |
| | | WarehouseCode = warehouse.WarehouseCode, |
| | | Docremark = "", |
| | | Deptno = outboundOrder.DepartmentCode, |
| | | Deptname = outboundOrder.DepartmentName, |
| | | Createtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | Createuser = outboundOrder.Creater, |
| | | 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 |
| | | { |
| | | return WebResponseContent.Instance.Error(requestContent.Data); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// æ´æ¹åºåºååºåç¶æ |
| | | /// </summary> |
| | | /// <param name="warehouse"></param> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | 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 (stockInfos.Count <= 0) |
| | | { |
| | | return WebResponseContent.Instance.Error($"åºåä¸è¶³"); |
| | | } |
| | | //æ´æ¹ç¶æ |
| | | stockInfos.ForEach(x => |
| | | { |
| | | x.StockStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | | }); |
| | | return WebResponseContent.Instance.OK("æå", stockInfos); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | }*/ |
| | |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | | public partial class TaskService |
| | | public partial class TaskService |
| | | { |
| | | /// <summary> |
| | | /// æµè¯æ¶åºä» |
| | |
| | | MesResponseContent responseContent = new MesResponseContent(); |
| | | try |
| | | { |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x=>x.WarehouseCode==WarehouseEnum.HA64.ToString()); |
| | | 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==model.ToolCode)); |
| | | 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 == model.ToolCode)); |
| | | if (stockInfo == null) |
| | | { |
| | | return responseContent.Error($"æµè¯æ¶:{model.ToolCode}æ å¯ç¨åºå"); |
| | |
| | | x.WarehouseId == stockInfo.WarehouseId && |
| | | x.LocationStatus == (int)LocationStatusEnum.InStock && |
| | | (x.EnableStatus == (int)EnableStatusEnum.Normal || x.EnableStatus == (int)EnableStatusEnum.OnlyOut)); |
| | | if (locationInfo==null) |
| | | if (locationInfo == null) |
| | | { |
| | | return responseContent.Error($"æµè¯æ¶è´§ä½:{stockInfo.LocationCode}åºåºæ¡ä»¶ä¸æ»¡è¶³"); |
| | | } |
| | |
| | | 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(); |
| | | //æ´æ°åºåç¶æ |
| | |
| | | BaseDal.AddData(taskOut); |
| | | //å å
¥è´§ä½åå¨è®°å½ |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, locationStatus, LocationChangeType.OutboundAssignLocation, stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", taskOut.TaskNum); |
| | | //å å
¥åºååå¨è®°å½ |
| | | //_recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfoDetails, beforeQuantity, totalQuantity, StockChangeTypeEnum.StockLock); |
| | | _unitOfWorkManage.CommitTran(); |
| | | //å°ä»»å¡æ¨éå°WCS |
| | | WebResponseContent content = PushTasksToWCS(new List<Dt_Task>() { taskOut }, "AGV"); |
| | | responseContent.OK(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | 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 == backModel.TestToolCode)); |
| | | if (stockInfo==null) |
| | | if (stockInfo == null) |
| | | { |
| | | return responseContent.Error($"{backModel.TestToolCode}åºåä¿¡æ¯ä¸åå¨"); |
| | | } |
| | |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | }; |
| | | //æ´æ¹åºåç¶æ |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(); |
| | | stockInfo.StockStatus = StockStatusEmun.éåº.ObjToInt(); |
| | | BaseDal.AddData(taskIn); |
| | | _stockRepository.StockInfoRepository.UpdateData(stockInfo); |
| | | //å°ä»»å¡æ¨éå°WCS |
| | |
| | | /// <returns></returns> |
| | | public WebResponseContent TestSynStock(TestToolSynInfo toolSynInfo) |
| | | { |
| | | WebResponseContent content= new WebResponseContent(); |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x=>x.ApiCode==APIEnum.WMS_MES_TestToolSync.ToString()); |
| | | Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.WMS_MES_TestToolSync.ToString()); |
| | | MESRoot<TestToolSynInfo> root = new MESRoot<TestToolSynInfo>() |
| | | { |
| | | From = "WMS", |
| | | DateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | Content=toolSynInfo |
| | | Content = toolSynInfo |
| | | }; |
| | | JsonSerializerSettings settings = new JsonSerializerSettings |
| | | { |
| | |
| | | string response = HttpMesHelper.Post(apiInfo.ApiAddress, request); |
| | | MesResponseContent mesResponseContent = response.DeserializeObject<MesResponseContent>(); |
| | | //è°ç¨æ¥å£ |
| | | if (mesResponseContent.BSucc==true) |
| | | if (mesResponseContent.BSucc == true) |
| | | { |
| | | content.OK(mesResponseContent.StrMsg); |
| | | } |
| | |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_DTO.Task; |
| | | using WIDESEA_External.ERPService; |
| | | using WIDESEA_External.Model; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IInboundRepository; |
| | |
| | | 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(); |
| | | 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) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°æç对åºçç»çä¿¡æ¯"); |
| | |
| | | |
| | | LocationStatusEnum lastStatus = (LocationStatusEnum)locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x=>x.WarehouseId== task.WarehouseId); |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == task.WarehouseId); |
| | | |
| | | stockInfo.LocationCode = locationInfo.LocationCode; |
| | | Dt_InboundOrder? inboundOrder = _inboundRepository.InboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x => x.InboundOrderNo == stockInfo.Details.FirstOrDefault().OrderNo).Includes(x => x.Details).First(); |
| | | List<Dt_InboundOrderDetail> inboundOrderDetails = new List<Dt_InboundOrderDetail>(); |
| | | if (stockInfo.StockStatus == StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt()) |
| | | { |
| | | //æ¨éå
¥åºå®æç»Erp |
| | | if (inboundOrder == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"对åºå
¥åºåä¸åå¨"); |
| | | } |
| | | |
| | | List<ERPInboundDetailModel> detailModels = new List<ERPInboundDetailModel>(); |
| | | |
| | | 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); |
| | | } |
| | | |
| | | //å
¥åºæç»æ°å¢å®ææ°é |
| | | 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; |
| | | if (inboundOrder.Details.Count == (newCount + oldCount)) |
| | | { |
| | | inboundOrder.OrderStatus = InOrderStatusEnum.å
¥åºå®æ.ObjToInt(); |
| | | } |
| | | if (!_inboundOrderService.FeedbackInboundOrder(stockInfo, inboundOrder, detailModels).Status) |
| | | { |
| | | return WebResponseContent.Instance.Error($"å
¥åºåæ¥Erp失败"); |
| | | } |
| | | } |
| | | //æµè¯æ¶å
¥åºåºåç¶æ |
| | | if (task.TaskType == TaskTypeEnum.Inbound.ObjToInt() && warehouse.WarehouseCode==WarehouseEnum.HA64.ToString()) |
| | | if (task.TaskType == TaskTypeEnum.Inbound.ObjToInt() && warehouse.WarehouseCode == WarehouseEnum.HA64.ToString()) |
| | | { |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºå®ææªå»ºåºåºå.ObjToInt(); |
| | | } |
| | | else |
| | | { |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | | |
| | | |
| | | } |
| | | stockInfo.Details.ForEach(x => |
| | | { |
| | | x.Status = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | | }); |
| | | stockInfo.LocationCode = locationInfo.LocationCode; |
| | | //æ¨éå
¥åºå®æç»Erp |
| | | 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); |
| | |
| | | _stockRepository.StockInfoDetailRepository.UpdateData(stockInfo.Details); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationChangeType.InboundCompleted); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, stockInfo.Details.Sum(x => x.StockQuantity), stockInfo.Details.Sum(x => x.StockQuantity), StockChangeTypeEnum.Inbound, taskNum); |
| | | _inboundRepository.InboundOrderDetailRepository.UpdateData(inboundOrderDetails); |
| | | _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è´§ä½ä¿¡æ¯"); |
| | | } |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x=>x.WarehouseId== task.WarehouseId); |
| | | 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) && warehouse.WarehouseCode != WarehouseEnum.HA64.ToString()) |
| | |
| | | if (warehouse.WarehouseCode != WarehouseEnum.HA64.ToString()) |
| | | { |
| | | //æ¨éåºåºå®æ |
| | | WebResponseContent webResponse = _outboundService.OutboundOrderService.TestOutUpload(outboundOrderDetails.FirstOrDefault().Id,stockInfo); |
| | | WebResponseContent webResponse = _outboundService.OutboundOrderService.TestOutUpload(outboundOrderDetails.FirstOrDefault().Id, stockInfo); |
| | | if (!webResponse.Status) |
| | | { |
| | | return webResponse; |
| | | } |
| | | } |
| | | _unitOfWorkManage.BeginTran(); |
| | | if (outboundOrderDetails.Count>0) |
| | | if (outboundOrderDetails.Count > 0) |
| | | { |
| | | _outboundService.OutboundOrderDetailService.Repository.UpdateData(outboundOrderDetails); |
| | | } |
| | | stockInfo.LocationCode = locationInfo.LocationCode; |
| | | stockInfo.LocationCode = ""; |
| | | stockInfo.StockStatus = StockStatusEmun.åºåºå®æ.ObjToInt(); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | |
| | | |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, (LocationStatusEnum)beforeStatus, LocationChangeType.OutboundCompleted, stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"该æçå·²ç»å®è´§ä½"); |
| | | } |
| | | if(warehouseId != stockInfo.WarehouseId) |
| | | { |
| | | return WebResponseContent.Instance.Error($"ä»åºä¸æ£ç¡®"); |
| | | } |
| | | |
| | | Dt_Task newTask = new Dt_Task() |
| | | { |
| | |
| | | TargetAddress = "", |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = warehouseId |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType |
| | | }; |
| | | |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(); |
| | |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥å
¥åºä»»å¡"); |
| | | } |
| | | |
| | | if(_basicRepository.LocationInfoRepository.QueryFirst(x=>x.LocationCode == task.TargetAddress) != null) |
| | | { |
| | | return WebResponseContent.Instance.OK(data: task.TargetAddress); |
| | | } |
| | | |
| | | Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(roadwayNo, (PalletTypeEnum)task.PalletType, task.WarehouseId); |
| | | if (locationInfo == null) |
| | | { |
| | |
| | | { |
| | | WebResponseContent content = _outboundService.OutboundOrderDetailService.LockOutboundStockDataUpdate(stockInfos, outboundOrderDetails, outStockLockInfos, locationInfos, tasks: tasks); |
| | | |
| | | if (content.Status) |
| | | { |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | | else |
| | | if (!content.Status) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content; |
| | | } |
| | | return content; |
| | | } |
| | | else if (outboundOrderDetails != null && outboundOrderDetails.Count > 0) |
| | | { |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Approval |
| | | { |
| | | /// <summary> |
| | | /// 审æ¹ä»»å¡ |
| | | /// </summary> |
| | | [Route("api/[controller]")] |
| | | [ApiController] |
| | | public class ApprovalTaskController : ApiBaseController<IApprovalTaskService, Dt_ApprovalTask> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Basic |
| | | { |
| | | /// <summary> |
| | | /// å®¢æ· |
| | | /// </summary> |
| | | [Route("api/[controller]")] |
| | | [ApiController] |
| | | public class CustomerInfoController : ApiBaseController<ICustomerInfoService, Dt_CustomerInfo> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Basic |
| | | { |
| | | /// <summary> |
| | | /// è´§ä½ |
| | | /// </summary> |
| | | [Route("api/LocationInfo")] |
| | | [ApiController] |
| | | public class LocationInfoController : ApiBaseController<ILocationInfoService, Dt_LocationInfo> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Basic |
| | | { |
| | | /// <summary> |
| | | /// ç©æ |
| | | /// </summary> |
| | | [Route("api/MaterielInfo")] |
| | | [ApiController] |
| | | public class MaterielInfoController : ApiBaseController<IMaterielInfoService, Dt_MaterielInfo> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Basic |
| | | { |
| | | /// <summary> |
| | | /// ä¾åºå |
| | | /// </summary> |
| | | [Route("api/[controller]")] |
| | | [ApiController] |
| | | public class SupplierInfoController : ApiBaseController<ISupplierInfoService, Dt_SupplierInfo> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Basic |
| | | { |
| | | /// <summary> |
| | | /// ç¨æ· |
| | | /// </summary> |
| | | [Route("api/[controller]")] |
| | | [ApiController] |
| | | public class UserInfoController : ApiBaseController<IUserInfoService, Dt_UserInfo> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Basic |
| | | { |
| | | /// <summary> |
| | | /// ä»åº |
| | | /// </summary> |
| | | [Route("api/Warehouse")] |
| | | [ApiController] |
| | | public class WarehouseController : ApiBaseController<IWarehouseService, Dt_Warehouse> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Check |
| | | { |
| | | /// <summary> |
| | | /// è´¨æ£å |
| | | /// </summary> |
| | | [Route("api/[controller]")] |
| | | [ApiController] |
| | | public class CheckOrderController : ApiBaseController<ICheckOrderService, Dt_CheckOrder> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Check |
| | | { |
| | | /// <summary> |
| | | /// è´¨æ£ç»æ |
| | | /// </summary> |
| | | [Route("api/[controller]")] |
| | | [ApiController] |
| | | public class CheckOrderResultController : ApiBaseController<ICheckOrderResultService, Dt_CheckOrderResult> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.ERP |
| | | { |
| | | /// <summary> |
| | | /// ERPæ¥å£ |
| | | /// </summary> |
| | | [Route("api/Erp")] |
| | | [ApiController] |
| | | public class ErpController : ControllerBase |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Inbound |
| | | { |
| | | /// <summary> |
| | | /// å
¥åºå |
| | | /// </summary> |
| | | [Route("api/InboundOrder")] |
| | | [ApiController] |
| | | public class InboundOrderController : ApiBaseController<IInboundOrderService, Dt_InboundOrder> |
| | |
| | | /// <param name="palletCode"></param> |
| | | /// <param name="serNum"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("MaterielGroupSingle"),AllowAnonymous] |
| | | [HttpPost, HttpGet, Route("MaterielGroupSingle")] |
| | | public WebResponseContent MaterielGroup(int inboundOrderId, string palletCode, string serNum) |
| | | { |
| | | return Service.MaterielGroup(inboundOrderId, palletCode, serNum); |
| | |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("FeedbackInboundOrder"),AllowAnonymous] |
| | | [HttpPost, HttpGet, Route("FeedbackInboundOrder")] |
| | | public WebResponseContent FeedbackInboundOrder(int id) |
| | | { |
| | | return Service.FeedbackInboundOrder(id); |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Inbound |
| | | { |
| | | /// <summary> |
| | | /// å
¥åºåæç» |
| | | /// </summary> |
| | | [Route("api/InboundOrderDetail")] |
| | | [ApiController] |
| | | public class InboundOrderDetailController : ApiBaseController<IInboundOrderDetailService, Dt_InboundOrderDetail> |
| | |
| | | namespace WIDESEA_WMSServer.Controllers.Inbound |
| | | { |
| | | /// <summary> |
| | | /// åå²å
¥åºåæç» |
| | | /// å
¥åºåæç»åå² |
| | | /// </summary> |
| | | [Route("api/InboundOrderDetail_Hty")] |
| | | [ApiController] |
| | |
| | | namespace WIDESEA_WMSServer.Controllers.Inbound |
| | | { |
| | | /// <summary> |
| | | /// åå²å
¥åºå |
| | | /// å
¥åºååå² |
| | | /// </summary> |
| | | [Route("api/InboundOrder_Hty")] |
| | | [ApiController] |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Inbound |
| | | { |
| | | /// <summary> |
| | | /// éè´å |
| | | /// </summary> |
| | | [Route("api/PurchaseOrder")] |
| | | [ApiController] |
| | | public class PurchaseOrderController : ApiBaseController<IPurchaseOrderService, Dt_PurchaseOrder> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Inbound |
| | | { |
| | | /// <summary> |
| | | /// éè´åæç» |
| | | /// </summary> |
| | | [Route("api/PurchaseOrderDetail")] |
| | | [ApiController] |
| | | public class PurchaseOrderDetailController : ApiBaseController<IPurchaseOrderDetailService, Dt_PurchaseOrderDetail> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Inbound |
| | | { |
| | | /// <summary> |
| | | /// æ¶è´§å |
| | | /// </summary> |
| | | [Route("api/[controller]")] |
| | | [ApiController] |
| | | public class ReceiveOrderController : ApiBaseController<IReceiveOrderService, Dt_ReceiveOrder> |
| | |
| | | /// </summary> |
| | | /// <param name="receiveOrderId">æ¶è´§åç¼å·</param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("CreateInboundOrder"),AllowAnonymous] |
| | | [HttpPost, HttpGet, Route("CreateInboundOrder")] |
| | | public WebResponseContent CreateInboundOrder(int receiveOrderId) |
| | | { |
| | | return Service.CreateInboundOrder(receiveOrderId); |
| | |
| | | /// </summary> |
| | | /// <param name="orderId"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("FeedbackReceiveOrder"),AllowAnonymous] |
| | | [HttpPost, HttpGet, Route("FeedbackReceiveOrder")] |
| | | public WebResponseContent FeedbackReceiveOrder(int orderId) |
| | | { |
| | | return Service.FeedbackReceiveOrder(orderId); |
| | |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("GetReceiveOrders")] |
| | | public WebResponseContent GetReceiveOrders([FromBody]SaveModel saveModel) |
| | | public WebResponseContent GetReceiveOrders([FromBody] SaveModel saveModel) |
| | | { |
| | | return Service.GetReceiveOrders(saveModel); |
| | | } |
| | |
| | | /// <param name="purchaseOrderId"></param> |
| | | /// <param name="lotNo"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("ReceiveAllOrder"),AllowAnonymous] |
| | | [HttpPost, HttpGet, Route("ReceiveAllOrder")] |
| | | public WebResponseContent ReceiveAllOrder(int purchaseOrderId, string lotNo) |
| | | { |
| | | return Service.ReceiveAllOrder(purchaseOrderId, lotNo); |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Inbound |
| | | { |
| | | /// <summary> |
| | | /// æ¶è´§åæç» |
| | | /// </summary> |
| | | [Route("api/[controller]")] |
| | | [ApiController] |
| | | public class ReceiveOrderDetailController : ApiBaseController<IReceiveOrderDetailService, Dt_ReceiveOrderDetail> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.MES |
| | | { |
| | | /// <summary> |
| | | /// MESæ¥å£ |
| | | /// </summary> |
| | | [Route("api/Mes")] |
| | | [ApiController] |
| | | public class MesController : ControllerBase |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Outbound |
| | | { |
| | | /// <summary> |
| | | /// åºåºè¯¦æ
|
| | | /// </summary> |
| | | [Route("api/OutStockLockInfo")] |
| | | [ApiController] |
| | | public class OutStockLockInfoController : ApiBaseController<IOutStockLockInfoService, Dt_OutStockLockInfo> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Outbound |
| | | { |
| | | /// <summary> |
| | | /// åºåºå |
| | | /// </summary> |
| | | [Route("api/OutboundOrder")] |
| | | [ApiController] |
| | | public class OutboundOrderController : ApiBaseController<IOutboundOrderService, Dt_OutboundOrder> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Outbound |
| | | { |
| | | /// <summary> |
| | | /// åºåºåæç» |
| | | /// </summary> |
| | | [Route("api/OutboundOrderDetail")] |
| | | [ApiController] |
| | | public class OutboundOrderDetailController : ApiBaseController<IOutboundOrderDetailService, Dt_OutboundOrderDetail> |
| | |
| | | namespace WIDESEA_WMSServer.Controllers.Inbound |
| | | { |
| | | /// <summary> |
| | | /// åå²åºåºåæç» |
| | | /// åºåºåæç»åå² |
| | | /// </summary> |
| | | [Route("api/OutboundOrderDetail_Hty")] |
| | | [ApiController] |
| | |
| | | namespace WIDESEA_WMSServer.Controllers.Inbound |
| | | { |
| | | /// <summary> |
| | | /// åå²åºåºå |
| | | /// åºåºååå² |
| | | /// </summary> |
| | | [Route("api/OutboundOrder_Hty")] |
| | | [ApiController] |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers |
| | | { |
| | | /// <summary> |
| | | /// PDA |
| | | /// </summary> |
| | | [Route("api/PDA")] |
| | | [Authorize, ApiController] |
| | | public class PDAController : Controller |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Record |
| | | { |
| | | /// <summary> |
| | | /// è´§ä½ç¶æåå¨è®°å½ |
| | | /// </summary> |
| | | [Route("api/LocationStatusChangeRecord")] |
| | | [ApiController] |
| | | public class LocationStatusChangeRecordController : ApiBaseController<ILocationStatusChangeRecordService, Dt_LocationStatusChangeRecord> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Record |
| | | { |
| | | /// <summary> |
| | | /// åºåæ°éåå¨è®°å½ |
| | | /// </summary> |
| | | [Route("api/StockQuantityChangeRecord")] |
| | | [ApiController] |
| | | public class StockQuantityChangeRecordController : ApiBaseController<IStockQuantityChangeRecordService, Dt_StockQuantityChangeRecord> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Stock |
| | | { |
| | | /// <summary> |
| | | /// åºå |
| | | /// </summary> |
| | | [Route("api/StockInfo")] |
| | | [ApiController] |
| | | public class StockInfoController : ApiBaseController<IStockInfoService, Dt_StockInfo> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Stock |
| | | { |
| | | /// <summary> |
| | | /// åºåæç» |
| | | /// </summary> |
| | | [Route("api/StockInfoDetail")] |
| | | [ApiController] |
| | | public class StockInfoDetailController : ApiBaseController<IStockInfoDetailService, Dt_StockInfoDetail> |
| | |
| | | namespace WIDESEA_WMSServer.Controllers.Stock |
| | | { |
| | | /// <summary> |
| | | /// åå²åºåæç» |
| | | /// åºåæç»åå² |
| | | /// </summary> |
| | | [Route("api/StockInfoDetail_Hty")] |
| | | [ApiController] |
| | |
| | | namespace WIDESEA_WMSServer.Controllers.Stock |
| | | { |
| | | /// <summary> |
| | | /// åå²åºåä¿¡æ¯ |
| | | /// åºååå² |
| | | /// </summary> |
| | | [Route("api/StockInfo_Hty")] |
| | | [ApiController] |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Stock |
| | | { |
| | | /// <summary> |
| | | /// åºåè§å¾ |
| | | /// </summary> |
| | | [Route("api/StockView")] |
| | | [Authorize, ApiController] |
| | | public class StockViewController : Controller |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers |
| | | { |
| | | /// <summary> |
| | | /// åå
¸ |
| | | /// </summary> |
| | | [Route("api/Sys_Dictionary")] |
| | | [ApiController] |
| | | public class Sys_DictionaryController : ApiBaseController<ISys_DictionaryService, Sys_Dictionary> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers |
| | | { |
| | | /// <summary> |
| | | /// åå
¸æç» |
| | | /// </summary> |
| | | [Route("api/Sys_DictionaryList")] |
| | | [ApiController] |
| | | public class Sys_DictionaryListController : ApiBaseController<ISys_DictionaryListService, Sys_DictionaryList> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers |
| | | { |
| | | /// <summary> |
| | | /// æ¥å¿ |
| | | /// </summary> |
| | | [Route("api/[controller]")] |
| | | [ApiController] |
| | | public class Sys_LogController : ApiBaseController<ISys_LogService, Sys_Log> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers |
| | | { |
| | | /// <summary> |
| | | /// èå |
| | | /// </summary> |
| | | [Route("api/Sys_Menu")] |
| | | [ApiController] |
| | | public class Sys_MenuController : ApiBaseController<ISys_MenuService, Sys_Menu> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers |
| | | { |
| | | /// <summary> |
| | | /// è§è² |
| | | /// </summary> |
| | | [Route("api/Sys_Role")] |
| | | [ApiController] |
| | | public class Sys_RoleController : ApiBaseController<ISys_RoleService, Sys_Role> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers |
| | | { |
| | | /// <summary> |
| | | /// ç§æ· |
| | | /// </summary> |
| | | [Route("api/tenant")] |
| | | [ApiController] |
| | | public class Sys_TenantController : ApiBaseController<ISys_TenantService, Sys_Tenant> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers |
| | | { |
| | | /// <summary> |
| | | /// ç¨æ· |
| | | /// </summary> |
| | | [Route("api/User")] |
| | | [ApiController] |
| | | public class Sys_UserController : ApiBaseController<ISys_UserService, Sys_User> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.TaskInfo |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡ |
| | | /// </summary> |
| | | [Route("api/Task")] |
| | | [ApiController] |
| | | public class TaskController : ApiBaseController<ITaskService, Dt_Task> |
| | |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.TaskInfo |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡åå² |
| | | /// </summary> |
| | | [Route("api/Task_Hty")] |
| | | [ApiController] |
| | | public class Task_HtyController : ApiBaseController<ITask_HtyService, Dt_Task_Hty> |
| | |
| | | |
| | | "WCS": "http://localhost:9291/api/Task/", |
| | | "LogAopEnable": false, |
| | | "PrintSql": true, //æå°SQLè¯å¥ |
| | | "ApiName": "WIDESEA", |
| | | "ExpMinutes": 120, |
| | | "QuartzJobAutoStart": true, |