| | |
| | | { |
| | | if (mES_In.containerType == "2") LocationType = 2; |
| | | } |
| | | else if (dt_Warehouse.WarehouseType == (int)WarehouseEnum.YMCP) |
| | | { |
| | | LocationType = 3; |
| | | } |
| | | |
| | | string Roadway = _locationInfoService.AccessingTunnel(dt_Warehouse.WarehouseId, LocationType); |
| | | if (Roadway == "") return apiResponse.Error($"WMSæªè½æ¥è¯¢é对åºå··éç¼å·ï¼ä»åºç¼ç ï¼{mES_In.warehouseNo}"); |
| | | |
| | | //è·å对åºPLCç«å°ä¿¡æ¯ |
| | | Dt_roadwayinfo _Roadwayinfo = _roadWayinfoService.QbtainPlatform(Roadway); |
| | | |
| | | Dt_Task setask = BaseDal.QueryData(x => x.PalletCode == mES_In.containerNo).FirstOrDefault(); |
| | | if (setask != null) return apiResponse.Error($"WMSå·²æå½åä»»å¡ï¼ä¸å¯éå¤ä¸åï¼æçç¼å·ï¼{mES_In.containerNo}"); |
| | | |
| | | |
| | | Dt_Task task = new Dt_Task(); |
| | |
| | | |
| | | Dt_roadwayinfo _Roadwayinfo = _roadWayinfoService.QbtainPlatform(dt_LocationInfo.RoadwayNo); |
| | | |
| | | Dt_Task setask = BaseDal.QueryData(x => x.PalletCode == mES_In.containerNo).FirstOrDefault(); |
| | | if (setask != null) return apiResponse.Error($"WMSå·²æå½åä»»å¡ï¼ä¸å¯éå¤ä¸åï¼æçç¼å·ï¼{mES_In.containerNo}"); |
| | | |
| | | Dt_Task task = new Dt_Task(); |
| | | task.TaskNum = mES_In.transNo; |
| | | task.PalletCode = dt_Stock.PalletCode; |
| | |
| | | //å¨ä½æ¥è¯¢æ¥å£ |
| | | public ApiResponse GetLocationByContainer(MES_InTask mES_In) |
| | | { |
| | | WriteLog.GetLog("å¨ä½æ¥è¯¢æ¥å£").Write($"åæ°ï¼{mES_In.ToJson()}", $"任塿¥æ¶åæ°"); |
| | | ApiResponse apiResponse = new ApiResponse(); |
| | | try |
| | | { |
| | | if (string.IsNullOrWhiteSpace(mES_In.containerNo)) return apiResponse.Error("æçç ä¸è½ä¸ºç©º"); |
| | | Dt_StockInfo dt_Stock = _stockInfoService.Repository.QueryData(x => x.PalletCode == mES_In.containerNo).FirstOrDefault(); |
| | | Dt_StockInfo dt_Stock = _stockInfoService.Repository.QueryData(x => x.PalletCode == mES_In.containerNo &&x.StockStatus==(int)StockStatusEmun.å·²å
¥åº).FirstOrDefault(); |
| | | if (dt_Stock == null) return apiResponse.Error($"WMSæªè½æ¥æ¾é该æçæ¡ç çåºåè´§ä½ä¿¡æ¯ï¼æ¡ç ï¼{mES_In.containerNo}"); |
| | | Dt_LocationInfo dt_LocationInfo = _locationInfoService.Repository.QueryData(x => x.LocationCode == dt_Stock.LocationCode).FirstOrDefault(); |
| | | if (dt_LocationInfo == null) return apiResponse.Error($"WMSæªè½æ¥æ¾é该æçæ¡ç çåºåè´§ä½ä¿¡æ¯ï¼æ¡ç ï¼{mES_In.containerNo}ï¼æªæ¾å°è´§ä½å·ï¼{dt_Stock.LocationCode}"); |
| | |
| | | if (string.IsNullOrWhiteSpace(mES_In.transNo)) return apiResponse.Error("åæ®ç¼å·ä¸è½ä¸ºç©º"); |
| | | Dt_Task dt_Task = BaseDal.QueryData(x => x.TaskNum == mES_In.transNo).FirstOrDefault(); |
| | | if (dt_Task == null) return apiResponse.Error($"WMSæªè½æ¥æ¾é对åºåæ®ä»»å¡ï¼æ¡ç ï¼{mES_In.transNo}"); |
| | | if(dt_Task.TaskStatus== (int)InTaskStatusEnum.InNew || dt_Task.TaskStatus == (int)OutTaskStatusEnum.OutNew) |
| | | if(dt_Task.TaskStatus== (int)InTaskStatusEnum.InNew) |
| | | { |
| | | Dt_StockInfo dt_StockInfo=_stockInfoService.Repository.QueryData(x=>x.PalletCode==dt_Task.PalletCode).FirstOrDefault(); |
| | | if (dt_StockInfo == null) return apiResponse.Error("åæ¶å¤±è´¥ï¼WMSè®°å½çæçåºåæ¥æ¾å¤±è´¥"); |
| | | _stockInfoService.Repository.DeleteData(dt_StockInfo); |
| | | BaseDal.DeleteData(dt_Task); |
| | | return apiResponse.OK(); |
| | | }else if(dt_Task.TaskStatus == (int)OutTaskStatusEnum.OutNew) |
| | | { |
| | | Dt_StockInfo dt_StockInfo = _stockInfoService.Repository.QueryData(x => x.PalletCode == dt_Task.PalletCode).FirstOrDefault(); |
| | | Dt_LocationInfo dt_LocationInfo= _locationInfoService.Repository.QueryData(x=>x.LocationCode== dt_StockInfo.LocationCode).FirstOrDefault(); |
| | | dt_StockInfo.StockStatus = (int)StockStatusEmun.å·²å
¥åº; |
| | | dt_LocationInfo.LocationStatus = (int)LocationStatusEnum.InStock; |
| | | |
| | | _stockInfoService.Repository.UpdateData(dt_StockInfo); |
| | | _locationInfoService.Repository.UpdateData(dt_LocationInfo); |
| | | BaseDal.DeleteData(dt_Task); |
| | | return apiResponse.OK(); |
| | | } |
| | |
| | | |
| | | } |
| | | //åºåºä»»å¡å馿¥å£ |
| | | public MES_parameter OutStoreDocCallback(string TransNo,string Result,string ResultMsg,string ContainerNo,string LocationCode) |
| | | public MES_parameter OutStoreDocCallback(string TransNo,string Result,string ResultMsg) |
| | | { |
| | | MES_parameter mES_Parame = new MES_parameter(); |
| | | try |
| | | { |
| | | MesInResultResponse mesInResult = new MesInResultResponse(); |
| | | MesOutResultResponse mesInResult = new MesOutResultResponse(); |
| | | mesInResult.TransNo = TransNo; |
| | | mesInResult.Result = Result; |
| | | mesInResult.ResultMsg = ResultMsg; |
| | | mesInResult.ContainerNo = ContainerNo; |
| | | mesInResult.LocationCode = LocationCode; |
| | | mES_Parame = HttpHelper.Post<MES_parameter>(MES_OutReporttask, mesInResult, "åºåºä»»å¡æ±æ¥"); |
| | | return mES_Parame; |
| | | } |