Example #1
0
        public vehicleInfoDto receive([System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] vehicleInfoDto arg0)
        {
            object[] results = this.Invoke("receive", new object[] {
                arg0
            });

            return((vehicleInfoDto)(results[0]));
        }
Example #2
0
 /// <remarks/>
 public void receiveAsync(vehicleInfoDto arg0, object userState)
 {
     if ((this.receiveOperationCompleted == null))
     {
         this.receiveOperationCompleted = new System.Threading.SendOrPostCallback(this.OnreceiveOperationCompleted);
     }
     this.InvokeAsync("receive", new object[] {
         arg0
     }, this.receiveOperationCompleted, userState);
 }
Example #3
0
 /// <remarks/>
 public void receiveAsync(vehicleInfoDto arg0)
 {
     this.receiveAsync(arg0, null);
 }
Example #4
0
        // 车辆状态跟踪接口
        /// <summary>
        /// 车辆状态跟踪接口
        /// </summary>
        /// <param name="service"></param>
        /// <param name="param"></param>
        /// <returns></returns>
        public static vehicleInfoDto Do(this SI03ImplService service, vehicleInfoDto 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;
        }
Example #5
0
 /// <remarks/>
 public void receiveAsync(vehicleInfoDto arg0, object userState) {
     if ((this.receiveOperationCompleted == null)) {
         this.receiveOperationCompleted = new System.Threading.SendOrPostCallback(this.OnreceiveOperationCompleted);
     }
     this.InvokeAsync("receive", new object[] {
                 arg0}, this.receiveOperationCompleted, userState);
 }
Example #6
0
 /// <remarks/>
 public void receiveAsync(vehicleInfoDto arg0) {
     this.receiveAsync(arg0, null);
 }
 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))
         {
             SingleWorkPlan Singleworkplan = key.GetEntity() as SingleWorkPlan;
             if (Context.LoginOrg.Code == "10")
             {
                 bool flag = PubHelper.IsUsedDMSAPI();
                 if (flag)
                 {
                     string dmssaleno = string.Empty;
                     if (Singleworkplan.SrcDoc != null && Singleworkplan.SrcDoc.PLSKey != null && Singleworkplan.SrcDoc.PLS.ProjectKey != null)
                     {
                         SOLine soline = SOLine.Finder.Find(string.Format("SO.Org={0} and Project={1}", Context.LoginOrg.ID.ToString(), Singleworkplan.SrcDoc.PLS.ProjectKey.ID.ToString()), new OqlParam[0]);
                         if (soline != null)
                         {
                             dmssaleno = soline.SO.DescFlexField.PubDescSeg5;
                         }
                     }
                     if (!string.IsNullOrEmpty(dmssaleno))
                     {
                         try
                         {
                             SI03ImplService service = new SI03ImplService();
                             // service.Url = PubHelper.GetAddress(service.Url);
                             vehicleInfoDto dto = new vehicleInfoDto();
                             if (Singleworkplan.SrcDoc != null && Singleworkplan.SrcDoc.PLSKey != null && Singleworkplan.SrcDoc.PLS.ProjectKey != null)
                             {
                                 SOLine soline = SOLine.Finder.Find(string.Format("SO.Org={0} and Project={1}", Context.LoginOrg.ID.ToString(), Singleworkplan.SrcDoc.PLS.ProjectKey.ID.ToString()), new OqlParam[0]);
                                 if (soline != null)
                                 {
                                     dto.dmsSaleNo = soline.SO.DescFlexField.PubDescSeg5;
                                 }
                             }
                             dto.commissionNo = Singleworkplan.WorkCode;
                             dto.vin = Singleworkplan.VINFinal;
                             if (Singleworkplan.ItemMasterKey != null)
                             {
                                 dto.erpMaterialCode = Singleworkplan.ItemMaster.Code;
                             }
                             dto.flowingCode = Singleworkplan.VIN;
                             dto.oldVin = string.Empty;
                             dto.nodeStatus = Singleworkplan.PlanStatus.Value.ToString();
                             vehicleInfoDto resultdto = service.Do(dto);
                             if (resultdto != null && resultdto.flag == 0)
                             {
                                 throw new System.ApplicationException(resultdto.errMsg);
                             }
                         }
                         catch (System.Exception e)
                         {
                             throw new System.ApplicationException("调用DMS接口错误:" + e.Message);
                         }
                     }
                 }
             }
         }
     }
 }
 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))
         {
             CompleteRpt rpt = key.GetEntity() as CompleteRpt;
             bool flag = PubHelper.IsUsedDMSAPI();
             if (flag)
             {
                 // 制造组织(成都)的才做完工报告
                 if (Context.LoginOrg.Code == PubHelper.Const_OrgCode_Chengdu)
                 {
                     if (rpt.ProjectKey != null)
                     {
                         Project project = Project.Finder.Find("Code='" + rpt.Project.Code.ToString() + "' and org=" + rpt.Project.MasterOrg.ID.ToString(), new OqlParam[0]);
                         if (project != null)
                         {
                             SOLine soline = SOLine.Finder.Find(string.Format("Project={0}", project.ID.ToString()), new OqlParam[0]);
                             if (soline != null && !string.IsNullOrEmpty(soline.SO.DescFlexField.PubDescSeg5))
                             {
                                 if (((rpt.MOKey != null && rpt.MO.MODocType.Code != "MO02")
                                         || rpt.PLSKey != null
                                         )
                                     // 物料一样,说明是整车完工
                                     && soline.ItemInfo.ItemID.Code == rpt.Item.Code
                                     )
                                 {
                                     if (rpt.DocState == CompleteRptStateEnum.Approved && rpt.OriginalData.DocState == CompleteRptStateEnum.Approving)
                                     {
                                         try
                                         {
                                             SI03ImplService service = new SI03ImplService();
                                             // service.Url = PubHelper.GetAddress(service.Url);
                                             vehicleInfoDto dto = new vehicleInfoDto();
                                             if (rpt.ProjectKey != null)
                                             {
                                                 dto.dmsSaleNo = rpt.Project.Code;
                                             }
                                             dto.vin = rpt.DescFlexField.PubDescSeg12;
                                             dto.erpMaterialCode = rpt.Item.Code;
                                             // 等待上线0,上线1,下线滞留2,下线调试3,最终检验4,总装入库5,调试检验6,车辆整改7
                                             dto.nodeStatus = "4";
                                             dto.oldVin = string.Empty;
                                             dto.flowingCode = ((rpt.DescFlexField.PubDescSeg12.Length >= 8) ? rpt.DescFlexField.PubDescSeg12.Substring(rpt.DescFlexField.PubDescSeg12.Length - 8, 8) : rpt.DescFlexField.PubDescSeg12);
                                             vehicleInfoDto resultdto = service.Do(dto);
                                             if (resultdto != null && resultdto.flag == 0)
                                             {
                                                 throw new System.ApplicationException(resultdto.errMsg);
                                             }
                                         }
                                         catch (System.Exception e)
                                         {
                                             throw new System.ApplicationException("调用DMS接口错误:" + e.Message);
                                         }
                                     }
                                     else if (rpt.DescFlexField.PrivateDescSeg21 != rpt.OriginalData.DescFlexField.PrivateDescSeg21)
                                     //// 新增是不是要写???
                                     //if (rpt.DocState == CompleteRptStateEnum.Opened
                                     //    || rpt.DocState == CompleteRptStateEnum.Approving
                                     //    )
                                     {
                                         try
                                         {
                                             SI03ImplService service = new SI03ImplService();
                                             // service.Url = PubHelper.GetAddress(service.Url);
                                             vehicleInfoDto dto = new vehicleInfoDto();
                                             if (rpt.ProjectKey != null)
                                             {
                                                 dto.dmsSaleNo = rpt.Project.Code;
                                             }
                                             dto.vin = rpt.DescFlexField.PubDescSeg12;
                                             dto.erpMaterialCode = rpt.Item.Code;
                                             // 等待上线0,上线1,下线滞留2,下线调试3,最终检验4,总装入库5,调试检验6,车辆整改7
                                             dto.nodeStatus = "4";
                                             dto.oldVin = rpt.DescFlexField.PrivateDescSeg21;
                                             dto.flowingCode = ((rpt.DescFlexField.PrivateDescSeg21.Length >= 8) ? rpt.DescFlexField.PrivateDescSeg21.Substring(rpt.DescFlexField.PrivateDescSeg21.Length - 8, 8) : rpt.DescFlexField.PrivateDescSeg21);
                                             vehicleInfoDto resultdto = service.Do(dto);
                                             if (resultdto != null && resultdto.flag == 0)
                                             {
                                                 throw new System.ApplicationException(resultdto.errMsg);
                                             }
                                         }
                                         catch (System.Exception e)
                                         {
                                             throw new System.ApplicationException("调用DMS接口错误:" + e.Message);
                                         }
                                     }
                                 }
                                 else
                                 {
                                     System.DateTime arg_42B_0 = rpt.ActualRcvTime;
                                     if (rpt.MOKey != null && rpt.MO.MODocType.Code == "MO02")
                                     {
                                         try
                                         {
                                             SI09ImplService service2 = new SI09ImplService();
                                             service2.Url = PubHelper.GetAddress(service2.Url);
                                             //vehicleChangeInfoDto d = service2.receive(new vehicleChangeInfoDto
                                             //{
                                             //    vin = rpt.DescFlexField.PubDescSeg12,
                                             //    docStatus = 7
                                             //});
                                             vehicleChangeInfoDto dto = new vehicleChangeInfoDto();
                                             // 等待上线0,上线1,下线滞留2,下线调试3,最终检验4,总装入库5,调试检验6,车辆整改7
                                             dto.vin = rpt.DescFlexField.PubDescSeg12;
                                             dto.docStatus = 7;
                                             vehicleChangeInfoDto d = service2.Do(dto);
                                             if (d != null && d.flag == 0)
                                             {
                                                 throw new System.ApplicationException(d.errMsg);
                                             }
                                         }
                                         catch (System.Exception e)
                                         {
                                             throw new System.ApplicationException("调用DMS接口错误:" + e.Message);
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }