コード例 #1
0
ファイル: PubExtend.cs プロジェクト: HaiBoHan/HBHDaYunsy
        // 移库接口
        /// <summary>
        /// 移库接口
        /// </summary>
        /// <param name="service"></param>
        /// <param name="param"></param>
        /// <returns></returns>
        public static vehicleMoveInfoDto Do(this SI11ImplService service, vehicleMoveInfoDto[] param)
        {
            service.Url = PubHelper.GetAddress(service.Url);

            string entityName = "移库接口";
            long svID = -1;
            if (IsLog)
            {
                svID = ProxyLogger.CreateTransferSV(entityName
                    //, EntitySerialization.EntitySerial(bpObj)
                    , Newtonsoft.Json.JsonConvert.SerializeObject(param)
                    , service.GetType().FullName,Newtonsoft.Json.JsonConvert.SerializeObject(service));
            }

            try
            {
                var result = service.receive(param);

                if (svID > 0)
                {
                    if (result != null
                        )
                    {
                        //string resultXml = EntitySerialization.EntitySerial(result);
                        string resultXml = Newtonsoft.Json.JsonConvert.SerializeObject(result);

                        ProxyLogger.UpdateTransferSV(svID, resultXml, result.flag == 1, result.errMsg, string.Empty, string.Empty);
                    }
                    else
                    {
                        ProxyLogger.UpdateTransferSV(svID, string.Empty, false, Const_ResultNullMessage, string.Empty, string.Empty);
                    }
                }
                return result;
            }
            catch (Exception ex)
            {
                if (svID > 0)
                {
                    ProxyLogger.UpdateTransferSV(svID, string.Empty, false, ex.Message, string.Empty, ex.StackTrace);
                }

                throw ex;
            }

            return null;
        }
コード例 #2
0
ファイル: Reference.cs プロジェクト: HaiBoHan/HBHDaYunsy
 /// <remarks/>
 public void receiveAsync(vehicleMoveInfoDto[] arg0, object userState) {
     if ((this.receiveOperationCompleted == null)) {
         this.receiveOperationCompleted = new System.Threading.SendOrPostCallback(this.OnreceiveOperationCompleted);
     }
     this.InvokeAsync("receive", new object[] {
                 arg0}, this.receiveOperationCompleted, userState);
 }
コード例 #3
0
 public void Notify(params object[] args)
 {
     if (args != null && args.Length != 0 && args[0] is EntityEvent)
     {
         BusinessEntity.EntityKey key = ((EntityEvent)args[0]).EntityKey;
         if (!(key == null))
         {
             TransferIn transferin = key.GetEntity() as TransferIn;
             if (PubHelper.SaleOrg2DMS.Contains(Context.LoginOrg.Code))
             {
                 bool flag = PubHelper.IsUsedDMSAPI();
                 if (flag)
                 {
                     if (transferin.DocType.Code == "MoveWH")
                     {
                         if (transferin.Status == TransInStatus.Approved && transferin.OriginalData.Status == TransInStatus.Approving)
                         {
                             SI11ImplService service = new SI11ImplService();
                             // service.Url = PubHelper.GetAddress(service.Url);
                             System.Collections.Generic.List<vehicleMoveInfoDto> list = new System.Collections.Generic.List<vehicleMoveInfoDto>();
                             foreach (TransInLine line in transferin.TransInLines)
                             {
                                 foreach (TransInSubLine subline in line.TransInSubLines)
                                 {
                                     vehicleMoveInfoDto dto = new vehicleMoveInfoDto();
                                     dto.flowCode = ((subline.TransInLine.DescFlexSegments.PubDescSeg12.Length >= 8) ? subline.TransInLine.DescFlexSegments.PubDescSeg12.Substring(subline.TransInLine.DescFlexSegments.PubDescSeg12.Length - 8, 8) : subline.TransInLine.DescFlexSegments.PubDescSeg12);
                                     if (subline.TransInLine.TransInWhKey != null)
                                     {
                                         dto.toWarehose = subline.TransInLine.TransInWh.Code;
                                     }
                                     if (subline.TransOutWhKey != null)
                                     {
                                         dto.fromWarehose = subline.TransOutWh.Code;
                                     }
                                     list.Add(dto);
                                 }
                             }
                             try
                             {
                                 vehicleMoveInfoDto dto2 = service.Do(list.ToArray());
                                 if (dto2 != null && dto2.flag == 0)
                                 {
                                     throw new System.ApplicationException(dto2.errMsg);
                                 }
                             }
                             catch (System.Exception e)
                             {
                                 throw new System.ApplicationException("调用DMS接口错误:" + e.Message);
                             }
                         }
                         else if (transferin.Status == TransInStatus.Opening && transferin.OriginalData.Status == TransInStatus.Approved)
                         {
                             SI11ImplService service = new SI11ImplService();
                             // service.Url = PubHelper.GetAddress(service.Url);
                             System.Collections.Generic.List<vehicleMoveInfoDto> list = new System.Collections.Generic.List<vehicleMoveInfoDto>();
                             foreach (TransInLine line in transferin.TransInLines)
                             {
                                 foreach (TransInSubLine subline in line.TransInSubLines)
                                 {
                                     vehicleMoveInfoDto dto = new vehicleMoveInfoDto();
                                     dto.flowCode = ((subline.TransInLine.DescFlexSegments.PubDescSeg12.Length >= 8) ? subline.TransInLine.DescFlexSegments.PubDescSeg12.Substring(subline.TransInLine.DescFlexSegments.PubDescSeg12.Length - 8, 8) : subline.TransInLine.DescFlexSegments.PubDescSeg12);
                                     if (subline.TransInLine.TransInWhKey != null)
                                     {
                                         dto.fromWarehose = subline.TransInLine.TransInWh.Code;
                                     }
                                     if (subline.TransOutWhKey != null)
                                     {
                                         dto.toWarehose = subline.TransOutWh.Code;
                                     }
                                     list.Add(dto);
                                 }
                             }
                             try
                             {
                                 vehicleMoveInfoDto dto2 = service.Do(list.ToArray());
                                 if (dto2 != null && dto2.flag == 0)
                                 {
                                     throw new System.ApplicationException(dto2.errMsg);
                                 }
                             }
                             catch (System.Exception e)
                             {
                                 throw new System.ApplicationException("调用DMS接口错误:" + e.Message);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
コード例 #4
0
ファイル: Reference.cs プロジェクト: HaiBoHan/HBHDaYunsy
 /// <remarks/>
 public void receiveAsync(vehicleMoveInfoDto[] arg0) {
     this.receiveAsync(arg0, null);
 }