| | |
| | | using LogLibrary.Log; |
| | | using Microsoft.Extensions.Configuration; |
| | | using Microsoft.Extensions.Hosting; |
| | | using Microsoft.Extensions.Logging; |
| | | using MimeKit; |
| | | using Newtonsoft.Json; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; |
| | | using Org.BouncyCastle.Tls; |
| | | using System; |
| | | using System.Net; |
| | | using System.Net.Sockets; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using WIDESEA_Common; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.Middlewares; |
| | | using WIDESEA_DTO.AGV; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_IServices; |
| | | using WIDESEA_IStorageBasicRepository; |
| | | using WIDESEA_IStorageSocketServices; |
| | | using WIDESEA_IStorageTaskRepository; |
| | | using WIDESEA_IStorageTaskServices; |
| | | using WIDESEA_Model.Models.AGV; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEAWCS_BasicInfoRepository; |
| | | //using static MailKit.Telemetry; |
| | | using WIDESEAWCS_Model.Models; |
| | | using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using AutoMapper; |
| | | using Mapster; |
| | |
| | | private readonly ILocationInfoRepository _locationRepository; |
| | | |
| | | |
| | | public SocketClientService(/*IDt_TaskService taskService*/IDt_TaskRepository TaskRepository, IDt_StationManagerRepository stationManagerRepository, ILogger<SocketClientService> logger) |
| | | public SocketClientService(IDt_TaskRepository TaskRepository, IDt_StationManagerRepository stationManagerRepository, ILogger<SocketClientService> logger) |
| | | { |
| | | //_taskService = taskService; |
| | | BaseDal= TaskRepository; |
| | | _stationManagerRepository= stationManagerRepository; |
| | | BaseDal = TaskRepository; |
| | | _stationManagerRepository = stationManagerRepository; |
| | | _logger = logger; |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | LogFactory.GetLog("Socketæ¥æ¶æ°æ®").Error(true, "æ ææ¥ææ ¼å¼"); |
| | | LogFactory.GetLog("Socketæ¥æ¶æ°æ®").Error(true, $"æ ææ¥ææ ¼å¼:{JsonConvert.SerializeObject(Y)}"); |
| | | } |
| | | } |
| | | catch |
| | |
| | | ReceiveCommandResponse(x); |
| | | break; |
| | | case "906": |
| | | AGVJobStartOrEndResponse(x.Substring(21, 1),x.Substring(22,1)); |
| | | AGVJobStartOrEndResponse(x.Substring(21, 1), x.Substring(22, 1)); |
| | | break; |
| | | case "902": |
| | | DataReportResponse(x.Substring(21, 1)); |
| | | break; |
| | | case "935": |
| | | DeviceStationStatusInvite(); |
| | | DeviceStationStatusInvite(x.Substring(15, 5)); |
| | | break; |
| | | case "103": |
| | | HOSTOutBoundTask(x); |
| | |
| | | public void clientSend(byte[] buffer) |
| | | { |
| | | var Y = Encoding.UTF8.GetString(buffer); |
| | | LogFactory.GetLog("Socketåéæ°æ®").Error(true, Y); |
| | | LogFactory.GetLog("Socketåéæ°æ®").Info(true, Y); |
| | | socket.Send(buffer); |
| | | } |
| | | |
| | |
| | | int sum = 0; |
| | | try |
| | | { |
| | | for (int i = 0; i < x.Length-2; i++) |
| | | for (int i = 0; i < x.Length - 2; i++) |
| | | { |
| | | sum += x[i]; |
| | | } |
| | |
| | | /// <summary> |
| | | /// 设å¤ç¼å· |
| | | /// </summary> |
| | | public const string DeviceID = "0000000001"; |
| | | public const string DeviceID = "0013130010"; |
| | | /// <summary> |
| | | /// åéä¸éè¦åå¤ |
| | | /// </summary> |
| | |
| | | { |
| | | try |
| | | { |
| | | string str = SendandReply + "101" + BaseDal.GetSeqNo().Result.ToString() + GetFieldsAsString(Agvstatus) + GetListStringOutStation(outStations) + "1" + GetFieldsAsString(inStation); |
| | | string str = SendandReply + "101" + BaseDal.GetSeqNo().Result.ToString("D5") + GetFieldsAsString(Agvstatus) + GetListStringOutStation(outStations) + "1" + GetFieldsAsString(inStation); |
| | | clientSend(MakeStringToByteMsg(str)); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | try |
| | | { |
| | | string str = SendandReply + "925" + BaseDal.GetSeqNo().Result.ToString(); |
| | | string str = SendandReply + "925" + BaseDal.GetSeqNo().Result.ToString("D5"); |
| | | clientSend(MakeStringToByteMsg(str)); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | try |
| | | { |
| | | string str = SendNotReply + "915" + BaseDal.GetSeqNo().Result.ToString() + Command; |
| | | string str = SendNotReply + "915" + BaseDal.GetSeqNo().Result.ToString("D5") + Command; |
| | | clientSend(MakeStringToByteMsg(str)); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | try |
| | | { |
| | | string str = SendNotReply + "913" + BaseDal.GetSeqNo().Result.ToString() + Status; |
| | | string str = SendNotReply + "913" + BaseDal.GetSeqNo().Result.ToString("D5") + Status; |
| | | clientSend(MakeStringToByteMsg(str)); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | try |
| | | { |
| | | string str = SendNotReply + "917" + BaseDal.GetSeqNo().Result.ToString() + Status; |
| | | string str = SendNotReply + "917" + BaseDal.GetSeqNo().Result.ToString("D5") + Status; |
| | | clientSend(MakeStringToByteMsg(str)); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | try |
| | | { |
| | | string str = SendandReply + "905" + BaseDal.GetSeqNo().Result.ToString() + Status + JobOrderID + priority + FormLocation + ToLocation + TaskType + TrayCnt + PallteCode; |
| | | string str = SendandReply + "905" + BaseDal.GetSeqNo().Result.ToString("D5") + Status + JobOrderID + priority + FormLocation + ToLocation + TaskType + TrayCnt + PallteCode; |
| | | clientSend(MakeStringToByteMsg(str)); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | try |
| | | { |
| | | string str = SendNotReply + "907" + BaseDal.GetSeqNo().Result.ToString() + Status + JobOrderID + priority + FormLocation + ToLocation + TaskType + TrayCnt + PallteCode; |
| | | string str = SendNotReply + "907" + BaseDal.GetSeqNo().Result.ToString("D5") + Status + JobOrderID + priority + FormLocation + ToLocation + TaskType + TrayCnt + PallteCode; |
| | | clientSend(MakeStringToByteMsg(str)); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | try |
| | | { |
| | | string str = SendandReply + "901" + BaseDal.GetSeqNo().Result.ToString() + "0" + JobOrderID + priority + FormLocation + ToLocation + TaskType + TrayCnt + PallteCode; |
| | | string str = SendandReply + "901" + BaseDal.GetSeqNo().Result.ToString("D5") + "0" + JobOrderID + priority + FormLocation + ToLocation + TaskType + TrayCnt + PallteCode; |
| | | clientSend(MakeStringToByteMsg(str)); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | /// <param name="TaskType">ä»»å¡ç±»å Iå
¥åºãOåºåºãSç«å°å°ç«å°ãRç§»åº</param> |
| | | /// <param name="PallteCode">æçå·</param> |
| | | /// <returns></returns> |
| | | public void DeviceStationStatusReport(HOSTAGVStatus Agvstatus, List<OutStationStatus> outStations, List<InStationStatus> inStation) |
| | | public void DeviceStationStatusReport(HOSTAGVStatus Agvstatus, List<OutStationStatus> outStations, List<InStationStatus> inStation, string sGetSeqNo) |
| | | { |
| | | try |
| | | { |
| | | string str = SendNotReply + "936" + BaseDal.GetSeqNo().Result.ToString() + GetFieldsAsString(Agvstatus) + GetListStringOutStation(outStations) + GetListStringInStation(inStation); |
| | | var agvstatus = GetFieldsAsString(Agvstatus); |
| | | var outstation = GetListStringOutStation(outStations); |
| | | var instation = GetListStringInStation(inStation); |
| | | string str = SendNotReply + "936" + sGetSeqNo + agvstatus + outstation + OutStationSpare2 + "2" + instation; |
| | | clientSend(MakeStringToByteMsg(str)); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | try |
| | | { |
| | | string str = SendandReply + "105" + BaseDal.GetSeqNo().Result.ToString() + "R" + JobOrderID + priority + FormLocation + ToLocation + TaskType + TrayCnt + PallteCode; |
| | | string str = SendandReply + "105" + BaseDal.GetSeqNo().Result.ToString("D5") + "R" + JobOrderID + priority + FormLocation + ToLocation + TaskType + TrayCnt + PallteCode; |
| | | clientSend(MakeStringToByteMsg(str)); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | try |
| | | { |
| | | string str = SendNotReply + "985" + BaseDal.GetSeqNo().Result.ToString() + Trouble + Level + Location; |
| | | string str = SendNotReply + "985" + BaseDal.GetSeqNo().Result.ToString("D5") + Trouble + Level + Location; |
| | | clientSend(MakeStringToByteMsg(str)); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | try |
| | | { |
| | | string str = SendNotReply + "104" + BaseDal.GetSeqNo().Result.ToString() + Statues; |
| | | string str = SendNotReply + "104" + BaseDal.GetSeqNo().Result.ToString("D5") + Statues; |
| | | clientSend(MakeStringToByteMsg(str)); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | try |
| | | { |
| | | string str = SendandReply + "107" + BaseDal.GetSeqNo().Result.ToString() + "1" + JobOrderID + priority + FormLocation + ToLocation + "O" + TrayCnt + PallteCode; |
| | | string str = SendandReply + "107" + BaseDal.GetSeqNo().Result.ToString("D5") + "1" + JobOrderID + priority + FormLocation + ToLocation + "O" + TrayCnt + PallteCode; |
| | | clientSend(MakeStringToByteMsg(str)); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | /// <param name="AgvStatus"></param> |
| | | public void DeviceStatusReportResponse(HOSTAGVStatus AgvStatus, string X, string Y) |
| | | { |
| | | string str = SendNotReply + "910" + BaseDal.GetSeqNo().Result.ToString() + "1" + GetFieldsAsString(AgvStatus) + X + Y; |
| | | string str = SendNotReply + "910" + BaseDal.GetSeqNo().Result.ToString("D5") + GetFieldsAsString(AgvStatus) + X + Y; |
| | | clientSend(MakeStringToByteMsg(str)); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | { |
| | | //OK |
| | | case "0": |
| | | //UpdateTaskLocation(parseMessage); |
| | | InsertWMSTask(parseMessage); |
| | | Thread.Sleep(500); |
| | | //915 |
| | | JobReady("0"); |
| | | break; |
| | | var location = _locationRepository.QueryFirst(x => x.LocationCode == parseMessage.body.ToLocation); |
| | | if (location == null) |
| | | { |
| | | return; |
| | | } |
| | | if (location.LocationStatus == (int)LocationEnum.Free) |
| | | { |
| | | InsertWMSTask(parseMessage); |
| | | Thread.Sleep(500); |
| | | //915 |
| | | JobReady("0"); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | //todoè´§ä½æè´§éå¤å
¥åº |
| | | return; |
| | | } |
| | | //NG |
| | | case "1": |
| | | break; |
| | |
| | | { |
| | | JobStartOrEnd("E", task.SourceAddress, task.TargetAddress, "O", task.PalletCode); |
| | | } |
| | | CompleteInboundTask(task); |
| | | CompleteInboundTask(task); |
| | | break; |
| | | case (int)TaskOutboundTypeEnum.Outbound: |
| | | //åºåº |
| | |
| | | { |
| | | //OK |
| | | case "0": |
| | | var task = InsertWMSTask(parseMessage); |
| | | BaseDal.AddData(task); |
| | | InsertAGVTask(task); |
| | | Thread.Sleep(500); |
| | | //915 |
| | | JobReady("0"); |
| | | Thread.Sleep(500); |
| | | //104 |
| | | DeviceReceiveJobResponse("0"); |
| | | var location = _locationRepository.QueryFirst(x => x.LocationCode == parseMessage.body.ToLocation); |
| | | if (location == null) |
| | | { |
| | | return; |
| | | } |
| | | if (location.LocationStatus == (int)LocationEnum.InStock) |
| | | { |
| | | var task = InsertWMSTask(parseMessage); |
| | | BaseDal.AddData(task); |
| | | InsertAGVTask(task); |
| | | Thread.Sleep(500); |
| | | //915 |
| | | JobReady("0"); |
| | | Thread.Sleep(500); |
| | | //104 |
| | | DeviceReceiveJobResponse("0"); |
| | | } |
| | | else |
| | | { |
| | | //todoè´§ä½æ 货空åºåº |
| | | return; |
| | | } |
| | | |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | /// HOST设å¤ç¶æè·å å·¥åº935 |
| | | /// </summary> |
| | | /// <param name="message"></param> |
| | | public void DeviceStationStatusInvite() |
| | | public void DeviceStationStatusInvite(string sSeqNo) |
| | | { |
| | | try |
| | | { |
| | | //åå¤936 |
| | | List<Dt_StationManager> Instation = _stationManagerRepository.QueryData(x => x.stationType == 1).ToList(); |
| | | List<Dt_StationManager> Outstation = _stationManagerRepository.QueryData(x => x.stationType == 2).ToList(); |
| | | List<OutStationStatus> outStationStatus = new List<OutStationStatus>(); |
| | | List<InStationStatus> inStationStatus = new List<InStationStatus>(); |
| | | foreach (var item in Instation) |
| | | StationStatus stationIn = GetStationStatus("B002"); |
| | | |
| | | inStationStatus.Add(new InStationStatus() |
| | | { |
| | | inStationStatus.Add(new InStationStatus() |
| | | { |
| | | StationName = item.stationName, |
| | | StationEnable = item.stationStatus, |
| | | IsDistributionTask = item.stationHasTask, |
| | | PallteCode = "0000000000", |
| | | }); |
| | | } |
| | | foreach (var item in Outstation) |
| | | StationName = "02", |
| | | StationEnable = stationIn.WorkstationO == "1" ? "0" : "1", |
| | | IsDistributionTask = "0", |
| | | PallteCode = "0000000000", |
| | | }); |
| | | inStationStatus.Add(new InStationStatus() |
| | | { |
| | | StationStatus station = GetStationStatus(item.stationName); |
| | | var taskStation = BaseDal.QueryFirst(x => x.SourceAddress == item.stationName || x.TargetAddress == item.stationName); |
| | | outStationStatus.Add(new OutStationStatus() |
| | | { |
| | | StationName = item.stationName, |
| | | StationEnable = station.StationEnable == "1" ? "0" : "1", |
| | | IsDistributionTask = taskStation == null ? "0" : "1", |
| | | Spare1 = "00" |
| | | }); |
| | | //outStationStatus.Add(new OutStationStatus() |
| | | //{ |
| | | // StationName = item.stationName, |
| | | // StationEnable = item.stationStatus, |
| | | // IsDistributionTask = item.stationHasTask, |
| | | // Spare1 = "00" |
| | | //}); |
| | | } |
| | | StationName = "01", |
| | | StationEnable = stationIn.WorkstationT == "1" ? "0" : "1", |
| | | IsDistributionTask = "0", |
| | | PallteCode = "0000000000", |
| | | }); |
| | | |
| | | StationStatus stationOut = GetStationStatus("B001"); |
| | | var taskOutStationO = BaseDal.QueryFirst(x => x.SourceAddress == "B001::1" || x.TargetAddress == "B001::1"); |
| | | var taskOutStationT = BaseDal.QueryFirst(x => x.SourceAddress == "B001::2" || x.TargetAddress == "B001::2"); |
| | | outStationStatus.Add(new OutStationStatus() |
| | | { |
| | | StationName = "04", |
| | | StationEnable = stationOut.WorkstationO == "1" ? "0" : "1", |
| | | IsDistributionTask = taskOutStationO == null ? "0" : "1", |
| | | Spare1 = "00" |
| | | }); |
| | | outStationStatus.Add(new OutStationStatus() |
| | | { |
| | | StationName = "03", |
| | | StationEnable = stationOut.WorkstationT == "1" ? "0" : "1", |
| | | IsDistributionTask = taskOutStationT == null ? "0" : "1", |
| | | Spare1 = "00" |
| | | }); |
| | | AGVStatusRespone status = GetAGVStatus(); |
| | | HOSTAGVStatus AgvStatus = new HOSTAGVStatus() |
| | | { |
| | |
| | | AutoStatus = status.AutoStatus == "MaintenanceMode" ? "1" : "0", |
| | | Ready = status.AutoStatus == "MaintenanceMode" ? "0" : "1", |
| | | }; |
| | | DeviceStationStatusReport(AgvStatus, outStationStatus, inStationStatus); |
| | | DeviceStationStatusReport(AgvStatus, outStationStatus, inStationStatus, sSeqNo); |
| | | } |
| | | catch (Exception) |
| | | { |
| | |
| | | /// </summary> |
| | | public void DeviceStatusReportRequest() |
| | | { |
| | | AGVStatusRespone status = GetAGVStatus(); |
| | | |
| | | HOSTAGVStatus AgvStatus = new HOSTAGVStatus() |
| | | { |
| | | RuntimeStatus = "R", |
| | | AutoStatus = "1", |
| | | Ready = "1" |
| | | RuntimeStatus = CapitalizeFirstLetter(status.RuntimeStatus), |
| | | AutoStatus = status.AutoStatus == "MaintenanceMode" ? "1" : "0", |
| | | Ready = status.AutoStatus == "MaintenanceMode" ? "0" : "1", |
| | | }; |
| | | string axis = "000000"; |
| | | |
| | | DeviceStatusReportResponse(AgvStatus, axis, axis); |
| | | } |
| | | #endregion |
| | |
| | | { |
| | | byte[] byt = Encoding.UTF8.GetBytes(Message); // ä½¿ç¨ UTF-8 é¿å
ç¼ç é®é¢ |
| | | |
| | | LogFactory.GetLog("è¯·æ±æçä»»å¡").Error(true, BitConverter.ToString(byt)); |
| | | string checksum = GetCheckSum(byt); |
| | | |
| | | string str = Message + checksum; |
| | |
| | | // å¤å¶åå§æ°ç»çæææ°æ®å°æ°æ°ç»çä¸é´é¨å |
| | | Array.Copy(buffer, 0, newArray, 1, buffer.Length); |
| | | |
| | | //var parseMessage = GetParse(str); |
| | | LogFactory.GetLog("Socketå鿥æ").Info(true, str); |
| | | return newArray; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | throw new Exception(ex.Message); |
| | | } |
| | | } |
| | | //public bool IsOnline() |
| | | //{ |
| | | |
| | | //} |
| | | public string GetListStringOutStation(List<OutStationStatus> outStationStatus) |
| | | { |
| | | return string.Join("", outStationStatus.Select(status => $"{status.StationName}{status.StationEnable}{status.IsDistributionTask}{status.Spare1}")); |
| | | } |
| | | public string GetListStringInStation(List<InStationStatus> inStationStatus) |
| | | { |
| | | return string.Join("", inStationStatus.Select(status => $"{status.StationName}{status.StationEnable}{status.IsDistributionTask}{status.Spare1}")); |
| | | return string.Join("", inStationStatus.Select(status => $"{status.StationName}{status.StationEnable}{status.IsDistributionTask}{status.IsHasPallte}{status.Spare1}{status.StationPallteCount}{status.PallteCode}{status.Spare2}")); |
| | | } |
| | | /// <summary> |
| | | /// å°å¯¹è±¡å¼åæ¼æ¥ |
| | |
| | | } |
| | | else |
| | | { |
| | | |
| | | |
| | | Console.WriteLine("æ ¡éªå¤±è´¥ï¼"); |
| | | return null; |
| | | } |
| | |
| | | /// <returns></returns> |
| | | private int InsertAGVTask(Dt_Task task) |
| | | { |
| | | string SourceAddress = string.Empty; |
| | | string TargetAddress = string.Empty; |
| | | if (task.TaskType == (int)TaskInboundTypeEnum.Inbound) |
| | | { |
| | | TargetAddress = InsertHyphenEveryTwoChars(task.TargetAddress); |
| | | } |
| | | else if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound) |
| | | { |
| | | SourceAddress = InsertHyphenEveryTwoChars(task.SourceAddress); |
| | | } |
| | | else if (task.TaskType == (int)TaskRelocationTypeEnum.Relocation) |
| | | { |
| | | TargetAddress = InsertHyphenEveryTwoChars(task.TargetAddress); |
| | | SourceAddress = InsertHyphenEveryTwoChars(task.SourceAddress); |
| | | } |
| | | else if (task.TaskType == (int)TaskStationTypeEnum.StationToStation) |
| | | { |
| | | TargetAddress = task.TargetAddress; |
| | | SourceAddress = task.SourceAddress; |
| | | } |
| | | task_call task_Call = new task_call() |
| | | { |
| | | d_task_type = task.TaskType == (int)TaskTypeEnum.Inbound ? 1 : 2, |
| | | d_floor = 1, |
| | | d_involed1 = task.SourceAddress, |
| | | d_involed2 = task.TargetAddress, |
| | | d_involed1 = SourceAddress, |
| | | d_involed2 = TargetAddress, |
| | | d_involed5 = task.TaskNum, |
| | | }; |
| | | |
| | |
| | | } |
| | | public AGVStatusRespone GetAGVStatus() |
| | | { |
| | | string urlnew = url + "/ilns/AGV/getAgvState"; |
| | | string urlnew = url + "/ilns/AGV/getState"; |
| | | var result = HttpsClient.PostAsync(urlnew, JsonConvert.DeserializeObject<Dictionary<string, object>>(new { getStatus = "1" }.ToJson())).Result; |
| | | |
| | | return JsonConvert.DeserializeObject<AGVStatusRespone>(result.ToString()); |
| | |
| | | |
| | | public StationStatus GetStationStatus(string stationName) |
| | | { |
| | | string urlnew = url + "/ilns/strl/getStat"; |
| | | var result = HttpsClient.PostAsync(urlnew, JsonConvert.DeserializeObject<Dictionary<string, object>>(new { strlName = stationName }.ToJson())).Result; |
| | | string urlnew = url + "/ilns/ctrl/getState"; |
| | | var result = HttpsClient.PostAsync(urlnew, JsonConvert.DeserializeObject<Dictionary<string, object>>(new { ctrlName = "B001" }.ToJson())).Result; |
| | | return JsonConvert.DeserializeObject<StationStatus>(result.ToString()); |
| | | } |
| | | public string CapitalizeFirstLetter(string s) |
| | |
| | | char firstChar = s[0]; |
| | | return char.ToUpper(firstChar).ToString(); |
| | | } |
| | | public string InsertHyphenEveryTwoChars(string input) |
| | | { |
| | | if (string.IsNullOrEmpty(input)) |
| | | { |
| | | return input; |
| | | } |
| | | |
| | | StringBuilder result = new StringBuilder(); |
| | | |
| | | for (int i = 0; i < input.Length; i += 2) |
| | | { |
| | | // æ·»å 两个å符 |
| | | result.Append(input.Substring(i, 2)); |
| | | |
| | | // 妿䏿¯æå两个åç¬¦ï¼æ·»å ä¸ä¸ªè¿å符 |
| | | if (i + 2 < input.Length) |
| | | { |
| | | result.Append('-'); |
| | | } |
| | | } |
| | | |
| | | return result.ToString(); |
| | | } |
| | | #region å¤é¨æ¥å£æ¹æ³ |
| | | |
| | | public WebResponseContent CompleteInboundTask(Dt_Task task) |