| | |
| | | using WIDESEA_Comm.AGVInterface.Requset; |
| | | using WIDESEA_Common; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.Const; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_StoragIntegrationServices |
| | |
| | | public partial class ToAGVService |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// PDAæ§è¡agvä»»å¡ç´èµ°åè½ |
| | | /// </summary> |
| | | /// <param name="taskinfo"></param> |
| | | /// <param name="operationType">æä½ç±»å(1-ç»å® 2-è§£ç»)</param> |
| | | /// <returns></returns> |
| | | public static WebResponseContent UntieStation(Dt_Task taskinfo, string operationType) |
| | | public WebResponseContent UntieStation(SaveModel saveModel) |
| | | { |
| | | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | |
| | | string CZTM = saveModel.MainData["CZTM"].ToString(); |
| | | if (string.IsNullOrEmpty(CZTM)) throw new Exception("车轴æ¡ç 为空"); |
| | | |
| | | string TargetAddress = saveModel.MainData["TargetAddress"].ToString(); |
| | | if (string.IsNullOrEmpty(TargetAddress)) return content.Error("æªéæ©ç¼åå°ï¼ç¼åå°ä¸å¯ä¸ºç©º"); |
| | | try |
| | | { |
| | | bindCtnrAndBin bind = new bindCtnrAndBin() |
| | | //è°åwcsæ¥å£ï¼è¯»å该ç«å°æ¯å¦å¯æ¾ |
| | | var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress); |
| | | var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.WCSIPAddress)?.ConfigValue; |
| | | var ReceiveByWMSTask = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.GetPlcState)?.ConfigValue; |
| | | if (ReceiveByWMSTask == null || ipAddress == null) |
| | | { |
| | | reqCode = Guid.NewGuid().ToString().Replace("-", ""), |
| | | clientCode = "WMS", |
| | | ctnrTyp = "2", |
| | | indBind = operationType, // 1-ç»å® 2-è§£ç» |
| | | stgBinCode = taskinfo.SourceAddress, |
| | | }; |
| | | throw new Exception("WMS IP æªé
ç½®"); |
| | | } |
| | | var wmsIpAddrss = ipAddress + ReceiveByWMSTask; |
| | | |
| | | string ipaddress = AGV_Interface + "/getCLInfostring"; |
| | | var respon = HttpHelper.Post(wmsIpAddrss, JsonConvert.SerializeObject(TargetAddress)); //http://localhost:9291/api/Task/ReceiveTask, |
| | | |
| | | var requestBindInfo = bind.ToDictionary(); |
| | | if (respon == null) return content.OK("çæä»»å¡æå"); |
| | | |
| | | var strRespon = HttpsClient.PostAsync(ipaddress, requestBindInfo).Result; |
| | | WebResponseContent respone = JsonConvert.DeserializeObject<WebResponseContent>(respon.ToString()); |
| | | if (!respone.Status) |
| | | { |
| | | return content.Error(respone.Message); |
| | | } |
| | | |
| | | var responBase = JsonConvert.DeserializeObject<AGVResponBase>(strRespon); |
| | | if (responBase.code != "0") throw new Exception(responBase.message); |
| | | |
| | | //todo |
| | | |
| | | return content.OK(); |
| | | RequestTaskDto input=new RequestTaskDto(); |
| | | input.Position = TargetAddress; |
| | | WebResponseContent agvtocon=genAgvSchedulingTask(input); |
| | | if(agvtocon.Status) |
| | | { |
| | | return content.OK("çæä»»å¡æå"); |
| | | } |
| | | else |
| | | { |
| | | return content.Error("é误信æ¯ï¼"+agvtocon.Message); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |