sync.design.cs 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. using BizCom;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using ThridCore;
  8. namespace SiteCore.Handler
  9. {
  10. public partial class sync
  11. {
  12. //设计语音通知 接口---------------------------------------------
  13. public void design_notify_voice()
  14. {
  15. if (UrlPostParmsCheck("tid"))
  16. {
  17. string tid = GetPostString("tid");
  18. int uid = CurrentUser.UserID;
  19. CeErpTradeCell entity = CeErpTradeCell.GetByCtid(tid);
  20. if (entity != null)
  21. {
  22. if (entity.CallTimes >= 3)
  23. {
  24. returnErrorMsg("请不要使用语音通知太多次!");
  25. return;
  26. }
  27. if (entity.OrderState >= (int)OrderState.设计中)
  28. {
  29. string bid = "";
  30. string msg = AliHelper.sendVoice(entity, out bid);
  31. if (msg == "")
  32. {
  33. entity.CallTimes += 1;
  34. entity.Update();
  35. CeErpTradeLog.AddLog(tid, entity.OrderState, uid, "发送语音通知!返回ID:" + bid);
  36. returnSuccessMsg("语音通知成功!");
  37. return;
  38. }
  39. else
  40. {
  41. returnErrorMsg("无法通知!" + msg);
  42. return;
  43. }
  44. }
  45. }
  46. }
  47. returnErrorMsg("无法发送通知!");
  48. }
  49. //设计短信通知 接口---------------------------------------------
  50. public void design_notify_sms()
  51. {
  52. if (UrlPostParmsCheck("tid"))
  53. {
  54. string tid = GetPostString("tid");
  55. int uid = CurrentUser.UserID;
  56. CeErpTradeCell entity = CeErpTradeCell.GetByCtid(tid);
  57. if (entity != null)
  58. {
  59. if (entity.NoteTimes >= 5)
  60. {
  61. returnErrorMsg("请不要使用短信通知太多次!");
  62. return;
  63. }
  64. if (entity.OrderState >= (int)OrderState.设计中)
  65. {
  66. string bid = "";
  67. string msg = AliHelper.sendSms(entity, out bid);
  68. if (msg == "")
  69. {
  70. entity.NoteTimes += 1;
  71. entity.Update();
  72. CeErpTradeLog.AddLog(tid, entity.OrderState, uid, "发送短信通知!返回ID:" + bid);
  73. returnSuccessMsg("短信通知成功!");
  74. return;
  75. }
  76. else
  77. {
  78. returnErrorMsg("无法通知!" + msg);
  79. return;
  80. }
  81. }
  82. }
  83. }
  84. returnErrorMsg("无法发送通知!");
  85. }
  86. }
  87. }