|
@@ -692,27 +692,31 @@ namespace OASystem.API.Controllers
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> GroupOperation(GroupOperationDto dto)
|
|
|
{
|
|
|
- try
|
|
|
+ // 创建 Stopwatch 实例
|
|
|
+ Stopwatch stopwatch = Stopwatch.StartNew();
|
|
|
+
|
|
|
+ decimal ffrPrice = 0.00M;
|
|
|
+ DateTime? visitDt = null;
|
|
|
+ if (dto.Status == 2)
|
|
|
{
|
|
|
- decimal ffrPrice = 0.00M;
|
|
|
- DateTime? visitDt = null;
|
|
|
- if (dto.Status == 2)
|
|
|
+ var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().FirstAsync(x => x.Id == dto.Id && x.IsDel == 0);
|
|
|
+ if (groupInfo != null)
|
|
|
{
|
|
|
- var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().FirstAsync(x => x.Id == dto.Id && x.IsDel == 0);
|
|
|
- if (groupInfo != null)
|
|
|
- {
|
|
|
- ffrPrice = groupInfo.PaymentMoney;
|
|
|
- visitDt = groupInfo.VisitDate.AddDays(-groupInfo.PayDay);
|
|
|
- }
|
|
|
+ ffrPrice = groupInfo.PaymentMoney;
|
|
|
+ visitDt = groupInfo.VisitDate.AddDays(-groupInfo.PayDay);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- var groupData = await _groupRepository.GroupOperation(dto);
|
|
|
- if (groupData.Code != 0)
|
|
|
- {
|
|
|
- return Ok(JsonView(false, groupData.Msg));
|
|
|
- }
|
|
|
+ var groupData = await _groupRepository.GroupOperation(dto);
|
|
|
+ if (groupData.Code != 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, groupData.Msg));
|
|
|
+ }
|
|
|
+ int diId = 0;
|
|
|
+ try
|
|
|
+ {
|
|
|
|
|
|
- int diId = 0;
|
|
|
+
|
|
|
//添加时 默认加入团组汇率
|
|
|
if (dto.Status == 1) //添加
|
|
|
{
|
|
@@ -763,10 +767,7 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
- if (diId > 0)
|
|
|
- {
|
|
|
- await AppNoticeLibrary.SendUserMsg_GroupTimeInfo_ToVisaUser(diId, startTime.ToString("yyyy-MM-dd"), endTime.ToString("yyyy-MM-dd"));
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
#endregion
|
|
|
|
|
@@ -820,15 +821,33 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- return Ok(JsonView(true, "操作成功!", diId));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (diId > 0)
|
|
|
+ {
|
|
|
+ await AppNoticeLibrary.SendUserMsg_GroupTimeInfo_ToVisaUser(diId, startTime.ToString("yyyy-MM-dd"), endTime.ToString("yyyy-MM-dd"));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 停止计时
|
|
|
+ stopwatch.Stop();
|
|
|
+
|
|
|
+ return Ok(JsonView(true, $"操作成功!{stopwatch.ElapsedMilliseconds}ms", diId));
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
-
|
|
|
+ // 停止计时
|
|
|
+ stopwatch.Stop();
|
|
|
Logs("[response]" + JsonConvert.SerializeObject(dto));
|
|
|
Logs(ex.Message);
|
|
|
- return Ok(JsonView(false, ex.Message));
|
|
|
+ //return Ok(JsonView(false, $"{ex.Message}[{stopwatch.ElapsedMilliseconds}ms]"));
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ // 停止计时
|
|
|
+ stopwatch.Stop();
|
|
|
+
|
|
|
+ return Ok(JsonView(true, $"操作成功!{stopwatch.ElapsedMilliseconds}ms", diId));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|