U9杂发相关服务调用

DLL引用:

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

1、创建 UFIDA.U9.ISV.MiscShipISV.Proxy.CommonCreateMiscShipProxy

long MiscShipmentTransID = 0L;
UFIDA.U9.PM.Rcv.Receivement holder = key.GetEntity() as UFIDA.U9.PM.Rcv.Receivement; 
获取当前业务实体
try{
                        List MiscSDTOList = new List();
                        ISV.MiscShipISV.IC_MiscShipmentDTOData MiscSDTO = new ISV.MiscShipISV.IC_MiscShipmentDTOData();
                        MiscSDTO.Org = new CommonArchiveDataDTOData();
                        MiscSDTO.Org.ID = 1001810161097075;
                        MiscSDTO.Org.Code = "601";//目标组织
                        MiscSDTO.Org.Name = "测试组织";
                        MiscSDTO.MiscShipDocType=new CommonArchiveDataDTOData();
                        MiscSDTO.MiscShipDocType.ID=1001811200000162;
                        MiscSDTO.MiscShipDocType.Code="MiscShip003";
                        MiscSDTO.MiscShipDocType.Name = "杂发出库";
                        MiscSDTO.BusinessDate = holder.BusinessDate;
                        MiscSDTO.SysState= UFSoft.UBF.PL.Engine.ObjectState.Inserted;
                        MiscSDTO.Memo = holder.Org.Code + " | " + holder.DocNo;
                        List MiscSLDTOList = new List();
                        foreach (UFIDA.U9.PM.Rcv.RcvLine ls in holder.RcvLines)
                        {
                            UFIDA.U9.ISV.MiscShipISV.IC_MiscShipmentLDTOData MiscSLDTO = new ISV.MiscShipISV.IC_MiscShipmentLDTOData();
                            MiscSLDTO.ItemInfo = new CBO.SCM.Item.ItemInfoData();
                            MiscSLDTO.ItemInfo.ItemCode = ls.ItemInfo.ItemCode;
                            MiscSLDTO.Wh = new CommonArchiveDataDTOData();
                            MiscSLDTO.Wh.ID=1001811010001599;
                            MiscSLDTO.Wh.Code="GT002";
                            MiscSLDTO.Wh.Name = "材料库";
                            MiscSLDTO.StoreUOMQty = ls.ArriveQtySU;
                            MiscSLDTO.IsZeroCost = true;
                            MiscSLDTOList.Add(MiscSLDTO);
                        }

                        UFIDA.U9.ISV.MiscShipISV.Proxy.CommonCreateMiscShipProxy MiscSProxy = new ISV.MiscShipISV.Proxy.CommonCreateMiscShipProxy();
                        MiscSProxy.TargetOrgCode = "601";//目标组织
                        MiscSDTO.MiscShipLs = MiscSLDTOList;
                        MiscSDTOList.Add(MiscSDTO);
                        MiscSProxy.MiscShipmentDTOList=MiscSDTOList;
                        List MiscSlist= MiscSProxy.Do();
                        MiscShipmentTransID = MiscSlist[0].ID;
                    }
                    catch (Exception e)
                    {
                        throw new Exception(e.ToString());
                    }
收货单生成杂发

2、提交 UFIDA.U9.ISV.MiscShipISV.Proxy.CommonCommitMiscShipSVProxy

UFIDA.U9.ISV.MiscShipISV.Proxy.CommonCommitMiscShipSVProxy MiscSCommitProxy = new ISV.MiscShipISV.Proxy.CommonCommitMiscShipSVProxy();
                    MiscSCommitProxy.TargetOrgCode = "601";
                    MiscSCommitProxy.MiscShipmentKeyList = new List();
                    CommonArchiveDataDTOData MiscSCommitProxyData = new CommonArchiveDataDTOData { ID = MiscShipmentTransID };
                    MiscSCommitProxy.MiscShipmentKeyList.Add(MiscSCommitProxyData);
                    MiscSCommitProxy.Do();
杂发 提交

3、审核 UFIDA.U9.ISV.MiscShipISV.Proxy.CommonApproveMiscShipSVProxy

                UFIDA.U9.ISV.MiscShipISV.Proxy.CommonApproveMiscShipSVProxy MiscSApproveProxy = new ISV.MiscShipISV.Proxy.CommonApproveMiscShipSVProxy();
                    MiscSApproveProxy.TargetOrgCode = "600";//目标组织
                    MiscSApproveProxy.MiscShipmentKeyList = new List();
                    CommonArchiveDataDTOData MiscSApproveProxyData = new CommonArchiveDataDTOData { ID = MiscShipmentTransID };
                    MiscSApproveProxy.MiscShipmentKeyList.Add(MiscSApproveProxyData);
                    MiscSApproveProxy.Do();
杂发 审核

4、弃审 UFIDA.U9.ISV.MiscShipISV.Proxy.CommonUnApporveMiscShipSVProxy

                        try
                        {
                            UFIDA.U9.ISV.MiscShipISV.Proxy.CommonUnApporveMiscShipSVProxy UnApporveMiscShipSVProxy = new ISV.MiscShipISV.Proxy.CommonUnApporveMiscShipSVProxy();
                            UnApporveMiscShipSVProxy.TargetOrgCode = "601";//目标组织
                            UnApporveMiscShipSVProxy.MiscShipmentKeyList = new List();
                            CommonArchiveDataDTOData UnApporveMiscShipSVProxyData = new CommonArchiveDataDTOData { ID =MiscShipmentTransID };
                            UnApporveMiscShipSVProxy.MiscShipmentKeyList.Add(UnApporveMiscShipSVProxyData);
                            UnApporveMiscShipSVProxy.Do();

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

5、删除 UFIDA.U9.ISV.MiscShipISV.Proxy.CommonDeleteMiscShipProxy

 try
                        {
                            UFIDA.U9.ISV.MiscShipISV.Proxy.CommonDeleteMiscShipProxy DeleteMiscShipProxy = new ISV.MiscShipISV.Proxy.CommonDeleteMiscShipProxy();
                            DeleteMiscShipProxy.TargetOrgCode = "601";//目标组织
                            DeleteMiscShipProxy.MiscShipmentKeyList = new List();
                            CommonArchiveDataDTOData DeleteMiscShipProxyData = new CommonArchiveDataDTOData { ID = MiscShipmentTransID };
                            DeleteMiscShipProxy.MiscShipmentKeyList.Add(DeleteMiscShipProxyData);
                            DeleteMiscShipProxy.Do();
                        }
                        catch (Exception e)
                        {
                            throw new Exception(e.ToString());
                        }
杂发 删除

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