Aucune description

SatisfactionClose.cs 3.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using CallCenterApi.Model;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace CallCenter.QuartzService
  9. {
  10. public class SatisfactionClose : QuartzJob
  11. {
  12. public SatisfactionClose()
  13. {
  14. CronExpression = "0 0 0 * * ? *";
  15. DoWork += MyWork_DoWork;
  16. }
  17. private readonly CallCenterApi.BLL.T_Bus_WorkOrder workorder = new CallCenterApi.BLL.T_Bus_WorkOrder();
  18. private void MyWork_DoWork(object sender, EventArgs e)
  19. {
  20. string sql = "and F_WorkState = 6 and F_IsSms = 1 and F_IsDelete = 0 and(datediff(dd, (select top 1 RecvTime from T_SMS_RecvSMS where Content = '您反映的诉求已办理完成,请前往安阳政务服务官网(https://zwfw.anyang.gov.cn),登录后查看办结结果并对办理情况进行评价,谢谢' and CallerNum = b.F_CusPhone and F_Name = b.F_WorkOrderId order by RecvTime desc), GETDATE()) >= 15) and F_DealTime is not null";
  21. DataTable dt = new DataTable();
  22. int recordCount = 0;
  23. dt = CallCenterApi.BLL.PagerBLL.GetListPager(
  24. "T_Bus_WorkOrder b WITH(NOLOCK)",
  25. "F_WorkOrderId",
  26. "*",
  27. sql,
  28. "ORDER BY F_CreateTime DESC",
  29. 1000,
  30. 1,
  31. true,
  32. out recordCount);
  33. var now = DateTime.Now;
  34. // var modellist = workorder.GetModelList("F_WorkState =6 and F_IsSms =1 and F_IsDelete =0 and (datediff(hh,F_DealTime ,GETDATE() )>=15) and F_DealTime is not null");
  35. if (dt != null && dt.Rows .Count >0)
  36. {
  37. foreach (DataRow dr in dt.Rows)
  38. {
  39. CallCenterApi.Model.T_Bus_WorkOrder it = new CallCenterApi.Model.T_Bus_WorkOrder();
  40. it = workorder.GetModel(dr["F_WorkOrderId"].ToString());
  41. if (it !=null )
  42. {
  43. it.F_WorkState = 9;
  44. it.F_IsSatisfie = 1;
  45. it.F_IsClosed = 1;
  46. it.F_CloseUser = "";
  47. it.F_CloseTime = DateTime.Now;
  48. it.F_FinalOpinion = "15天自动满意";
  49. it.F_IsStandard = 1;
  50. it.F_StandardIDS = "";
  51. it.F_ToBereply = 0;
  52. workorder.Update(it);
  53. CallCenterApi.Model.T_Bus_Operation oper = new CallCenterApi.Model.T_Bus_Operation();
  54. oper.F_WorkOrderId = it.F_WorkOrderId;
  55. oper.F_State = it.F_WorkState;
  56. oper.F_Message = " 15天未评价自动结案了工单,结果:满意";
  57. oper.F_CreateUser = "8000";
  58. oper.F_CreateTime = DateTime.Now;
  59. oper.F_IsDelete = 0;
  60. new CallCenterApi.BLL.T_Bus_Operation().Add(oper);
  61. }
  62. }
  63. }
  64. }
  65. }
  66. }