using BizCom; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using ThridCore; namespace SiteCore.Handler { public partial class sync { //设计语音通知 接口--------------------------------------------- public void design_notify_voice() { if (UrlPostParmsCheck("tid")) { string tid = GetPostString("tid"); int uid = CurrentUser.UserID; CeErpTradeCell entity = CeErpTradeCell.GetByCtid(tid); if (entity != null) { if (entity.CallTimes >= 3) { returnErrorMsg("请不要使用语音通知太多次!"); return; } if (entity.OrderState >= (int)OrderState.设计中) { string bid = ""; string msg = AliHelper.sendVoice(entity, out bid); if (msg == "") { entity.CallTimes += 1; entity.Update(); CeErpTradeLog.AddLog(tid, entity.OrderState, uid, "发送语音通知!返回ID:" + bid); returnSuccessMsg("语音通知成功!"); return; } else { returnErrorMsg("无法通知!" + msg); return; } } } } returnErrorMsg("无法发送通知!"); } //设计短信通知 接口--------------------------------------------- public void design_notify_sms() { if (UrlPostParmsCheck("tid")) { string tid = GetPostString("tid"); int uid = CurrentUser.UserID; CeErpTradeCell entity = CeErpTradeCell.GetByCtid(tid); if (entity != null) { if (entity.NoteTimes >= 5) { returnErrorMsg("请不要使用短信通知太多次!"); return; } if (entity.OrderState >= (int)OrderState.设计中) { string bid = ""; string msg = AliHelper.sendSms(entity, out bid); if (msg == "") { entity.NoteTimes += 1; entity.Update(); CeErpTradeLog.AddLog(tid, entity.OrderState, uid, "发送短信通知!返回ID:" + bid); returnSuccessMsg("短信通知成功!"); return; } else { returnErrorMsg("无法通知!" + msg); return; } } } } returnErrorMsg("无法发送通知!"); } } }