| | |
| | | public interface IOrderDetailsService : IService<OrderDetails> |
| | | { |
| | | int GetOrderDetails(string Barcodes); |
| | | bool ToMesBarc(int Barcodes); |
| | | ToMesBarcRes ToMesBarc(int Barcodes); |
| | | } |
| | | |
| | | public class ToMesBarc |
| | |
| | | } |
| | | |
| | | [HttpPost,Route("ToMesBarc"), AllowAnonymous] |
| | | public bool ToMesBarc(int Barcodes) |
| | | public ToMesBarcRes ToMesBarc(int Barcodes) |
| | | { |
| | | return Service.ToMesBarc(Barcodes); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <!-- |
| | | https://go.microsoft.com/fwlink/?LinkID=208121. |
| | | --> |
| | | <Project> |
| | | <PropertyGroup> |
| | | <DeleteExistingFiles>false</DeleteExistingFiles> |
| | | <ExcludeApp_Data>false</ExcludeApp_Data> |
| | | <LaunchSiteAfterPublish>true</LaunchSiteAfterPublish> |
| | | <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> |
| | | <LastUsedPlatform>Any CPU</LastUsedPlatform> |
| | | <PublishProvider>FileSystem</PublishProvider> |
| | | <PublishUrl>bin\Release\net6.0\publish\</PublishUrl> |
| | | <WebPublishMethod>FileSystem</WebPublishMethod> |
| | | <_TargetId>Folder</_TargetId> |
| | | </PropertyGroup> |
| | | </Project> |
| | |
| | | } |
| | | }, |
| | | "dics": "deviceType,devicePlcType,jobAssembly,jobClassName,deviceStatus,taskType,taskState,inOutType,agvStationEnum,agvareaEnum", |
| | | "ToMesScan_sync": "/api/product/batchProcess/scan_sync", |
| | | "ToMesScan_sync": "http://47.110.241.74:3000/mock/164/api/product/batchProcess/scan_sync", //æµ |
| | | "AllowedHosts": "*", |
| | | "ConnectionStringsEncryption": false, |
| | | "MainDB": "DB_WIDESEA", //å½å项ç®ç主åºï¼æå¯¹åºçè¿æ¥å符串çEnabledå¿
须为true |
| | |
| | | { |
| | | |
| | | } |
| | | |
| | | private static bool toggle = false; |
| | | public int GetOrderDetails(string Barcodes) |
| | | { |
| | | OrderDetails orderDetails = BaseDal.QueryData(x=>x.Orderdetails_outid == Barcodes).FirstOrDefault(); |
| | | if(orderDetails != null) |
| | | { |
| | | if (orderDetails.Orderdetails_cutLength <= 800 && orderDetails.Orderdetails_cutLength>=50) |
| | | if (orderDetails.Orderdetails_width <= 800 && orderDetails.Orderdetails_width>=50) |
| | | { |
| | | Random random = new Random(); |
| | | return random.Next(0, 2) == 0 ? 2 : 3; |
| | | toggle = !toggle; // åæ¢ç¶æ |
| | | return toggle ? 2 : 3; |
| | | } |
| | | else if (orderDetails.Orderdetails_cutLength >= 800 && orderDetails.Orderdetails_cutLength <= 1220) |
| | | else if (orderDetails.Orderdetails_width >= 800 && orderDetails.Orderdetails_width <= 1220) |
| | | { |
| | | return 2; |
| | | } |
| | |
| | | |
| | | public string ToMesScan_sync = WIDESEAWCS_Core.Helper.AppSettings.Configuration["ToMesScan_sync"]; |
| | | |
| | | public bool ToMesBarc(int Barcodes) |
| | | public ToMesBarcRes ToMesBarc(int Barcodes) |
| | | { |
| | | ToMesBarc toMes = new ToMesBarc() |
| | | { |
| | |
| | | type = "1", |
| | | }; |
| | | ToMesBarcRes toMesBarc=HttpHelper.Post<ToMesBarcRes>($"{ToMesScan_sync}", toMes); |
| | | if (toMesBarc.code == 1) |
| | | { |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return toMesBarc; |
| | | } |
| | | |
| | | |
| | |
| | | conveyorLine.Communicator.Write("DB7.3022", (int)toplc); //åå
¥å»å |
| | | conveyorLine.Communicator.Write("DB7.3028.0", (bool)true); //åå
¥åé¦ |
| | | WriteLog.Write_Log("æ«ç æª", "æ«ç ç«å°", "æå", new { ä¿¡æ¯ = $"æ¡ç ï¼{barcodeNumber}ï¼åå
¥å»å{toplc}" }); |
| | | if (conveyorLine.Communicator.Read<bool>("DB7.2986")) |
| | | if (conveyorLine.Communicator.Read<bool>("DB7.3116")) |
| | | { |
| | | conveyorLine.Communicator.Write("DB7.3022", (int)0); //æ¸
é¤åå
¥å»å |
| | | conveyorLine.Communicator.Write("DB7.3028.0", (bool)false); //æ¸
é¤åå
¥åé¦ |
| | | WriteLog.Write_Log("æ«ç æª", "æ«ç ç«å°", "æå", new { ä¿¡æ¯ = $"æ¡ç ï¼{barcodeNumber}ï¼æ¸
é¤è¾é线å馿å" }); |
| | | //è°ååé¦MESæçæ¡ç |
| | | if (_OrderDetailsService.ToMesBarc(int.Parse(barcodeNumber))) |
| | | |
| | | var datast= _OrderDetailsService.ToMesBarc(int.Parse(barcodeNumber)); |
| | | if (datast.code==1) |
| | | { |
| | | WriteLog.Write_Log("ToMes", "æ¡ç åé¦Mes", "æå", new { ä¿¡æ¯ = $"æ¡ç ï¼{barcodeNumber}ï¼å馿å" }); |
| | | } |