ImportReportJob.cs 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989
  1. using DynamicExpresso;
  2. using Microsoft.Data.SqlClient;
  3. using Microsoft.Extensions.DependencyInjection;
  4. using Quartz;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Configuration;
  8. using System.Data;
  9. using System.IO;
  10. using System.Linq;
  11. using System.Net.Http;
  12. using System.Threading.Tasks;
  13. using System.Xml.Serialization;
  14. using wispro.sp.entity;
  15. using wispro.sp.utility;
  16. using static System.Net.WebRequestMethods;
  17. namespace wispro.sp.api.Job
  18. {
  19. public class ImportReportJob : Quartz.IJob
  20. {
  21. /// <summary>
  22. /// 不需要计算绩效的处理事项
  23. /// </summary>
  24. private string[] InValidDoItem = new string[]
  25. {
  26. "案件异常-催缴年费",
  27. "案件异常-视为放弃取得专利权",
  28. "办理登记手续",
  29. "办理登记手续-确认客户是否委托",
  30. "代理所变更",
  31. "绘图",
  32. "技术确认",
  33. "缴年费",
  34. "请求保密审查",
  35. "请求费减",
  36. "请求实审",
  37. "取得申请号",
  38. "取得证书",
  39. "取得专利权评价报告",
  40. "确认官方审查状况",
  41. "询问放弃或复审",
  42. "知识点总结",
  43. "专利权人发明人申请人信息变更",
  44. "专利挖掘与布局",
  45. "我方文号前缀带J",
  46. "开卷",
  47. "请求提前公开",
  48. "取得国际检索报告",
  49. "委外检索",
  50. "中止程序",
  51. "终止",
  52. "案件异常-视为撤回",
  53. "进入国家阶段提醒",
  54. "请求恢复权利",
  55. "请求优先权",
  56. "取得【无效宣告请求审查决定】",
  57. "撤回",
  58. "请求退款",
  59. "确认是否委托申请与类型",
  60. "专利交易",
  61. "专利权评价报告",
  62. "专利权人发明人申请人信息变更+代理所变更",
  63. "补缴费用"
  64. };
  65. spDbContext spDb = new spDbContext();
  66. public Task Execute(IJobExecutionContext context)
  67. {
  68. CalMonth calMonth = new CalMonth()
  69. {
  70. Year = DateTime.Now.AddMonths(-1).Year,
  71. Month = DateTime.Now.AddMonths(-1).Month,
  72. Status = 0
  73. };
  74. var temCalMonth = spDb.CalMonths.Where<CalMonth>(x => x.Year == calMonth.Year && x.Month == calMonth.Month).FirstOrDefault();
  75. if (temCalMonth != null)
  76. {
  77. var iCount = spDb.PerformanceItems.Where<PerformanceItem>(p => p.CalMonthId == temCalMonth.Id).Count<PerformanceItem>();
  78. if (iCount > 0)
  79. {
  80. return Task.CompletedTask;
  81. }
  82. calMonth = temCalMonth;
  83. }
  84. else
  85. {
  86. spDb.CalMonths.Add(calMonth);
  87. spDb.SaveChanges();
  88. }
  89. //每月绩效统计--发客户超过一个月未完成案件
  90. DownloadReport_SQL("每月绩效统计--发客户超过一个月未完成案件", calMonth, false);
  91. //DownloadReport( "每月绩效统计--发客户超过一个月未完成案件", calMonth,false);
  92. //每月绩效统计--上个月递交完成案件
  93. DownloadReport_SQL("每月绩效统计--上个月递交完成案件", calMonth, true);
  94. //DownloadReport("每月绩效统计--上个月递交完成案件", calMonth, true);
  95. //每月绩效统计--中国一次OA授权表
  96. DownloadReport_SQL("每月绩效统计--中国一次OA授权表", calMonth, true, true);
  97. //DownloadReport("每月绩效统计--中国一次OA授权表", calMonth, true,true);
  98. return Task.CompletedTask;
  99. }
  100. private void DownloadReport_SQL(string ReportName, CalMonth calMonth, bool isModifyDate, bool isFirstOA = false)
  101. {
  102. try
  103. {
  104. DataTable data = GetDataFromIPEasy(ReportName,isModifyDate);
  105. InputPerformanctItem(calMonth, isFirstOA, data);
  106. }
  107. catch
  108. {
  109. }
  110. }
  111. private Task InputPerformanceItem(string strExcelFile, bool isColumnName, bool ignorHideRows = false, int ColumnNameRow = 0, CalMonth calMonth = null, bool isFirstOAFile = false)
  112. {
  113. DataTable dt = NPOIExcel.ExcelToDataTable(strExcelFile, isColumnName, ignorHideRows, ColumnNameRow);
  114. return InputPerformanctItem(calMonth, isFirstOAFile, dt);
  115. }
  116. private Task InputPerformanctItem(CalMonth calMonth, bool isFirstOAFile, DataTable dt)
  117. {
  118. #region 删除重复行
  119. DataTable temdt = new DataTable();
  120. foreach (DataColumn col in dt.Columns)
  121. {
  122. DataColumn temCol = new DataColumn();
  123. temCol.ColumnName = col.ColumnName;
  124. temCol.DataType = col.DataType;
  125. temCol.Caption = col.Caption;
  126. temdt.Columns.Add(temCol);
  127. }
  128. new ExcelHelper().MerageDataTable(temdt, dt);
  129. #endregion
  130. List<BasePointRule> rules = spDb.BasePointRules.ToList<BasePointRule>();
  131. int iRow = 0;
  132. foreach (DataRow row in temdt.Rows)
  133. {
  134. string strDebug = $"{++iRow}\t{row["我方文号"]}";
  135. PerformanceItem item = null;
  136. if (isFirstOAFile)
  137. {
  138. item = Row2Item_1(row, calMonth);
  139. }
  140. else
  141. {
  142. item = Row2Item(row, calMonth);
  143. }
  144. if (item != null)
  145. {
  146. if (!InValidDoItem.Contains(item.DoItem) && !isDBNotFinishedDate(item))
  147. {
  148. //foreach(var temObj in item.ItemStaffs)
  149. //{
  150. // temObj.DoPerson.Name = temObj.DoPerson.Name.Replace("-君龙", "");
  151. //}
  152. SavePerformanceItem(item, rules);
  153. strDebug = $"{strDebug}\t保存成功";
  154. }
  155. else
  156. {
  157. strDebug = $"{strDebug}\t无效处理事项";
  158. }
  159. }
  160. else
  161. {
  162. strDebug = $"{strDebug}\t转换Item为Null";
  163. }
  164. System.Diagnostics.Debug.WriteLine(strDebug);
  165. }
  166. return Task.CompletedTask;
  167. }
  168. private bool isDBNotFinishedDate(PerformanceItem item)
  169. {
  170. return (item.DoItem == "处理审查意见" && item.FinishedDate == null);
  171. }
  172. private Task SavePerformanceItem(PerformanceItem item,List<BasePointRule> rules)
  173. {
  174. try
  175. {
  176. Utility.Utility.CalBasePoint(item, rules);
  177. var ret= new Controllers.PerformanceItemController(spDb,new Services.FileTaskCacheService()).New(item);
  178. if (ret.Success == false)
  179. {
  180. System.Diagnostics.Debug.WriteLine(ret.ErrorMessage);
  181. }
  182. }
  183. catch (Exception ex)
  184. {
  185. System.Diagnostics.Debug.WriteLine(ex.Message);
  186. }
  187. return Task.CompletedTask;
  188. }
  189. private PerformanceItem Row2Item_1(DataRow row, CalMonth calMonth)
  190. {
  191. PerformanceItem item = new PerformanceItem();
  192. item.ApplicationType = row["申请类型"].ToString().Trim();
  193. if (item.ApplicationType != "发明")
  194. {
  195. return null;
  196. }
  197. item.CaseNo = row["我方文号"].ToString().Trim();
  198. if (item.CaseNo.StartsWith("S"))
  199. {
  200. return null;
  201. }
  202. if (calMonth != null)
  203. {
  204. item.CalMonth = calMonth;
  205. }
  206. else
  207. {
  208. if (row.Table.Columns.Contains("绩效核算月份"))
  209. {
  210. string strjxyf = row["绩效核算月份"].ToString().Trim();
  211. string[] temYFs = strjxyf.Split(new char[] { '.' });
  212. item.CalMonth = new CalMonth();
  213. item.CalMonth.Year = int.Parse(temYFs[0]);
  214. item.CalMonth.Month = int.Parse(temYFs[1]);
  215. item.CalMonth.Status = 4;
  216. }
  217. else
  218. {
  219. item.CalMonth = new CalMonth();
  220. item.Status = 0;
  221. item.CalMonth.Year = DateTime.Now.AddMonths(-1).Year;
  222. item.CalMonth.Month = DateTime.Now.AddMonths(-1).Month;
  223. }
  224. }
  225. item.ApplicationType = row["申请类型"].ToString().Trim();
  226. item.BusinessType = "普通新申请"; // row["业务类型"].ToString().Trim();
  227. item.AgentFeedbackMemo = "发明一次OA授权"; //row["备注(填表注意事项)"].ToString().Trim();
  228. item.DoItem = "发明一次OA授权"; //row["处理事项"].ToString().Trim();
  229. string strHandler = "";
  230. if (row.Table.Columns.Contains("处理人"))
  231. {
  232. strHandler = row["处理人"].ToString().Trim();
  233. }
  234. else
  235. {
  236. if (row.Table.Columns.Contains("案件处理人"))
  237. {
  238. strHandler = row["案件处理人"].ToString().Trim();
  239. }
  240. }
  241. string[] temHandlers = strHandler.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
  242. item.ItemStaffs = new List<ItemStaff>();
  243. foreach (string name in temHandlers)
  244. {
  245. ItemStaff itemStaff = new ItemStaff();
  246. string temName = name.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
  247. if (!name.Contains("君龙"))
  248. {
  249. temName = name.Trim();
  250. }
  251. int? iTem = GetStaff(temName);
  252. if ((iTem != null))
  253. {
  254. //itemStaff.Item = item;
  255. itemStaff.DoPersonId = iTem.Value;
  256. item.ItemStaffs.Add(itemStaff);
  257. }
  258. else
  259. {
  260. itemStaff.DoPerson = new Staff()
  261. {
  262. Name = temName,
  263. Account = temName,
  264. Password = utility.MD5Utility.GetMD5("12345678"),
  265. IsCalPerformsnce = false,
  266. Status = "试用期",
  267. StaffGradeId = 4
  268. };
  269. item.ItemStaffs.Add(itemStaff);
  270. }
  271. }
  272. if (item.ItemStaffs.Count == 0)
  273. {
  274. System.Diagnostics.Debug.WriteLine($"没有处理人: {item.CaseNo}\t{item.DoItem}");
  275. }
  276. if (row.Table.Columns.Contains("核稿人"))
  277. {
  278. item.ReviewerId = GetStaff(row["核稿人"].ToString().Trim());
  279. }
  280. else
  281. {
  282. if (row.Table.Columns.Contains("案件核稿人"))
  283. {
  284. item.ReviewerId = GetStaff(row["案件核稿人"].ToString().Trim());
  285. }
  286. }
  287. if (row.Table.Columns.Contains("业务人员"))
  288. {
  289. if (!string.IsNullOrEmpty(row["业务人员"].ToString().Trim()))
  290. {
  291. string name = row["业务人员"].ToString();
  292. string temName = row["业务人员"].ToString().Trim().Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
  293. if (!name.Contains("君龙"))
  294. {
  295. temName = name.Trim();
  296. }
  297. item.WorkflowUserId = GetStaff(temName);
  298. }
  299. }
  300. item.Customer = new Customer() { Name = row["客户名称"].ToString().Trim() };
  301. item.ApplicationName = row["申请人"].ToString().Trim();
  302. item.CaseName = row["案件名称"].ToString().Trim();
  303. if (row.Table.Columns.Contains("国家(地区)"))
  304. {
  305. item.Country = row["国家(地区)"].ToString().Trim();
  306. }
  307. //案件备注
  308. item.CaseMemo = $"发文日期:{row["发文日期"].ToString().Trim()}\r\n客户文号:{row["客户文号"].ToString().Trim()}\r\n上传日期:{row["上传日期"].ToString().Trim()}\r\n文件描述:{row["文件描述"].ToString().Trim()}";
  309. if (row.Table.Columns.Contains("翻译字数"))
  310. {
  311. //item.ReviewerId = GetStaff(row["案件核稿人"].ToString().Trim());
  312. var strWordCount = row["翻译字数"].ToString().Trim();
  313. if (string.IsNullOrEmpty(strWordCount))
  314. {
  315. try
  316. {
  317. item.WordCount = int.Parse(strWordCount);
  318. }
  319. catch { }
  320. }
  321. }
  322. return item;
  323. }
  324. private PerformanceItem Row2Item(DataRow row, CalMonth calMonth)
  325. {
  326. PerformanceItem item = new PerformanceItem();
  327. item.CaseNo = row["我方文号"].ToString().Trim();
  328. if (item.CaseNo.StartsWith("S"))
  329. {
  330. return null;
  331. }
  332. if (calMonth != null)
  333. {
  334. item.CalMonth = calMonth;
  335. }
  336. else
  337. {
  338. if (row.Table.Columns.Contains("绩效核算月份"))
  339. {
  340. string strjxyf = row["绩效核算月份"].ToString().Trim();
  341. string[] temYFs = strjxyf.Split(new char[] { '.' });
  342. item.CalMonth = new CalMonth();
  343. item.CalMonth.Year = int.Parse(temYFs[0]);
  344. item.CalMonth.Month = int.Parse(temYFs[1]);
  345. item.CalMonth.Status = 4;
  346. }
  347. else
  348. {
  349. item.CalMonth = new CalMonth();
  350. item.Status = 0;
  351. item.CalMonth.Year = DateTime.Now.AddMonths(-1).Year;
  352. item.CalMonth.Month = DateTime.Now.AddMonths(-1).Month;
  353. }
  354. }
  355. item.ApplicationType = row["申请类型"].ToString().Trim();
  356. item.BusinessType = row["业务类型"].ToString().Trim();
  357. if (row.Table.Columns.Contains("国家(地区)"))
  358. {
  359. item.Country = row["国家(地区)"].ToString().Trim();
  360. }
  361. if (row.Table.Columns.Contains("备注(填表注意事项)"))
  362. item.AgentFeedbackMemo = row["备注(填表注意事项)"].ToString().Trim();
  363. item.DoItem = row["处理事项"].ToString().Trim();
  364. item.CaseStage = row["案件阶段"].ToString().Trim();
  365. item.CaseCoefficient = row["案件系数"].ToString().Trim();
  366. item.DoItemCoefficient = row["处理事项系数"].ToString().Trim();
  367. item.PreOastaffId = GetStaff(row["前一次OA处理人"].ToString().Trim());
  368. string strHandler = "";
  369. if (row.Table.Columns.Contains("处理人"))
  370. {
  371. strHandler = row["处理人"].ToString().Trim();
  372. }
  373. else
  374. {
  375. if (row.Table.Columns.Contains("案件处理人"))
  376. {
  377. strHandler = row["案件处理人"].ToString().Trim();
  378. }
  379. }
  380. string[] temHandlers = strHandler.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
  381. item.ItemStaffs = new List<ItemStaff>();
  382. foreach (string name in temHandlers)
  383. {
  384. ItemStaff itemStaff = new ItemStaff();
  385. string temName = name.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
  386. if (!name.Contains("君龙"))
  387. {
  388. temName = name.Trim();
  389. }
  390. int? iTem = GetStaff(temName);
  391. if ((iTem != null))
  392. {
  393. //itemStaff.Item = item;
  394. itemStaff.DoPersonId = iTem.Value;
  395. item.ItemStaffs.Add(itemStaff);
  396. }
  397. else
  398. {
  399. itemStaff.DoPerson = new Staff()
  400. {
  401. Name = temName,
  402. Account = temName,
  403. Password = utility.MD5Utility.GetMD5("12345678"),
  404. IsCalPerformsnce = false,
  405. Status = "试用期",
  406. StaffGradeId = 4
  407. };
  408. item.ItemStaffs.Add(itemStaff);
  409. }
  410. }
  411. if (item.ItemStaffs.Count == 0)
  412. {
  413. System.Diagnostics.Debug.WriteLine($"没有处理人: {item.CaseNo}\t{item.DoItem}");
  414. }
  415. if (row.Table.Columns.Contains("核稿人"))
  416. {
  417. if (!string.IsNullOrEmpty(row["核稿人"].ToString().Trim()))
  418. {
  419. string name = row["核稿人"].ToString();
  420. string temName = name.Trim().Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
  421. if (!name.Contains("君龙"))
  422. {
  423. temName = name.Trim();
  424. }
  425. item.ReviewerId = GetStaff(temName);
  426. }
  427. }
  428. else
  429. {
  430. if (row.Table.Columns.Contains("案件核稿人"))
  431. {
  432. if (!string.IsNullOrEmpty(row["案件核稿人"].ToString().Trim()))
  433. {
  434. string name = row["案件核稿人"].ToString();
  435. string temName = row["案件核稿人"].ToString().Trim().Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
  436. if (!name.Contains("君龙"))
  437. {
  438. temName = name.Trim();
  439. }
  440. item.ReviewerId = GetStaff(temName);
  441. }
  442. }
  443. }
  444. if (row.Table.Columns.Contains("业务人员"))
  445. {
  446. if (!string.IsNullOrEmpty(row["业务人员"].ToString().Trim()))
  447. {
  448. string name = row["业务人员"].ToString();
  449. string temName = row["业务人员"].ToString().Trim().Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
  450. if (!name.Contains("君龙"))
  451. {
  452. temName = name.Trim();
  453. }
  454. item.WorkflowUserId = GetStaff(temName);
  455. }
  456. }
  457. item.Customer = new Customer() { Name = row["客户名称"].ToString().Trim() };
  458. item.ApplicationName = row["申请人"].ToString().Trim();
  459. DateTime temDate = new DateTime();
  460. if (DateTime.TryParse(row["处理事项完成日"].ToString().Trim(), out temDate))
  461. {
  462. item.FinishedDate = temDate;
  463. }
  464. //定稿日
  465. if (DateTime.TryParse(row["定稿日"].ToString().Trim(), out temDate))
  466. {
  467. item.FinalizationDate = temDate;
  468. }
  469. //返稿日
  470. if (DateTime.TryParse(row["返稿日"].ToString().Trim(), out temDate))
  471. {
  472. item.ReturnDate = temDate;
  473. }
  474. //案件类型
  475. item.CaseType = row["案件类型"].ToString().Trim();
  476. //案件状态
  477. item.CaseState = row["案件状态"].ToString().Trim();
  478. //处理事项备注
  479. item.DoItemMemo = row["处理事项备注"].ToString().Trim();
  480. //处理状态
  481. item.DoItemState = row["处理状态"].ToString().Trim();
  482. //案件名称
  483. item.CaseName = row["案件名称"].ToString().Trim();
  484. //委案日期
  485. if (DateTime.TryParse(row["委案日期"].ToString().Trim(), out temDate))
  486. {
  487. item.EntrustingDate = temDate;
  488. }
  489. //客户期限
  490. if (DateTime.TryParse(row["客户期限"].ToString().Trim(), out temDate))
  491. {
  492. item.CustomerLimitDate = temDate;
  493. }
  494. //内部期限
  495. if (DateTime.TryParse(row["内部期限"].ToString().Trim(), out temDate))
  496. {
  497. item.InternalDate = temDate;
  498. }
  499. //初稿日
  500. if (DateTime.TryParse(row["初稿日"].ToString().Trim(), out temDate))
  501. {
  502. item.FirstDraftDate = temDate;
  503. }
  504. //备注(发文严重超期是否属客观原因,若为否,请填写原因)
  505. if (row.Table.Columns.Contains("备注(发文严重超期是否属客观原因,若为否,请填写原因)"))
  506. {
  507. item.OverDueMemo = row["备注(发文严重超期是否属客观原因,若为否,请填写原因)"].ToString().Trim();
  508. }
  509. //案件备注
  510. item.CaseMemo = row["案件备注"].ToString().Trim();
  511. if (row.Table.Columns.Contains("翻译字数"))
  512. {
  513. //item.ReviewerId = GetStaff(row["案件核稿人"].ToString().Trim());
  514. var strWordCount = row["翻译字数"].ToString().Trim();
  515. if (string.IsNullOrEmpty(strWordCount))
  516. {
  517. try
  518. {
  519. item.WordCount = int.Parse(strWordCount);
  520. }
  521. catch { }
  522. }
  523. }
  524. return item;
  525. }
  526. private int? GetStaff(string v)
  527. {
  528. if (!string.IsNullOrEmpty(v))
  529. {
  530. string temName = v.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
  531. if (!v.Contains("君龙"))
  532. {
  533. temName = v;
  534. }
  535. var staff = spDb.Staffs.Where<Staff>(s => s.Name == temName).FirstOrDefault();
  536. if (staff != null)
  537. {
  538. return staff.Id;
  539. }
  540. }
  541. return null;
  542. }
  543. private DataTable GetDataFromIPEasy(string ReportName, bool isModifyDate)
  544. {
  545. HttpClient http = new HttpClient();
  546. var bytRespon = http.GetAsync($"{ConfigHelper.GetSectionValue("IPEasySetting:ipEeasyApi")}/api/ipEasy/GetDataFromIPEasy?ReportName={ReportName}&isModifyDate={isModifyDate}").Result;
  547. if (bytRespon.IsSuccessStatusCode)
  548. {
  549. string result = bytRespon.Content.ReadAsStringAsync().Result.Replace("\"", string.Empty);
  550. byte[] data = Convert.FromBase64String(result);
  551. //byte[] data = bytRespon.Content.ReadAsByteArrayAsync().Result;//Here is the problem
  552. XmlSerializer serializer = new XmlSerializer(typeof(System.Data.DataTable));
  553. MemoryStream memory = new MemoryStream(data);
  554. DataTable dt = (DataTable)serializer.Deserialize(memory);
  555. return dt;
  556. }
  557. else
  558. {
  559. return null;
  560. }
  561. #region old code 从维德数据库中直接读取
  562. // DataTable dt = new DataTable();
  563. // string strSQL = "";
  564. // switch (ReportName)
  565. // {
  566. // case "每月绩效统计--发客户超过一个月未完成案件":
  567. // strSQL = @"SELECT p_case_info.case_volume as 我方文号,
  568. // i_apply_type.apply_type_zh_cn as 申请类型,
  569. // i_business_type.business_type_zh_cn as 业务类型,
  570. // i_ctrl_proc.ctrl_proc_zh_cn as 处理事项,
  571. // (select case_status_zh_cn from i_case_status where case_status_id=p_proc_info.review_stage) as 案件阶段,
  572. // i_case_coefficient.case_coefficient_zh_cn as 案件系数,
  573. // i_proc_coefficient.proc_coefficient_zh_cn as 处理事项系数,
  574. // (select proc_coefficient_zh_cn from p_proc_info pr
  575. // left join i_proc_coefficient pc on pc.proc_coefficient_id=pr.proc_coefficient_id
  576. // where case_id=p_case_info.case_id and ctrl_proc_id='8b96378e-05a0-4a8d-b3d1-39af92fddaf5'
  577. // and pr.seq=
  578. // (select max(seq) from p_proc_info pr where case_id=p_case_info.case_id
  579. // and ctrl_proc_id='8b96378e-05a0-4a8d-b3d1-39af92fddaf5'and seq<p_proc_info.seq)
  580. // ) as 前一次OA处理事项系数,
  581. // (STUFF((SELECT ',' + u.cn_name from p_proc_pic_list as pl
  582. // inner join s_user_info as u on u.user_id = pl.pic_id
  583. // inner join p_proc_info pr1 on pr1.proc_id=pl.obj_id
  584. // where case_id=p_case_info.case_id and
  585. // ctrl_proc_id='8b96378e-05a0-4a8d-b3d1-39af92fddaf5'
  586. // and pr1.seq=(
  587. // select max(seq) from p_proc_info pr2 where case_id=p_case_info.case_id
  588. // and ctrl_proc_id='8b96378e-05a0-4a8d-b3d1-39af92fddaf5'
  589. // and seq<p_proc_info.seq) FOR XML PATH('') ),1,1,'')) as 前一次OA处理人,
  590. // STUFF((SELECT ',' + ur.rank_zh_cn from p_proc_pic_list as pl
  591. // inner join s_user_info as u on u.user_id = pl.pic_id
  592. // left join i_user_rank ur on ur.rank_id=u.rank_id
  593. // where pl.obj_id = p_proc_info.proc_id FOR XML PATH('') ),1,1,'') as 处理人等级,
  594. // STUFF((SELECT ',' + u.cn_name from p_proc_pic_list as pl
  595. // inner join s_user_info as u on u.user_id = pl.pic_id
  596. // where pl.obj_id = p_proc_info.proc_id FOR XML PATH('') ),1,1,'') as 处理人,
  597. // STUFF((SELECT ',' + u.cn_name from p_revise_user_list as pl
  598. // inner join s_user_info as u on u.user_id = pl.revise_user_id
  599. // where pl.obj_id = p_proc_info.proc_id FOR XML PATH('') ),1,1,'') as 核稿人,
  600. // c_customer.customer_name as 客户名称,
  601. // STUFF((SELECT ',' + a.applicant_name_cn from p_applicant_list as al
  602. // inner join i_applicant as a on a.applicant_id = al.applicant_id
  603. // where al.obj_id = p_case_info.case_id order by al.seq FOR XML PATH('') ),1,1,'') as 申请人,
  604. // p_proc_info.finish_date as 处理事项完成日,
  605. // p_proc_info.finish_doc_date as 定稿日,
  606. // p_proc_info.back_date as 返稿日,
  607. // i_case_type.case_type_zh_cn as 案件类型,
  608. // i_case_status.case_status_zh_cn as 案件状态,
  609. // p_proc_info.proc_note as 处理事项备注,
  610. // (select proc_status_zh_cn from i_proc_status where proc_status_id=p_proc_info.proc_status_id) as 处理状态,
  611. // p_case_info.case_name as 案件名称,
  612. // p_case_info.charge_date as 委案日期,
  613. // p_proc_info.cus_due_date as 客户期限,
  614. // p_proc_info.int_due_date as 内部期限,
  615. // p_proc_info.first_doc_date as 初稿日,
  616. // p_case_info.remark as 案件备注,
  617. // p_proc_info.translate_count as 翻译字数,
  618. // STUFF((SELECT ',' + ui.cn_name from p_sales_list as sl
  619. // inner join dbo.s_user_info as ui on ui.user_id = sl.sales_user_id
  620. // where sl.obj_id = p_case_info.case_id AND sl.is_enabled=1 order by sl.seq FOR XML PATH('') ),1,1,'') as 业务人员,
  621. // i_country.country_zh_cn as '国家(地区)'
  622. // from p_case_info
  623. // inner join p_case_advance_info with(nolock) on p_case_info.case_id=p_case_advance_info.case_id
  624. // inner join i_apply_type with(nolock) on i_apply_type.apply_type_id=p_case_info.apply_type_id
  625. // inner join i_case_type with(nolock) on i_case_type.case_type_id=p_case_info.case_type_id
  626. // inner join i_country with(nolock) on i_country.country_id=p_case_info.country_id
  627. // inner join i_case_status with(nolock) on i_case_status.case_status_id=p_case_info.case_status_id
  628. // inner join c_customer with(nolock) on c_customer.customer_id=p_case_info.customer_id
  629. // left join i_case_coefficient on i_case_coefficient.case_coefficient_id=p_case_info.case_coefficient_id
  630. // inner join p_proc_info with(nolock) on p_case_info.case_id=p_proc_info.case_id
  631. // inner join i_ctrl_proc with(nolock) on p_proc_info.ctrl_proc_id=i_ctrl_proc.ctrl_proc_id
  632. // inner join i_business_type on i_business_type.business_type_id = p_case_info.business_type_id
  633. // inner join s_dept_info on s_dept_info.dept_id = p_case_info.charge_dept_id
  634. // left join p_proc_pic_list with(nolock) on p_proc_pic_list.obj_id=p_proc_info.proc_id
  635. // left join s_user_info with(nolock) on s_user_info.user_id=p_proc_pic_list.pic_id
  636. // left join i_proc_coefficient on i_proc_coefficient.proc_coefficient_id=p_proc_info.proc_coefficient_id
  637. // where
  638. // p_case_info.is_enabled=1 and p_proc_info.is_enabled=1 and
  639. // s_user_info.dept_id not in ('60e09ee0-fcc7-446f-badc-af9973079fee','34d0e351-71dc-418f-9b6b-bcb67af62fed','599cbe0c-044e-4ffc-9411-96dd9019d8a6') and
  640. // p_proc_info.finish_date is null
  641. // and p_proc_info.back_date<DATEADD(MM,-1,DATEADD(MM, DATEDIFF(MM,0,getdate()), 0)) and
  642. // (p_case_info.case_type_id='31D1A147-2931-43B5-94AE-B72B1525BA8A' ) AND
  643. // ( i_ctrl_proc.ctrl_proc_zh_cn='新申请'
  644. // or i_ctrl_proc.ctrl_proc_zh_cn='Non'
  645. // or i_ctrl_proc.ctrl_proc_zh_cn='无效宣告'
  646. // or i_ctrl_proc.ctrl_proc_zh_cn='意见陈述'
  647. // or i_ctrl_proc.ctrl_proc_zh_cn='专利挖掘与布局'
  648. // or i_ctrl_proc.ctrl_proc_zh_cn='处理审查意见'
  649. // or i_ctrl_proc.ctrl_proc_zh_cn='Final'
  650. // or i_ctrl_proc.ctrl_proc_zh_cn='复审通知意见陈述'
  651. // or i_ctrl_proc.ctrl_proc_zh_cn='申復'
  652. // or i_ctrl_proc.ctrl_proc_zh_cn='RCE'
  653. // or i_ctrl_proc.ctrl_proc_zh_cn='翻译'
  654. // or i_ctrl_proc.ctrl_proc_zh_cn='提出异议复审'
  655. // or i_ctrl_proc.ctrl_proc_zh_cn='Advisory'
  656. // or i_ctrl_proc.ctrl_proc_zh_cn='复审'
  657. // or i_ctrl_proc.ctrl_proc_zh_cn='请求复审'
  658. // or i_ctrl_proc.ctrl_proc_zh_cn='提出报告'
  659. // or i_ctrl_proc.ctrl_proc_zh_cn='提出公众意见'
  660. // or i_ctrl_proc.ctrl_proc_zh_cn='诉讼'
  661. // or i_ctrl_proc.ctrl_proc_zh_cn='提出异议'
  662. // or i_ctrl_proc.ctrl_proc_zh_cn='补充理由和证据'
  663. // or i_ctrl_proc.ctrl_proc_zh_cn='无效分析'
  664. // or i_ctrl_proc.ctrl_proc_zh_cn='无效答辩'
  665. // )";
  666. // break;
  667. // case "每月绩效统计--上个月递交完成案件":
  668. // strSQL = @"SELECT
  669. // p_case_info.case_volume as 我方文号,
  670. // i_apply_type.apply_type_zh_cn as 申请类型,
  671. // i_business_type.business_type_zh_cn as 业务类型,
  672. // i_ctrl_proc.ctrl_proc_zh_cn as 处理事项,
  673. // (select case_status_zh_cn from i_case_status where case_status_id=p_proc_info.review_stage) as 案件阶段,
  674. // i_case_coefficient.case_coefficient_zh_cn as 案件系数,
  675. // i_proc_coefficient.proc_coefficient_zh_cn as 处理事项系数,
  676. // (select
  677. // proc_coefficient_zh_cn from p_proc_info pr
  678. // left join i_proc_coefficient pc on pc.proc_coefficient_id=pr.proc_coefficient_id
  679. // where case_id=p_case_info.case_id
  680. // and ctrl_proc_id='8b96378e-05a0-4a8d-b3d1-39af92fddaf5'
  681. // and pr.seq=(select max(seq) from p_proc_info pr where case_id=p_case_info.case_id
  682. // and ctrl_proc_id='8b96378e-05a0-4a8d-b3d1-39af92fddaf5'and seq<p_proc_info.seq)
  683. // ) as 前一次OA处理事项系数,
  684. // (STUFF((SELECT ',' + u.cn_name from p_proc_pic_list as pl
  685. // inner join s_user_info as u on u.user_id = pl.pic_id
  686. // inner join p_proc_info pr1 on pr1.proc_id=pl.obj_id
  687. // where case_id=p_case_info.case_id
  688. // and ctrl_proc_id='8b96378e-05a0-4a8d-b3d1-39af92fddaf5'
  689. // and pr1.seq=(select max(seq) from p_proc_info pr2 where case_id=p_case_info.case_id
  690. // and ctrl_proc_id='8b96378e-05a0-4a8d-b3d1-39af92fddaf5'and seq<p_proc_info.seq) FOR XML PATH('') ),1,1,'')
  691. // ) as 前一次OA处理人,
  692. // STUFF((SELECT ',' + ur.rank_zh_cn from p_proc_pic_list as pl
  693. // inner join s_user_info as u on u.user_id = pl.pic_id
  694. // left join i_user_rank ur on ur.rank_id=u.rank_id where pl.obj_id = p_proc_info.proc_id FOR XML PATH('') ),1,1,'') as 处理人等级,
  695. // STUFF((SELECT ',' + u.cn_name from p_proc_pic_list as pl
  696. // inner join s_user_info as u on u.user_id = pl.pic_id
  697. // where pl.obj_id = p_proc_info.proc_id FOR XML PATH('') ),1,1,'') as 处理人,
  698. // STUFF((SELECT ',' + u.cn_name from p_revise_user_list as pl
  699. // inner join s_user_info as u on u.user_id = pl.revise_user_id
  700. // where pl.obj_id = p_case_info.case_id FOR XML PATH('') ),1,1,'') as 案件核稿人,
  701. // c_customer.customer_name as 客户名称,
  702. // STUFF((SELECT ',' + a.applicant_name_cn from p_applicant_list as al
  703. // inner join i_applicant as a on a.applicant_id = al.applicant_id
  704. // where al.obj_id = p_case_info.case_id order by al.seq FOR XML PATH('') ),1,1,'') as 申请人,
  705. // p_proc_info.finish_date as 处理事项完成日,
  706. // p_proc_info.finish_doc_date as 定稿日,
  707. // p_proc_info.back_date as 返稿日,
  708. // i_case_type.case_type_zh_cn as 案件类型,
  709. // i_case_status.case_status_zh_cn as 案件状态,
  710. // p_proc_info.proc_note as 处理事项备注,
  711. // (select proc_status_zh_cn from i_proc_status where proc_status_id=p_proc_info.proc_status_id) as 处理状态,
  712. // p_case_info.case_name as 案件名称,
  713. // p_case_info.charge_date as 委案日期,
  714. // p_proc_info.cus_due_date as 客户期限,
  715. // p_proc_info.int_due_date as 内部期限,
  716. // p_proc_info.first_doc_date as 初稿日,
  717. // p_case_info.remark as 案件备注,
  718. // p_proc_info.translate_count as 翻译字数,
  719. // STUFF((SELECT ',' + ui.cn_name from p_sales_list as sl
  720. // inner join dbo.s_user_info as ui on ui.user_id = sl.sales_user_id
  721. // where sl.obj_id = p_case_info.case_id AND sl.is_enabled=1 order by sl.seq FOR XML PATH('') ),1,1,'') as 业务人员,
  722. // i_country.country_zh_cn as '国家(地区)'
  723. // from p_case_info
  724. // inner join p_case_advance_info with(nolock) on p_case_info.case_id=p_case_advance_info.case_id
  725. // inner join i_apply_type with(nolock) on i_apply_type.apply_type_id=p_case_info.apply_type_id
  726. // inner join i_case_type with(nolock) on i_case_type.case_type_id=p_case_info.case_type_id
  727. // inner join i_country with(nolock) on i_country.country_id=p_case_info.country_id
  728. // inner join i_case_status with(nolock) on i_case_status.case_status_id=p_case_info.case_status_id
  729. // inner join c_customer with(nolock) on c_customer.customer_id=p_case_info.customer_id
  730. // left join i_case_coefficient on i_case_coefficient.case_coefficient_id=p_case_info.case_coefficient_id
  731. // inner join p_proc_info with(nolock) on p_case_info.case_id=p_proc_info.case_id
  732. // inner join i_ctrl_proc with(nolock) on p_proc_info.ctrl_proc_id=i_ctrl_proc.ctrl_proc_id
  733. // inner join i_business_type on i_business_type.business_type_id = p_case_info.business_type_id
  734. // inner join s_dept_info on s_dept_info.dept_id = p_case_info.charge_dept_id
  735. // left join p_proc_pic_list with(nolock) on p_proc_pic_list.obj_id=p_proc_info.proc_id
  736. // left join s_user_info with(nolock) on s_user_info.user_id=p_proc_pic_list.pic_id
  737. // left join i_proc_coefficient on i_proc_coefficient.proc_coefficient_id=p_proc_info.proc_coefficient_id
  738. // where
  739. // p_case_info.is_enabled=1
  740. // and p_proc_info.is_enabled=1
  741. // and s_user_info.dept_id not in ('60e09ee0-fcc7-446f-badc-af9973079fee','34d0e351-71dc-418f-9b6b-bcb67af62fed','599cbe0c-044e-4ffc-9411-96dd9019d8a6')
  742. // and (p_case_info.case_type_id='31D1A147-2931-43B5-94AE-B72B1525BA8A' )
  743. // AND ((p_proc_info.finish_date >= @beginTime and p_proc_info.finish_date<@endTime)) ";
  744. // break;
  745. // case "每月绩效统计--中国一次OA授权表":
  746. // strSQL = @"select
  747. // p_case_info.case_volume as 我方文号,
  748. // p_case_info.case_name as 案件名称,
  749. // p_case_info.app_no as 申请号,
  750. // c_customer.customer_name as 客户名称,
  751. // STUFF((SELECT ',' + u.cn_name from p_proc_pic_list as pl
  752. // inner join s_user_info as u on u.user_id = pl.pic_id
  753. // where pl.obj_id = p_case_info.case_id FOR XML PATH('') ),1,1,'') as 案件处理人,
  754. // STUFF((SELECT ',' + u.cn_name from p_revise_user_list as pl
  755. // inner join s_user_info as u on u.user_id = pl.revise_user_id
  756. // where pl.obj_id = p_case_info.case_id FOR XML PATH('') ),1,1,'') as 案件核稿人,
  757. // p_file_list.post_date as 发文日期,
  758. // p_case_info.case_volume_customer as 客户文号,
  759. // p_case_info.app_date as 申请日,
  760. // i_country.country_zh_cn as '国家(地区)',
  761. // STUFF((SELECT ',' + a.applicant_name_cn from p_applicant_list as al
  762. // inner join i_applicant as a on a.applicant_id = al.applicant_id
  763. // where al.obj_id = p_case_info.case_id order by al.seq FOR XML PATH('') ),1,1,'') as 申请人,
  764. // p_file_list.upload_time as 上传日期,
  765. // i_file_desc.file_desc_zh_cn as 文件描述,
  766. // i_apply_type.apply_type_zh_cn as 申请类型,
  767. // STUFF((SELECT ',' + ui.cn_name from p_sales_list as sl
  768. // inner join dbo.s_user_info as ui on ui.user_id = sl.sales_user_id
  769. // where sl.obj_id = p_case_info.case_id AND sl.is_enabled=1 order by sl.seq FOR XML PATH('') ),1,1,'') as 业务人员
  770. // from p_case_info
  771. // inner join i_apply_type on p_case_info.apply_type_id=i_apply_type.apply_type_id
  772. // inner join p_proc_info on p_case_info.case_id=p_proc_info.case_id
  773. // inner join p_file_list on p_file_list.obj_id=p_proc_info.proc_id
  774. // inner join i_file_desc on i_file_desc.file_desc_id=p_file_list.file_desc_id
  775. // inner join c_customer on p_case_info.customer_id=c_customer.customer_id
  776. // inner join i_country on i_country.country_id=p_case_info.country_id
  777. // where
  778. // p_case_info.is_enabled=1
  779. // and p_proc_info.is_enabled=1 and p_case_info.country_id='CN'
  780. // and p_file_list.file_desc_id='09800D39-D585-49F3-B9DE-50AC689DE9AB'
  781. // and p_file_list.file_name not like '%.zip'
  782. // and (select count(*) from p_proc_info where case_id=p_case_info.case_id and ctrl_proc_id='8b96378e-05a0-4a8d-b3d1-39af92fddaf5')=1
  783. // and (p_case_info.case_type_id='31D1A147-2931-43B5-94AE-B72B1525BA8A' )
  784. // AND ((p_file_list.upload_time >= @beginTime and p_file_list.upload_time<@endTime))";
  785. // break;
  786. // case "每月绩效统计--专案进度跟踪~S卷":
  787. // strSQL = @"SELECT p_case_info.case_volume as 我方文号,
  788. // p_case_info.case_name as 案件名称,
  789. // i_case_type.case_type_zh_cn as 案件类型,
  790. // i_business_type.business_type_zh_cn as 业务类型,
  791. // i_country.country_zh_cn as '国家(地区)',
  792. // c_customer.customer_name as 客户名称,
  793. // s_dept_info.dept_full_name as 承办部门,
  794. // i_case_status.case_status_zh_cn as 案件状态,
  795. // i_ctrl_proc.ctrl_proc_zh_cn as 处理事项,
  796. // p_proc_info.int_due_date as 内部期限,
  797. // p_proc_info.cus_due_date as 客户期限,
  798. // p_proc_info.legal_due_date as 官方期限,
  799. // p_proc_info.finish_doc_date as 定稿日,
  800. // STUFF((SELECT ',' + u.cn_name from p_proc_pic_list as pl
  801. // inner join s_user_info as u on u.user_id = pl.pic_id where pl.obj_id = p_proc_info.proc_id
  802. // FOR XML PATH('') ),1,1,'') as 处理人,
  803. // p_case_info.charge_date as 委案日期,
  804. // (select proc_status_zh_cn from i_proc_status where proc_status_id=p_proc_info.proc_status_id) as 处理状态,
  805. // p_proc_info.first_doc_date as 初稿日,
  806. // STUFF((SELECT ',' + u.cn_name from c_customer_user as cu
  807. // inner join s_user_info as u on u.user_id = cu.user_id
  808. // where cu.customer_id = p_case_info.customer_id FOR XML PATH('') ),1,1,'') as 流程负责人,
  809. // p_proc_info.finish_date as 处理事项完成日,
  810. // STUFF((SELECT ',' + ui.cn_name from p_sales_list as sl
  811. // inner join dbo.s_user_info as ui on ui.user_id = sl.sales_user_id
  812. // where sl.obj_id = p_case_info.case_id AND sl.is_enabled=1 order by sl.seq FOR XML PATH('') ),1,1,'') as 业务人员
  813. // from p_case_info
  814. // inner join p_case_advance_info with(nolock) on p_case_info.case_id=p_case_advance_info.case_id
  815. // inner join i_apply_type with(nolock) on i_apply_type.apply_type_id=p_case_info.apply_type_id
  816. // inner join i_case_type with(nolock) on i_case_type.case_type_id=p_case_info.case_type_id
  817. // inner join i_country with(nolock) on i_country.country_id=p_case_info.country_id
  818. // inner join i_case_status with(nolock) on i_case_status.case_status_id=p_case_info.case_status_id
  819. // inner join c_customer with(nolock) on c_customer.customer_id=p_case_info.customer_id
  820. // inner join p_proc_info with(nolock) on p_case_info.case_id=p_proc_info.case_id
  821. // inner join i_ctrl_proc with(nolock) on p_proc_info.ctrl_proc_id=i_ctrl_proc.ctrl_proc_id
  822. // inner join i_business_type on i_business_type.business_type_id = p_case_info.business_type_id
  823. // inner join s_dept_info on s_dept_info.dept_id = p_case_info.charge_dept_id
  824. // where p_case_info.is_enabled=1 and p_proc_info.is_enabled=1 and
  825. // (isnull (p_proc_info.finish_date,'') ='') AND (i_ctrl_proc.ctrl_proc_zh_cn='提出报告')";
  826. // break;
  827. // case "每月绩效统计--专案开卷报表~S卷":
  828. // strSQL = @"SELECT p_case_info.case_volume as 我方文号,
  829. // p_case_info.case_volume_customer as 客户文号,
  830. // p_case_info.case_name as 案件名称,
  831. // p_case_info.charge_date as 委案日期,
  832. // i_case_status.case_status_zh_cn as 案件状态,
  833. // i_case_type.case_type_zh_cn as 案件类型,
  834. // p_case_info.app_no as 申请号,
  835. // p_case_info.app_date as 申请日,
  836. // i_business_type.business_type_zh_cn as 业务类型,
  837. // STUFF((SELECT ',' + u.cn_name from c_customer_user as cu
  838. // inner join s_user_info as u on u.user_id = cu.user_id where cu.customer_id = p_case_info.customer_id FOR XML PATH('') ),1,1,'') as 流程负责人,
  839. // c_customer.customer_name as 客户名称,
  840. // STUFF((SELECT ',' + u.cn_name from p_revise_user_list as pl
  841. // inner join s_user_info as u on u.user_id = pl.revise_user_id where pl.obj_id = p_case_info.case_id FOR XML PATH('') ),1,1,'') as 案件核稿人,
  842. // STUFF((SELECT ',' + u.cn_name from p_proc_pic_list as pl
  843. // inner join s_user_info as u on u.user_id = pl.pic_id where pl.obj_id = p_case_info.case_id FOR XML PATH('') ),1,1,'') as 案件处理人,
  844. // p_case_info.create_time as 开卷日期,
  845. // STUFF((SELECT ',' + ui.cn_name from p_sales_list as sl
  846. // inner join dbo.s_user_info as ui on ui.user_id = sl.sales_user_id
  847. // where sl.obj_id = p_case_info.case_id AND sl.is_enabled=1 order by sl.seq FOR XML PATH('') ),1,1,'') as 业务人员,
  848. // i_country.country_zh_cn as '国家(地区)'
  849. // from p_case_info
  850. // inner join p_case_advance_info with(nolock) on p_case_info.case_id=p_case_advance_info.case_id
  851. // inner join i_apply_type with(nolock) on i_apply_type.apply_type_id=p_case_info.apply_type_id
  852. // inner join i_case_type with(nolock) on i_case_type.case_type_id=p_case_info.case_type_id
  853. // inner join i_country with(nolock) on i_country.country_id=p_case_info.country_id
  854. // inner join i_case_status with(nolock) on i_case_status.case_status_id=p_case_info.case_status_id
  855. // inner join c_customer with(nolock) on c_customer.customer_id=p_case_info.customer_id
  856. // inner join i_business_type on i_business_type.business_type_id = p_case_info.business_type_id
  857. // inner join s_dept_info on s_dept_info.dept_id = p_case_info.charge_dept_id
  858. // where p_case_info.is_enabled=1 p_case_info.is_enabled=1 and p_case_info.case_volume like 'S%' and not p_case_info.case_volume like 'SC%'
  859. //and i_case_status.case_status_zh_cn<>'已完成' and i_case_status.case_status_zh_cn<>'结案'";
  860. // break;
  861. // }
  862. // using (var conn = new SqlConnection(ConfigHelper.GetSectionValue("IPEasySetting:ConnectionStrings")))
  863. // {
  864. // try
  865. // {
  866. // conn.Open();
  867. // using (var cmd = conn.CreateCommand())
  868. // {
  869. // cmd.CommandText = strSQL;
  870. // cmd.CommandType = CommandType.Text;
  871. // if (isModifyDate)
  872. // {
  873. // cmd.Parameters.Add(new SqlParameter("beginTime", DateTime.Parse(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01")));
  874. // cmd.Parameters.Add(new SqlParameter("endTime", DateTime.Parse(DateTime.Now.ToString("yyyy-MM") + "-01")));
  875. // }
  876. // using (var reader = cmd.ExecuteReader())
  877. // {
  878. // dt.Load(reader);
  879. // }
  880. // }
  881. // }
  882. // catch (Exception ex)
  883. // {
  884. // throw ex;
  885. // }
  886. // }
  887. // return dt;
  888. #endregion
  889. }
  890. }
  891. }