提升接口速度
This commit is contained in:
@@ -83,9 +83,9 @@ namespace Appointment.Api.Controllers
|
|||||||
/// <param name="req"></param>
|
/// <param name="req"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("Add")]
|
[HttpPost("Add")]
|
||||||
public ApiResult Add(ApptSummaryReq req)
|
public async Task<ApiResult> Add(ApptSummaryReq req)
|
||||||
{
|
{
|
||||||
return _ApptRepo.Add(req);
|
return await _ApptRepo.Add(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -94,9 +94,9 @@ namespace Appointment.Api.Controllers
|
|||||||
/// <param name="req"></param>
|
/// <param name="req"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("ApptAudit")]
|
[HttpPost("ApptAudit")]
|
||||||
public ApiResult ApptAudit(ApptAuditReq req)
|
public async Task<ApiResult> ApptAudit(ApptAuditReq req)
|
||||||
{
|
{
|
||||||
return _ApptRepo.ApptAudit(req);
|
return await _ApptRepo.ApptAudit(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("CancelAudit")]
|
[HttpPost("CancelAudit")]
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Appointment.IRepository
|
namespace Appointment.IRepository
|
||||||
{
|
{
|
||||||
@@ -46,7 +47,7 @@ namespace Appointment.IRepository
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="req"></param>
|
/// <param name="req"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
ApiResult Add(ApptSummaryReq req);
|
Task<ApiResult> Add(ApptSummaryReq req);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 删除主单或详情
|
/// 删除主单或详情
|
||||||
@@ -60,7 +61,7 @@ namespace Appointment.IRepository
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="req"></param>
|
/// <param name="req"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public ApiResult ApptAudit(ApptAuditReq req);
|
Task<ApiResult> ApptAudit(ApptAuditReq req);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 取消预订
|
/// 取消预订
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ namespace Appointment.Repository
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="req"></param>
|
/// <param name="req"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public ApiResult Add(ApptSummaryReq req)
|
public async Task<ApiResult> Add(ApptSummaryReq req)
|
||||||
{
|
{
|
||||||
DateTime now = DateTime.Now;
|
DateTime now = DateTime.Now;
|
||||||
|
|
||||||
@@ -654,7 +654,7 @@ namespace Appointment.Repository
|
|||||||
Remark = "自动"
|
Remark = "自动"
|
||||||
};
|
};
|
||||||
InsertReturnId(auditLog);
|
InsertReturnId(auditLog);
|
||||||
return InAppt(summaryId);
|
return await InAppt(summaryId);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -729,7 +729,7 @@ namespace Appointment.Repository
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="req"></param>
|
/// <param name="req"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public ApiResult ApptAudit(ApptAuditReq req)
|
public async Task<ApiResult> ApptAudit(ApptAuditReq req)
|
||||||
{
|
{
|
||||||
var loginUserRes = BaseRepo.DECLoginInfo(req.AccountDES);
|
var loginUserRes = BaseRepo.DECLoginInfo(req.AccountDES);
|
||||||
if (!loginUserRes.IsSuccess) return ApiResult.Failed(loginUserRes.Msg);
|
if (!loginUserRes.IsSuccess) return ApiResult.Failed(loginUserRes.Msg);
|
||||||
@@ -758,7 +758,7 @@ namespace Appointment.Repository
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return InAppt(req.ApptId);
|
return await InAppt(req.ApptId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1420,7 +1420,7 @@ namespace Appointment.Repository
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private ApiResult InAppt(int id)
|
private async Task<ApiResult> InAppt(int id)
|
||||||
{
|
{
|
||||||
var appt = GetDataModel(id);
|
var appt = GetDataModel(id);
|
||||||
if (!appt.IsSuccess) return ApiResult.Failed(appt.Msg);
|
if (!appt.IsSuccess) return ApiResult.Failed(appt.Msg);
|
||||||
@@ -1431,7 +1431,7 @@ namespace Appointment.Repository
|
|||||||
|
|
||||||
|
|
||||||
DateTime now = DateTime.Now;
|
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();
|
var user = userList.Where(t => t.OpId == appt.Info.UserId).FirstOrDefault();
|
||||||
if (user == null && user.Locked == "T") return ApiResult.Failed("生成正式预订失败,提交人不存在!");
|
if (user == null && user.Locked == "T") return ApiResult.Failed("生成正式预订失败,提交人不存在!");
|
||||||
@@ -1709,7 +1709,7 @@ namespace Appointment.Repository
|
|||||||
});
|
});
|
||||||
if (!string.IsNullOrEmpty(item.WxServiceId))
|
if (!string.IsNullOrEmpty(item.WxServiceId))
|
||||||
{
|
{
|
||||||
SetCopyMsg(item.WxServiceId);
|
_ = SetCopyMsg(item.WxServiceId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
InsertRange(apptAuditLogs);
|
InsertRange(apptAuditLogs);
|
||||||
@@ -1879,10 +1879,11 @@ namespace Appointment.Repository
|
|||||||
/// 抄送 消息模板
|
/// 抄送 消息模板
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="wxSericeOpenId">接收人程序openid</param>
|
/// <param name="wxSericeOpenId">接收人程序openid</param>
|
||||||
private void SetCopyMsg(string wxSericeOpenId)
|
private async Task<ApiResult> SetCopyMsg(string wxSericeOpenId)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
await Task.Delay(1);
|
||||||
string AppId = BaseConfig.App(new string[] { "WeChatService", "AppId" });
|
string AppId = BaseConfig.App(new string[] { "WeChatService", "AppId" });
|
||||||
if (AppId == "wx3f193488e04b2ed8")
|
if (AppId == "wx3f193488e04b2ed8")
|
||||||
{
|
{
|
||||||
@@ -1925,6 +1926,8 @@ namespace Appointment.Repository
|
|||||||
{
|
{
|
||||||
_logger.Error(ex.ToString());
|
_logger.Error(ex.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ApiResult.Success(string.Empty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4526,7 +4526,7 @@ namespace Appointment.Repository
|
|||||||
});
|
});
|
||||||
if (!string.IsNullOrEmpty(item.WxServiceId))
|
if (!string.IsNullOrEmpty(item.WxServiceId))
|
||||||
{
|
{
|
||||||
_ = await SetCopyMsg(createUserName, summary.BuyerTitle, item.WxServiceId, true, "");
|
_ = SetCopyMsg(createUserName, summary.BuyerTitle, item.WxServiceId, true, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
InsertRange(apptAuditLogs);
|
InsertRange(apptAuditLogs);
|
||||||
|
|||||||
Reference in New Issue
Block a user