| | |
| | | using Admin.NET.Application; |
| | | using iWareCC.Common.Helper; |
| | | using iWareCC.StationService; |
| | | using iWareCommon.Common.Globle; |
| | | using iWareCommon.Utils; |
| | |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | { |
| | | |
| | | |
| | | var rgvLocation = StationLocationEnum.BZ21.ToString(); |
| | | /* |
| | | * 1ã仿°æ®åºä¸å¤ææ¯å¦é½å¥ |
| | |
| | | SystemWarningMsg._lbl_alert_DataProcess_BZ21 = $"{rgvLocation.ToString()},æ ¹æ®UPI:{result}æ²¡ææ¾å°å¯¹è±¡ "; |
| | | continue; |
| | | } |
| | | string upi = "LS070700101B0001GS"; |
| | | //string upi = "LS070700101B0001GS"; |
| | | //è°ç¨åºçº¸æºæ¥å£ |
| | | var res =new HTTPService("http://172.17.1.22:44374/api/LuLi/").getContent<Respone>("cartons-machine?PackageCode="+upi, Guid.NewGuid(),10000); |
| | | var res = new HTTPService("http://172.17.1.22:44374/api/LuLi/").getContent<Respone>("cartons-machine?PackageCode=" + upiObj.PackageCode, Guid.NewGuid(), 10000); |
| | | if (res.iState == 0) |
| | | { |
| | | /* |
| | | var papertable = wmsDB.mes_push_papercut.Where(x => x.PackageCode == upiObj.PackageCode).OrderByDescending(x => x.Id).FirstOrDefault(); |
| | | if (papertable != null) |
| | | { |
| | |
| | | var papercut = ClassHelper.RotationMapping<mes_push_papercut, mes_batchOrderUPI_new>(upiObj); |
| | | papercut.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | papercut.ApiMessage = res.message; |
| | | papercut.PushNum = 0; |
| | | papercut.PushNum = 1; |
| | | papercut.PushStatus = (int)PushStatusEnum.PushSuccess; |
| | | wmsDB.mes_push_papercut.Add(papercut); |
| | | } |
| | | //*/ |
| | | var papercut = ClassHelper.RotationMapping<mes_push_papercut, mes_batchOrderUPI_new>(upiObj); |
| | | papercut.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | papercut.ApiMessage = res.message; |
| | | papercut.PushNum = 1; |
| | | papercut.PushStatus = (int)PushStatusEnum.PushSuccess; |
| | | wmsDB.mes_push_papercut.Add(papercut); |
| | | } |
| | | else |
| | | { |
| | | /* |
| | | var papertable = wmsDB.mes_push_papercut.Where(x => x.PackageCode == upiObj.PackageCode).OrderByDescending(x => x.Id).FirstOrDefault(); |
| | | if (papertable != null) |
| | | { |
| | |
| | | var papercut = ClassHelper.RotationMapping<mes_push_papercut, mes_batchOrderUPI_new>(upiObj); |
| | | papercut.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | papercut.ApiMessage = res.message; |
| | | papercut.PushNum = 0; |
| | | papercut.PushNum = 1; |
| | | papercut.PushStatus = (int)PushStatusEnum.PushFail; |
| | | wmsDB.mes_push_papercut.Add(papercut); |
| | | } |
| | | //*/ |
| | | var papercut = ClassHelper.RotationMapping<mes_push_papercut, mes_batchOrderUPI_new>(upiObj); |
| | | papercut.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | papercut.ApiMessage = res.message; |
| | | papercut.PushNum = 1; |
| | | papercut.PushStatus = (int)PushStatusEnum.PushFail; |
| | | wmsDB.mes_push_papercut.Add(papercut); |
| | | continue; |
| | | } |
| | | //æ´æ°è¡¨ |
| | |
| | | mesgather.AreaCode = (int)AreaCodeEnum.åå
è£ååº; |
| | | mesgather.UpiStatus = (int)UpiStatusEnum.å·²åå
; |
| | | } |
| | | |
| | | var upilist = wmsDB.mes_batchOrderUPI_new.Where(x => x.PackageCode == upiObj.PackageCode).ToList(); |
| | | var upilength = upilist.Max(x => x.Length); |
| | | var upiwidth = upilist.Max(x => x.Width); |
| | | cartonhigh = (short)upiObj.Info3; |
| | | cartonwidth = (short)upiObj.Info2; |
| | | upiObj.UpiStatus = (int)UpiStatusEnum.å·²åå
; |
| | |
| | | PlaceCode = place |
| | | }; |
| | | //æ°å¢æå°è¡¨ |
| | | var printid= Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | var printid = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | var print = ClassHelper.RotationMapping<wms_record_print, mes_batchOrderUPI_new>(upiObj); |
| | | print.Id = printid; |
| | | print.PrintType = (int)PrintTypeEnum.å
è£
æ¡ç ; |
| | | print.PrintSource = (int)PrintSourceEnum.å
è£
æ¡ç æå°; |
| | | print.PrintSheetNum = 1; |
| | | print.PrintNum= 0; |
| | | print.PrintNum = 0; |
| | | print.PrintStatus = (int)PrintStatuEnum.æªæå°; |
| | | print.IsAllowPrint= true; |
| | | print.IsAllowPrint = true; |
| | | print.CreateTime = print.UpdateTime = DateTime.Now; |
| | | wmsDB.wms_record_print.Add(print); |
| | | wms_record_print printtwo = print; |
| | | printtwo.Id= Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | var printtwo = ClassHelper.RotationMapping<wms_record_print, mes_batchOrderUPI_new>(upiObj); |
| | | printtwo.PrintType = (int)PrintTypeEnum.å
è£
æ¡ç ; |
| | | printtwo.PrintSource = (int)PrintSourceEnum.å
è£
æ¡ç æå°; |
| | | printtwo.PrintSheetNum = 1; |
| | | printtwo.PrintNum = 0; |
| | | printtwo.PrintStatus = (int)PrintStatuEnum.æªæå°; |
| | | printtwo.IsAllowPrint = true; |
| | | printtwo.CreateTime = print.UpdateTime = DateTime.Now; |
| | | printtwo.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wmsDB.wms_record_print.Add(printtwo); |
| | | |
| | | wmsDB.mes_package_linequeue.Add(mesinequeue); |
| | | wmsDB.wms_rbline_task.Add(task); |
| | | wmsDB.wms_rbline_task.Add(task); |
| | | wmsDB.mes_push_packagecode.Add(putpakegecode); |
| | | |
| | | //å¤ç表 mes_order_gather |
| | | var errmsg = ""; |
| | | var package = wmsDB.mes_package_gather.Where(x => x.PackageCode == upiObj.PackageCode).FirstOrDefault(); |
| | | var resultAlert = MyExtendHelper.HandlerOrderGather(wmsDB, package, "", "", out errmsg); |
| | | if (resultAlert == false) |
| | | { |
| | | SystemWarningMsg._lbl_alert_DataProcess_BZ21 = errmsg; |
| | | continue; |
| | | } |
| | | |
| | | using (StationServiceClient client = new StationServiceClient()) |
| | | { |
| | | |
| | | var plcres = client.WriteSurroundTaskInfo((int)EDevice.Station, rgvLocation, short.Parse(task.TaskNo), |
| | | (short)upiObj.Length, (short)upiObj.Width, cartonhigh, cartonwidth, 0, 0); |
| | | (short)upilength, (short)upiwidth, cartonhigh, cartonwidth, 0, 0); |
| | | if (!plcres.result) |
| | | { |
| | | SystemWarningMsg._lbl_alert_DataProcess_BZ12 = $"{rgvLocation.ToString()}-ä¸åå
¥åºä»»å¡ 失败,WriteInStoreTaskInfoAsync è¿å:{plcres.resMsg}"; |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | SystemWarningMsg._lbl_alert_DataProcess_BZ39 += " åºç°å¼å¸¸:" + ex.Message + SysGloble.SPLIT_STR; |
| | | SystemWarningMsg._lbl_alert_DataProcess_BZ21 += " åºç°å¼å¸¸:" + ex.Message + SysGloble.SPLIT_STR; |
| | | Log4NetHelper.WriteErrorLog(logType, " åºç°å¼å¸¸ï¼" + ex.Message, ex); |
| | | } |
| | | } |
| | |
| | | { |
| | | value.PushStatus = (int)PushStatusEnum.Pushing; |
| | | value.PushNum++; |
| | | value.ApiMessage+= res.message; |
| | | value.ApiMessage += res.message; |
| | | if (value.PushNum == 3) |
| | | { |
| | | value.PushStatus = (int)PushStatusEnum.PushFail; |