|
@@ -31,6 +31,7 @@ using OASystem.Domain.Entities.Customer;
|
|
|
using OASystem.Domain.Entities.Financial;
|
|
|
using OASystem.Domain.Entities.Groups;
|
|
|
using OASystem.Domain.ViewModels;
|
|
|
+using OASystem.Domain.ViewModels.Financial;
|
|
|
using OASystem.Domain.ViewModels.Groups;
|
|
|
using OASystem.Domain.ViewModels.Statistics;
|
|
|
using OASystem.Infrastructure.Repositories.CRM;
|
|
@@ -7279,6 +7280,38 @@ FROM
|
|
|
return Ok(JsonView(true, "查询成功!", data, total));
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 团组模块 - 出入境费用-移动端 - 其他项 - 币种基础数据Data
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> PostEnterExitCostMobileOtherItemCurrencyData(PostEnterExitCostMobileOtherItemCurrencyDataDto dto)
|
|
|
+ {
|
|
|
+ if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
+ if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
+
|
|
|
+ var groupRateData = await GeneralMethod.PostGroupTeamRateByDiIdAndCTableId(dto.PortType, dto.DiId, 98);
|
|
|
+
|
|
|
+ if (groupRateData == null) return Ok(JsonView(false, "请填写“团组汇率-->其他款项”汇率!"));
|
|
|
+ var groupOtherRateData = groupRateData.TeamRates;
|
|
|
+
|
|
|
+ var enterExitCostInfo = await _sqlSugar.Queryable<Grp_EnterExitCost>().FirstAsync(it => it.DiId == dto.DiId && it.IsDel == 0);
|
|
|
+ if (enterExitCostInfo == null) return Ok(JsonView(groupOtherRateData));
|
|
|
+ var eecRateData = (List<CurrencyInfo>?)CommonFun.GetCurrencyChinaToList(enterExitCostInfo.CurrencyRemark);
|
|
|
+
|
|
|
+ groupOtherRateData = groupOtherRateData
|
|
|
+ .Select(x => new TeamRateDescAddCurrencyIdView {
|
|
|
+ CurrencyId = x.CurrencyId,
|
|
|
+ CurrencyName = x.CurrencyName,
|
|
|
+ CurrencyCode = x.CurrencyCode,
|
|
|
+ Rate = eecRateData.Find(it => it.CurrencyCode.ToUpper().Equals(x.CurrencyCode.ToUpper()))?.Rate ?? x.Rate
|
|
|
+
|
|
|
+ }).ToList();
|
|
|
+
|
|
|
+ return Ok(JsonView(true, "查询成功!", groupOtherRateData));
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 团组模块 - 出入境费用-移动端 - 实时汇率、签证费用、机票费用 Tips
|
|
|
/// </summary>
|
|
@@ -7397,6 +7430,40 @@ FROM
|
|
|
|
|
|
#region op
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 移动端更新费用消息通知
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="diid"></param>
|
|
|
+ /// <param name="id"></param>
|
|
|
+ /// <param name="currUserId"></param>
|
|
|
+ private async Task EnterExitCostMobileOpNotice(int diid, int id,int currUserId)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ ////生成默认文件pdf并且通知人员
|
|
|
+ //var fileView = await GeneralMethod.EnterExitCostDownload(new EnterExitCostDownloadDto()
|
|
|
+ //{
|
|
|
+ // DiId = diid,
|
|
|
+ // ExportType = 1,
|
|
|
+ // SubTypeId = 1005
|
|
|
+ //}, "pdf");
|
|
|
+
|
|
|
+ ////发送通知
|
|
|
+ //string fileUrl = (string)fileView.Data.GetType().GetProperty("Url").GetValue(fileView.Data, null);
|
|
|
+ //string md5Sign = GeneralMethod.Encrypt($"{id}&fileName={fileUrl}");
|
|
|
+ //string url = string.Format("http://oa.pan-american-intl.com:4399/#/Sankunginfo?sign={0}&fileName={1}", id, fileUrl);
|
|
|
+ //await AppNoticeLibrary.SendUserMsg_GroupShare_ToGM(diid, new List<string>() { "208", "233", "21" }, currUserId, url);
|
|
|
+ ////汇率信息记录
|
|
|
+ //await GeneralMethod.RateRecordSave(currUserId, id, "出入境费用");
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ //记录日志
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 团组模块 - 出入境费用-移动端 - OP --> 汇率
|
|
|
/// </summary>
|
|
@@ -7416,6 +7483,7 @@ FROM
|
|
|
var add = await _sqlSugar.Insertable(new Grp_EnterExitCost() { CurrencyRemark = currencyStr, CreateUserId = dto.CurrUserId }).ExecuteCommandAsync();
|
|
|
|
|
|
if (add < 1) return Ok(JsonView(false));
|
|
|
+ id = add;
|
|
|
}
|
|
|
else //update
|
|
|
{
|
|
@@ -7423,7 +7491,6 @@ FROM
|
|
|
if (upd < 1) return Ok(JsonView(false));
|
|
|
}
|
|
|
|
|
|
- //todo:
|
|
|
#region 汇率变更时更改币种相关费用
|
|
|
var opDayCosts = new List<Grp_DayAndCost>();
|
|
|
var opDayOtherCosts = new List<Grp_DayOtherPrice>();
|
|
@@ -7504,6 +7571,9 @@ FROM
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+ //消息通知
|
|
|
+ await EnterExitCostMobileOpNotice(dto.DiId, id,dto.CurrUserId);
|
|
|
+
|
|
|
return Ok(JsonView(true));
|
|
|
}
|
|
|
|
|
@@ -7574,6 +7644,7 @@ FROM
|
|
|
var add = await _sqlSugar.Insertable(info).ExecuteCommandAsync();
|
|
|
|
|
|
if (add < 1) return Ok(JsonView(false));
|
|
|
+ id = add;
|
|
|
}
|
|
|
else //update
|
|
|
{
|
|
@@ -7593,6 +7664,10 @@ FROM
|
|
|
if (upd < 1) return Ok(JsonView(false));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ //消息通知
|
|
|
+ await EnterExitCostMobileOpNotice(dto.DiId, id, dto.CurrUserId);
|
|
|
+
|
|
|
return Ok(JsonView(new { itemTotal = info.InsidePay }));
|
|
|
}
|
|
|
|
|
@@ -7618,7 +7693,7 @@ FROM
|
|
|
var addInfo = await _sqlSugar.Insertable(info).ExecuteReturnEntityAsync();
|
|
|
|
|
|
if (addInfo == null) return Ok(JsonView(false));
|
|
|
-
|
|
|
+ id = addInfo.Id;
|
|
|
}
|
|
|
else //update
|
|
|
{
|
|
@@ -7642,6 +7717,9 @@ FROM
|
|
|
gwcItemTotal = info.AirGW + info.CityTranffic;
|
|
|
tdcItemTotal = info.AirTD + info.CityTranffic;
|
|
|
|
|
|
+ //消息通知
|
|
|
+ await EnterExitCostMobileOpNotice(dto.DiId, id, dto.CurrUserId);
|
|
|
+
|
|
|
return Ok(JsonView(new { jjcItemTotal = jjcItemTotal, gwcItemTotal = gwcItemTotal, tdcItemTotal = tdcItemTotal }));
|
|
|
}
|
|
|
|
|
@@ -7682,6 +7760,7 @@ FROM
|
|
|
{
|
|
|
var add = await _sqlSugar.Insertable(adds).ExecuteCommandAsync();
|
|
|
if (add < 1) return Ok(JsonView(false));
|
|
|
+
|
|
|
}
|
|
|
if (upds.Count > 0)
|
|
|
{
|
|
@@ -7699,7 +7778,12 @@ FROM
|
|
|
if (upd < 1) return Ok(JsonView(false));
|
|
|
}
|
|
|
|
|
|
- var itemTotal = await _sqlSugar.Queryable<Grp_DayAndCost>().Where(x => x.IsDel == 0 && x.DiId == dto.DiId && x.Type == dto.FeeType).SumAsync(x => x.SubTotal);
|
|
|
+ var itemTotal = _sqlSugar.Queryable<Grp_DayAndCost>().Where(x => x.IsDel == 0 && x.DiId == dto.DiId && x.Type == dto.FeeType).Sum(x => x.SubTotal);
|
|
|
+
|
|
|
+ //消息通知
|
|
|
+ var id = _sqlSugar.Queryable<Grp_EnterExitCost>().Where(x => x.IsDel == 0 && x.DiId == dto.DiId).First()?.Id ?? 0;
|
|
|
+ await EnterExitCostMobileOpNotice(dto.DiId, id, dto.CurrUserId);
|
|
|
+
|
|
|
return Ok(JsonView(new { itemTotal = itemTotal }));
|
|
|
}
|
|
|
|
|
@@ -7741,7 +7825,12 @@ FROM
|
|
|
if (upd < 1) return Ok(JsonView(false));
|
|
|
}
|
|
|
|
|
|
- var itemTotal = await _sqlSugar.Queryable<Grp_DayAndCost>().Where(x => x.IsDel == 0 && x.DiId == dto.DiId && x.Type == dto.FeeType).SumAsync(x => x.SubTotal);
|
|
|
+ var itemTotal = _sqlSugar.Queryable<Grp_DayAndCost>().Where(x => x.IsDel == 0 && x.DiId == dto.DiId && x.Type == dto.FeeType).Sum(x => x.SubTotal);
|
|
|
+
|
|
|
+ //消息通知
|
|
|
+ var id = _sqlSugar.Queryable<Grp_EnterExitCost>().Where(x => x.IsDel == 0 && x.DiId == dto.DiId).First()?.Id ?? 0;
|
|
|
+ await EnterExitCostMobileOpNotice(dto.DiId, id, dto.CurrUserId);
|
|
|
+
|
|
|
return Ok(JsonView(new { itemTotal = itemTotal }));
|
|
|
}
|
|
|
|
|
@@ -7796,7 +7885,10 @@ FROM
|
|
|
if (upd < 1) return Ok(JsonView(false));
|
|
|
}
|
|
|
|
|
|
- var itemTotal = await _sqlSugar.Queryable<Grp_DayOtherPrice>().Where(x => x.IsDel == 0 && x.Diid == dto.DiId).SumAsync(x => x.SubTotal);
|
|
|
+ var itemTotal = _sqlSugar.Queryable<Grp_DayOtherPrice>().Where(x => x.IsDel == 0 && x.Diid == dto.DiId).Sum(x => x.SubTotal);
|
|
|
+ //消息通知
|
|
|
+ var id = _sqlSugar.Queryable<Grp_EnterExitCost>().Where(x => x.IsDel == 0 && x.DiId == dto.DiId).First()?.Id ?? 0;
|
|
|
+ await EnterExitCostMobileOpNotice(dto.DiId, id, dto.CurrUserId);
|
|
|
return Ok(JsonView(new { itemTotal = itemTotal }));
|
|
|
}
|
|
|
|
|
@@ -7837,7 +7929,12 @@ FROM
|
|
|
if (upd < 1) return Ok(JsonView(false));
|
|
|
}
|
|
|
|
|
|
- var itemTotal = await _sqlSugar.Queryable<Grp_DayOtherPrice>().Where(x => x.IsDel == 0 && x.Diid == dto.DiId).SumAsync(x => x.SubTotal);
|
|
|
+ var itemTotal = _sqlSugar.Queryable<Grp_DayOtherPrice>().Where(x => x.IsDel == 0 && x.Diid == dto.DiId).Sum(x => x.SubTotal);
|
|
|
+
|
|
|
+ //消息通知
|
|
|
+ var id = _sqlSugar.Queryable<Grp_EnterExitCost>().Where(x => x.IsDel == 0 && x.DiId == dto.DiId).First()?.Id ?? 0;
|
|
|
+ await EnterExitCostMobileOpNotice(dto.DiId, id, dto.CurrUserId);
|
|
|
+
|
|
|
return Ok(JsonView(new { itemTotal = itemTotal }));
|
|
|
}
|
|
|
|