Bez popisu

Peoplewebsite.cs 73KB

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