示例#1
0
        private void DoKPQS()
        {
            string    sql = @"select AA.* from (
	select AA.TASKID,AA.FinishAt,AA.SerialNum,AA.XH,BB.Z_XH,BB.Z_ZP,BB.Z_GLBH,BB.Z_GLBH_PK,BB.Z_HTBH,AA.KHBM Z_KHBM,AA.KHMC Z_KHMC,BB.Z_YWLX,BB.Z_YYDD,BB.S_MC,BB.S_DJ,BB.S_KPJE,BB.S_SL,BB.S_BHSJE,BB.C_SAKNR,BB.C_SNWBMC,BB.C_WBJE,BB.C_WBCS,BB.C_CXZBBB,BB.CD from (
		--开票信息,开票序号 开始
		select AA.TASKID,AA.FinishAt,AA.SerialNum,BB.ID,BB.XH,BB.KHBM,BB.KHMC from (
			select AA.TASKID,BB.FinishAt,BB.SerialNum from DABAN_BPM_DSCG.[dbo].[KPSQ_C_H] AA 
			left join BPMDB.DBO.BPMInstTasks BB on AA.TASKID=BB.TaskID
			where AA.PROCESS_TYPE='0' and AA.YCWC_TYPE='0' and BB.State='Approved'
		) AA left join DABAN_BPM_DSCG.[dbo].[KPSQ_FP_D] BB on AA.TASKID=BB.TASKID
		--开票信息,开票序号 结束
	) AA left join DABAN_BPM_DSCG.[dbo].[KPSQ_ZYDXX_D] BB on AA.TASKID=BB.TASKID and AA.ID=BB.KPSQ_FP_D_ID
	--left join BPMDB.dbo.MAIN_CUSTOMER CC on AA.KHBM = CC.CSR_ID and CC.COMPANY='DSCG'
--与Queue表关联,得到可以生成联携的数据
	) AA left join BPMDB.dbo.SAP_COMPANYFUNDS_LINKS_QUEUE BB on AA.SerialNum=BB.APPLY_NO
where BB.ISLINK=0";
            DataTable dt  = SQLHelper.ExecuteDataset(context.connStr, System.Data.CommandType.Text, sql).Tables[0];

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                queue.Add(Convert.ToString(dt.Rows[i]["SerialNum"]));
                if (!string.IsNullOrEmpty(Convert.ToString(dt.Rows[i]["C_CXZBBB"])) && VerificationPurchaseSaknr(Convert.ToString(dt.Rows[i]["C_SAKNR"])))
                {
                    DoPurchase(dt.Rows[i]);
                    KPSQPurchaseCount++;
                }
                DoSale(dt.Rows[i]);
                KPSQSaleCount++;
            }
        }
示例#2
0
        public void GetSqlByList(ref Dictionary <string, List <RecList> > dic, ref Dictionary <string, T_SAP_COMPANYFUNDS_LINKS_QUEUE> dicQ)
        {
            string    company  = "1020";
            string    filePath = "DICS_Path_Rec".ToAppSetting();
            string    fileName = "DICS_Name_Rec".ToAppSetting() + "_" + company + "_" + DateTime.Now.ToString("yyyyMMdd");
            string    fileExt  = "DICS_Ext_Rec".ToAppSetting();
            string    sql      = @"SELECT * FROM DABAN_BPM_DICS.DBO.V_DICS_SAPLINKFILEDATA A
                       INNER JOIN SAP_COMPANYFUNDS_LINKS_QUEUE B
                       ON A.SN = B.APPLY_NO AND ISLINK = 0";
            DataTable dt       = SQLHelper.ExecuteDataset("BPMDB".ToConnectionString(), System.Data.CommandType.Text, sql).Tables[0];

            List <RecList> recList = new List <RecList>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                queue.Add(Convert.ToString(dt.Rows[i]["SN"]));
                getDtFor40(dt.Rows[i], recList);
                getDtFor31(dt.Rows[i], recList);
            }
            dic.Add("1020", recList);
            dicQ.Add("1020", queue);
            //AccvouchEntityConvertStreamBaseManager accvouchEntityConvertStreamBaseManager = new AccvouchEntityConvertStreamBaseManager();
            //SapLinksQueueEntity sapLinksQueue = new SapLinksQueueEntity("BPMDB".ToConnectionString(), queue.GetSql_ISLINK1());
            //StringBuilder sb = new StringBuilder();
            //foreach (RecList item in recList)
            //{
            //sb.AppendLine(item.ToVouchString());
            //}

            //SAPLinks.Helper.SaveFile.ISaveFileProvider saveFileProvider = SapSaveFileProviderFactory.CreateSaveProvider(sapLinksQueue);
            //saveFileProvider.AddFileInfo(new SapSaveFileInfo(filePath, fileName + fileExt, sb));
            //saveFileProvider.SaveFile();
        }
示例#3
0
        public StringBuilder GetData()
        {
            StringBuilder sb  = new StringBuilder();
            string        sql = @"select AA.APPLY_NO,AA.YS_NAME,AA.APPLY_DISPLAYNAME,AA.PAY_AMOUNT,AA.APPLY_DATE,AA.APPLY_DEPT from DABAN_BPM_DICS.dbo.YSJE_SQ_H AA
LEFT JOIN BPMDB.DBO.SAP_COMPANYFUNDS_LINKS_QUEUE BB ON AA.APPLY_NO = BB.APPLY_NO
where BB.ISLINK = 0";
            DataTable     dt  = SQLHelper.ExecuteDataset(connStr, System.Data.CommandType.Text, sql).Tables[0];

            LogInfo.Log.Info("《扩贩申请》获取需处理数量:" + dt.Rows.Count + "条");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                AccVouch acc = new AccVouch();
                acc.I_KOKRS = "1000";                                                            //控制范围(I_KOKRS)
                acc.I_AUART = "ZZT1";                                                            //订单类型(I_AUART)
                acc.I_AUFNR = dt.Rows[i]["APPLY_NO"].ToString();                                 //订单(I_AUFNR)
                acc.I_KTEXT = dt.Rows[i]["YS_NAME"].ToString();                                  //描述(I_KTEXT)
                acc.I_BUKRS = Code;                                                              //公司代码(I_BUKRS)
                acc.I_SCOPE = "OC";                                                              //对象类(I_SCOPE)
                acc.I_USER0 = dt.Rows[i]["APPLY_DISPLAYNAME"].ToString();                        //申请人(I_USER0)
                acc.I_USER1 = "";                                                                //电话(I_USER1)
                acc.I_USER2 = "";                                                                //负责人(I_USER2)
                acc.I_USER3 = "";                                                                //电话1(I_USER3)
                acc.I_USER4 = dt.Rows[i]["PAY_AMOUNT"].ToString();                               //估算成本(I_USER4)
                acc.I_USER5 = Convert.ToDateTime(dt.Rows[i]["APPLY_DATE"]).ToString("yyyyMMdd"); //申请日期(I_USER5)
                acc.I_USER6 = dt.Rows[i]["APPLY_DEPT"].ToString();                               //部门(I_USER6)
                queue.Add(dt.Rows[i]["APPLY_NO"].ToString());
                sb.AppendLine(acc.ToVouchString());
            }
            return(sb);
        }
        private void GetSqlByList(string companyCode, DataRow[] drs, ref Dictionary <string, List <RecList> > dic, ref Dictionary <string, T_SAP_COMPANYFUNDS_LINKS_QUEUE> dicQ)
        {
            T_SAP_COMPANYFUNDS_LINKS_QUEUE queue = new T_SAP_COMPANYFUNDS_LINKS_QUEUE();

            //companyCode = "1020";
            string filePath = "DICS_Path_Rec".ToAppSetting();
            string fileName = "DICS_Name_Rec".ToAppSetting() + "_" + companyCode + "_" + DateTime.Now.ToString("yyyyMMdd");
            string fileExt  = "DICS_Ext_Rec".ToAppSetting();
            //string sql = @"SELECT * FROM DABAN_BPM_DICS.DBO.V_EmptyAndClearSale_Post A
            //           INNER JOIN SAP_COMPANYFUNDS_LINKS_QUEUE B
            //           ON A.SN = B.APPLY_NO AND ISLINK = 0";
            //DataTable dt = SQLHelper.ExecuteDataset("BPMDB".ToConnectionString(), System.Data.CommandType.Text, sql).Tables[0];

            List <RecList> recList = new List <RecList>();

            if (dic.ContainsKey(companyCode))
            {
                recList = dic[companyCode];
            }
            if (dicQ.ContainsKey(companyCode))
            {
                queue = dicQ[companyCode];
            }
            for (int i = 0; i < drs.Length; i++)
            {
                queue.Add(Convert.ToString(drs[i]["SN"]));
                getDtFor40(drs[i], recList);
                getDtFor19(drs[i], recList);
            }

            if (dic.ContainsKey(companyCode))
            {
                dic[companyCode] = recList;
            }
            else
            {
                dic.Add(companyCode, recList);
            }

            if (dicQ.ContainsKey(companyCode))
            {
                dicQ[companyCode] = queue;
            }
            else
            {
                dicQ.Add(companyCode, queue);
            }
            //AccvouchEntityConvertStreamBaseManager accvouchEntityConvertStreamBaseManager = new AccvouchEntityConvertStreamBaseManager();
            //SapLinksQueueEntity sapLinksQueue = new SapLinksQueueEntity("BPMDB".ToConnectionString(), queue.GetSql_ISLINK1());
            //StringBuilder sb = new StringBuilder();
            //foreach (RecList item in recList)
            //{
            //    sb.AppendLine(item.ToVouchString());
            //}

            //SAPLinks.Helper.SaveFile.ISaveFileProvider saveFileProvider = SapSaveFileProviderFactory.CreateSaveProvider(sapLinksQueue);
            //saveFileProvider.AddFileInfo(new SapSaveFileInfo(filePath, fileName + fileExt, sb));
            //saveFileProvider.SaveFile();
        }
示例#5
0
        private string GetUpdateSapLinkQueue(ApplyNoEntityCollection applyNoEntityCollection)
        {
            T_SAP_COMPANYFUNDS_LINKS_QUEUE tquere = new T_SAP_COMPANYFUNDS_LINKS_QUEUE();

            foreach (ApplyNoEntity applyNoEntity in applyNoEntityCollection)
            {
                tquere.Add(applyNoEntity.ApplyNo);
            }
            return(tquere.GetSql_ISLINK1());
        }
        private void GetSqlByList(string companyCode, DataRow[] drs, ref Dictionary <string, List <RecList> > dic, ref Dictionary <string, T_SAP_COMPANYFUNDS_LINKS_QUEUE> dicQ)
        {
            T_SAP_COMPANYFUNDS_LINKS_QUEUE queue = new T_SAP_COMPANYFUNDS_LINKS_QUEUE();

            string filePath = "DICS_Path_Rec".ToAppSetting();
            string fileName = "DICS_Name_Rec".ToAppSetting() + "_" + companyCode + "_" + DateTime.Now.ToString("yyyyMMdd");
            string fileExt  = "DICS_Ext_Rec".ToAppSetting();

            List <RecList> recList = new List <RecList>();

            if (dic.ContainsKey(companyCode))
            {
                recList = dic[companyCode];
            }
            if (dicQ.ContainsKey(companyCode))
            {
                queue = dicQ[companyCode];
            }
            for (int i = 0; i < drs.Length; i++)
            {
                queue.Add(Convert.ToString(drs[i]["BATCH_NO"]));
                getDtFor40(drs[i], recList);
                getDtFor50(drs[i], recList);
            }
            if (dic.ContainsKey(companyCode))
            {
                dic[companyCode] = recList;
            }
            else
            {
                dic.Add(companyCode, recList);
            }

            if (dicQ.ContainsKey(companyCode))
            {
                dicQ[companyCode] = queue;
            }
            else
            {
                dicQ.Add(companyCode, queue);
            }
            //AccvouchEntityConvertStreamBaseManager accvouchEntityConvertStreamBaseManager = new AccvouchEntityConvertStreamBaseManager();
            //SapLinksQueueEntity sapLinksQueue = new SapLinksQueueEntity("BPMDB".ToConnectionString(), queue.GetSql_ISLINK1());
            //StringBuilder sb = new StringBuilder();
            //foreach (RecList item in recList)
            //{
            //    sb.AppendLine(item.ToVouchString());
            //}

            //SAPLinks.Helper.SaveFile.ISaveFileProvider saveFileProvider = SapSaveFileProviderFactory.CreateSaveProvider(sapLinksQueue);
            //saveFileProvider.AddFileInfo(new SapSaveFileInfo(filePath, fileName + fileExt, sb));
            //saveFileProvider.SaveFile();
        }