提升接口速度
This commit is contained in:
@@ -282,7 +282,7 @@ namespace Appointment.Repository
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
public ApiResult Add(ApptSummaryReq req)
|
||||
public async Task<ApiResult> Add(ApptSummaryReq req)
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
|
||||
@@ -654,7 +654,7 @@ namespace Appointment.Repository
|
||||
Remark = "自动"
|
||||
};
|
||||
InsertReturnId(auditLog);
|
||||
return InAppt(summaryId);
|
||||
return await InAppt(summaryId);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -729,7 +729,7 @@ namespace Appointment.Repository
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
/// <returns></returns>
|
||||
public ApiResult ApptAudit(ApptAuditReq req)
|
||||
public async Task<ApiResult> ApptAudit(ApptAuditReq req)
|
||||
{
|
||||
var loginUserRes = BaseRepo.DECLoginInfo(req.AccountDES);
|
||||
if (!loginUserRes.IsSuccess) return ApiResult.Failed(loginUserRes.Msg);
|
||||
@@ -758,7 +758,7 @@ namespace Appointment.Repository
|
||||
}
|
||||
else
|
||||
{
|
||||
return InAppt(req.ApptId);
|
||||
return await InAppt(req.ApptId);
|
||||
}
|
||||
|
||||
|
||||
@@ -1420,7 +1420,7 @@ namespace Appointment.Repository
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
private ApiResult InAppt(int id)
|
||||
private async Task<ApiResult> InAppt(int id)
|
||||
{
|
||||
var appt = GetDataModel(id);
|
||||
if (!appt.IsSuccess) return ApiResult.Failed(appt.Msg);
|
||||
@@ -1431,7 +1431,7 @@ namespace Appointment.Repository
|
||||
|
||||
|
||||
DateTime now = DateTime.Now;
|
||||
var userList = Db.Queryable<UcLogin>().ToList().Replace();
|
||||
var userList =await Db.Queryable<UcLogin>().ToListAsync().Replace();
|
||||
|
||||
var user = userList.Where(t => t.OpId == appt.Info.UserId).FirstOrDefault();
|
||||
if (user == null && user.Locked == "T") return ApiResult.Failed("生成正式预订失败,提交人不存在!");
|
||||
@@ -1709,7 +1709,7 @@ namespace Appointment.Repository
|
||||
});
|
||||
if (!string.IsNullOrEmpty(item.WxServiceId))
|
||||
{
|
||||
SetCopyMsg(item.WxServiceId);
|
||||
_ = SetCopyMsg(item.WxServiceId);
|
||||
}
|
||||
}
|
||||
InsertRange(apptAuditLogs);
|
||||
@@ -1879,10 +1879,11 @@ namespace Appointment.Repository
|
||||
/// 抄送 消息模板
|
||||
/// </summary>
|
||||
/// <param name="wxSericeOpenId">接收人程序openid</param>
|
||||
private void SetCopyMsg(string wxSericeOpenId)
|
||||
private async Task<ApiResult> SetCopyMsg(string wxSericeOpenId)
|
||||
{
|
||||
try
|
||||
{
|
||||
await Task.Delay(1);
|
||||
string AppId = BaseConfig.App(new string[] { "WeChatService", "AppId" });
|
||||
if (AppId == "wx3f193488e04b2ed8")
|
||||
{
|
||||
@@ -1925,6 +1926,8 @@ namespace Appointment.Repository
|
||||
{
|
||||
_logger.Error(ex.ToString());
|
||||
}
|
||||
|
||||
return ApiResult.Success(string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user