Geen omschrijving

Peoplewebsite.cs 73KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561
  1. using CallCenter.Utility;
  2. using CallCenterApi.DB;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Net;
  8. using System.Text;
  9. using System.Threading;
  10. using System.Threading.Tasks;
  11. namespace CallCenter.QuartzService
  12. {
  13. public class Peoplewebsite : QuartzJob
  14. {
  15. public Peoplewebsite()
  16. {
  17. CronExpression = "0 0 0 * * ? *";
  18. DoWork += GetLY;
  19. }
  20. public void GetLY(object sender, EventArgs e)
  21. {
  22. while (true)
  23. {
  24. if (DateTime.Now.Hour >= 0 && DateTime.Now.Hour < 7)
  25. {
  26. Thread.Sleep(6000);
  27. string t = TSWORKORDER();
  28. if (t != "推送成功" && t != "推送失败")
  29. {
  30. LogFactory.GetLogger("22222").Warn(t);
  31. break;
  32. }
  33. }
  34. else
  35. break;
  36. }
  37. }
  38. public class submit_case_info
  39. {
  40. public List<jsonList> jsonList { set; get; }
  41. }
  42. public class jsonList
  43. {
  44. /// <summary>
  45. /// "工单编号",
  46. /// </summary>
  47. public string CASE_SERIAL { set; get; }
  48. /// <summary>
  49. /// "行政区划代码",
  50. /// </summary>
  51. public string AREA_CODE { set; get; }
  52. /// <summary>
  53. /// "工单唯一标识",
  54. /// </summary>
  55. public string CASE_ID { set; get; }//
  56. /// <summary>
  57. /// 诉求人姓名
  58. /// </summary>
  59. public string APPLICANT_NAME { set; get; }
  60. /// <summary>
  61. /// 诉求人性别
  62. /// </summary>
  63. public string APPLICANT_SEX { set; get; }
  64. /// <summary>
  65. /// 诉求人年龄
  66. /// </summary>
  67. public string APPLICANT_AGE { set; get; }
  68. /// <summary>
  69. /// 诉求人联系电话
  70. /// </summary>
  71. public string APPLICANT_NUMBER { set; get; }
  72. /// <summary>
  73. /// 诉求时间
  74. /// </summary>
  75. public string APPLICANT_TIME { set; get; }
  76. /// <summary>
  77. /// 话务员姓名
  78. /// </summary>
  79.             public string HWY_NAME { set; get; }
  80. /// <summary>
  81. /// 话务员工号
  82. /// </summary>
  83. public string HWY_LOGINID { set; get; }
  84. /// <summary>
  85. /// 登记时间
  86. /// </summary>
  87.             public string CASE_TIME { set; get; }
  88. /// <summary>
  89. /// 服务工单标题
  90. /// </summary>
  91.             public string CASE_TITLE { set; get; }
  92. /// <summary>
  93. /// 服务工单内容
  94. /// </summary>
  95.             public string CASE_CONTENT { set; get; }
  96. /// <summary>
  97. /// 诉求渠道
  98. /// </summary>
  99.             public string CASE_SOURCE { set; get; }
  100. /// <summary>
  101. /// 诉求类型
  102. /// </summary>
  103.             public string CASE_TYPE { set; get; }
  104. /// <summary>
  105. /// 诉求归口
  106. /// </summary>
  107.             public string CASE_ACCORD { set; get; }
  108. /// <summary>
  109. /// 诉求人信息是否公开
  110. /// </summary>
  111. public string CASE_ISPUBLIC { set; get; }
  112. /// <summary>
  113. /// 是否回访
  114. /// </summary>
  115. public string CASE_ISVISIT { set; get; }
  116. /// <summary>
  117. /// 紧急程度
  118. /// </summary>
  119. public string CASE_ISURGENT { set; get; }
  120. /// <summary>
  121. /// 经纬度
  122. /// </summary>
  123. public string CASE_LNGLAT { set; get; }
  124. /// <summary>
  125. /// 诉求情感
  126. /// </summary>
  127. public string CASE_EMOTION { set; get; }
  128. /// <summary>
  129. /// 诉求详细地址
  130. /// </summary>
  131. public string CASE_ADDRESS { set; get; }//""
  132. }
  133. string AREA_CODE = Configs.GetValue("AREACODE");
  134. private int id = 0;
  135. public string TSWORKORDER()
  136. {
  137. try
  138. {
  139. if (DateTime.Now.Hour >= 0 && DateTime.Now.Hour < 7)
  140. {
  141. string token = GetToken();
  142. if (string.IsNullOrEmpty(token))
  143. return "token 错误";
  144. int count = 0;
  145. DataTable Push = new DataTable();
  146. string PushWorkorder = "SELECT top 1 * FROM T_Bus_PushWorkorder";
  147. Push = DbHelperSQL.Query(PushWorkorder).Tables[0];
  148. if (Push != null)
  149. {
  150. id = int.Parse(Push.Rows[0]["id"].ToString());
  151. count = int.Parse(Push.Rows[0]["count"].ToString());
  152. }
  153. var modellist = new CallCenterApi.BLL.T_Bus_WorkOrder().GetModelList(5, "F_CreateTime>='2022-06-01 01:31:35.160'and F_Id>" + id +
  154. " and F_IsDelete=0 and F_CreateTime <'2023-07-06 09:00:00.000' AND F_Email ='' "
  155. , " F_CreateTime ASC");
  156. if (modellist != null && modellist.Count > 0)
  157. {
  158. submit_case_info paras = new submit_case_info();
  159. paras.jsonList = new List<jsonList>();
  160. foreach (var model in modellist)
  161. {
  162. jsonList jsonList = new jsonList();
  163. string newwokrkorder = "";
  164. if (model.F_WorkOrderId.Contains("QT"))
  165. newwokrkorder = "WZ" + model.F_WorkOrderId.Substring(2, model.F_WorkOrderId.Length - 2);
  166. else
  167. newwokrkorder = model.F_WorkOrderId;
  168. jsonList.CASE_SERIAL = newwokrkorder;
  169. jsonList.AREA_CODE = AREA_CODE;
  170. jsonList.CASE_ID = model.F_Id.ToString();
  171. if (string.IsNullOrEmpty(model.F_CusName))
  172. jsonList.APPLICANT_NAME = "匿名";
  173. else
  174. jsonList.APPLICANT_NAME = model.F_CusName;
  175. if (model.F_CusSex == "0")
  176. jsonList.APPLICANT_SEX = "1";
  177. else if (model.F_CusSex == "1")
  178. jsonList.APPLICANT_SEX = "2";
  179. else
  180. jsonList.APPLICANT_SEX = "3";
  181. jsonList.APPLICANT_AGE = "8";//没有
  182. jsonList.APPLICANT_NUMBER = model.F_CusPhone;
  183. jsonList.APPLICANT_TIME = model.F_CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss");//没有
  184. if (DbHelperSQL.GetSingle(" select dbo.GetUserName('" + model.F_CreateUser + "')") != null)
  185. jsonList.HWY_NAME = DbHelperSQL.GetSingle(" select dbo.GetUserName('" + model.F_CreateUser + "')").ToString();
  186. else
  187. jsonList.HWY_NAME = model.F_CreateUser;
  188. jsonList.HWY_LOGINID = model.F_CreateUser;
  189. jsonList.CASE_TIME = model.F_CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  190. jsonList.CASE_TITLE = model.F_ComTitle;
  191. jsonList.CASE_CONTENT = model.F_ComContent;
  192. jsonList.CASE_SOURCE = model.F_WorkOrderId.Substring(0, 2);
  193. if (model.F_InfoType == 9)//咨询
  194. jsonList.CASE_TYPE = "10";
  195. else if (model.F_InfoType == 12)//建议
  196. jsonList.CASE_TYPE = "15";
  197. else if (model.F_InfoType == 11)//投诉
  198. jsonList.CASE_TYPE = "20";
  199. else if (model.F_InfoType == 10)//求助
  200. jsonList.CASE_TYPE = "30";
  201. else if (model.F_InfoType == 13)//表扬
  202. jsonList.CASE_TYPE = "35";
  203. else
  204. jsonList.CASE_TYPE = "40";//其他
  205. if (DbHelperSQL.GetSingle(" select dbo.GetDicRemark('" + model.F_Key + "')") != null)
  206. jsonList.CASE_ACCORD = DbHelperSQL.GetSingle(" select dbo.GetDicRemark('" + model.F_Key + "')").ToString();
  207. else
  208. jsonList.CASE_ACCORD = "";
  209. jsonList.CASE_ISPUBLIC = model.F_IsProtect.ToString();
  210. if (model.F_IsResult == 0)
  211. jsonList.CASE_ISPUBLIC = "1";
  212. else
  213. jsonList.CASE_ISPUBLIC = "0";
  214. if (model.F_Level == 2 || model.F_Level == 3)
  215. {
  216. jsonList.CASE_ISURGENT = "20";
  217. }
  218. else
  219. {
  220. jsonList.CASE_ISURGENT = "30";
  221. }
  222. if (model.F_IsResult == 1)
  223. jsonList.CASE_ISVISIT = "0";
  224. else
  225. jsonList.CASE_ISVISIT = "1";
  226. jsonList.CASE_LNGLAT = model.F_Latitude + "," + model.F_Longitude;
  227. jsonList.CASE_EMOTION = "70";
  228. jsonList.CASE_ADDRESS = model.F_SourceAddress;
  229. try
  230. {
  231. if (!string.IsNullOrEmpty(model.F_File))
  232. {
  233. fjcl(token, newwokrkorder, model.F_File, model.F_SourceArea.ToString(), model.F_Id, "10");
  234. }
  235. if (model.F_CallRecordId > 0)
  236. {
  237. dianhua(token, model.F_WorkOrderId);
  238. }
  239. }
  240. catch
  241. {
  242. }
  243. paras.jsonList.Add(jsonList);
  244. }
  245. if (paras.jsonList != null && paras.jsonList.Count > 0)
  246. {
  247. string jsonParam = "access_token=" + token + "&paras=" + paras.ToJson();
  248. var responseString = HttpMethods.HttpPost("http://59.227.93.14:9000/share/fwgdsl", jsonParam
  249. );
  250. try
  251. {
  252. Push jo = responseString.ToObject<Push>();
  253. if (jo.code == "1")
  254. {
  255. id = modellist[modellist.Count - 1].F_Id;
  256. count += modellist.Count;
  257. string strSql = string.Format(@"INSERT INTO T_Sys_PushMsg ( [WorkOrderId], [Conent], [CreatTime], [Code], [Message], [Title], [ErrorObjs], [Remarks])
  258. values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}') ;select @@IDENTITY ", modellist.FirstOrDefault().F_Id, "", DateTime.Now, jo.code, jo.message, "批量推送工单", "", "推送成功数:" + jo.body.successCount + " 推送总数:" + jo.body.totalCount);
  259. object objres = DbHelperSQL.GetSingle(strSql);
  260. string ts = "update T_Bus_PushWorkorder set id='" + id + "' ,count='" + count + "'";
  261. var rh = DbHelperSQL.GetSingle(ts);
  262. try
  263. {
  264. yiji(token, modellist);
  265. erji(token, modellist);
  266. pingjia(token, modellist);
  267. bajie(token, modellist);
  268. liucheng(token, modellist);
  269. huifangjilu(token, modellist);
  270. }
  271. catch
  272. {
  273. return "推送失败";
  274. }
  275. return "推送成功";
  276. }
  277. else
  278. {
  279. id = modellist[modellist.Count - 1].F_Id;
  280. count += modellist.Count;
  281. string error = "";
  282. if (jo.body.errorObjs != null && jo.body.errorObjs.Length > 0)
  283. {
  284. foreach (var it in jo.body.errorObjs)
  285. {
  286. if (!string.IsNullOrEmpty(it.resturl))
  287. {
  288. error += " 推送接口名称:" + it.resturl;
  289. }
  290. if (!string.IsNullOrEmpty(it.caseserial))
  291. {
  292. error += " 推送工单号:" + it.caseserial;
  293. }
  294. if (!string.IsNullOrEmpty(it.resturl))
  295. {
  296. error += " 推送标识:" + it.errorid;
  297. }
  298. if (!string.IsNullOrEmpty(it.resturl))
  299. {
  300. error += " 推送失败原因:" + it.errormsg;
  301. }
  302. }
  303. }
  304. string strSql = string.Format(@"INSERT INTO T_Sys_PushMsg ( [WorkOrderId], [Conent], [CreatTime], [Code], [Message], [Title], [ErrorObjs], [Remarks])
  305. values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}') ;select @@IDENTITY ", "", jsonParam, DateTime.Now, jo.code, jo.message, "批量推送工单失败", error, "推送成功数:" + jo.body.successCount + " 推送总数:" + jo.body.totalCount);
  306. object objres = DbHelperSQL.GetSingle(strSql);
  307. string ts = "update T_Bus_PushWorkorder set id='" + id + "' ,count='" + count + "'";
  308. var rh = DbHelperSQL.GetSingle(ts);
  309. try
  310. {
  311. yiji(token, modellist);
  312. erji(token, modellist);
  313. pingjia(token, modellist);
  314. bajie(token, modellist);
  315. liucheng(token, modellist);
  316. huifangjilu(token, modellist);
  317. }
  318. catch
  319. {
  320. return "推送失败";
  321. }
  322. return "推送失败";
  323. }
  324. }
  325. catch
  326. {
  327. id = modellist[modellist.Count - 1].F_Id;
  328. // count += modellist.Count;
  329. string ts = "update T_Bus_PushWorkorder set id='" + id + "'";
  330. var rh = DbHelperSQL.GetSingle(ts);
  331. return "推送失败";
  332. }
  333. }
  334. else
  335. {
  336. return "推送失败空";
  337. }
  338. }
  339. else
  340. {
  341. return "推送完结";
  342. }
  343. }
  344. else
  345. {
  346. return "等待时间";
  347. }
  348. }
  349. catch (Exception e)
  350. {
  351. return e.ToString();
  352. }
  353. }
  354. public void bajie(string token, List<CallCenterApi.Model.T_Bus_WorkOrder> modellist)
  355. {
  356. submit_case_finish_info paras = new submit_case_finish_info();
  357. paras.jsonList = new List<finish_info>();
  358. foreach (var model in modellist)
  359. {
  360. if (model.F_WorkState == 9 && model.F_DealTime != null)
  361. {
  362. finish_info jsonList = new finish_info();
  363. string newwokrkorder = model.F_WorkOrderId;
  364. if (model.F_WorkOrderId.Contains("QT"))
  365. newwokrkorder = "WZ" + model.F_WorkOrderId.Substring(2, model.F_WorkOrderId.Length - 2);
  366. else
  367. newwokrkorder = model.F_WorkOrderId;
  368. jsonList.CASE_SERIAL = newwokrkorder;
  369. jsonList.AREA_CODE = AREA_CODE;
  370. if (model.F_IsResult == null || model.F_IsResult == 1)
  371. {
  372. jsonList.FINISH_TYPE = "10";
  373. jsonList.DEPT_NAME = "热线中心";
  374. if (model.F_CloseTime != null)
  375. jsonList.END_TIME = model.F_CloseTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  376. else if (model.F_DealTime != null)
  377. jsonList.END_TIME = model.F_DealTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  378. else
  379. jsonList.END_TIME = model.F_CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  380. jsonList.DEPT_CODE = "4106000299";
  381. }
  382. else
  383. {
  384. jsonList.FINISH_TYPE = "20";
  385. if (model.F_MainDeptId != null && model.F_MainDeptId > 0 && model.F_DealTime != null)
  386. {
  387. jsonList.END_TIME = model.F_DealTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  388. if (DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + model.F_MainDeptId + "')") != null)
  389. jsonList.DEPT_NAME = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + model.F_MainDeptId + "')").ToString();
  390. if (DbHelperSQL.GetSingle(" select F_DeptNameSpell from T_Sys_Department where F_DeptId= '" + model.F_MainDeptId + "'") != null)
  391. jsonList.DEPT_CODE = DbHelperSQL.GetSingle(" select F_DeptNameSpell from T_Sys_Department where F_DeptId= '" + model.F_MainDeptId + "'").ToString();
  392. }
  393. else
  394. {
  395. if (model.F_CloseTime != null)
  396. jsonList.END_TIME = model.F_CloseTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  397. else if (model.F_DealTime != null)
  398. jsonList.END_TIME = model.F_DealTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  399. else
  400. jsonList.END_TIME = model.F_CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  401. jsonList.DEPT_NAME = "热线中心";
  402. jsonList.DEPT_CODE = "4106000299";
  403. }
  404. }
  405. if (model.F_CloseTime != null)
  406. jsonList.FINISH_TIME = model.F_CloseTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  407. else if (model.F_DealTime != null)
  408. jsonList.FINISH_TIME = model.F_DealTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  409. else
  410. jsonList.FINISH_TIME = model.F_CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  411. if (DbHelperSQL.GetSingle(" select dbo.GetUserName('" + model.F_DealUser + "')") != null)
  412. jsonList.FINISH_NAME = DbHelperSQL.GetSingle(" select dbo.GetUserName('" + model.F_DealUser + "')").ToString();
  413. else
  414. jsonList.FINISH_NAME = model.F_DealUser;
  415. if (string.IsNullOrEmpty(jsonList.FINISH_NAME))
  416. jsonList.FINISH_NAME = "热线中心";
  417. jsonList.FINISH_CONTENT = model.F_Result;
  418. jsonList.END_LENGTH = int.Parse(DbHelperSQL.GetSingle(" SELECT DATEDIFF(SECOND,'" + model.F_CreateTime + "', '" + model.F_DealTime + "')").ToString());
  419. }
  420. }
  421. if (paras.jsonList != null && paras.jsonList.Count > 0)
  422. {
  423. string jsonParam = "access_token=" + token + "&paras=" + paras.ToJson();
  424. var responseString = HttpMethods.HttpPost("http://59.227.93.14:9000/share/fwgdbj", jsonParam);
  425. Push jo = responseString.ToObject<Push>();
  426. if (jo.code == "1")
  427. {
  428. string strSql = string.Format(@"INSERT INTO T_Sys_PushMsg ( [WorkOrderId], [Conent], [CreatTime], [Code], [Message], [Title], [ErrorObjs], [Remarks])
  429. values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}') ;select @@IDENTITY ", "", jsonParam, DateTime.Now, jo.code, jo.message, "批量推送服务工单办结", "", "推送成功数:" + jo.body.successCount + " 推送总数:" + jo.body.totalCount);
  430. object objres = DbHelperSQL.GetSingle(strSql);
  431. }
  432. else
  433. {
  434. string error = "";
  435. if (jo.body.errorObjs != null && jo.body.errorObjs.Length > 0)
  436. {
  437. foreach (var it in jo.body.errorObjs)
  438. {
  439. if (!string.IsNullOrEmpty(it.resturl))
  440. {
  441. error += " 推送接口名称:" + it.resturl;
  442. }
  443. if (!string.IsNullOrEmpty(it.caseserial))
  444. {
  445. error += " 推送工单号:" + it.caseserial;
  446. }
  447. if (!string.IsNullOrEmpty(it.resturl))
  448. {
  449. error += " 推送标识:" + it.errorid;
  450. }
  451. if (!string.IsNullOrEmpty(it.resturl))
  452. {
  453. error += " 推送失败原因:" + it.errormsg;
  454. }
  455. }
  456. }
  457. string strSql = string.Format(@"INSERT INTO T_Sys_PushMsg ( [WorkOrderId], [Conent], [CreatTime], [Code], [Message], [Title], [ErrorObjs], [Remarks])
  458. values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}') ;select @@IDENTITY ", "", jsonParam, DateTime.Now, jo.code, jo.message, "批量推送服务工单办结", error, "推送成功数:" + jo.body.successCount + " 推送总数:" + jo.body.totalCount);
  459. object objres = DbHelperSQL.GetSingle(strSql);
  460. }
  461. }
  462. }
  463. public void yiji(string token, List<CallCenterApi.Model.T_Bus_WorkOrder> modellist)
  464. {
  465. submit_task_handle_info paras = new submit_task_handle_info();
  466. paras.jsonList = new List<handle_info>();
  467. foreach (var models in modellist)
  468. {
  469. if (models.F_MainDeptId != null && models.F_MainDeptId > 0)
  470. {
  471. var model = new CallCenterApi.BLL.T_Bus_Feedback().GetNewModelByWorkOrderID(models.F_WorkOrderId);
  472. var info = new CallCenterApi.BLL.T_Bus_AssignedInfo().GetNewModelByWorkOrderID(models.F_WorkOrderId);
  473. if (model != null && info != null)
  474. {
  475. handle_info jsonList = new handle_info();
  476. string newwokrkorder = models.F_WorkOrderId;
  477. if (model.F_WorkOrderId.Contains("QT"))
  478. newwokrkorder = "WZ" + model.F_WorkOrderId.Substring(2, model.F_WorkOrderId.Length - 2);
  479. else
  480. newwokrkorder = model.F_WorkOrderId;
  481. jsonList.CASE_SERIAL = newwokrkorder;
  482. jsonList.AREA_CODE = AREA_CODE;
  483. jsonList.TASK_ID = model.F_Id.ToString();
  484. jsonList.TASK_PARENTID = "TOP";
  485. if (DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + model.F_CreateDeptId + "')") != null)
  486. jsonList.TASK_OUNAME = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + model.F_CreateDeptId + "')").ToString();
  487. else
  488. jsonList.TASK_OUNAME = "";
  489. if (DbHelperSQL.GetSingle(" select dbo.GetUserName('" + model.F_CreateUser + "')") != null)
  490. jsonList.TASK_USERNAME = DbHelperSQL.GetSingle(" select dbo.GetUserName('" + model.F_CreateUser + "')").ToString();
  491. else
  492. jsonList.TASK_USERNAME = model.F_CreateUser;
  493. if (string.IsNullOrEmpty(model.F_Result))
  494. jsonList.TASK_CONTENT = "无";
  495. else
  496. jsonList.TASK_CONTENT = model.F_Result;
  497. jsonList.TASK_ASSIGNTIME = info.F_CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  498. jsonList.TASK_SIGNTIME = info.F_SureTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  499. jsonList.TASK_FINISHTIME = model.F_CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  500. jsonList.TASK_FINISHTIME_BF = info.F_LimitTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  501. if (info.F_State == 2)
  502. {
  503. jsonList.TASK_ISBACK = "1";
  504. }
  505. else
  506. {
  507. jsonList.TASK_ISBACK = "0";
  508. }
  509. if (info.F_IsNext > 0)
  510. {
  511. jsonList.TASK_ISALLOT = "1";
  512. }
  513. else
  514. {
  515. jsonList.TASK_ISALLOT = "0";
  516. }
  517. if (!string.IsNullOrEmpty(model.F_File))
  518. {
  519. fjcl(token, newwokrkorder, model.F_File, models.F_SourceArea.ToString(), model.F_Id, "20");
  520. }
  521. jsonList.TASK_HANDLE_LENGTH = int.Parse(DbHelperSQL.GetSingle(" SELECT DATEDIFF(SECOND,'" + jsonList.TASK_ASSIGNTIME + "', '" + jsonList.TASK_FINISHTIME + "')").ToString());
  522. paras.jsonList.Add(jsonList);
  523. }
  524. }
  525. }
  526. if (paras.jsonList != null && paras.jsonList.Count > 0)
  527. {
  528. string jsonParam = "access_token=" + token + "&paras=" + paras.ToJson();
  529. var responseString = HttpMethods.HttpPost("http://59.227.93.14:9000/share/bmcbjl", jsonParam);
  530. Push jo = responseString.ToObject<Push>();
  531. if (jo.code == "1")
  532. {
  533. string strSql = string.Format(@"INSERT INTO T_Sys_PushMsg ( [WorkOrderId], [Conent], [CreatTime], [Code], [Message], [Title], [ErrorObjs], [Remarks])
  534. values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}') ;select @@IDENTITY ", "", jsonParam, DateTime.Now, jo.code, jo.message, "批量推送一级部门处办记录", "", "推送成功数:" + jo.body.successCount + " 推送总数:" + jo.body.totalCount);
  535. object objres = DbHelperSQL.GetSingle(strSql);
  536. }
  537. else
  538. {
  539. string error = "";
  540. if (jo.body.errorObjs != null && jo.body.errorObjs.Length > 0)
  541. {
  542. foreach (var it in jo.body.errorObjs)
  543. {
  544. if (!string.IsNullOrEmpty(it.resturl))
  545. {
  546. error += " 推送接口名称:" + it.resturl;
  547. }
  548. if (!string.IsNullOrEmpty(it.caseserial))
  549. {
  550. error += " 推送工单号:" + it.caseserial;
  551. }
  552. if (!string.IsNullOrEmpty(it.resturl))
  553. {
  554. error += " 推送标识:" + it.errorid;
  555. }
  556. if (!string.IsNullOrEmpty(it.resturl))
  557. {
  558. error += " 推送失败原因:" + it.errormsg;
  559. }
  560. }
  561. }
  562. string strSql = string.Format(@"INSERT INTO T_Sys_PushMsg ( [WorkOrderId], [Conent], [CreatTime], [Code], [Message], [Title], [ErrorObjs], [Remarks])
  563. values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}') ;select @@IDENTITY ", "", jsonParam, DateTime.Now, jo.code, jo.message, "批量推送一级部门处办记录", error, "推送成功数:" + jo.body.successCount + " 推送总数:" + jo.body.totalCount);
  564. object objres = DbHelperSQL.GetSingle(strSql);
  565. }
  566. }
  567. }
  568. public void erji(string token, List<CallCenterApi.Model.T_Bus_WorkOrder> modellist)
  569. {
  570. submit_task_handle_info paras = new submit_task_handle_info();
  571. paras.jsonList = new List<handle_info>();
  572. foreach (var models in modellist)
  573. {
  574. if (!string.IsNullOrEmpty(models.F_MainDeptID3))
  575. {
  576. var info1 = new CallCenterApi.BLL.T_Bus_AssignedInfo().GetNewModelByWorkOrderID(models.F_WorkOrderId);
  577. var model = new CallCenterApi.BLL.T_Bus_Feedback_Next().GetNewModelByWorkOrderID(models.F_WorkOrderId);
  578. var info = new CallCenterApi.BLL.T_Bus_AssignedInfo_Next().GetNewModelByWorkOrderID(models.F_WorkOrderId);
  579. if (model != null && info != null && info1 != null)
  580. {
  581. handle_info jsonList = new handle_info();
  582. string newwokrkorder = models.F_WorkOrderId;
  583. if (model.F_WorkOrderId.Contains("QT"))
  584. newwokrkorder = "WZ" + model.F_WorkOrderId.Substring(2, model.F_WorkOrderId.Length - 2);
  585. else
  586. newwokrkorder = model.F_WorkOrderId;
  587. jsonList.CASE_SERIAL = newwokrkorder;
  588. jsonList.AREA_CODE = AREA_CODE;
  589. jsonList.TASK_ID = model.F_Id.ToString();
  590. jsonList.TASK_PARENTID = info1.F_Id.ToString();
  591. if (DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + model.F_CreateDeptId + "')") != null)
  592. jsonList.TASK_OUNAME = DbHelperSQL.GetSingle(" select dbo.GetDeptNames('" + model.F_CreateDeptId + "')").ToString();
  593. if (DbHelperSQL.GetSingle(" select dbo.GetUserName('" + model.F_CreateUser + "')") != null)
  594. jsonList.TASK_USERNAME = DbHelperSQL.GetSingle(" select dbo.GetUserName('" + model.F_CreateUser + "')").ToString();
  595. else
  596. jsonList.TASK_USERNAME = model.F_CreateUser;
  597. jsonList.TASK_CONTENT = model.F_Result;
  598. jsonList.TASK_ASSIGNTIME = info.F_CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  599. jsonList.TASK_SIGNTIME = info.F_SureTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  600. jsonList.TASK_FINISHTIME = model.F_CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  601. jsonList.TASK_FINISHTIME_BF = info.F_LimitTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  602. if (info.F_State == 2)
  603. {
  604. jsonList.TASK_ISBACK = "1";
  605. }
  606. else
  607. {
  608. jsonList.TASK_ISBACK = "0";
  609. }
  610. jsonList.TASK_ISALLOT = "1";
  611. jsonList.TASK_HANDLE_LENGTH = int.Parse(DbHelperSQL.GetSingle(" SELECT DATEDIFF(SECOND,'" + jsonList.TASK_ASSIGNTIME + "', '" + jsonList.TASK_FINISHTIME + "')").ToString());
  612. paras.jsonList.Add(jsonList);
  613. }
  614. }
  615. }
  616. if (paras.jsonList != null && paras.jsonList.Count > 0)
  617. {
  618. string jsonParam = "access_token=" + token + "&paras=" + paras.ToJson();
  619. var responseString = HttpMethods.HttpPost("http://59.227.93.14:9000/share/bmcbjl", jsonParam);
  620. Push jo = responseString.ToObject<Push>();
  621. if (jo.code == "1")
  622. {
  623. string strSql = string.Format(@"INSERT INTO T_Sys_PushMsg ( [WorkOrderId], [Conent], [CreatTime], [Code], [Message], [Title], [ErrorObjs], [Remarks])
  624. values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}') ;select @@IDENTITY ", "", jsonParam, DateTime.Now, jo.code, jo.message, "批量推送二级部门处办记录", "", "推送成功数:" + jo.body.successCount + " 推送总数:" + jo.body.totalCount);
  625. object objres = DbHelperSQL.GetSingle(strSql);
  626. }
  627. else
  628. {
  629. string error = "";
  630. if (jo.body.errorObjs != null && jo.body.errorObjs.Length > 0)
  631. {
  632. foreach (var it in jo.body.errorObjs)
  633. {
  634. if (!string.IsNullOrEmpty(it.resturl))
  635. {
  636. error += " 推送接口名称:" + it.resturl;
  637. }
  638. if (!string.IsNullOrEmpty(it.caseserial))
  639. {
  640. error += " 推送工单号:" + it.caseserial;
  641. }
  642. if (!string.IsNullOrEmpty(it.resturl))
  643. {
  644. error += " 推送标识:" + it.errorid;
  645. }
  646. if (!string.IsNullOrEmpty(it.resturl))
  647. {
  648. error += " 推送失败原因:" + it.errormsg;
  649. }
  650. }
  651. }
  652. string strSql = string.Format(@"INSERT INTO T_Sys_PushMsg ( [WorkOrderId], [Conent], [CreatTime], [Code], [Message], [Title], [ErrorObjs], [Remarks])
  653. values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}') ;select @@IDENTITY ", "", jsonParam, DateTime.Now, jo.code, jo.message, "批量推送二级部门处办记录", error, "推送成功数:" + jo.body.successCount + " 推送总数:" + jo.body.totalCount);
  654. object objres = DbHelperSQL.GetSingle(strSql);
  655. }
  656. }
  657. }
  658. public void dianhua(string token, string WorkOrderId)
  659. {
  660. var workorder = workorderBLL.GetModel(WorkOrderId);
  661. var model = new CallCenterApi.BLL.T_Call_CallRecords().GetModelByCallId(workorder.F_CallId);
  662. if (model != null)
  663. {
  664. submit_case_record paras = new submit_case_record();
  665. paras.jsonList = new List<record>();
  666. record jsonList = new record();
  667. string newwokrkorder = WorkOrderId;
  668. if (WorkOrderId.Contains("QT"))
  669. newwokrkorder = "WZ" + WorkOrderId.Substring(2, WorkOrderId.Length - 2);
  670. else
  671. newwokrkorder = WorkOrderId;
  672. jsonList.CASE_SERIAL = newwokrkorder;
  673. jsonList.AREA_CODE = AREA_CODE;
  674. jsonList.RECORD_ID = model.CallRecordsId.ToString();
  675. jsonList.RECORD_PHONE = model.CallNumber;
  676. if (model.TalkEndTime != null)
  677. jsonList.RECORD_STATUS = "30";
  678. else
  679. jsonList.RECORD_STATUS = "10";
  680. if (model.CallType == 0)
  681. jsonList.RECORD_TYPE = "10";
  682. else
  683. jsonList.RECORD_TYPE = "30";
  684. if (model.TalkStartTime != null)
  685. jsonList.RECORD_STARTTIME = model.TalkStartTime
  686. .Value.ToString("yyyy-MM-dd HH:mm:ss");
  687. if (model.TalkEndTime != null)
  688. jsonList.RECORD_ENDTIME = model.TalkEndTime
  689. .Value.ToString("yyyy-MM-dd HH:mm:ss");
  690. else
  691. jsonList.RECORD_ENDTIME = "";
  692. jsonList.RECORD_LENGTH = model.TalkLongTime;
  693. jsonList.RECORD_LOGINID = model.UserCode;
  694. // var config = new CallCenterApi.BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayPath' ").FirstOrDefault();
  695. if (model.FilePath != null)
  696. {
  697. var ym = "http://222.143.144.10:12000/";
  698. if (ym.Substring(ym.Length - 1) == "/")
  699. {
  700. ym = ym.Substring(0, ym.Length - 1);
  701. }
  702. string lujing = model.FilePath.Substring(model.FilePath.IndexOf(':') + 1).Replace('\\', '/');
  703. string wlpath = ym + lujing;
  704. jsonList.RECORD_URL = wlpath;
  705. }
  706. paras.jsonList.Add(jsonList);
  707. string jsonParam = "access_token=" + token + "&paras=" + paras.ToJson();
  708. var responseString = HttpMethods.HttpPost("http://59.227.93.14:9000/share/dhfwjl", jsonParam);
  709. Push jo = responseString.ToObject<Push>();
  710. if (jo.code == "1")
  711. {
  712. string strSql = string.Format(@"INSERT INTO T_Sys_PushMsg ( [WorkOrderId], [Conent], [CreatTime], [Code], [Message], [Title], [ErrorObjs], [Remarks])
  713. values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}') ;select @@IDENTITY ", "", jsonParam, DateTime.Now, jo.code, jo.message, "批量推送电话服务记录", "", "推送成功数:" + jo.body.successCount + " 推送总数:" + jo.body.totalCount);
  714. object objres = DbHelperSQL.GetSingle(strSql);
  715. }
  716. else
  717. {
  718. string error = "";
  719. if (jo.body.errorObjs != null && jo.body.errorObjs.Length > 0)
  720. {
  721. foreach (var it in jo.body.errorObjs)
  722. {
  723. if (!string.IsNullOrEmpty(it.resturl))
  724. {
  725. error += " 推送接口名称:" + it.resturl;
  726. }
  727. if (!string.IsNullOrEmpty(it.caseserial))
  728. {
  729. error += " 推送工单号:" + it.caseserial;
  730. }
  731. if (!string.IsNullOrEmpty(it.resturl))
  732. {
  733. error += " 推送标识:" + it.errorid;
  734. }
  735. if (!string.IsNullOrEmpty(it.resturl))
  736. {
  737. error += " 推送失败原因:" + it.errormsg;
  738. }
  739. }
  740. }
  741. string strSql = string.Format(@"INSERT INTO T_Sys_PushMsg ( [WorkOrderId], [Conent], [CreatTime], [Code], [Message], [Title], [ErrorObjs], [Remarks])
  742. values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}') ;select @@IDENTITY ", "", jsonParam, DateTime.Now, jo.code, jo.message, "批量推送电话服务记录", error, "推送成功数:" + jo.body.successCount + " 推送总数:" + jo.body.totalCount);
  743. object objres = DbHelperSQL.GetSingle(strSql);
  744. }
  745. }
  746. }
  747. public void pingjia(string token, List<CallCenterApi.Model.T_Bus_WorkOrder> modellist)
  748. {
  749. submit_case_visit_info paras = new submit_case_visit_info();
  750. paras.jsonList = new List<visit_info>();
  751. foreach (var models in modellist)
  752. {
  753. var model = new CallCenterApi.BLL.T_Bus_VisitResult().GetNewModelByWorkOrderID(models.F_WorkOrderId);
  754. if (model != null)
  755. {
  756. visit_info jsonList = new visit_info();
  757. string newwokrkorder = models.F_WorkOrderId;
  758. if (model.F_WorkOrderId.Contains("QT"))
  759. newwokrkorder = "WZ" + model.F_WorkOrderId.Substring(2, model.F_WorkOrderId.Length - 2);
  760. else
  761. newwokrkorder = model.F_WorkOrderId;
  762. jsonList.CASE_SERIAL = newwokrkorder;
  763. jsonList.AREA_CODE = AREA_CODE;
  764. jsonList.VISIT_TYPE = "DH";
  765. jsonList.VISIT_TIME = model.F_CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  766. if (DbHelperSQL.GetSingle(" select dbo.GetUserName('" + model.F_CreateUser + "')") != null)
  767. jsonList.VISIT_NAME = DbHelperSQL.GetSingle(" select dbo.GetUserName('" + model.F_CreateUser + "')").ToString();
  768. else
  769. jsonList.VISIT_NAME = model.F_CreateUser;
  770. if (string.IsNullOrEmpty(model.F_Result))
  771. jsonList.VISIT_CONTENT = "无";
  772. else
  773. jsonList.VISIT_CONTENT = model.F_Result;
  774. if (model.F_IsSatisfie == 0)
  775. jsonList.VISIT_SATISFY = "2";
  776. else
  777. jsonList.VISIT_SATISFY = "4";
  778. jsonList.VISIT_NUMBER = int.Parse(DbHelperSQL.GetSingle(" select count(1) from T_Bus_VisitResult where F_WorkOrderId ='" + model.F_WorkOrderId + "'").ToString());
  779. paras.jsonList.Add(jsonList);
  780. }
  781. }
  782. if (paras.jsonList != null && paras.jsonList.Count > 0)
  783. {
  784. string jsonParam = "access_token=" + token + "&paras=" + paras.ToJson();
  785. var responseString = HttpMethods.HttpPost("http://59.227.93.14:9000/share/gdzzpj", jsonParam);
  786. Push jo = responseString.ToObject<Push>();
  787. if (jo.code == "1")
  788. {
  789. string strSql = string.Format(@"INSERT INTO T_Sys_PushMsg ( [WorkOrderId], [Conent], [CreatTime], [Code], [Message], [Title], [ErrorObjs], [Remarks])
  790. values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}') ;select @@IDENTITY ", "", jsonParam, DateTime.Now, jo.code, jo.message, "批量推送工单最终评价", "", "推送成功数:" + jo.body.successCount + " 推送总数:" + jo.body.totalCount);
  791. object objres = DbHelperSQL.GetSingle(strSql);
  792. }
  793. else
  794. {
  795. string error = "";
  796. if (jo.body.errorObjs != null && jo.body.errorObjs.Length > 0)
  797. {
  798. foreach (var it in jo.body.errorObjs)
  799. {
  800. if (!string.IsNullOrEmpty(it.resturl))
  801. {
  802. error += " 推送接口名称:" + it.resturl;
  803. }
  804. if (!string.IsNullOrEmpty(it.caseserial))
  805. {
  806. error += " 推送工单号:" + it.caseserial;
  807. }
  808. if (!string.IsNullOrEmpty(it.resturl))
  809. {
  810. error += " 推送标识:" + it.errorid;
  811. }
  812. if (!string.IsNullOrEmpty(it.resturl))
  813. {
  814. error += " 推送失败原因:" + it.errormsg;
  815. }
  816. }
  817. }
  818. string strSql = string.Format(@"INSERT INTO T_Sys_PushMsg ( [WorkOrderId], [Conent], [CreatTime], [Code], [Message], [Title], [ErrorObjs], [Remarks])
  819. values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}') ;select @@IDENTITY ", "", jsonParam, DateTime.Now, jo.code, jo.message, "批量推送工单最终评价", error, "推送成功数:" + jo.body.successCount + " 推送总数:" + jo.body.totalCount);
  820. object objres = DbHelperSQL.GetSingle(strSql);
  821. }
  822. }
  823. }
  824. public void liucheng(string token, List<CallCenterApi.Model.T_Bus_WorkOrder> modellist)
  825. {
  826. submit_case_process_info paras = new submit_case_process_info();
  827. paras.jsonList = new List<process_info>();
  828. foreach (var models in modellist)
  829. {
  830. var process = new CallCenterApi.BLL.T_Bus_Operation().GetModelList("F_WorkOrderId='" + models.F_WorkOrderId + "'");
  831. if (process != null)
  832. {
  833. foreach (var model in process)
  834. {
  835. if (model.F_Message.Contains("查收了") || model.F_Message.Contains("交办了")
  836. || model.F_Message.Contains("回访了"))
  837. {
  838. process_info jsonList = new process_info();
  839. string newwokrkorder = model.F_WorkOrderId;
  840. if (model.F_WorkOrderId.Contains("QT"))
  841. newwokrkorder = "WZ" + model.F_WorkOrderId.Substring(2, model.F_WorkOrderId.Length - 2);
  842. else
  843. newwokrkorder = model.F_WorkOrderId;
  844. jsonList.CASE_SERIAL = newwokrkorder;
  845. jsonList.AREA_CODE = AREA_CODE;
  846. jsonList.PROCESS_ID = model.F_Id.ToString();
  847. jsonList.DEPT_NAME = model.F_Message.Split('(')[0];
  848. if (model.F_Message.Contains("查收了"))
  849. jsonList.TACHE_NAME = "查收工单";
  850. else if (model.F_Message.Contains("交办了"))
  851. jsonList.TACHE_NAME = "交办工单";
  852. else if (model.F_Message.Contains("回访了"))
  853. jsonList.TACHE_NAME = "审核工单";
  854. jsonList.PROCESS_TIME = model.F_CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  855. if (DbHelperSQL.GetSingle(" select dbo.GetUserName('" + model.F_CreateUser + "')") != null)
  856. jsonList.PROCESS_NAME = DbHelperSQL.GetSingle(" select dbo.GetUserName('" + model.F_CreateUser + "')").ToString();
  857. else
  858. jsonList.PROCESS_NAME = model.F_CreateUser;
  859. jsonList.PROCESS_NOTE = model.F_Message;
  860. paras.jsonList.Add(jsonList);
  861. }
  862. }
  863. }
  864. }
  865. if (paras.jsonList != null && paras.jsonList.Count > 0)
  866. {
  867. string jsonParam = "access_token=" + token + "&paras=" + paras.ToJson();
  868. var responseString = HttpMethods.HttpPost("http://59.227.93.14:9000/share/gdcllc", jsonParam);
  869. Push jo = responseString.ToObject<Push>();
  870. if (jo.code == "1")
  871. {
  872. string strSql = string.Format(@"INSERT INTO T_Sys_PushMsg ( [WorkOrderId], [Conent], [CreatTime], [Code], [Message], [Title], [ErrorObjs], [Remarks])
  873. values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}') ;select @@IDENTITY ", "", jsonParam, DateTime.Now, jo.code, jo.message, "批量推送工单处理流程", "", "推送成功数:" + jo.body.successCount + " 推送总数:" + jo.body.totalCount);
  874. object objres = DbHelperSQL.GetSingle(strSql);
  875. }
  876. else
  877. {
  878. string error = "";
  879. if (jo.body.errorObjs != null && jo.body.errorObjs.Length > 0)
  880. {
  881. foreach (var it in jo.body.errorObjs)
  882. {
  883. if (!string.IsNullOrEmpty(it.resturl))
  884. {
  885. error += " 推送接口名称:" + it.resturl;
  886. }
  887. if (!string.IsNullOrEmpty(it.caseserial))
  888. {
  889. error += " 推送工单号:" + it.caseserial;
  890. }
  891. if (!string.IsNullOrEmpty(it.resturl))
  892. {
  893. error += " 推送标识:" + it.errorid;
  894. }
  895. if (!string.IsNullOrEmpty(it.resturl))
  896. {
  897. error += " 推送失败原因:" + it.errormsg;
  898. }
  899. }
  900. }
  901. string strSql = string.Format(@"INSERT INTO T_Sys_PushMsg ( [WorkOrderId], [Conent], [CreatTime], [Code], [Message], [Title], [ErrorObjs], [Remarks])
  902. values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}') ;select @@IDENTITY ", "", jsonParam, DateTime.Now, jo.code, jo.message, "批量推送工单处理流程", error, "推送成功数:" + jo.body.successCount + " 推送总数:" + jo.body.totalCount);
  903. object objres = DbHelperSQL.GetSingle(strSql);
  904. }
  905. }
  906. }
  907. public void huifangjilu(string token, List<CallCenterApi.Model.T_Bus_WorkOrder> modellist)
  908. {
  909. submit_case_visit_detail_info paras = new submit_case_visit_detail_info();
  910. paras.jsonList = new List<detail_info>();
  911. // LogFactory.GetLogger("HttpPost").Warn(modellist.ToJson()+"ttssds");
  912. foreach (var models in modellist)
  913. {
  914. var modelslist = new CallCenterApi.BLL.T_Bus_VisitResult().GetModelList("F_WorkOrderId='" + models.F_WorkOrderId + "'");
  915. if (modelslist != null && modelslist.Count > 0)
  916. {
  917. foreach (var model in modelslist)
  918. {
  919. detail_info jsonList = new detail_info();
  920. string newwokrkorder = model.F_WorkOrderId;
  921. if (model.F_WorkOrderId.Contains("QT"))
  922. newwokrkorder = "WZ" + model.F_WorkOrderId.Substring(2, model.F_WorkOrderId.Length - 2);
  923. else
  924. newwokrkorder = model.F_WorkOrderId;
  925. jsonList.CASE_SERIAL = newwokrkorder;
  926. jsonList.AREA_CODE = AREA_CODE;
  927. jsonList.VISIT_ID = model.F_Id.ToString();
  928. jsonList.VISIT_TYPE = "DH";
  929. jsonList.VISIT_TIME = model.F_CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
  930. if (DbHelperSQL.GetSingle(" select dbo.GetUserName('" + model.F_CreateUser + "')") != null)
  931. jsonList.VISIT_NAME = DbHelperSQL.GetSingle(" select dbo.GetUserName('" + model.F_CreateUser + "')").ToString();
  932. else
  933. jsonList.VISIT_NAME = model.F_CreateUser;
  934. if (string.IsNullOrEmpty(model.F_Result))
  935. jsonList.VISIT_CONTENT = "无";
  936. else
  937. jsonList.VISIT_CONTENT = model.F_Result;
  938. if (model.F_IsSatisfie == 0)
  939. jsonList.VISIT_SATISFY = "2";
  940. else
  941. jsonList.VISIT_SATISFY = "4";
  942. paras.jsonList.Add(jsonList);
  943. }
  944. }
  945. }
  946. if (paras.jsonList != null && paras.jsonList.Count > 0)
  947. {
  948. string jsonParam = "access_token=" + token + "&paras=" + paras.ToJson();
  949. var responseString = HttpMethods.HttpPost("http://59.227.93.14:9000/share/gdhfjl", jsonParam);
  950. Push jo = responseString.ToObject<Push>();
  951. if (jo.code == "1")
  952. {
  953. string strSql = string.Format(@"INSERT INTO T_Sys_PushMsg ( [WorkOrderId], [Conent], [CreatTime], [Code], [Message], [Title], [ErrorObjs], [Remarks])
  954. values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}') ;select @@IDENTITY ", "", jsonParam, DateTime.Now, jo.code, jo.message, "批量推送工单回访记录", "", "推送成功数:" + jo.body.successCount + " 推送总数:" + jo.body.totalCount);
  955. object objres = DbHelperSQL.GetSingle(strSql);
  956. }
  957. else
  958. {
  959. string error = "";
  960. if (jo.body.errorObjs != null && jo.body.errorObjs.Length > 0)
  961. {
  962. foreach (var it in jo.body.errorObjs)
  963. {
  964. if (!string.IsNullOrEmpty(it.resturl))
  965. {
  966. error += " 推送接口名称:" + it.resturl;
  967. }
  968. if (!string.IsNullOrEmpty(it.caseserial))
  969. {
  970. error += " 推送工单号:" + it.caseserial;
  971. }
  972. if (!string.IsNullOrEmpty(it.resturl))
  973. {
  974. error += " 推送标识:" + it.errorid;
  975. }
  976. if (!string.IsNullOrEmpty(it.resturl))
  977. {
  978. error += " 推送失败原因:" + it.errormsg;
  979. }
  980. }
  981. }
  982. string strSql = string.Format(@"INSERT INTO T_Sys_PushMsg ( [WorkOrderId], [Conent], [CreatTime], [Code], [Message], [Title], [ErrorObjs], [Remarks])
  983. values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}') ;select @@IDENTITY ", "", jsonParam, DateTime.Now, jo.code, jo.message, "批量推送工单回访记录", error, "推送成功数:" + jo.body.successCount + " 推送总数:" + jo.body.totalCount);
  984. object objres = DbHelperSQL.GetSingle(strSql);
  985. }
  986. }
  987. }
  988. public void fjcl(string token, string WorkOrderId, string file, string area, int id, string type)
  989. {
  990. string ParamValue = "http://222.143.144.10:8002";
  991. // var configfj = configBll.GetModelList(" F_ParamCode='FileUrlPath' ").FirstOrDefault();
  992. // if (configfj != null)
  993. // {
  994. // ParamValue = configfj.F_ParamValue;
  995. // }
  996. submit_case_material_info paras = new submit_case_material_info();
  997. paras.jsonList = new List<material_info>();
  998. var Accessories = new CallCenterApi.BLL.T_Sys_Accessories().GetModelList("F_FileId in (" + file + ")");
  999. if (Accessories != null && Accessories.Count > 0)
  1000. {
  1001. foreach (var it in Accessories)
  1002. {
  1003. material_info jsonList = new material_info();
  1004. string newwokrkorder = "";
  1005. if (WorkOrderId.Contains("QT"))
  1006. newwokrkorder = "WZ" + WorkOrderId.Substring(2, WorkOrderId.Length - 2);
  1007. else
  1008. newwokrkorder = WorkOrderId;
  1009. jsonList.CASE_SERIAL = newwokrkorder;
  1010. jsonList.AREA_CODE = AREA_CODE;
  1011. jsonList.MATERIAL_ID = it.F_FileId.ToString();
  1012. jsonList.MATERIAL_NAME = it.F_FileName;
  1013. jsonList.MATERIAL_FILE_TYPE = it.F_FileType;
  1014. jsonList.MATERIAL_TYPE = type;
  1015. jsonList.MATERIAL_CONTACTID = id.ToString();
  1016. jsonList.MATERAIL_URL = ParamValue + it.F_FileUrl;
  1017. paras.jsonList.Add(jsonList);
  1018. }
  1019. string jsonParam = "access_token=" + token + "&paras=" + paras.ToJson();
  1020. var responseString = HttpMethods.HttpPost("http://59.227.93.14:9000/share/fwgdcl", jsonParam);
  1021. Push jo = responseString.ToObject<Push>();
  1022. if (jo.code == "1")
  1023. {
  1024. string strSql = string.Format(@"INSERT INTO T_Sys_PushMsg ( [WorkOrderId], [Conent], [CreatTime], [Code], [Message], [Title], [ErrorObjs], [Remarks])
  1025. values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}') ;select @@IDENTITY ", "", jsonParam, DateTime.Now, jo.code, jo.message, "批量推送服务工单材料", "", "推送成功数:" + jo.body.successCount + " 推送总数:" + jo.body.totalCount);
  1026. object objres = DbHelperSQL.GetSingle(strSql);
  1027. }
  1028. else
  1029. {
  1030. string error = "";
  1031. if (jo.body.errorObjs != null && jo.body.errorObjs.Length > 0)
  1032. {
  1033. foreach (var iv in jo.body.errorObjs)
  1034. {
  1035. if (!string.IsNullOrEmpty(iv.resturl))
  1036. {
  1037. error += " 推送接口名称:" + iv.resturl;
  1038. }
  1039. if (!string.IsNullOrEmpty(iv.caseserial))
  1040. {
  1041. error += " 推送工单号:" + iv.caseserial;
  1042. }
  1043. if (!string.IsNullOrEmpty(iv.resturl))
  1044. {
  1045. error += " 推送标识:" + iv.errorid;
  1046. }
  1047. if (!string.IsNullOrEmpty(iv.resturl))
  1048. {
  1049. error += " 推送失败原因:" + iv.errormsg;
  1050. }
  1051. }
  1052. }
  1053. string strSql = string.Format(@"INSERT INTO T_Sys_PushMsg ( [WorkOrderId], [Conent], [CreatTime], [Code], [Message], [Title], [ErrorObjs], [Remarks])
  1054. values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}') ;select @@IDENTITY ", "", jsonParam, DateTime.Now, jo.code, jo.message, "批量推送服务工单材料", error, "推送成功数:" + jo.body.successCount + " 推送总数:" + jo.body.totalCount);
  1055. object objres = DbHelperSQL.GetSingle(strSql);
  1056. }
  1057. }
  1058. }
  1059. public class submit_case_record
  1060. {
  1061. public List<record> jsonList { set; get; }
  1062. }
  1063. private CallCenterApi.BLL.T_Bus_WorkOrder workorderBLL = new CallCenterApi.BLL.T_Bus_WorkOrder();
  1064. public class record
  1065. {
  1066. /// <summary>
  1067. /// "工单编号",
  1068. /// </summary>
  1069. public string CASE_SERIAL { set; get; }
  1070. /// <summary>
  1071. /// "行政区划代码",
  1072. /// </summary>
  1073. public string AREA_CODE { set; get; }
  1074. ///<summary>
  1075. /// 录音唯一标识
  1076. /// </summary>
  1077. public string RECORD_ID { set; get; }
  1078. /// <summary>
  1079. /// 电话号码
  1080. /// </summary>
  1081. public string RECORD_PHONE { set; get; }
  1082. /// <summary>
  1083. /// 通话状态
  1084. /// </summary>
  1085. public string RECORD_STATUS { set; get; }
  1086. /// <summary>
  1087. /// 通话类型
  1088. /// </summary>
  1089. public string RECORD_TYPE { set; get; }
  1090. /// <summary>
  1091. /// 通话开始时间
  1092. /// </summary>
  1093.             public string RECORD_STARTTIME { set; get; }
  1094. /// <summary>
  1095. /// 通话结束时间
  1096. /// </summary>
  1097.             public string RECORD_ENDTIME { set; get; }
  1098. /// <summary>
  1099. /// 通话时长
  1100. /// </summary>
  1101. public int? RECORD_LENGTH { set; get; }
  1102. /// <summary>
  1103. /// 座席人员工号
  1104. /// </summary>
  1105. public string RECORD_LOGINID { set; get; }
  1106. /// <summary>
  1107. /// 录音路径
  1108. /// </summary>
  1109. public string RECORD_URL { set; get; }
  1110. }
  1111. public class submit_case_material_info
  1112. {
  1113. public List<material_info> jsonList { set; get; }
  1114. }
  1115. public class material_info
  1116. {
  1117. /// <summary>
  1118. /// "工单编号",
  1119. /// </summary>
  1120. public string CASE_SERIAL { set; get; }
  1121. /// <summary>
  1122. /// "行政区划代码",
  1123. /// </summary>
  1124. public string AREA_CODE { set; get; }
  1125. ///<summary>
  1126. /// 附件唯一标识
  1127. /// </summary>
  1128. public string MATERIAL_ID { set; get; }
  1129. /// <summary>
  1130. /// 材料名称
  1131. /// </summary>
  1132. public string MATERIAL_NAME { set; get; }
  1133. /// <summary>
  1134. /// 材料文件类型
  1135. /// </summary>
  1136. public string MATERIAL_FILE_TYPE { set; get; }
  1137. /// <summary>
  1138. /// 材料类别
  1139. /// </summary>
  1140. public string MATERIAL_TYPE { set; get; }
  1141. /// <summary>
  1142. /// 材料关联标识
  1143. /// </summary>
  1144.             public string MATERIAL_CONTACTID { set; get; }
  1145. /// <summary>
  1146. /// 材料路径
  1147. /// </summary>
  1148.             public string MATERAIL_URL { set; get; }
  1149. }
  1150. // private CallCenterApi.BLL.T_Sys_SystemConfig configBll = new CallCenterApi.BLL.T_Sys_SystemConfig();
  1151. public class submit_case_visit_detail_info
  1152. {
  1153. public List<detail_info> jsonList { set; get; }
  1154. }
  1155. public class detail_info
  1156. {
  1157. /// <summary>
  1158. /// "工单编号",
  1159. /// </summary>
  1160. public string CASE_SERIAL { set; get; }
  1161. /// <summary>
  1162. /// "行政区划代码",
  1163. /// </summary>
  1164. public string AREA_CODE { set; get; }
  1165. ///<summary>
  1166. /// 回访唯一标识
  1167. /// </summary>
  1168. public string VISIT_ID { set; get; }
  1169. /// <summary>
  1170. /// 回访评价方式
  1171. /// </summary>
  1172. public string VISIT_TYPE { set; get; }
  1173. /// <summary>
  1174. /// 回访时间
  1175. /// </summary>
  1176. public string VISIT_TIME { set; get; }
  1177. /// <summary>
  1178. /// 回访人
  1179. /// </summary>
  1180. public string VISIT_NAME { set; get; }
  1181. /// <summary>
  1182. /// 回访评价情况
  1183. /// </summary>
  1184.             public string VISIT_CONTENT { set; get; }
  1185. /// <summary>
  1186. /// 回访结果满意度
  1187. /// </summary>
  1188.             public string VISIT_SATISFY { set; get; }
  1189. }
  1190. public class submit_case_process_info
  1191. {
  1192. public List<process_info> jsonList { set; get; }
  1193. }
  1194. public class process_info
  1195. {
  1196. /// <summary>
  1197. /// "工单编号",
  1198. /// </summary>
  1199. public string CASE_SERIAL { set; get; }
  1200. /// <summary>
  1201. /// "行政区划代码",
  1202. /// </summary>
  1203. public string AREA_CODE { set; get; }
  1204. ///<summary>
  1205. /// 流程唯一标识
  1206. /// </summary>
  1207. public string PROCESS_ID { set; get; }
  1208. /// <summary>
  1209. /// 环节名称
  1210. /// </summary>
  1211. public string TACHE_NAME { set; get; }
  1212. /// <summary>
  1213. /// 处理部门
  1214. /// </summary>
  1215. public string DEPT_NAME { set; get; }
  1216. /// <summary>
  1217. /// 处理时间
  1218. /// </summary>
  1219. public string PROCESS_TIME { set; get; }
  1220. /// <summary>
  1221. /// 处理人员
  1222. /// </summary>
  1223.             public string PROCESS_NAME { set; get; }
  1224. /// <summary>
  1225. /// 处办意见
  1226. /// </summary>
  1227.             public string PROCESS_NOTE { set; get; }
  1228. }
  1229. public class submit_case_finish_info
  1230. {
  1231. public List<finish_info> jsonList { set; get; }
  1232. }
  1233. public class finish_info
  1234. {
  1235. /// <summary>
  1236. /// "工单编号",
  1237. /// </summary>
  1238. public string CASE_SERIAL { set; get; }
  1239. /// <summary>
  1240. /// "行政区划代码",
  1241. /// </summary>
  1242. public string AREA_CODE { set; get; }
  1243. ///<summary>
  1244. /// 办结方式
  1245. /// </summary>
  1246. public string FINISH_TYPE { set; get; }
  1247. /// <summary>
  1248. /// 答复单位
  1249. /// </summary>
  1250. public string DEPT_NAME { set; get; }
  1251. /// <summary>
  1252. /// 答复单位组织架构编码
  1253. /// </summary>
  1254. public string DEPT_CODE { set; get; }
  1255. /// <summary>
  1256. /// 答复时间
  1257. /// </summary>
  1258.             public string FINISH_TIME { set; get; }
  1259. /// <summary>
  1260. /// 答复人员
  1261. /// </summary>
  1262.             public string FINISH_NAME { set; get; }
  1263. /// <summary>
  1264. /// 答复结果
  1265. /// </summary>
  1266.             public string FINISH_CONTENT { set; get; }
  1267. /// <summary>
  1268. /// 答复结果
  1269. /// </summary>
  1270. public string END_TIME { set; get; }
  1271. /// <summary>
  1272. /// 处办时长
  1273. /// </summary>
  1274.             public int END_LENGTH { set; get; }
  1275. }
  1276. public class submit_case_visit_info
  1277. {
  1278. public List<visit_info> jsonList { set; get; }
  1279. }
  1280. public class visit_info
  1281. {
  1282. /// <summary>
  1283. /// "工单编号",
  1284. /// </summary>
  1285. public string CASE_SERIAL { set; get; }
  1286. /// <summary>
  1287. /// "行政区划代码",
  1288. /// </summary>
  1289. public string AREA_CODE { set; get; }
  1290. ///<summary>
  1291. /// 回访评价方式
  1292. /// </summary>
  1293. public string VISIT_TYPE { set; get; }
  1294. /// <summary>
  1295. /// 回访时间
  1296. /// </summary>
  1297. public string VISIT_TIME { set; get; }
  1298. /// <summary>
  1299. /// 回访人
  1300. /// </summary>
  1301. public string VISIT_NAME { set; get; }
  1302. /// <summary>
  1303. /// 回访评价情况
  1304. /// </summary>
  1305.             public string VISIT_CONTENT { set; get; }
  1306. /// <summary>
  1307. /// 回访结果满意度
  1308. /// </summary>
  1309.             public string VISIT_SATISFY { set; get; }
  1310. /// <summary>
  1311. /// 回访次数
  1312. /// </summary>
  1313. public int VISIT_NUMBER { set; get; }
  1314. }
  1315. public class submit_task_handle_info
  1316. {
  1317. public List<handle_info> jsonList { set; get; }
  1318. }
  1319. public class handle_info
  1320. {
  1321. /// <summary>
  1322. /// "工单编号",
  1323. /// </summary>
  1324. public string CASE_SERIAL { set; get; }
  1325. /// <summary>
  1326. /// "行政区划代码",
  1327. /// </summary>
  1328. public string AREA_CODE { set; get; }
  1329. /// <summary>
  1330. /// "工单唯一标识",
  1331. /// </summary>
  1332. public string CASE_ID { set; get; }//
  1333. /// <summary>
  1334. /// 任务单唯一标识
  1335. /// </summary>
  1336. public string TASK_ID { set; get; }
  1337. /// <summary>
  1338. /// 父任务单标识
  1339. /// </summary>
  1340. public string TASK_PARENTID { set; get; }
  1341. /// <summary>
  1342. /// 办理部门
  1343. /// </summary>
  1344. public string TASK_OUNAME { set; get; }
  1345. /// <summary>
  1346. /// 办理人员
  1347. /// </summary>
  1348. public string TASK_USERNAME { set; get; }
  1349. /// <summary>
  1350. /// 反馈意见
  1351. /// </summary>
  1352. public string TASK_CONTENT { set; get; }
  1353. /// <summary>
  1354. /// 交办时间
  1355. /// </summary>
  1356.             public string TASK_ASSIGNTIME { set; get; }
  1357. /// <summary>
  1358. /// 签收时间
  1359. /// </summary>
  1360. public string TASK_SIGNTIME { set; get; }
  1361. /// <summary>
  1362. /// 反馈时间
  1363. /// </summary>
  1364.             public string TASK_FINISHTIME { set; get; }
  1365. /// <summary>
  1366. /// 应反馈时间
  1367. /// </summary>
  1368.             public string TASK_FINISHTIME_BF { set; get; }
  1369. /// <summary>
  1370. /// 是否退回
  1371. /// </summary>
  1372.             public string TASK_ISBACK { set; get; }
  1373. /// <summary>
  1374. /// 是否分派
  1375. /// </summary>
  1376.             public string TASK_ISALLOT { set; get; }
  1377. /// <summary>
  1378. /// 处办时长
  1379. /// </summary>
  1380.             public int TASK_HANDLE_LENGTH { set; get; }
  1381. }
  1382. private string GetToken()
  1383. {
  1384. //Dictionary<string, object> values = new Dictionary<string, object>();
  1385. //values.Add("client_id", "d620caf2-d00f-41a9-ae99-c6dfd435875e");
  1386. //values.Add("client_secret", "4f75914e-d517-4325-ac64-c321377b12f0");
  1387. //values.Add("grant_type", "client_credentials");
  1388. //var jsonParam = JsonConvert.SerializeObject(values);
  1389. string jsonParam = "client_id=b3e2ed3b-672a-43a0-80db-21f790c0368d&client_secret=362b50d7-2aa5-4874-9363-6c0ba483dfe9&grant_type=client_credentials";
  1390. var responseString = HttpMethods.HttpPost("http://59.227.93.14:8183/rzpt_edc/rest/oauth2/token", jsonParam);
  1391. Token jo = responseString.ToObject<Token>();
  1392. if (jo.status.code == "1")
  1393. {
  1394. if (!string.IsNullOrEmpty(jo.custom.access_token))
  1395. return jo.custom.access_token;
  1396. else
  1397. return "";
  1398. }
  1399. else
  1400. return "";
  1401. }
  1402. public class Token
  1403. {
  1404. public List<Controls> controls { set; get; }
  1405. public Custom custom { set; get; }
  1406. public Status status { set; get; }
  1407. }
  1408. public class Controls
  1409. {
  1410. }
  1411. public class Custom
  1412. {
  1413. public string access_token { set; get; }
  1414. public string refresh_token { set; get; }
  1415. public string jsessionid { set; get; }
  1416. public string expires_in { set; get; }
  1417. }
  1418. public class Status
  1419. {
  1420. public string code { set; get; }
  1421. }
  1422. public class Push
  1423. {
  1424. public string code { set; get; }
  1425. public string message { set; get; }
  1426. public body body { set; get; }
  1427. }
  1428. public class body
  1429. {
  1430. public errorObjs[] errorObjs { set; get; }
  1431. public string successCount { set; get; }
  1432. public string totalCount { set; get; }
  1433. }
  1434. public class goback
  1435. {
  1436. public string code { set; get; }
  1437. public string message { set; get; }
  1438. }
  1439. public class errorObjs
  1440. {
  1441. public string resturl { set; get; }
  1442. public string errorid { set; get; }
  1443. public string errormsg { set; get; }
  1444. public string caseserial { set; get; }
  1445. }
  1446. }
  1447. }