U9杂收相关服务调用

DLL引用:

UFIDA.U9.CBO.PubBE.Deploy
UFIDA.U9.CBO.PubSV.Agent
UFIDA.U9.CBO.PubSV.Deploy
UFIDA.U9.ISV.MiscRcvISV.Agent
UFIDA.U9.ISV.MiscRcvISV.Deploy
服务引用

1、创建 UFIDA.U9.ISV.MiscRcvISV.Proxy.CommonCreateMiscRcvProxy

UFIDA.U9.PM.Rcv.Receivement holder = key.GetEntity() as UFIDA.U9.PM.Rcv.Receivement;   
获取当前业务实体
long MiscRcvTransID = 0L;
try
                    {
                        using (Session Session = Session.Open())
                        {
                            List HeadDtoList = new List();
                            UFIDA.U9.ISV.MiscRcvISV.IC_MiscRcvDTOData HeadDto = new UFIDA.U9.ISV.MiscRcvISV.IC_MiscRcvDTOData();
                            HeadDto.Org = new CBO.Pub.Controller.CommonArchiveDataDTOData();
                            HeadDto.Org.ID = 1001810161097075;
                            HeadDto.Org.Code = "601";
                            HeadDto.Org.Name = "测试组织";
                            HeadDto.BusinessDate = holder.BusinessDate; //业务日期
                            HeadDto.MiscRcvDocType = new CBO.Pub.Controller.CommonArchiveDataDTOData();
                            HeadDto.MiscRcvDocType.ID = 1001811191099343; //单据类型
                            HeadDto.MiscRcvDocType.Code = "MiscRcv003";
                            HeadDto.MiscRcvDocType.Name = "杂收入库";
                            HeadDto.SysState = UFSoft.UBF.PL.Engine.ObjectState.Inserted;  //单据状态
                            HeadDto.Memo = holder.Org.Code + " | " + holder.DocNo; //单据备注
                            List LinesDtoList = new List();
                            foreach (UFIDA.U9.PM.Rcv.RcvLine lines in holder.RcvLines)
                            {
                                ISV.MiscRcvISV.IC_MiscRcvTransLsDTOData LinesDto = new ISV.MiscRcvISV.IC_MiscRcvTransLsDTOData();
                                LinesDto.ItemInfo = new CBO.SCM.Item.ItemInfoData();
                                LinesDto.ItemInfo.ItemCode = lines.ItemInfo.ItemCode;
                                LinesDto.Wh = new CBO.Pub.Controller.CommonArchiveDataDTOData();
                                LinesDto.Wh.ID = 1001811010001599;//601组织存储地点
                                LinesDto.Wh.Code = "GT002";
                                LinesDto.Wh.Name = "材料库";
                                LinesDto.StoreUOMQty = lines.ArriveQtySU;//库存数量 
                                LinesDto.IsZeroCost = true;//零成本
                                LinesDtoList.Add(LinesDto);
                            }
                            UFIDA.U9.ISV.MiscRcvISV.Proxy.CommonCreateMiscRcvProxy Proxy = new ISV.MiscRcvISV.Proxy.CommonCreateMiscRcvProxy();
                            Proxy.TargetOrgCode = "601";
                            HeadDto.MiscRcvTransLs = LinesDtoList;
                            HeadDtoList.Add(HeadDto);
                            Proxy.MiscRcvDTOList = HeadDtoList;
                            List listDo = Proxy.Do();
                            MiscRcvTransID = listDo[0].ID;
                            Session.Commit();
                        }
                    }
                    catch (Exception e)
                    {
                        throw new Exception(e.ToString());
                    }
                    #endregion
根据收货单生成杂收

2、提交 UFIDA.U9.ISV.MiscRcvISV.Proxy.CommonCommitMiscRcvProxy

long MiscRcvTransID = 0L;
                    #region 杂收提交操作
                    try
                    {
                        UFIDA.U9.ISV.MiscRcvISV.Proxy.CommonCommitMiscRcvProxy MisRCommit = new ISV.MiscRcvISV.Proxy.CommonCommitMiscRcvProxy();
                        MisRCommit.TargetOrgCode = "601";
                        MisRCommit.MiscRcvKeys = new List();
                        CommonArchiveDataDTOData MisRCommitDtoDate = new CommonArchiveDataDTOData { ID = MiscRcvTransID };
                        MisRCommit.MiscRcvKeys.Add(MisRCommitDtoDate);
                        MisRCommit.Do();

                    }
                    catch (Exception e)
                    {
                        throw new Exception(e.ToString());
                    }
                    #endregion
杂收 提交

3、审核 UFIDA.U9.ISV.MiscRcvISV.Proxy.CommonApproveMiscRcvProxy

 long MiscRcvTransID = 0L;
                    try
                    {
                        UFIDA.U9.ISV.MiscRcvISV.Proxy.CommonApproveMiscRcvProxy MisRApprove = new ISV.MiscRcvISV.Proxy.CommonApproveMiscRcvProxy();
                        MisRApprove.TargetOrgCode = "601";
                        MisRApprove.MiscRcvKeys = new List();
                        CommonArchiveDataDTOData MisRApproveDtoData = new CommonArchiveDataDTOData { ID = MiscRcvTransID };
                        MisRApprove.MiscRcvKeys.Add(MisRApproveDtoData);
                        MisRApprove.Do();

                    }
                    catch (Exception e)
                    {
                        throw new Exception(e.ToString());
                    }
杂收 审核

4、弃审 UFIDA.U9.ISV.MiscRcvISV.Proxy.CommonUnApproveMiscRcvProxy

 long MiscRcvTransID = 0L;
                        try
                        {
 UFIDA.U9.ISV.MiscRcvISV.Proxy.CommonUnApproveMiscRcvProxy UnApproveProxy = new ISV.MiscRcvISV.Proxy.CommonUnApproveMiscRcvProxy();
                            UnApproveProxy.TargetOrgCode = "601";
                            UnApproveProxy.MiscRcvKeys = new List();
                            CommonArchiveDataDTOData MiscRcvKeyDataDTOData = new CommonArchiveDataDTOData { ID = MiscRcvTransID  };
                            UnApproveProxy.MiscRcvKeys.Add(MiscRcvKeyDataDTOData);
                            UnApproveProxy.Do();


                        }
                        catch (Exception e)
                        {
                            throw new Exception(e.ToString());
                        }
杂收 弃审

5、删除 UFIDA.U9.ISV.MiscRcvISV.Proxy.CommonDeleteMiscRcvProxy

long MiscRcvTransID = 0L;
 try
                        {
                            UFIDA.U9.ISV.MiscRcvISV.Proxy.CommonDeleteMiscRcvProxy RDeleteProxy = new ISV.MiscRcvISV.Proxy.CommonDeleteMiscRcvProxy();
                            RDeleteProxy.TargetOrgCode = "601";
                            RDeleteProxy.MiscRcvKeyList = new List();
                            CommonArchiveDataDTOData MiscRcvKeyListDataDTOData = new CommonArchiveDataDTOData { ID = MiscRcvTransID  };
                            RDeleteProxy.MiscRcvKeyList.Add(MiscRcvKeyListDataDTOData);
                            RDeleteProxy.Do();
                        }
                        catch (Exception e)
                        {
                            throw new Exception(e.ToString());
                        }
杂收 删除

你可能感兴趣的:(U9杂收相关服务调用)