IcsFromERPJob
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

461 lines
23 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. using Quartz;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Configuration;
  5. using System.Data;
  6. using System.IO;
  7. using System.Linq;
  8. using System.Net;
  9. using System.Reflection;
  10. using System.Text;
  11. using System.Text.RegularExpressions;
  12. using System.Threading.Tasks;
  13. namespace ICSSoft.FromERP
  14. {
  15. /// <summary>
  16. /// 财务费用 明细账
  17. /// </summary>
  18. public class YERP_007_gz : IJob
  19. {
  20. private static object key = new object();
  21. private static log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
  22. public void Execute(IJobExecutionContext context)
  23. {
  24. try
  25. {
  26. lock (key)
  27. {
  28. log.Info("开始……………………………………………………………………");
  29. Execute();
  30. log.Info("结束……………………………………………………………………");
  31. }
  32. }
  33. catch (Exception ex)
  34. {
  35. log.Error(ex.ToString());
  36. }
  37. }
  38. public async void Execute()
  39. {
  40. try
  41. {
  42. Configuration config = GetConfig();
  43. var Dates = DateTime.Now;
  44. string conStr = ICSHelper.GetConfigString("SysConnectionString_gz");
  45. if (string.IsNullOrEmpty(conStr))
  46. {
  47. log.Info("YERP_006 conStr未找到。");
  48. return;
  49. }
  50. //<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:yerp="http://skch.com/YERP_007_TAX_FOR_FIN_EXPENSE">
  51. // <soapenv:Header/>
  52. // <soapenv:Body>
  53. // <yerp:YERP_007_OA1_MT>
  54. // <!--1 or more repetitions:-->
  55. // <FIN_CST_SPTDOC>
  56. // <YYYY>?</YYYY>
  57. // <MM>1</MM>
  58. // <DD>?</DD>
  59. // <SPTDOC>?</SPTDOC>
  60. // <SMR>?</SMR>
  61. // <DBTO>?</DBTO>
  62. // <CRDTO>?</CRDTO>
  63. // <DBTO_CRDTO_DVSN>?</DBTO_CRDTO_DVSN>
  64. // <BLNC>?</BLNC>
  65. // <!--Optional:-->
  66. // <DBTO_CMSN>?</DBTO_CMSN>
  67. // <!--Optional:-->
  68. // <DBTO_IENS>?</DBTO_IENS>
  69. // <!--Optional:-->
  70. // <DBTO_XCH_PC>?</DBTO_XCH_PC>
  71. // </FIN_CST_SPTDOC>
  72. // </yerp:YERP_007_OA1_MT>
  73. // </soapenv:Body>
  74. //</soapenv:Envelope>
  75. // 过滤时间为上个月
  76. string Date = Dates.ToString("yyyy");
  77. string beginMuoth = Dates.AddMonths(-1).ToString("MM");
  78. string endMuoth = Dates.ToString("MM");
  79. var beginPeriod = "200001";//Date + beginMuoth
  80. var endPeriod = "206001";//Date + endMuoth
  81. string sqlsgz = @"
  82. begin transaction
  83. exec GL_Ledger @tblname=N'cwfymxz',@KmCode=N'6603',@beginPeriod='{0}',@endPeriod='{1}',@bVouch=0,@bequal=1,@sum=0,@bMJ=1,@swhere=N'',@sAuth=N'',@ReportID=N'GL13',@ReportType=0,@iUnite=0
  84. --select * from tempdb..cwfymxz
  85. select autoid,a.iyear YYYY,imonth MM,iday DD,csign_no SPTDOC,cDigest SMR,cDCode ODR_ACC,a.md DBTO_AMT,a.mc CRDTO_AMT,tmpme tmpme,b.cbegind_c
  86. into #test
  87. from tempdb..cwfymxz a
  88. join GL_accsum b on a.cCode = b.ccode and a.iyear = b.iyear and b.iperiod=1
  89. select SPTDOC,YYYY,MM,DD,sum(DBTO_AMT) DBTO_AMT,sum(CRDTO_AMT) CRDTO_AMT,sum(isnull(tmpme,0)) tmpme,cbegind_c
  90. into #test2
  91. from #test a
  92. where SPTDOC is not null and DD IS NOT NULL
  93. group by SPTDOC,YYYY,MM,DD,cbegind_c
  94. order by SPTDOC
  95. update a set DBTO_AMT=b.DBTO_AMT,a.CRDTO_AMT=b.CRDTO_AMT,a.tmpme=b.tmpme from #test a
  96. left join #test2 b on a.SPTDOC=b.SPTDOC and a.MM=b.MM and a.DD=b.DD
  97. where a.sptdoc is not null
  98. select autoid,sptdoc,YYYY,MM,DD into #test3 from #test where sptdoc is not null
  99. select s.* into #test4 from (select *,ROW_NUMBER() over (partition by sptdoc+CAST(MM AS VARCHAR(255))+CAST(DD AS VARCHAR(255)) order by autoid) as group_idx from #test3)s where s.group_idx>1
  100. delete a from #test a
  101. left join #test4 b on a.autoid=b.autoid
  102. where b.autoid is not null
  103. select *,(case when (Select Sum(-tmpme) from #test where autoid<=a.autoid) =0 then '平' else (case when (Select Sum(-tmpme) from #test where autoid<=a.autoid) >0 then '贷' else '借' end) end) INVT,
  104. (case when (Select Sum(-tmpme) from #test where autoid<=a.autoid)<0 then -(Select Sum(-tmpme) from #test where autoid<=a.autoid) else (Select Sum(-tmpme) from #test where autoid<=a.autoid) end) BLNC
  105. into #test5
  106. from #test a
  107. select cCode SBJ_CD,ccode_name SBJ_NM,imonth,iday,csign_no SPTDOC,sum(md) DBTO_AMT
  108. into #test6
  109. from tempdb..cwfymxz a
  110. where csign_no is not null
  111. group by ccode_name,csign_no,cCode,imonth,iday
  112. order by csign_no,imonth,iday
  113. select DISTINCT sptdoc,imonth,iday into #test7 from #test6
  114. select *,ROW_NUMBER() over (order by sptdoc,imonth,iday) rownumber into #test8 from #test7
  115. declare @k int
  116. set @k=1
  117. while @k<=(select COUNT(*) from #test7)
  118. begin
  119. declare @i int
  120. set @i=0
  121. while @i<1
  122. begin
  123. insert into #test6 (SBJ_CD,SBJ_NM,imonth,iday,SPTDOC,DBTO_AMT)
  124. select a.ccode,a.ccode_name,(select imonth from #test8 where rownumber=@k),(select iday from #test8 where rownumber=@k),(select SPTDOC from #test8 where rownumber=@k),0
  125. from code a left join #test6 b on b.SPTDOC=(select SPTDOC from #test8 where rownumber=@k) and imonth=(select imonth from #test8 where rownumber=@k) and iday=(select iday from #test8 where rownumber=@k) and SBJ_NM=ccode_name
  126. where a.iYear=2024 and ( bclose=0 and ( ccode like N'6603%' or ccode_name like N'6603%' or ccode_engl like N'6603%' or chelp like N'6603%' )) and ccode <>'6603' and len(ccode)=6
  127. and b.SPTDOC is null
  128. set @i=@i +1
  129. end
  130. set @k=@k +1
  131. end
  132. SELECT
  133. SPTDOC,imonth,iday,
  134. SUM(CASE WHEN SBJ_CD = '660301' THEN DBTO_AMT ELSE 0 END) DBTO_CMSN,
  135. SUM(CASE WHEN SBJ_CD = '660302' THEN DBTO_AMT ELSE 0 END) DBTO_IENS,
  136. SUM(CASE WHEN SBJ_CD = '660303' THEN DBTO_AMT ELSE 0 END) DBTO_XCH_PC
  137. into #test9
  138. FROM
  139. #test6
  140. GROUP BY
  141. SPTDOC,imonth,iday
  142. select YYYY,MM,DD,A.SPTDOC,SMR,DBTO_AMT DBTO,CRDTO_AMT CRDTO,INVT,BLNC,DBTO_CMSN,DBTO_IENS,DBTO_XCH_PC,'' DBTO_CRDTO_DVSN,cbegind_c
  143. from #test5 a left join #test9 b on a.SPTDOC=b.SPTDOC and a.MM=b.imonth and a.DD=b.iday order by MM
  144. rollback transaction";//and dInvCreateDatetime > '{0}' and dInvCreateDatetime < '{1}'
  145. sqlsgz = string.Format(sqlsgz, beginPeriod, endPeriod);
  146. log.Info("YERP_007_gz sql:" + sqlsgz);
  147. DataTable vbsgzdt = ICSHelper.ExecuteTable(conStr, sqlsgz);
  148. log.Info("YERP_007_gz sql结果数量" + vbsgzdt.Rows.Count);
  149. string sqlyywsr_gz = @"
  150. begin transaction
  151. exec GL_Ledger @tblname=N'cwfymxz',@KmCode=N'6301',@beginPeriod='{0}',@endPeriod='{1}',@bVouch=0,@bequal=1,@sum=0,@bMJ=1,@swhere=N'',@sAuth=N'',@ReportID=N'GL13',@ReportType=0,@iUnite=0
  152. --select * from tempdb..cwfymxz
  153. select autoid,a.iyear YYYY,imonth MM,iday DD,csign_no SPTDOC,cDigest SMR,cDCode ODR_ACC,a.md DBTO_AMT,a.mc CRDTO_AMT,tmpme tmpme,b.cbegind_c
  154. into #test
  155. from tempdb..cwfymxz a
  156. join GL_accsum b on a.cCode = b.ccode and a.iyear = b.iyear and b.iperiod=1
  157. select SPTDOC,YYYY,MM,DD,sum(DBTO_AMT) DBTO_AMT,sum(CRDTO_AMT) CRDTO_AMT,sum(isnull(tmpme,0)) tmpme,cbegind_c
  158. into #test2
  159. from #test a
  160. where SPTDOC is not null and DD IS NOT NULL
  161. group by SPTDOC,YYYY,MM,DD,cbegind_c
  162. order by SPTDOC
  163. update a set DBTO_AMT=b.DBTO_AMT,a.CRDTO_AMT=b.CRDTO_AMT,a.tmpme=b.tmpme from #test a
  164. left join #test2 b on a.SPTDOC=b.SPTDOC and a.MM=b.MM and a.DD=b.DD
  165. where a.sptdoc is not null
  166. select autoid,sptdoc,YYYY,MM,DD into #test3 from #test where sptdoc is not null
  167. select s.* into #test4 from (select *,ROW_NUMBER() over (partition by sptdoc+CAST(MM AS VARCHAR(255))+CAST(DD AS VARCHAR(255)) order by autoid) as group_idx from #test3)s where s.group_idx>1
  168. delete a from #test a
  169. left join #test4 b on a.autoid=b.autoid
  170. where b.autoid is not null
  171. select *,(case when (Select Sum(-tmpme) from #test where autoid<=a.autoid) =0 then '平' else (case when (Select Sum(-tmpme) from #test where autoid<=a.autoid) >0 then '贷' else '借' end) end) INVT,
  172. (case when (Select Sum(-tmpme) from #test where autoid<=a.autoid)<0 then -(Select Sum(-tmpme) from #test where autoid<=a.autoid) else (Select Sum(-tmpme) from #test where autoid<=a.autoid) end) BLNC
  173. into #test5
  174. from #test a
  175. select cCode SBJ_CD,ccode_name SBJ_NM,imonth,iday,csign_no SPTDOC,sum(md) DBTO_AMT
  176. into #test6
  177. from tempdb..cwfymxz a
  178. where csign_no is not null
  179. group by ccode_name,csign_no,cCode,imonth,iday
  180. order by csign_no,imonth,iday
  181. select DISTINCT sptdoc,imonth,iday into #test7 from #test6
  182. select *,ROW_NUMBER() over (order by sptdoc,imonth,iday) rownumber into #test8 from #test7
  183. declare @k int
  184. set @k=1
  185. while @k<=(select COUNT(*) from #test7)
  186. begin
  187. declare @i int
  188. set @i=0
  189. while @i<1
  190. begin
  191. insert into #test6 (SBJ_CD,SBJ_NM,imonth,iday,SPTDOC,DBTO_AMT)
  192. select a.ccode,a.ccode_name,(select imonth from #test8 where rownumber=@k),(select iday from #test8 where rownumber=@k),(select SPTDOC from #test8 where rownumber=@k),0
  193. from code a left join #test6 b on b.SPTDOC=(select SPTDOC from #test8 where rownumber=@k) and imonth=(select imonth from #test8 where rownumber=@k) and iday=(select iday from #test8 where rownumber=@k) and SBJ_NM=ccode_name
  194. where a.iYear=2024 and ( bclose=0 and ( ccode like N'6301%' or ccode_name like N'6301%' or ccode_engl like N'6301%' or chelp like N'6301%' )) and ccode <>'6301' and len(ccode)=6
  195. and b.SPTDOC is null
  196. set @i=@i +1
  197. end
  198. set @k=@k +1
  199. end
  200. --SELECT
  201. --SPTDOC,imonth,iday,
  202. -- sum(DBTO_AMT)
  203. -- -- into #test9
  204. -- FROM
  205. -- #test6
  206. -- GROUP BY
  207. -- SPTDOC,imonth,iday
  208. --GROUP BY
  209. -- SPTDOC,imonth,iday
  210. SELECT
  211. SPTDOC,imonth,iday,sum(DBTO_AMT) as sumss
  212. into #test9
  213. FROM
  214. #test6
  215. GROUP BY
  216. SPTDOC,imonth,iday
  217. select YYYY,MM,SUM(ISNULL(sumss,0)) NOSLS_INCM
  218. from #test5 a left join #test9 b on a.SPTDOC=b.SPTDOC and a.MM=b.imonth and a.DD=b.iday
  219. group by YYYY,MM
  220. order by MM
  221. rollback transaction";
  222. sqlyywsr_gz = string.Format(sqlyywsr_gz, beginPeriod, endPeriod);
  223. log.Info("YERP_007_gz 营业外收入 sqlyywsr_gz:" + sqlyywsr_gz);
  224. DataTable vbsyywsrdt_gz = ICSHelper.ExecuteTable(conStr, sqlyywsr_gz);
  225. log.Info("YERP_007_gz 营业外收入sql结果数量" + vbsyywsrdt_gz.Rows.Count);
  226. string sqlyywzc_gz = @"begin transaction
  227. exec GL_Ledger @tblname=N'cwfymxz',@KmCode=N'6711',@beginPeriod='{0}',@endPeriod='{1}',@bVouch=0,@bequal=1,@sum=0,@bMJ=1,@swhere=N'',@sAuth=N'',@ReportID=N'GL13',@ReportType=0,@iUnite=0
  228. --select * from tempdb..cwfymxz
  229. select autoid,a.iyear YYYY,imonth MM,iday DD,csign_no SPTDOC,cDigest SMR,cDCode ODR_ACC,a.md DBTO_AMT,a.mc CRDTO_AMT,tmpme tmpme,b.cbegind_c
  230. into #test
  231. from tempdb..cwfymxz a
  232. join GL_accsum b on a.cCode = b.ccode and a.iyear = b.iyear and b.iperiod=1
  233. select SPTDOC,YYYY,MM,DD,sum(DBTO_AMT) DBTO_AMT,sum(CRDTO_AMT) CRDTO_AMT,sum(isnull(tmpme,0)) tmpme,cbegind_c
  234. into #test2
  235. from #test a
  236. where SPTDOC is not null and DD IS NOT NULL
  237. group by SPTDOC,YYYY,MM,DD,cbegind_c
  238. order by SPTDOC
  239. update a set DBTO_AMT=b.DBTO_AMT,a.CRDTO_AMT=b.CRDTO_AMT,a.tmpme=b.tmpme from #test a
  240. left join #test2 b on a.SPTDOC=b.SPTDOC and a.MM=b.MM and a.DD=b.DD
  241. where a.sptdoc is not null
  242. select autoid,sptdoc,YYYY,MM,DD into #test3 from #test where sptdoc is not null
  243. select s.* into #test4 from (select *,ROW_NUMBER() over (partition by sptdoc+CAST(MM AS VARCHAR(255))+CAST(DD AS VARCHAR(255)) order by autoid) as group_idx from #test3)s where s.group_idx>1
  244. delete a from #test a
  245. left join #test4 b on a.autoid=b.autoid
  246. where b.autoid is not null
  247. select *,(case when (Select Sum(-tmpme) from #test where autoid<=a.autoid) =0 then '平' else (case when (Select Sum(-tmpme) from #test where autoid<=a.autoid) >0 then '贷' else '借' end) end) INVT,
  248. (case when (Select Sum(-tmpme) from #test where autoid<=a.autoid)<0 then -(Select Sum(-tmpme) from #test where autoid<=a.autoid) else (Select Sum(-tmpme) from #test where autoid<=a.autoid) end) BLNC
  249. into #test5
  250. from #test a
  251. select cCode SBJ_CD,ccode_name SBJ_NM,imonth,iday,csign_no SPTDOC,sum(md) DBTO_AMT
  252. into #test6
  253. from tempdb..cwfymxz a
  254. where csign_no is not null
  255. group by ccode_name,csign_no,cCode,imonth,iday
  256. order by csign_no,imonth,iday
  257. select DISTINCT sptdoc,imonth,iday into #test7 from #test6
  258. select *,ROW_NUMBER() over (order by sptdoc,imonth,iday) rownumber into #test8 from #test7
  259. declare @k int
  260. set @k=1
  261. while @k<=(select COUNT(*) from #test7)
  262. begin
  263. declare @i int
  264. set @i=0
  265. while @i<1
  266. begin
  267. insert into #test6 (SBJ_CD,SBJ_NM,imonth,iday,SPTDOC,DBTO_AMT)
  268. select a.ccode,a.ccode_name,(select imonth from #test8 where rownumber=@k),(select iday from #test8 where rownumber=@k),(select SPTDOC from #test8 where rownumber=@k),0
  269. from code a left join #test6 b on b.SPTDOC=(select SPTDOC from #test8 where rownumber=@k) and imonth=(select imonth from #test8 where rownumber=@k) and iday=(select iday from #test8 where rownumber=@k) and SBJ_NM=ccode_name
  270. where a.iYear=2024 and ( bclose=0 and ( ccode like N'6711%' or ccode_name like N'6711%' or ccode_engl like N'6711%' or chelp like N'6711%' )) and ccode <>'6711' and len(ccode)=6
  271. and b.SPTDOC is null
  272. set @i=@i +1
  273. end
  274. set @k=@k +1
  275. end
  276. --SELECT
  277. --SPTDOC,imonth,iday,
  278. -- sum(DBTO_AMT)
  279. -- -- into #test9
  280. -- FROM
  281. -- #test6
  282. -- GROUP BY
  283. -- SPTDOC,imonth,iday
  284. --GROUP BY
  285. -- SPTDOC,imonth,iday
  286. SELECT
  287. SPTDOC,imonth,iday,sum(DBTO_AMT) as sumss
  288. into #test9
  289. FROM
  290. #test6
  291. GROUP BY
  292. SPTDOC,imonth,iday
  293. select YYYY,MM,SUM(ISNULL(sumss,0)) NOSLS_INCM
  294. from #test5 a left join #test9 b on a.SPTDOC=b.SPTDOC and a.MM=b.imonth and a.DD=b.iday
  295. group by YYYY,MM
  296. order by MM
  297. rollback transaction";
  298. sqlyywzc_gz = string.Format(sqlyywzc_gz, beginPeriod, endPeriod);
  299. log.Info("YERP_007_gz 营业外支出 sqlyywzc_gz:" + sqlyywzc_gz);
  300. DataTable vbsyywzcdt_gz = ICSHelper.ExecuteTable(conStr, sqlyywzc_gz);
  301. log.Info("YERP_007_gz 营业外支出sql结果数量" + vbsyywzcdt_gz.Rows.Count);
  302. if (vbsgzdt.Rows.Count > 0)
  303. {
  304. StringBuilder soapRequestData = new StringBuilder();
  305. soapRequestData.Append("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:yerp=\"http://skch.com/YERP_007_TAX_FOR_FIN_EXPENSE\">");
  306. soapRequestData.Append("<soapenv:Header/>");
  307. soapRequestData.Append("<soapenv:Body>");
  308. soapRequestData.Append("<yerp:YERP_007_OA1_MT>");
  309. //循环数据 DBTO_CRDTO_DVSN
  310. foreach (DataRow itemRow in vbsgzdt.Rows)
  311. {
  312. soapRequestData.Append("<!--Zero or more repetitions: -->");
  313. soapRequestData.Append("<FIN_CST_SPTDOC>");
  314. soapRequestData.Append(itemRow["YYYY"] != null ? "<YYYY>" + itemRow["YYYY"].ToString() + "</YYYY>" : "<YYYY>" + "</YYYY>");
  315. soapRequestData.Append(itemRow["MM"] != null ? "<MM>" + itemRow["MM"].ToString() + "</MM>" : "<MM>" + "</MM>");
  316. soapRequestData.Append(itemRow["DD"] != null ? "<DD>" + itemRow["DD"].ToString() + "</DD>" : "<DD>" + "</DD>");
  317. soapRequestData.Append(itemRow["SPTDOC"] != null ? "<SPTDOC>" + itemRow["SPTDOC"].ToString() + "</SPTDOC>" : "<SPTDOC>" + "</SPTDOC>");
  318. soapRequestData.Append(itemRow["SMR"] != null ? "<SMR>" + itemRow["SMR"].ToString() + "</SMR>" : "<SMR>" + "</SMR>");
  319. soapRequestData.Append(itemRow["DBTO"] != null ? "<DBTO>" + itemRow["DBTO"].ToString() + "</DBTO>" : "<DBTO>" + "</DBTO>");
  320. soapRequestData.Append(itemRow["CRDTO"] != null ? "<CRDTO>" + itemRow["CRDTO"].ToString() + "</CRDTO>" : "<CRDTO>" + "</CRDTO>");
  321. soapRequestData.Append(itemRow["DBTO_CRDTO_DVSN"] != null ? "<DBTO_CRDTO_DVSN>" + itemRow["DBTO_CRDTO_DVSN"].ToString() + "</DBTO_CRDTO_DVSN>" : "<DBTO_CRDTO_DVSN>" + "</DBTO_CRDTO_DVSN>");
  322. soapRequestData.Append(itemRow["BLNC"] != null ? "<BLNC>" + itemRow["BLNC"].ToString() + "</BLNC>" : "<BLNC>" + "</BLNC>");
  323. soapRequestData.Append(itemRow["DBTO_CMSN"] != null ? "<DBTO_CMSN>" + itemRow["DBTO_CMSN"].ToString() + "</DBTO_CMSN>" : "<DBTO_CMSN>" + "</DBTO_CMSN>");
  324. soapRequestData.Append(itemRow["DBTO_IENS"] != null ? "<DBTO_IENS>" + itemRow["DBTO_IENS"].ToString() + "</DBTO_IENS>" : "<DBTO_IENS>" + "</DBTO_IENS>");
  325. soapRequestData.Append(itemRow["DBTO_XCH_PC"] != null ? "<DBTO_XCH_PC>" + itemRow["DBTO_XCH_PC"].ToString() + "</DBTO_XCH_PC>" : "<DBTO_XCH_PC>" + "</DBTO_XCH_PC>");
  326. soapRequestData.Append("</FIN_CST_SPTDOC>");
  327. }
  328. soapRequestData.Append("</yerp:YERP_007_OA1_MT>");
  329. soapRequestData.Append("</soapenv:Body>");
  330. soapRequestData.Append("</soapenv:Envelope>");
  331. string postData = soapRequestData.ToString();
  332. log.Info("YERP_007 xmlRequest:" + postData);
  333. string statusCode;
  334. string resultContent;
  335. ServicePointManager.SecurityProtocol = (SecurityProtocolType)192 | (SecurityProtocolType)768 | (SecurityProtocolType)3072;
  336. RestOpHelper rop = new RestOpHelper();
  337. rop.Clientp12path = @"C:\Users\Administrator\Desktop\yonyou-cert\wildcard.pfx";
  338. rop.Clientp12PassWord = "Yonyou2024!";
  339. rop.Url = @"https://yerp-proxy-sap-prod.skchemicals.com/XISOAPAdapter/MessageServlet?senderParty=&senderService=YERP_P&receiverParty=&receiverService=&interface=YERP_007_OA1_SI&interfaceNamespace=http://skch.com/YERP_007_TAX_FOR_FIN_EXPENSE";
  340. rop.RequestSAP(rop.Url, 10000, postData, "IF_YERP", "Kfiw282082", out statusCode, out resultContent);
  341. log.Info("YERP_007 statusCode:" + statusCode + "\r\n" + "resultContent:" + resultContent);
  342. }
  343. }
  344. catch (Exception ex)
  345. {
  346. log.Error(ex.ToString());
  347. }
  348. }
  349. public static Configuration GetConfig()
  350. {
  351. Assembly assembly = Assembly.GetCallingAssembly();
  352. string path = string.Format("{0}.config", assembly.Location);
  353. if (!File.Exists(path))
  354. {
  355. throw new FileNotFoundException(path + "路径下的文件未找到!");
  356. }
  357. try
  358. {
  359. ExeConfigurationFileMap configFile = new ExeConfigurationFileMap();
  360. configFile.ExeConfigFilename = path;
  361. Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configFile, ConfigurationUserLevel.None);
  362. return config;
  363. }
  364. catch (Exception)
  365. {
  366. throw;
  367. }
  368. }
  369. }
  370. }