|
@@ -42,6 +42,7 @@ using System.Globalization;
|
|
|
using System.IO.Compression;
|
|
using System.IO.Compression;
|
|
|
using static OASystem.API.OAMethodLib.JWTHelper;
|
|
using static OASystem.API.OAMethodLib.JWTHelper;
|
|
|
using static OASystem.Infrastructure.Repositories.Groups.AirTicketResRepository;
|
|
using static OASystem.Infrastructure.Repositories.Groups.AirTicketResRepository;
|
|
|
|
|
+using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
|
|
|
using Bookmark = Aspose.Words.Bookmark;
|
|
using Bookmark = Aspose.Words.Bookmark;
|
|
|
using Cell = Aspose.Words.Tables.Cell;
|
|
using Cell = Aspose.Words.Tables.Cell;
|
|
|
using Table = Aspose.Words.Tables.Table;
|
|
using Table = Aspose.Words.Tables.Table;
|
|
@@ -9028,12 +9029,13 @@ FROM
|
|
|
|
|
|
|
|
//默认币种显示
|
|
//默认币种显示
|
|
|
var _currencyInfos = await EnterExitCostMobileGetCurrencyInit();
|
|
var _currencyInfos = await EnterExitCostMobileGetCurrencyInit();
|
|
|
-
|
|
|
|
|
|
|
+ var viewPermissionData = await _enterExitCostRep.PermissionViewUsersAsync();
|
|
|
return Ok(JsonView(true, "查询成功!", new
|
|
return Ok(JsonView(true, "查询成功!", new
|
|
|
{
|
|
{
|
|
|
WordTypeData = _WordTypeData,
|
|
WordTypeData = _WordTypeData,
|
|
|
ExcelTypeData = _ExcelTypeData,
|
|
ExcelTypeData = _ExcelTypeData,
|
|
|
- CurrencyInit = _currencyInfos
|
|
|
|
|
|
|
+ CurrencyInit = _currencyInfos,
|
|
|
|
|
+ viewPermissionData = viewPermissionData
|
|
|
}));
|
|
}));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -9046,21 +9048,71 @@ FROM
|
|
|
public async Task<IActionResult> EnterExitCostMobileGroupData(PostEnterExitCostMobileGroupDataDto dto)
|
|
public async Task<IActionResult> EnterExitCostMobileGroupData(PostEnterExitCostMobileGroupDataDto dto)
|
|
|
{
|
|
{
|
|
|
if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
|
|
+ if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
|
|
|
|
|
RefAsync<int> total = 0;
|
|
RefAsync<int> total = 0;
|
|
|
|
|
|
|
|
int diId = 0;
|
|
int diId = 0;
|
|
|
var status = int.TryParse(dto.GroupName, out diId);
|
|
var status = int.TryParse(dto.GroupName, out diId);
|
|
|
|
|
|
|
|
- var data = await _sqlSugar.Queryable<Grp_DelegationInfo>()
|
|
|
|
|
- .Where(x => x.IsDel == 0 && !string.IsNullOrEmpty(x.TeamName))
|
|
|
|
|
|
|
+ string sql = string.Format(@"SELECT
|
|
|
|
|
+ Id,
|
|
|
|
|
+ TeamName GroupName,
|
|
|
|
|
+ CASE WHEN EXISTS (
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ 1
|
|
|
|
|
+ FROM
|
|
|
|
|
+ Grp_EnterExitCost
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ IsDel = 0
|
|
|
|
|
+ AND DiId = di.Id
|
|
|
|
|
+ ) THEN 1 ELSE 0 END AS [IsNull],
|
|
|
|
|
+ CASE WHEN EXISTS(
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ TOP 1 *
|
|
|
|
|
+ FROM
|
|
|
|
|
+ Grp_EnterExitCost
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ IsDel = 0
|
|
|
|
|
+ AND DiId = di.Id
|
|
|
|
|
+ AND CreateUserId = {0}
|
|
|
|
|
+ ORDER BY
|
|
|
|
|
+ CreateTime DESC
|
|
|
|
|
+ ) THEN 1 ELSE 0 END AS [IsEdit],
|
|
|
|
|
+ CASE WHEN EXISTS(
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ TOP 1 *
|
|
|
|
|
+ FROM
|
|
|
|
|
+ Grp_EnterExitCost
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ IsDel = 0
|
|
|
|
|
+ AND DiId = di.Id
|
|
|
|
|
+ AND CreateUserId = {0}
|
|
|
|
|
+ ORDER BY
|
|
|
|
|
+ CreateTime DESC
|
|
|
|
|
+ ) THEN 1 WHEN EXISTS(
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ TOP 1 *
|
|
|
|
|
+ FROM
|
|
|
|
|
+ Grp_EnterExitCostPermission
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ IsDel = 0
|
|
|
|
|
+ AND GroupId = di.Id
|
|
|
|
|
+ AND Permission = 1
|
|
|
|
|
+ AND UserId = {0}
|
|
|
|
|
+ ORDER BY
|
|
|
|
|
+ CreateTime DESC
|
|
|
|
|
+ ) THEN 1 ELSE 0 END AS [IsView]
|
|
|
|
|
+FROM
|
|
|
|
|
+ Grp_DelegationInfo di
|
|
|
|
|
+WHERE
|
|
|
|
|
+ di.Isdel = 0 ",dto.CurrUserId);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ var data = await _sqlSugar.SqlQueryable<EnterExitCostMobileGroupView>(sql)
|
|
|
|
|
+ .Where(x => !string.IsNullOrEmpty(x.GroupName))
|
|
|
.WhereIF(!string.IsNullOrEmpty(dto.GroupName) && diId > 0, x => x.Id == diId)
|
|
.WhereIF(!string.IsNullOrEmpty(dto.GroupName) && diId > 0, x => x.Id == diId)
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.GroupName) && !status, x => x.TeamName.Contains(dto.GroupName))
|
|
|
|
|
- .Select(x => new
|
|
|
|
|
- {
|
|
|
|
|
- Id = x.Id,
|
|
|
|
|
- GroupName = x.TeamName
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.GroupName) && !status, x => x.GroupName.Contains(dto.GroupName))
|
|
|
.OrderByDescending(x => x.Id)
|
|
.OrderByDescending(x => x.Id)
|
|
|
.ToPageListAsync(dto.PageIndex, dto.PageSize, total);
|
|
.ToPageListAsync(dto.PageIndex, dto.PageSize, total);
|
|
|
|
|
|
|
@@ -9253,6 +9305,7 @@ FROM
|
|
|
{
|
|
{
|
|
|
if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
|
|
+ if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
|
|
|
|
|
var eecInfo = await _sqlSugar.Queryable<Grp_EnterExitCost>().OrderByDescending(x => x.CreateTime).FirstAsync(it => it.DiId == dto.DiId && it.IsDel == 0);
|
|
var eecInfo = await _sqlSugar.Queryable<Grp_EnterExitCost>().OrderByDescending(x => x.CreateTime).FirstAsync(it => it.DiId == dto.DiId && it.IsDel == 0);
|
|
|
|
|
|
|
@@ -9260,10 +9313,10 @@ FROM
|
|
|
mobileInfo.DiId = dto.DiId;
|
|
mobileInfo.DiId = dto.DiId;
|
|
|
mobileInfo.Currencys = await EnterExitCostMobileGetCurrencyInit();
|
|
mobileInfo.Currencys = await EnterExitCostMobileGetCurrencyInit();
|
|
|
if (eecInfo == null) return Ok(mobileInfo);
|
|
if (eecInfo == null) return Ok(mobileInfo);
|
|
|
- //验证查看、操作权限
|
|
|
|
|
- // var isView = await _enterExitCostRep.vi
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
+ //验证查看权限
|
|
|
|
|
+ (bool isView, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.DiId, dto.CurrUserId);
|
|
|
|
|
+ if (!isView) return Ok(JsonView(false, msg));
|
|
|
|
|
|
|
|
mobileInfo = _mapper.Map<EnterExitCostMobileParentInfoView>(eecInfo);
|
|
mobileInfo = _mapper.Map<EnterExitCostMobileParentInfoView>(eecInfo);
|
|
|
|
|
|
|
@@ -9320,6 +9373,32 @@ FROM
|
|
|
return Ok(mobileInfo);
|
|
return Ok(mobileInfo);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 团组模块 - 出入境费用-移动端 - 查看权限用户
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <returns></returns>
|
|
|
|
|
+ [HttpPost]
|
|
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
|
+ public async Task<IActionResult> EnterExitCostMobileViewPermissionUsers(EnterExitCostMobileViewPermissionUsersDto dto)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
|
|
+ if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
|
|
+
|
|
|
|
|
+ //验证查看权限
|
|
|
|
|
+ (bool isView, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.DiId, dto.CurrUserId);
|
|
|
|
|
+ if (!isView) return Ok(JsonView(false, msg));
|
|
|
|
|
+
|
|
|
|
|
+ var userIds = Array.Empty<int>();
|
|
|
|
|
+
|
|
|
|
|
+ userIds = await _sqlSugar
|
|
|
|
|
+ .Queryable<Grp_EnterExitCostPermission>()
|
|
|
|
|
+ .Where(x => x.IsDel == 0 && x.GroupId == dto.DiId)
|
|
|
|
|
+ .Select(x => x.UserId)
|
|
|
|
|
+ .ToArrayAsync();
|
|
|
|
|
+
|
|
|
|
|
+ return Ok(userIds);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// 团组模块 - 出入境费用-移动端 - SubInfo
|
|
/// 团组模块 - 出入境费用-移动端 - SubInfo
|
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -9330,10 +9409,16 @@ FROM
|
|
|
{
|
|
{
|
|
|
if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
|
|
+ if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
|
|
|
|
|
var subTypes = new List<int>() { 1, 2, 3, 4, 5, 6, 7 };
|
|
var subTypes = new List<int>() { 1, 2, 3, 4, 5, 6, 7 };
|
|
|
if (!subTypes.Contains(dto.SubType)) return Ok(JsonView(false, $"请传入有效的subTypeId!"));
|
|
if (!subTypes.Contains(dto.SubType)) return Ok(JsonView(false, $"请传入有效的subTypeId!"));
|
|
|
|
|
|
|
|
|
|
+ //验证查看权限
|
|
|
|
|
+ (bool isView, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.DiId, dto.CurrUserId);
|
|
|
|
|
+ if (!isView) return Ok(JsonView(false, msg));
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
var eecInfo = await _sqlSugar.Queryable<Grp_EnterExitCost>().OrderByDescending(x => x.CreateTime).FirstAsync(it => it.DiId == dto.DiId && it.IsDel == 0);
|
|
var eecInfo = await _sqlSugar.Queryable<Grp_EnterExitCost>().OrderByDescending(x => x.CreateTime).FirstAsync(it => it.DiId == dto.DiId && it.IsDel == 0);
|
|
|
|
|
|
|
|
if (eecInfo == null) return Ok(JsonView(false, $"出入境费用明细未录入!"));
|
|
if (eecInfo == null) return Ok(JsonView(false, $"出入境费用明细未录入!"));
|
|
@@ -9580,7 +9665,10 @@ FROM
|
|
|
var parentId = 0;
|
|
var parentId = 0;
|
|
|
|
|
|
|
|
var info = await _sqlSugar.Queryable<Grp_EnterExitCost>().Where(x => x.IsDel == 0 && x.DiId == diId).OrderByDescending(x => x.CreateTime).FirstAsync();
|
|
var info = await _sqlSugar.Queryable<Grp_EnterExitCost>().Where(x => x.IsDel == 0 && x.DiId == diId).OrderByDescending(x => x.CreateTime).FirstAsync();
|
|
|
- if (info != null) parentId = info.Id;
|
|
|
|
|
|
|
+ if (info != null) {
|
|
|
|
|
+
|
|
|
|
|
+ parentId = info.Id;
|
|
|
|
|
+ }
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
var currencys = await EnterExitCostMobileGetCurrencyInit();
|
|
var currencys = await EnterExitCostMobileGetCurrencyInit();
|
|
@@ -9592,6 +9680,54 @@ FROM
|
|
|
return parentId;
|
|
return parentId;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 团组模块 - 出入境费用-移动端 - 设置view权限
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <returns></returns>
|
|
|
|
|
+ [HttpPost]
|
|
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
|
+ public async Task<IActionResult> EnterExitCostMobileSetViewPermissiion(EnterExitCostMobileSetViewPermissiionDto dto)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
|
|
+ if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
|
|
+ if (dto.UserIds.Length < 1) return Ok(JsonView(false, "请传入有效的userId;"));
|
|
|
|
|
+
|
|
|
|
|
+ //验证编辑权限
|
|
|
|
|
+ (bool isEdit, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.DiId, dto.CurrUserId, 2);
|
|
|
|
|
+ if (!isEdit) return Ok(JsonView(false, msg));
|
|
|
|
|
+
|
|
|
|
|
+ var permissions = new List<Grp_EnterExitCostPermission>();
|
|
|
|
|
+ foreach (var userId in dto.UserIds)
|
|
|
|
|
+ {
|
|
|
|
|
+ permissions.Add(new Grp_EnterExitCostPermission { Permission = 1, GroupId = dto.DiId, UserId = userId, CreateUserId = dto.CurrUserId });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (permissions.Any())
|
|
|
|
|
+ {
|
|
|
|
|
+ _sqlSugar.BeginTran();
|
|
|
|
|
+ try
|
|
|
|
|
+ {
|
|
|
|
|
+ await _sqlSugar.Deleteable<Grp_EnterExitCostPermission>().Where(it => it.GroupId == dto.DiId).ExecuteCommandAsync();
|
|
|
|
|
+
|
|
|
|
|
+ var result = await _sqlSugar.Insertable(permissions).ExecuteCommandAsync();
|
|
|
|
|
+ if (result < 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ _sqlSugar.RollbackTran();
|
|
|
|
|
+ return Ok(JsonView(false));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ catch (Exception ex)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ _sqlSugar.RollbackTran();
|
|
|
|
|
+ return Ok(JsonView(false, ex.Message));
|
|
|
|
|
+ }
|
|
|
|
|
+ _sqlSugar.CommitTran();
|
|
|
|
|
+ return Ok(JsonView(true));
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ return Ok(JsonView(false));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// 团组模块 - 出入境费用-移动端 - OP --> 汇率
|
|
/// 团组模块 - 出入境费用-移动端 - OP --> 汇率
|
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -9604,6 +9740,7 @@ FROM
|
|
|
if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
if (dto.Currencys.Length < 1) return Ok(JsonView(false, "请传入有效的汇率信息!"));
|
|
if (dto.Currencys.Length < 1) return Ok(JsonView(false, "请传入有效的汇率信息!"));
|
|
|
|
|
+
|
|
|
var currencyStr = CommonFun.GetCurrencyChinaToString(dto.Currencys.ToList());
|
|
var currencyStr = CommonFun.GetCurrencyChinaToString(dto.Currencys.ToList());
|
|
|
int id = dto.Id;
|
|
int id = dto.Id;
|
|
|
if (id <= 0) //add
|
|
if (id <= 0) //add
|
|
@@ -9615,6 +9752,10 @@ FROM
|
|
|
}
|
|
}
|
|
|
else //update
|
|
else //update
|
|
|
{
|
|
{
|
|
|
|
|
+ //验证编辑权限
|
|
|
|
|
+ (bool isEdit, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.DiId, dto.CurrUserId, 2);
|
|
|
|
|
+ if (!isEdit) return Ok(JsonView(false, msg));
|
|
|
|
|
+
|
|
|
var upd = await _sqlSugar.Updateable<Grp_EnterExitCost>().SetColumns(x => new Grp_EnterExitCost() { CurrencyRemark = currencyStr }).Where(x => x.Id == dto.Id).ExecuteCommandAsync();
|
|
var upd = await _sqlSugar.Updateable<Grp_EnterExitCost>().SetColumns(x => new Grp_EnterExitCost() { CurrencyRemark = currencyStr }).Where(x => x.Id == dto.Id).ExecuteCommandAsync();
|
|
|
if (upd < 1) return Ok(JsonView(false));
|
|
if (upd < 1) return Ok(JsonView(false));
|
|
|
}
|
|
}
|
|
@@ -9732,6 +9873,10 @@ FROM
|
|
|
}
|
|
}
|
|
|
else //update
|
|
else //update
|
|
|
{
|
|
{
|
|
|
|
|
+ //验证编辑权限
|
|
|
|
|
+ (bool isEdit, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.DiId, dto.CurrUserId, 2);
|
|
|
|
|
+ if (!isEdit) return Ok(JsonView(false, msg));
|
|
|
|
|
+
|
|
|
var upd = await _sqlSugar.Updateable(checkboxInfo)
|
|
var upd = await _sqlSugar.Updateable(checkboxInfo)
|
|
|
.UpdateColumns(x => new {
|
|
.UpdateColumns(x => new {
|
|
|
x.ChoiceOne,
|
|
x.ChoiceOne,
|
|
@@ -9792,6 +9937,10 @@ FROM
|
|
|
}
|
|
}
|
|
|
else //update
|
|
else //update
|
|
|
{
|
|
{
|
|
|
|
|
+ //验证编辑权限
|
|
|
|
|
+ (bool isEdit, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.DiId, dto.CurrUserId, 2);
|
|
|
|
|
+ if (!isEdit) return Ok(JsonView(false, msg));
|
|
|
|
|
+
|
|
|
var upd = await _sqlSugar.Updateable<Grp_EnterExitCost>()
|
|
var upd = await _sqlSugar.Updateable<Grp_EnterExitCost>()
|
|
|
.SetColumnsIF(itemTypeId == 3, it => it.ChoiceThree == isSelected)
|
|
.SetColumnsIF(itemTypeId == 3, it => it.ChoiceThree == isSelected)
|
|
|
.SetColumnsIF(itemTypeId == 4, it => it.ChoiceFour == isSelected)
|
|
.SetColumnsIF(itemTypeId == 4, it => it.ChoiceFour == isSelected)
|
|
@@ -9834,6 +9983,10 @@ FROM
|
|
|
}
|
|
}
|
|
|
else //update
|
|
else //update
|
|
|
{
|
|
{
|
|
|
|
|
+ //验证编辑权限
|
|
|
|
|
+ (bool isEdit, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.DiId, dto.CurrUserId, 2);
|
|
|
|
|
+ if (!isEdit) return Ok(JsonView(false, msg));
|
|
|
|
|
+
|
|
|
var upd = await _sqlSugar.Updateable(info)
|
|
var upd = await _sqlSugar.Updateable(info)
|
|
|
.UpdateColumns(x => new {
|
|
.UpdateColumns(x => new {
|
|
|
x.ChoiceOne,
|
|
x.ChoiceOne,
|
|
@@ -9852,7 +10005,6 @@ FROM
|
|
|
if (upd < 1) return Ok(JsonView(false));
|
|
if (upd < 1) return Ok(JsonView(false));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
//消息通知
|
|
//消息通知
|
|
|
await EnterExitCostMobileOpNotice(dto.DiId, id, dto.CurrUserId);
|
|
await EnterExitCostMobileOpNotice(dto.DiId, id, dto.CurrUserId);
|
|
|
|
|
|
|
@@ -9898,6 +10050,10 @@ FROM
|
|
|
}
|
|
}
|
|
|
else //update
|
|
else //update
|
|
|
{
|
|
{
|
|
|
|
|
+ //验证编辑权限
|
|
|
|
|
+ (bool isEdit, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.DiId, dto.CurrUserId, 2);
|
|
|
|
|
+ if (!isEdit) return Ok(JsonView(false, msg));
|
|
|
|
|
+
|
|
|
var upd = await _sqlSugar.Updateable(info)
|
|
var upd = await _sqlSugar.Updateable(info)
|
|
|
.UpdateColumns(x => new {
|
|
.UpdateColumns(x => new {
|
|
|
x.SumJJC,
|
|
x.SumJJC,
|
|
@@ -9915,7 +10071,6 @@ FROM
|
|
|
.Where(x => x.Id == id)
|
|
.Where(x => x.Id == id)
|
|
|
.ExecuteCommandAsync();
|
|
.ExecuteCommandAsync();
|
|
|
if (upd <1) return Ok(JsonView(false));
|
|
if (upd <1) return Ok(JsonView(false));
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
jjcItemTotal = info.AirJJ + info.CityTranffic;
|
|
jjcItemTotal = info.AirJJ + info.CityTranffic;
|
|
@@ -10041,6 +10196,10 @@ FROM
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
|
|
+ //验证编辑权限
|
|
|
|
|
+ (bool isEdit, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.DiId, dto.CurrUserId, 2);
|
|
|
|
|
+ if (!isEdit) return Ok(JsonView(false, msg));
|
|
|
|
|
+
|
|
|
var subUpd = await _sqlSugar.Updateable(subInfo)
|
|
var subUpd = await _sqlSugar.Updateable(subInfo)
|
|
|
.UpdateColumns(x => new
|
|
.UpdateColumns(x => new
|
|
|
{
|
|
{
|
|
@@ -10151,6 +10310,11 @@ FROM
|
|
|
}
|
|
}
|
|
|
else //upd
|
|
else //upd
|
|
|
{
|
|
{
|
|
|
|
|
+
|
|
|
|
|
+ //验证编辑权限
|
|
|
|
|
+ (bool isEdit, string msg) = await _enterExitCostRep.MobilePermissionsValidationAsync(dto.Diid, dto.CurrUserId, 2);
|
|
|
|
|
+ if (!isEdit) return Ok(JsonView(false, msg));
|
|
|
|
|
+
|
|
|
var subUpd = await _sqlSugar.Updateable(subInfo)
|
|
var subUpd = await _sqlSugar.Updateable(subInfo)
|
|
|
.UpdateColumns(x => new
|
|
.UpdateColumns(x => new
|
|
|
{
|
|
{
|
|
@@ -10220,6 +10384,1195 @@ FROM
|
|
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
+ //#region 团组经理模块 出入境费用-草稿 移动端(Android/IOS)
|
|
|
|
|
+
|
|
|
|
|
+ ///// <summary>
|
|
|
|
|
+ ///// 出入境费用-草稿 移动端
|
|
|
|
|
+ ///// 获取币种基础数据(含逻辑处理)
|
|
|
|
|
+ ///// </summary>
|
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
|
+ //private async Task<List<CurrencyInfo>> EnterExitCostDratfMobileGetCurrencyInit()
|
|
|
|
|
+ //{
|
|
|
|
|
+ // //默认币种显示
|
|
|
|
|
+ // var _currencyInfos = _currencyInit;
|
|
|
|
|
+
|
|
|
|
|
+ // var _currencyRate = await _juHeApi.PostItemRateAsync(_currencyInfos.Select(it => it.CurrencyCode).ToArray());
|
|
|
|
|
+ // if (_currencyRate.Count > 0)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // foreach (var item in _currencyInfos)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var rateInfo = _currencyRate.Where(it => it.Name.Equals(item.CurrencyName)).FirstOrDefault();
|
|
|
|
|
+ // if (rateInfo != null)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // decimal rate1 = Convert.ToDecimal(rateInfo.FSellPri) / 100.00M;
|
|
|
|
|
+ // rate1 *= 1.035M;
|
|
|
|
|
+
|
|
|
|
|
+ // item.Rate = Convert.ToDecimal(rate1.ToString("#0.00")) + 0.01M;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // return _currencyInfos;
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ ///// <summary>
|
|
|
|
|
+ ///// 团组模块 - 出入境费用-草稿-移动端 - 基础数据源(Word明细类型、Excel明细类型、默认币种显示)
|
|
|
|
|
+ ///// </summary>
|
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
|
+ //[HttpPost]
|
|
|
|
|
+ //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
|
+ //public async Task<IActionResult> EnterExitCostDraftMobileDataSource(PortDtoBase dto)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // string sql = string.Format("Select * From Sys_SetData Where IsDel = 0");
|
|
|
|
|
+ // //SetDataInfoView
|
|
|
|
|
+ // var dataSource = await _sqlSugar.SqlQueryable<Sys_SetData>(sql).ToListAsync();
|
|
|
|
|
+
|
|
|
|
|
+ // var wordTypeData = dataSource.Where(it => it.STid == 72).ToList(); //三公费用-Word明细类型
|
|
|
|
|
+ // List<SetDataInfoView> _WordTypeData = _mapper.Map<List<SetDataInfoView>>(wordTypeData);
|
|
|
|
|
+
|
|
|
|
|
+ // var excelTypeData = dataSource.Where(it => it.STid == 73).ToList(); //三公费用-Excel明细类型
|
|
|
|
|
+ // List<SetDataInfoView> _ExcelTypeData = _mapper.Map<List<SetDataInfoView>>(excelTypeData);
|
|
|
|
|
+
|
|
|
|
|
+ // //默认币种显示
|
|
|
|
|
+ // var _currencyInfos = await EnterExitCostMobileGetCurrencyInit();
|
|
|
|
|
+
|
|
|
|
|
+ // return Ok(JsonView(true, "查询成功!", new
|
|
|
|
|
+ // {
|
|
|
|
|
+ // WordTypeData = _WordTypeData,
|
|
|
|
|
+ // ExcelTypeData = _ExcelTypeData,
|
|
|
|
|
+ // CurrencyInit = _currencyInfos
|
|
|
|
|
+ // }));
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ ///// <summary>
|
|
|
|
|
+ ///// 团组模块 - 出入境费用-草稿-移动端 - 团组基础数据Data
|
|
|
|
|
+ ///// </summary>
|
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
|
+ //[HttpPost]
|
|
|
|
|
+ //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
|
+ //public async Task<IActionResult> EnterExitCostDraftMobileGroupData(PostEnterExitCostDraftMobileGroupDataDto dto)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
|
|
+
|
|
|
|
|
+ // RefAsync<int> total = 0;
|
|
|
|
|
+
|
|
|
|
|
+ // int diId = 0;
|
|
|
|
|
+ // var status = int.TryParse(dto.GroupName, out diId);
|
|
|
|
|
+
|
|
|
|
|
+ // var data = await _sqlSugar.Queryable<Grp_DelegationInfo>()
|
|
|
|
|
+ // .Where(x => x.IsDel == 0 && !string.IsNullOrEmpty(x.TeamName))
|
|
|
|
|
+ // .WhereIF(!string.IsNullOrEmpty(dto.GroupName) && diId > 0, x => x.Id == diId)
|
|
|
|
|
+ // .WhereIF(!string.IsNullOrEmpty(dto.GroupName) && !status, x => x.TeamName.Contains(dto.GroupName))
|
|
|
|
|
+ // .Select(x => new
|
|
|
|
|
+ // {
|
|
|
|
|
+ // Id = x.Id,
|
|
|
|
|
+ // GroupName = x.TeamName
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .OrderByDescending(x => x.Id)
|
|
|
|
|
+ // .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
|
|
|
|
|
+
|
|
|
|
|
+ // return Ok(JsonView(true, "查询成功!", data, total));
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ ///// <summary>
|
|
|
|
|
+ ///// 团组模块 - 出入境费用-草稿-移动端 - 币种基础数据Data
|
|
|
|
|
+ ///// </summary>
|
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
|
+ //[HttpPost]
|
|
|
|
|
+ //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
|
+ //public async Task<IActionResult> EnterExitCostDraftMobileCurrencyData(PostEnterExitCostDraftMobileCurrencyDataDto dto)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
|
|
+
|
|
|
|
|
+ // RefAsync<int> total = 0;
|
|
|
|
|
+ // var data = await _sqlSugar.Queryable<Sys_SetData>()
|
|
|
|
|
+ // .Where(x => x.IsDel == 0 && x.STid == 66)
|
|
|
|
|
+ // .WhereIF(!string.IsNullOrEmpty(dto.CurrencyName), x => x.Name.ToLower().Contains(dto.CurrencyName) || x.Remark.Contains(dto.CurrencyName))
|
|
|
|
|
+ // .Select(x => new
|
|
|
|
|
+ // {
|
|
|
|
|
+ // id = x.Id,
|
|
|
|
|
+ // name = x.Name,
|
|
|
|
|
+ // remark = x.Remark,
|
|
|
|
|
+
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
|
|
|
|
|
+
|
|
|
|
|
+ // return Ok(JsonView(true, "查询成功!", data, total));
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ ///// <summary>
|
|
|
|
|
+ ///// 团组模块 - 出入境费用-移动端 - 其他款项 - 币种、费用类型基础数据Data
|
|
|
|
|
+ ///// </summary>
|
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
|
+ //[HttpPost]
|
|
|
|
|
+ //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
|
+ //public async Task<IActionResult> EnterExitCostDraftMobileOtherItemCurrencyData(PostEnterExitCostDraftMobileOtherItemCurrencyDataDto dto)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
|
|
+ // if (dto.DraftId < 1) return Ok(JsonView(false, MsgTips.Id));
|
|
|
|
|
+
|
|
|
|
|
+ // var groupRateData = await GeneralMethod.PostGroupTeamRateByDiIdAndCTableId(dto.PortType,2274, 98);
|
|
|
|
|
+
|
|
|
|
|
+ // if (groupRateData == null) return Ok(JsonView(false, "请填写“团组汇率-->其他款项”汇率!"));
|
|
|
|
|
+ // var groupOtherRateData = groupRateData.TeamRates;
|
|
|
|
|
+
|
|
|
|
|
+ // var enterExitCostInfo = await _sqlSugar.Queryable<Grp_EnterExitCostDraft>().FirstAsync(it => it.Id == dto.DraftId && 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();
|
|
|
|
|
+
|
|
|
|
|
+ // var otherFeeTypeData = await _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0 && x.STid == 92).Select(x => new { x.Id, x.Name }).ToListAsync();
|
|
|
|
|
+
|
|
|
|
|
+ // return Ok(JsonView(true, "查询成功!", new { groupOtherRateData = groupOtherRateData, otherFeeTypeData = otherFeeTypeData }));
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ ///// <summary>
|
|
|
|
|
+ ///// 团组模块 - 出入境费用-移动端 - 实时汇率、签证费用、机票费用 Tips
|
|
|
|
|
+ ///// </summary>
|
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
|
+ //[HttpPost]
|
|
|
|
|
+ //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
|
+ //public async Task<IActionResult> EnterExitCostDraftMobileFeeTips(EnterExitCostDraftMobileFeeTipsDto dto)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
|
|
+
|
|
|
|
|
+ // var tipsData = new List<int>() { 1, 2, 3 };
|
|
|
|
|
+ // if (!tipsData.Contains(dto.TipsType)) return Ok(JsonView(false, $"请传入有效的TipsType参数;1 实时汇率;2 签证费用;3 机票费用;"));
|
|
|
|
|
+
|
|
|
|
|
+ // if (dto.TipsType == 1)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // //默认币种显示
|
|
|
|
|
+ // var _currencyInfos = _currencyInit;
|
|
|
|
|
+ // var _currencyRate = await _juHeApi.PostItemRateAsync(_currencyInfos.Select(it => it.CurrencyCode).ToArray());
|
|
|
|
|
+ // List<dynamic> reteInfos = new List<dynamic>();
|
|
|
|
|
+ // if (_currencyRate.Count > 0)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // foreach (var item in _currencyInfos)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var rateInfo = _currencyRate.Where(it => it.Name.Equals(item.CurrencyName)).FirstOrDefault();
|
|
|
|
|
+ // if (rateInfo != null)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // item.Rate = Convert.ToDecimal((Convert.ToDecimal(rateInfo.FSellPri == null ? 0.00M : rateInfo.FSellPri) / 100.00M).ToString("#0.0000"));
|
|
|
|
|
+
|
|
|
|
|
+ // decimal rate1 = item.Rate;
|
|
|
|
|
+ // rate1 *= 1.03M;
|
|
|
|
|
+
|
|
|
|
|
+ // decimal rate2 = Convert.ToDecimal(rate1.ToString("#0.00")) + 0.01M;
|
|
|
|
|
+
|
|
|
|
|
+ // reteInfos.Add(new
|
|
|
|
|
+ // {
|
|
|
|
|
+ // currCode = item.CurrencyCode,
|
|
|
|
|
+ // currName = item.CurrencyName,
|
|
|
|
|
+ // rate = rate2,
|
|
|
|
|
+ // lastUpdateDt = rateInfo.Date + " " + rateInfo.Time
|
|
|
|
|
+ // });
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // return Ok(JsonView(true, "查询成功!", reteInfos));
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else if (dto.TipsType == 2)
|
|
|
|
|
+ // {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else if (dto.TipsType == 3)
|
|
|
|
|
+ // {
|
|
|
|
|
+
|
|
|
|
|
+ // }
|
|
|
|
|
+ // return Ok(JsonView(false));
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ ///// <summary>
|
|
|
|
|
+ ///// 团组模块 - 出入境费用-移动端 - ParentInfo
|
|
|
|
|
+ ///// </summary>
|
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
|
+ //[HttpPost]
|
|
|
|
|
+ //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
|
+ //public async Task<IActionResult> EnterExitCostDraftMobileParentInfo(EnterExitCostDraftMobileParentInfoDto dto)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // if (dto.DraftId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
|
|
+
|
|
|
|
|
+ // var eecInfo = await _sqlSugar.Queryable<Grp_EnterExitCostDraft>().OrderByDescending(x => x.CreateTime).FirstAsync(it => it.Id == dto.DraftId && it.IsDel == 0);
|
|
|
|
|
+
|
|
|
|
|
+ // var mobileInfo = new EnterExitCostDraftMobileParentInfoView();
|
|
|
|
|
+ // mobileInfo.Currencys = await EnterExitCostMobileGetCurrencyInit();
|
|
|
|
|
+ // if (eecInfo == null) return Ok(mobileInfo);
|
|
|
|
|
+ // //验证查看、操作权限
|
|
|
|
|
+ // // var isView = await _enterExitCostRep.vi
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // mobileInfo = _mapper.Map<EnterExitCostMobileParentInfoView>(eecInfo);
|
|
|
|
|
+
|
|
|
|
|
+ // var dayAndCostData = _sqlSugar.Queryable<Grp_DayAndCost>()
|
|
|
|
|
+ // .LeftJoin<Grp_NationalTravelFee>((dac, ntf) => dac.NationalTravelFeeId == ntf.Id)
|
|
|
|
|
+ // .LeftJoin<Sys_SetData>((dac, ntf, sd) => dac.Currency == sd.Id)
|
|
|
|
|
+ // .Where((dac, ntf, sd) => dac.IsDel == 0 && dac.DiId == dto.DiId)
|
|
|
|
|
+ // .Select((dac, ntf, sd) => new DayAndCostMobileInfoView
|
|
|
|
|
+ // {
|
|
|
|
|
+ // SubId = dac.Id,
|
|
|
|
|
+ // DiId = dac.DiId,
|
|
|
|
|
+ // Type = dac.Type,
|
|
|
|
|
+ // Days = dac.Days,
|
|
|
|
|
+ // NationalTravelFeeId = dac.NationalTravelFeeId,
|
|
|
|
|
+ // Arae = $"{ntf.Country}-{ntf.City}",
|
|
|
|
|
+ // Cost = dac.Cost,
|
|
|
|
|
+ // Currency = dac.Currency,
|
|
|
|
|
+ // CurrencyName = sd.Name,
|
|
|
|
|
+ // SubTotal = dac.SubTotal,
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .ToList();
|
|
|
|
|
+
|
|
|
|
|
+ // mobileInfo.ChoiceOneTotalCost = eecInfo.InsidePay;
|
|
|
|
|
+ // mobileInfo.ChoiceTwoJJ = eecInfo.SumJJC;
|
|
|
|
|
+ // mobileInfo.ChoiceTwoGW = eecInfo.SumGWC;
|
|
|
|
|
+ // mobileInfo.ChoiceTwoTD = eecInfo.SumTDC;
|
|
|
|
|
+ // mobileInfo.Currencys = !string.IsNullOrEmpty(eecInfo.CurrencyRemark) ? CommonFun.GetCurrencyChinaToList(eecInfo.CurrencyRemark) : mobileInfo.Currencys;
|
|
|
|
|
+ // mobileInfo.ChoiceThreeTotalCost = dayAndCostData.Where(it => it.Type == 1).Sum(x => x.SubTotal); //住宿费 1
|
|
|
|
|
+ // mobileInfo.ChoiceFourTotalCost = dayAndCostData.Where(it => it.Type == 2).Sum(x => x.SubTotal); //伙食费 2
|
|
|
|
|
+ // mobileInfo.ChoiceFiveTotalCost = dayAndCostData.Where(it => it.Type == 3).Sum(x => x.SubTotal); //公杂费 3
|
|
|
|
|
+ // mobileInfo.ChoiceSixTotalCost = dayAndCostData.Where(it => it.Type == 4).Sum(x => x.SubTotal); //培训费 4
|
|
|
|
|
+ // //其他款项
|
|
|
|
|
+ // var otherData = _sqlSugar.Queryable<Grp_DayOtherPrice>()
|
|
|
|
|
+ // .LeftJoin<Sys_SetData>((dop, sd1) => dop.SetDataId == sd1.Id)
|
|
|
|
|
+ // .LeftJoin<Sys_SetData>((dop, sd1, sd2) => dop.Currency == sd2.Id)
|
|
|
|
|
+ // .Where((dop, sd1, sd2) => dop.IsDel == 0 && dop.Diid == dto.DiId)
|
|
|
|
|
+ // .OrderBy((dop, sd1, sd2) => dop.Index)
|
|
|
|
|
+ // .Select((dop, sd1, sd2) => new DayOtherPriceMobileInfoView
|
|
|
|
|
+ // {
|
|
|
|
|
+ // SubId = dop.Id,
|
|
|
|
|
+ // DiId = dop.Diid,
|
|
|
|
|
+ // Index = dop.Index,
|
|
|
|
|
+ // SetDataId = dop.SetDataId,
|
|
|
|
|
+ // SetDataName = sd1.Name,
|
|
|
|
|
+ // Cost = dop.Cost,
|
|
|
|
|
+ // Currency = dop.Currency,
|
|
|
|
|
+ // CurrencyName = sd2.Remark,
|
|
|
|
|
+ // SubTotal = dop.SubTotal,
|
|
|
|
|
+ // Remark = dop.Remark,
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .ToArray();
|
|
|
|
|
+ // mobileInfo.OtherExpensesTotalCost = otherData.Sum(x => x.SubTotal);
|
|
|
|
|
+
|
|
|
|
|
+ // return Ok(mobileInfo);
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ ///// <summary>
|
|
|
|
|
+ ///// 团组模块 - 出入境费用-移动端 - SubInfo
|
|
|
|
|
+ ///// </summary>
|
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
|
+ //[HttpPost]
|
|
|
|
|
+ //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
|
+ //public async Task<IActionResult> EnterExitCostMobileSubInfo(PostEnterExitCostMobileSubInfoDto dto)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
|
|
+ // if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
|
|
+
|
|
|
|
|
+ // var subTypes = new List<int>() { 1, 2, 3, 4, 5, 6, 7 };
|
|
|
|
|
+ // if (!subTypes.Contains(dto.SubType)) return Ok(JsonView(false, $"请传入有效的subTypeId!"));
|
|
|
|
|
+
|
|
|
|
|
+ // var eecInfo = await _sqlSugar.Queryable<Grp_EnterExitCost>().OrderByDescending(x => x.CreateTime).FirstAsync(it => it.DiId == dto.DiId && it.IsDel == 0);
|
|
|
|
|
+
|
|
|
|
|
+ // if (eecInfo == null) return Ok(JsonView(false, $"出入境费用明细未录入!"));
|
|
|
|
|
+ // var subType = dto.SubType;
|
|
|
|
|
+
|
|
|
|
|
+ // if (subType == 1) //1:境内费用
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var oneData = new ChoiceOneMobileSubInfoView()
|
|
|
|
|
+ // {
|
|
|
|
|
+ // Id = eecInfo.Id,
|
|
|
|
|
+ // ChoiceOne = eecInfo.ChoiceOne,
|
|
|
|
|
+ // ChoiceOneTotalCost = eecInfo.InsidePay,
|
|
|
|
|
+ // Visa = eecInfo.Visa,
|
|
|
|
|
+ // VisaRemark = eecInfo.VisaRemark,
|
|
|
|
|
+ // YiMiao = eecInfo.YiMiao,
|
|
|
|
|
+ // HeSuan = eecInfo.HeSuan,
|
|
|
|
|
+ // Service = eecInfo.Service,
|
|
|
|
|
+ // Ticket = eecInfo.Ticket,
|
|
|
|
|
+ // Safe = eecInfo.Safe,
|
|
|
|
|
+ // FirstItemRemark = eecInfo.FirstItemRemark
|
|
|
|
|
+ // };
|
|
|
|
|
+ // return Ok(JsonView(oneData));
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else if (subType == 2) //2:国际旅费
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var twoData = new ChoiceTwoMobileSubInfoView()
|
|
|
|
|
+ // {
|
|
|
|
|
+ // Id = eecInfo.Id,
|
|
|
|
|
+ // ChoiceTwoJJ = eecInfo.SumJJC,
|
|
|
|
|
+ // OutsideJJPay = eecInfo.OutsideJJPay,
|
|
|
|
|
+ // ChoiceTwoGW = eecInfo.SumGWC,
|
|
|
|
|
+ // OutsideGWPay = eecInfo.OutsideGWPay,
|
|
|
|
|
+ // ChoiceTwoTD = eecInfo.SumTDC,
|
|
|
|
|
+ // OutsideTDPay = eecInfo.OutsideTDPay,
|
|
|
|
|
+ // AirJJ = eecInfo.AirJJ,
|
|
|
|
|
+ // AirGW = eecInfo.AirGW,
|
|
|
|
|
+ // AirTD = eecInfo.AirTD,
|
|
|
|
|
+ // CityTranffic = eecInfo.CityTranffic,
|
|
|
|
|
+ // TwoItemRemark = eecInfo.TwoItemRemark
|
|
|
|
|
+ // };
|
|
|
|
|
+ // return Ok(JsonView(twoData));
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else if (subType == 3) //3:住宿费
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var dayAndCostDatas = _sqlSugar.Queryable<Grp_DayAndCost>()
|
|
|
|
|
+ // .LeftJoin<Grp_NationalTravelFee>((dac, ntf) => dac.NationalTravelFeeId == ntf.Id)
|
|
|
|
|
+ // .LeftJoin<Sys_SetData>((dac, ntf, sd) => dac.Currency == sd.Id)
|
|
|
|
|
+ // .Where((dac, ntf, sd) => dac.IsDel == 0 && dac.DiId == dto.DiId && dac.Type == 1)
|
|
|
|
|
+ // .Select((dac, ntf, sd) => new DayAndCostMobileInfoView
|
|
|
|
|
+ // {
|
|
|
|
|
+ // SubId = dac.Id,
|
|
|
|
|
+ // DiId = dac.DiId,
|
|
|
|
|
+ // Type = dac.Type,
|
|
|
|
|
+ // Days = dac.Days,
|
|
|
|
|
+ // NationalTravelFeeId = dac.NationalTravelFeeId,
|
|
|
|
|
+ // Arae = $"{ntf.Country}-{ntf.City}",
|
|
|
|
|
+ // Cost = dac.Cost,
|
|
|
|
|
+ // Currency = dac.Currency,
|
|
|
|
|
+ // CurrencyName = sd.Name,
|
|
|
|
|
+ // SubTotal = dac.SubTotal,
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .ToArray();
|
|
|
|
|
+
|
|
|
|
|
+ // var data = new ChoiceMobileSubInfo3To6View()
|
|
|
|
|
+ // {
|
|
|
|
|
+ // ParentId = eecInfo.Id,
|
|
|
|
|
+ // Choice = eecInfo.ChoiceThree,
|
|
|
|
|
+ // TotalCost = dayAndCostDatas.Sum(x => x.SubTotal),
|
|
|
|
|
+ // Details = dayAndCostDatas
|
|
|
|
|
+
|
|
|
|
|
+ // };
|
|
|
|
|
+ // return Ok(JsonView(data));
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else if (subType == 4) //4:伙食费
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var dayAndCostDatas = _sqlSugar.Queryable<Grp_DayAndCost>()
|
|
|
|
|
+ // .LeftJoin<Grp_NationalTravelFee>((dac, ntf) => dac.NationalTravelFeeId == ntf.Id)
|
|
|
|
|
+ // .LeftJoin<Sys_SetData>((dac, ntf, sd) => dac.Currency == sd.Id)
|
|
|
|
|
+ // .Where((dac, ntf, sd) => dac.IsDel == 0 && dac.DiId == dto.DiId && dac.Type == 2)
|
|
|
|
|
+ // .Select((dac, ntf, sd) => new DayAndCostMobileInfoView
|
|
|
|
|
+ // {
|
|
|
|
|
+ // SubId = dac.Id,
|
|
|
|
|
+ // DiId = dac.DiId,
|
|
|
|
|
+ // Type = dac.Type,
|
|
|
|
|
+ // Days = dac.Days,
|
|
|
|
|
+ // NationalTravelFeeId = dac.NationalTravelFeeId,
|
|
|
|
|
+ // Arae = $"{ntf.Country}-{ntf.City}",
|
|
|
|
|
+ // Cost = dac.Cost,
|
|
|
|
|
+ // Currency = dac.Currency,
|
|
|
|
|
+ // CurrencyName = sd.Name,
|
|
|
|
|
+ // SubTotal = dac.SubTotal,
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .ToArray();
|
|
|
|
|
+
|
|
|
|
|
+ // var data = new ChoiceMobileSubInfo3To6View()
|
|
|
|
|
+ // {
|
|
|
|
|
+ // ParentId = eecInfo.Id,
|
|
|
|
|
+ // Choice = eecInfo.ChoiceFour,
|
|
|
|
|
+ // TotalCost = dayAndCostDatas.Sum(x => x.SubTotal),
|
|
|
|
|
+ // Details = dayAndCostDatas
|
|
|
|
|
+ // };
|
|
|
|
|
+ // return Ok(JsonView(data));
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else if (subType == 5) //5:公杂费
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var dayAndCostDatas = _sqlSugar.Queryable<Grp_DayAndCost>()
|
|
|
|
|
+ // .LeftJoin<Grp_NationalTravelFee>((dac, ntf) => dac.NationalTravelFeeId == ntf.Id)
|
|
|
|
|
+ // .LeftJoin<Sys_SetData>((dac, ntf, sd) => dac.Currency == sd.Id)
|
|
|
|
|
+ // .Where((dac, ntf, sd) => dac.IsDel == 0 && dac.DiId == dto.DiId && dac.Type == 3)
|
|
|
|
|
+ // .Select((dac, ntf, sd) => new DayAndCostMobileInfoView
|
|
|
|
|
+ // {
|
|
|
|
|
+ // SubId = dac.Id,
|
|
|
|
|
+ // DiId = dac.DiId,
|
|
|
|
|
+ // Type = dac.Type,
|
|
|
|
|
+ // Days = dac.Days,
|
|
|
|
|
+ // NationalTravelFeeId = dac.NationalTravelFeeId,
|
|
|
|
|
+ // Arae = $"{ntf.Country}-{ntf.City}",
|
|
|
|
|
+ // Cost = dac.Cost,
|
|
|
|
|
+ // Currency = dac.Currency,
|
|
|
|
|
+ // CurrencyName = sd.Name,
|
|
|
|
|
+ // SubTotal = dac.SubTotal,
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .ToArray();
|
|
|
|
|
+
|
|
|
|
|
+ // var data = new ChoiceMobileSubInfo3To6View()
|
|
|
|
|
+ // {
|
|
|
|
|
+ // ParentId = eecInfo.Id,
|
|
|
|
|
+ // Choice = eecInfo.ChoiceFive,
|
|
|
|
|
+ // TotalCost = dayAndCostDatas.Sum(x => x.SubTotal),
|
|
|
|
|
+ // Details = dayAndCostDatas
|
|
|
|
|
+ // };
|
|
|
|
|
+ // return Ok(JsonView(data));
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else if (subType == 6) //6:培训费
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var dayAndCostDatas = _sqlSugar.Queryable<Grp_DayAndCost>()
|
|
|
|
|
+ // .LeftJoin<Grp_NationalTravelFee>((dac, ntf) => dac.NationalTravelFeeId == ntf.Id)
|
|
|
|
|
+ // .LeftJoin<Sys_SetData>((dac, ntf, sd) => dac.Currency == sd.Id)
|
|
|
|
|
+ // .Where((dac, ntf, sd) => dac.IsDel == 0 && dac.DiId == dto.DiId && dac.Type == 4)
|
|
|
|
|
+ // .Select((dac, ntf, sd) => new DayAndCostMobileInfoView
|
|
|
|
|
+ // {
|
|
|
|
|
+ // SubId = dac.Id,
|
|
|
|
|
+ // DiId = dac.DiId,
|
|
|
|
|
+ // Type = dac.Type,
|
|
|
|
|
+ // Days = dac.Days,
|
|
|
|
|
+ // NationalTravelFeeId = dac.NationalTravelFeeId,
|
|
|
|
|
+ // Arae = $"{ntf.Country}-{ntf.City}",
|
|
|
|
|
+ // Cost = dac.Cost,
|
|
|
|
|
+ // Currency = dac.Currency,
|
|
|
|
|
+ // CurrencyName = sd.Name,
|
|
|
|
|
+ // SubTotal = dac.SubTotal,
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .ToArray();
|
|
|
|
|
+
|
|
|
|
|
+ // var data = new ChoiceMobileSubInfo3To6View()
|
|
|
|
|
+ // {
|
|
|
|
|
+ // ParentId = eecInfo.Id,
|
|
|
|
|
+ // Choice = eecInfo.ChoiceSix,
|
|
|
|
|
+ // TotalCost = dayAndCostDatas.Sum(x => x.SubTotal),
|
|
|
|
|
+ // Details = dayAndCostDatas
|
|
|
|
|
+ // };
|
|
|
|
|
+ // return Ok(JsonView(data));
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else if (subType == 7) //7:其他
|
|
|
|
|
+ // {
|
|
|
|
|
+ // //其他款项
|
|
|
|
|
+ // var otherData = _sqlSugar.Queryable<Grp_DayOtherPrice>()
|
|
|
|
|
+ // .LeftJoin<Sys_SetData>((dop, sd1) => dop.SetDataId == sd1.Id)
|
|
|
|
|
+ // .LeftJoin<Sys_SetData>((dop, sd1, sd2) => dop.Currency == sd2.Id)
|
|
|
|
|
+ // .Where((dop, sd1, sd2) => dop.IsDel == 0 && dop.Diid == dto.DiId)
|
|
|
|
|
+ // .OrderBy((dop, sd1, sd2) => dop.Index)
|
|
|
|
|
+ // .Select((dop, sd1, sd2) => new DayOtherPriceMobileInfoView
|
|
|
|
|
+ // {
|
|
|
|
|
+ // SubId = dop.Id,
|
|
|
|
|
+ // DiId = dop.Diid,
|
|
|
|
|
+ // Index = dop.Index,
|
|
|
|
|
+ // SetDataId = dop.SetDataId,
|
|
|
|
|
+ // SetDataName = sd1.Name,
|
|
|
|
|
+ // Cost = dop.Cost,
|
|
|
|
|
+ // Currency = dop.Currency,
|
|
|
|
|
+ // CurrencyName = sd2.Name,
|
|
|
|
|
+ // SubTotal = dop.SubTotal,
|
|
|
|
|
+ // Remark = dop.Remark,
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .ToArray();
|
|
|
|
|
+
|
|
|
|
|
+ // var data = new ChoiceSevenMobileSubInfoView()
|
|
|
|
|
+ // {
|
|
|
|
|
+ // ParentId = eecInfo.Id,
|
|
|
|
|
+ // OtherExpenses_Checked = eecInfo.OtherExpenses_Checked,
|
|
|
|
|
+ // OtherExpensesTotalCost = otherData.Sum(x => x.SubTotal),
|
|
|
|
|
+ // Details = otherData
|
|
|
|
|
+ // };
|
|
|
|
|
+
|
|
|
|
|
+ // return Ok(JsonView(data));
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // return Ok(JsonView(false));
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ //#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>
|
|
|
|
|
+ ///// 验证出入境费用数据是否存在
|
|
|
|
|
+ ///// 不存在添加
|
|
|
|
|
+ ///// </summary>
|
|
|
|
|
+ ///// <param name="diId"></param>
|
|
|
|
|
+ ///// <param name="currUserId"></param>
|
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
|
+ ///// <exception cref="CustomException"></exception>
|
|
|
|
|
+ //private async Task<int> EnterExitCostVerifyIsNull(int diId, int currUserId)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // var parentId = 0;
|
|
|
|
|
+
|
|
|
|
|
+ // var info = await _sqlSugar.Queryable<Grp_EnterExitCost>().Where(x => x.IsDel == 0 && x.DiId == diId).OrderByDescending(x => x.CreateTime).FirstAsync();
|
|
|
|
|
+ // if (info != null) parentId = info.Id;
|
|
|
|
|
+ // else
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var currencys = await EnterExitCostMobileGetCurrencyInit();
|
|
|
|
|
+ // int addId = await _sqlSugar.Insertable(new Grp_EnterExitCost() { DiId = diId, CreateUserId = currUserId, CurrencyRemark = JsonConvert.SerializeObject(currencys) }).ExecuteReturnIdentityAsync();
|
|
|
|
|
+ // if (addId < 1) throw new CustomException("出入境费用添加失败!");
|
|
|
|
|
+ // parentId = addId;
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // return parentId;
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ ///// <summary>
|
|
|
|
|
+ ///// 团组模块 - 出入境费用-移动端 - OP --> 汇率
|
|
|
|
|
+ ///// </summary>
|
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
|
+ //[HttpPost]
|
|
|
|
|
+ //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
|
+ //public async Task<IActionResult> EnterExitCostMobileOpRate(PostEnterExitCostMobileFeeRateOpDto dto)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
|
|
+ // if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
|
|
+ // if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
|
|
+ // if (dto.Currencys.Length < 1) return Ok(JsonView(false, "请传入有效的汇率信息!"));
|
|
|
|
|
+ // var currencyStr = CommonFun.GetCurrencyChinaToString(dto.Currencys.ToList());
|
|
|
|
|
+ // int id = dto.Id;
|
|
|
|
|
+ // if (id <= 0) //add
|
|
|
|
|
+ // {
|
|
|
|
|
+ // 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
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var upd = await _sqlSugar.Updateable<Grp_EnterExitCost>().SetColumns(x => new Grp_EnterExitCost() { CurrencyRemark = currencyStr }).Where(x => x.Id == dto.Id).ExecuteCommandAsync();
|
|
|
|
|
+ // if (upd < 1) return Ok(JsonView(false));
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // #region 汇率变更时更改币种相关费用
|
|
|
|
|
+ // var opDayCosts = new List<Grp_DayAndCost>();
|
|
|
|
|
+ // var opDayOtherCosts = new List<Grp_DayOtherPrice>();
|
|
|
|
|
+ // var eecCurrencys = dto.Currencys.Select(x => x.CurrencyCode.ToUpper()).ToList();
|
|
|
|
|
+
|
|
|
|
|
+ // var dayCosts = _sqlSugar.Queryable<Grp_DayAndCost>()
|
|
|
|
|
+ // .LeftJoin<Sys_SetData>((dac, sd) => dac.Currency == sd.Id)
|
|
|
|
|
+ // .Where((dac, sd) => dac.IsDel == 0 && dac.DiId == dto.DiId)
|
|
|
|
|
+ // .Select((dac, sd) => new {
|
|
|
|
|
+ // dac.Id,
|
|
|
|
|
+ // dac.DiId,
|
|
|
|
|
+ // CurrencyCode = sd.Name,
|
|
|
|
|
+ // dac.Cost
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .ToList();
|
|
|
|
|
+ // var dayOtherCosts = _sqlSugar.Queryable<Grp_DayOtherPrice>()
|
|
|
|
|
+ // .LeftJoin<Sys_SetData>((dop, sd) => dop.Currency == sd.Id)
|
|
|
|
|
+ // .Where((dop, sd) => dop.IsDel == 0 && dop.Diid == dto.DiId)
|
|
|
|
|
+ // .Select((dop, sd) => new {
|
|
|
|
|
+ // dop.Id,
|
|
|
|
|
+ // dop.Diid,
|
|
|
|
|
+ // CurrencyCode = sd.Name,
|
|
|
|
|
+ // dop.Cost
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .ToList();
|
|
|
|
|
+ // if (dayCosts.Count > 0)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var new_dayCosts = dayCosts.Where(x => eecCurrencys.Contains(x.CurrencyCode.ToUpper())).GroupBy(x => x.CurrencyCode);
|
|
|
|
|
+ // foreach (var dc in new_dayCosts)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var thisCurrency = dc.Key.ToUpper();
|
|
|
|
|
+ // var thisRate = dto.Currencys.Where(x => x.CurrencyCode.ToUpper().Equals(thisCurrency)).First()?.Rate ?? 0.00M;
|
|
|
|
|
+ // if (thisRate == 0.00M) continue;
|
|
|
|
|
+
|
|
|
|
|
+ // foreach (var dcSub in dc)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // opDayCosts.Add(new Grp_DayAndCost()
|
|
|
|
|
+ // {
|
|
|
|
|
+ // Id = dcSub.Id,
|
|
|
|
|
+ // DiId = dcSub.DiId,
|
|
|
|
|
+ // Cost = dcSub.Cost,
|
|
|
|
|
+ // SubTotal = dcSub.Cost * thisRate,
|
|
|
|
|
+ // Remark = $"[移动端->汇率变更时费用变更][变更信息:currency:{thisCurrency}、opDatetime:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}、opUserId:{dto.CurrUserId}]"
|
|
|
|
|
+ // });
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (opDayCosts.Count > 0)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // await _sqlSugar.Updateable(opDayCosts).UpdateColumns(x => new { x.SubTotal, x.Remark }).WhereColumns(x => new { x.Id }).ExecuteCommandAsync();
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // if (dayOtherCosts.Count > 0)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var new_dayOtherCosts = dayOtherCosts.Where(x => eecCurrencys.Contains(x.CurrencyCode.ToUpper())).GroupBy(x => x.CurrencyCode);
|
|
|
|
|
+ // foreach (var dc in new_dayOtherCosts)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var thisCurrency = dc.Key.ToUpper();
|
|
|
|
|
+ // var thisRate = dto.Currencys.Where(x => x.CurrencyCode.ToUpper().Equals(thisCurrency)).First()?.Rate ?? 0.00M;
|
|
|
|
|
+ // if (thisRate == 0.00M) continue;
|
|
|
|
|
+
|
|
|
|
|
+ // foreach (var dcSub in dc)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // opDayOtherCosts.Add(new Grp_DayOtherPrice()
|
|
|
|
|
+ // {
|
|
|
|
|
+ // Id = dcSub.Id,
|
|
|
|
|
+ // Diid = dcSub.Diid,
|
|
|
|
|
+ // Cost = dcSub.Cost,
|
|
|
|
|
+ // SubTotal = dcSub.Cost * thisRate,
|
|
|
|
|
+ // // Remark = $"[移动端->汇率变更时费用变更][变更信息:currency:{thisCurrency}、opDatetime:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}、opUserId:{dto.CurrUserId}]"
|
|
|
|
|
+ // });
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (opDayOtherCosts.Count > 0)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // await _sqlSugar.Updateable(opDayOtherCosts).UpdateColumns(x => new { x.SubTotal }).WhereColumns(x => new { x.Id }).ExecuteCommandAsync();
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // #endregion
|
|
|
|
|
+
|
|
|
|
|
+ // //消息通知
|
|
|
|
|
+ // await EnterExitCostMobileOpNotice(dto.DiId, id, dto.CurrUserId);
|
|
|
|
|
+ // //汇率信息记录
|
|
|
|
|
+ // await GeneralMethod.RateRecordSave(dto.CurrUserId, id, "出入境费用");
|
|
|
|
|
+
|
|
|
|
|
+ // return Ok(JsonView(new { parentId = id }));
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ ///// <summary>
|
|
|
|
|
+ ///// 团组模块 - 出入境费用-移动端 - OP --> 复选框
|
|
|
|
|
+ ///// </summary>
|
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
|
+ //[HttpPost]
|
|
|
|
|
+ //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
|
+ //public async Task<IActionResult> EnterExitCostMobileOpCheckbox(PostEnterExitCostMobileFeeOpCheckboxDto dto)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
|
|
+ // if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
|
|
+ // if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
|
|
+
|
|
|
|
|
+ // var checkboxInfo = _mapper.Map<Grp_EnterExitCost>(dto);
|
|
|
|
|
+
|
|
|
|
|
+ // int id = dto.Id;
|
|
|
|
|
+ // if (id <= 0) //add
|
|
|
|
|
+ // {
|
|
|
|
|
+ // checkboxInfo.CreateUserId = dto.CurrUserId;
|
|
|
|
|
+ // checkboxInfo.CurrencyRemark = JsonConvert.SerializeObject(await EnterExitCostMobileGetCurrencyInit());
|
|
|
|
|
+ // var add = await _sqlSugar.Insertable(checkboxInfo).ExecuteCommandAsync();
|
|
|
|
|
+
|
|
|
|
|
+ // if (add < 1) return Ok(JsonView(false));
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else //update
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var upd = await _sqlSugar.Updateable(checkboxInfo)
|
|
|
|
|
+ // .UpdateColumns(x => new {
|
|
|
|
|
+ // x.ChoiceOne,
|
|
|
|
|
+ // x.ChoiceTwo,
|
|
|
|
|
+ // x.SumJJC,
|
|
|
|
|
+ // x.SumGWC,
|
|
|
|
|
+ // x.SumTDC,
|
|
|
|
|
+ // x.ChoiceThree,
|
|
|
|
|
+ // x.ChoiceFour,
|
|
|
|
|
+ // x.ChoiceFive,
|
|
|
|
|
+ // x.ChoiceSix,
|
|
|
|
|
+ // x.OtherExpenses_Checked
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .Where(x => x.Id == id)
|
|
|
|
|
+ // .ExecuteCommandAsync();
|
|
|
|
|
+ // if (upd < 1) return Ok(JsonView(false));
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // return Ok(JsonView(new { parentId = id }));
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ ///// <summary>
|
|
|
|
|
+ ///// 团组模块 - 出入境费用-移动端 - OP --> 3-7项复选框单个复选框更改
|
|
|
|
|
+ ///// </summary>
|
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
|
+ //[HttpPost]
|
|
|
|
|
+ //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
|
+ //public async Task<IActionResult> EnterExitCostMobileOpSingleCheckbox(EnterExitCostMobileOpSingleCheckboxDto dto)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // int itemTypeId = dto.ItemType, id = dto.Id, currUserId = dto.CurrUserId, diId = dto.DiId, isSelected = dto.IsSelected;
|
|
|
|
|
+ // var itemTypes = new List<int>() { 3, 4, 5, 6, 7 };
|
|
|
|
|
+
|
|
|
|
|
+ // if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
|
|
+ // if (diId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
|
|
+ // if (currUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
|
|
+ // if (!itemTypes.Contains(itemTypeId)) return Ok(JsonView(false, $"请传入要修改的项类型;3:住宿费; 4:伙食费; 5:公杂费; 6:培训费;7:其他;"));
|
|
|
|
|
+
|
|
|
|
|
+ // var checkboxInfo = new Grp_EnterExitCost()
|
|
|
|
|
+ // {
|
|
|
|
|
+ // Id = id,
|
|
|
|
|
+ // DiId = diId,
|
|
|
|
|
+ // CreateUserId = currUserId
|
|
|
|
|
+ // };
|
|
|
|
|
+
|
|
|
|
|
+ // if (itemTypeId == 3) checkboxInfo.ChoiceThree = isSelected;
|
|
|
|
|
+ // else if (itemTypeId == 4) checkboxInfo.ChoiceFour = isSelected;
|
|
|
|
|
+ // else if (itemTypeId == 5) checkboxInfo.ChoiceFive = isSelected;
|
|
|
|
|
+ // else if (itemTypeId == 6) checkboxInfo.ChoiceSix = isSelected;
|
|
|
|
|
+ // else if (itemTypeId == 7) checkboxInfo.OtherExpenses_Checked = isSelected;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // if (id <= 0) //add
|
|
|
|
|
+ // {
|
|
|
|
|
+ // checkboxInfo.CreateUserId = dto.CurrUserId;
|
|
|
|
|
+ // checkboxInfo.CurrencyRemark = JsonConvert.SerializeObject(await EnterExitCostMobileGetCurrencyInit());
|
|
|
|
|
+ // var add = await _sqlSugar.Insertable(checkboxInfo).ExecuteCommandAsync();
|
|
|
|
|
+
|
|
|
|
|
+ // if (add < 1) return Ok(JsonView(false));
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else //update
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var upd = await _sqlSugar.Updateable<Grp_EnterExitCost>()
|
|
|
|
|
+ // .SetColumnsIF(itemTypeId == 3, it => it.ChoiceThree == isSelected)
|
|
|
|
|
+ // .SetColumnsIF(itemTypeId == 4, it => it.ChoiceFour == isSelected)
|
|
|
|
|
+ // .SetColumnsIF(itemTypeId == 5, it => it.ChoiceFive == isSelected)
|
|
|
|
|
+ // .SetColumnsIF(itemTypeId == 6, it => it.ChoiceSix == isSelected)
|
|
|
|
|
+ // .SetColumnsIF(itemTypeId == 7, it => it.OtherExpenses_Checked == isSelected)
|
|
|
|
|
+ // .Where(x => x.Id == id)
|
|
|
|
|
+ // .ExecuteCommandAsync();
|
|
|
|
|
+ // if (upd < 1) return Ok(JsonView(false));
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // return Ok(JsonView(new { parentId = id }));
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ ///// <summary>
|
|
|
|
|
+ ///// 团组模块 - 出入境费用-移动端 - OP --> 境内费用 Step1
|
|
|
|
|
+ ///// </summary>
|
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
|
+ //[HttpPost]
|
|
|
|
|
+ //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
|
+ //public async Task<IActionResult> EnterExitCostMobileOpStep1(PostEnterExitCostMobileOpStep1Dto dto)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
|
|
+ // if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
|
|
+ // if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
|
|
+
|
|
|
|
|
+ // var info = _mapper.Map<Grp_EnterExitCost>(dto);
|
|
|
|
|
+ // info.FirstItemRemark = dto.FirstItemRemark;
|
|
|
|
|
+ // info.InsidePay = dto.Visa + dto.Service + dto.Safe + dto.Ticket + dto.HeSuan + dto.YiMiao;
|
|
|
|
|
+
|
|
|
|
|
+ // int id = dto.Id;
|
|
|
|
|
+ // if (id <= 0) //add
|
|
|
|
|
+ // {
|
|
|
|
|
+ // info.CreateUserId = dto.CurrUserId;
|
|
|
|
|
+ // info.CurrencyRemark = JsonConvert.SerializeObject(await EnterExitCostMobileGetCurrencyInit());
|
|
|
|
|
+ // var add = await _sqlSugar.Insertable(info).ExecuteReturnIdentityAsync();
|
|
|
|
|
+
|
|
|
|
|
+ // if (add < 1) return Ok(JsonView(false));
|
|
|
|
|
+ // id = add;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else //update
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var upd = await _sqlSugar.Updateable(info)
|
|
|
|
|
+ // .UpdateColumns(x => new {
|
|
|
|
|
+ // x.ChoiceOne,
|
|
|
|
|
+ // x.InsidePay,
|
|
|
|
|
+ // x.VisaRemark,
|
|
|
|
|
+ // x.Visa,
|
|
|
|
|
+ // x.Service,
|
|
|
|
|
+ // x.Safe,
|
|
|
|
|
+ // x.Ticket,
|
|
|
|
|
+ // x.HeSuan,
|
|
|
|
|
+ // x.YiMiao,
|
|
|
|
|
+ // x.FirstItemRemark
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .Where(x => x.Id == id)
|
|
|
|
|
+ // .ExecuteCommandAsync();
|
|
|
|
|
+ // if (upd < 1) return Ok(JsonView(false));
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // //消息通知
|
|
|
|
|
+ // await EnterExitCostMobileOpNotice(dto.DiId, id, dto.CurrUserId);
|
|
|
|
|
+
|
|
|
|
|
+ // return Ok(JsonView(new { parentId = id, itemTotal = info.InsidePay }));
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ ///// <summary>
|
|
|
|
|
+ ///// 团组模块 - 出入境费用-移动端 - OP --> 国际旅费 Step2
|
|
|
|
|
+ ///// </summary>
|
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
|
+ //[HttpPost]
|
|
|
|
|
+ //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
|
+ //public async Task<IActionResult> EnterExitCostMobileOpStep2(PostEnterExitCostMobileOpStep2Dto dto)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
|
|
+ // if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
|
|
+ // if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
|
|
+
|
|
|
|
|
+ // var info = _mapper.Map<Grp_EnterExitCost>(dto);
|
|
|
|
|
+
|
|
|
|
|
+ // info.OutsideJJPay = dto.OutsideJJPay;
|
|
|
|
|
+ // info.OutsideGWPay = dto.OutsideGWPay;
|
|
|
|
|
+ // info.OutsideTDPay = dto.OutsideTDPay;
|
|
|
|
|
+ // info.AirJJ = dto.AirJJ;
|
|
|
|
|
+ // info.AirGW = dto.AirGW;
|
|
|
|
|
+ // info.AirTD = dto.AirTD;
|
|
|
|
|
+ // info.CityTranffic = dto.CityTranffic;
|
|
|
|
|
+ // info.TwoItemRemark = dto.TwoItemRemark;
|
|
|
|
|
+ // info.SumJJC = dto.ChoiceTwoJJ;
|
|
|
|
|
+ // info.SumGWC = dto.ChoiceTwoGW;
|
|
|
|
|
+ // info.SumTDC = dto.ChoiceTwoTD;
|
|
|
|
|
+
|
|
|
|
|
+ // int id = dto.Id;
|
|
|
|
|
+ // decimal jjcItemTotal = 0.00M, gwcItemTotal = 0.00M, tdcItemTotal = 0.00M;
|
|
|
|
|
+ // if (id <= 0) //add
|
|
|
|
|
+ // {
|
|
|
|
|
+ // info.CreateUserId = dto.CurrUserId;
|
|
|
|
|
+ // info.CurrencyRemark = JsonConvert.SerializeObject(await EnterExitCostMobileGetCurrencyInit());
|
|
|
|
|
+ // var addId = await _sqlSugar.Insertable(info).ExecuteReturnIdentityAsync();
|
|
|
|
|
+
|
|
|
|
|
+ // if (addId <= 0) return Ok(JsonView(false));
|
|
|
|
|
+ // id = addId;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else //update
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var upd = await _sqlSugar.Updateable(info)
|
|
|
|
|
+ // .UpdateColumns(x => new {
|
|
|
|
|
+ // x.SumJJC,
|
|
|
|
|
+ // x.OutsideJJPay,
|
|
|
|
|
+ // x.SumGWC,
|
|
|
|
|
+ // x.OutsideGWPay,
|
|
|
|
|
+ // x.SumTDC,
|
|
|
|
|
+ // x.OutsideTDPay,
|
|
|
|
|
+ // x.AirJJ,
|
|
|
|
|
+ // x.AirGW,
|
|
|
|
|
+ // x.AirTD,
|
|
|
|
|
+ // x.CityTranffic,
|
|
|
|
|
+ // x.TwoItemRemark
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .Where(x => x.Id == id)
|
|
|
|
|
+ // .ExecuteCommandAsync();
|
|
|
|
|
+ // if (upd < 1) return Ok(JsonView(false));
|
|
|
|
|
+
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // jjcItemTotal = info.AirJJ + info.CityTranffic;
|
|
|
|
|
+ // gwcItemTotal = info.AirGW + info.CityTranffic;
|
|
|
|
|
+ // tdcItemTotal = info.AirTD + info.CityTranffic;
|
|
|
|
|
+
|
|
|
|
|
+ // //消息通知
|
|
|
|
|
+ // await EnterExitCostMobileOpNotice(dto.DiId, id, dto.CurrUserId);
|
|
|
|
|
+
|
|
|
|
|
+ // return Ok(JsonView(new
|
|
|
|
|
+ // {
|
|
|
|
|
+ // parentId = id,
|
|
|
|
|
+ // choiceTwoJJ = dto.ChoiceTwoJJ,
|
|
|
|
|
+ // jjcItemTotal = jjcItemTotal,
|
|
|
|
|
+ // choiceTwoGW = dto.ChoiceTwoGW,
|
|
|
|
|
+ // gwcItemTotal = gwcItemTotal,
|
|
|
|
|
+ // choiceTwoTD = dto.ChoiceTwoTD,
|
|
|
|
|
+ // tdcItemTotal = tdcItemTotal
|
|
|
|
|
+ // }));
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ ///// <summary>
|
|
|
|
|
+ ///// 团组模块 - 出入境费用-移动端 - OP --> 批量(住宿、伙食、公杂、培训) Step3-Step6
|
|
|
|
|
+ ///// </summary>
|
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
|
+ //[HttpPost]
|
|
|
|
|
+ //[ApiExplorerSettings(IgnoreApi = true)]
|
|
|
|
|
+ //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
|
+ //public async Task<IActionResult> EnterExitCostMobileOpBatchStep3To6(PostEnterExitCostMobileOpStep3To6Dto dto)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
|
|
+ // if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
|
|
+ // if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
|
|
+ // if (dto.Infos.Length < 1) return Ok(JsonView(false, "请传入有效的费用信息!"));
|
|
|
|
|
+ // var feeTypeIds = new List<int>() { 1, 2, 3, 4, };
|
|
|
|
|
+ // if (!feeTypeIds.Contains(dto.FeeType)) return Ok(JsonView(false, "请传入有效的费用类型!"));
|
|
|
|
|
+
|
|
|
|
|
+ // var infos1 = _mapper.Map<List<Grp_DayAndCost>>(dto.Infos);
|
|
|
|
|
+ // var infos = infos1.Select(x => new Grp_DayAndCost
|
|
|
|
|
+ // {
|
|
|
|
|
+ // Id = x.Id,
|
|
|
|
|
+ // DiId = dto.DiId,
|
|
|
|
|
+ // Type = dto.FeeType,
|
|
|
|
|
+ // Days = x.Days,
|
|
|
|
|
+ // NationalTravelFeeId = x.NationalTravelFeeId,
|
|
|
|
|
+ // Cost = x.Cost,
|
|
|
|
|
+ // Currency = x.Currency,
|
|
|
|
|
+ // SubTotal = x.SubTotal,
|
|
|
|
|
+ // CreateUserId = dto.CurrUserId
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .ToList();
|
|
|
|
|
+
|
|
|
|
|
+ // var adds = infos.Where(x => x.Id <= 0).ToList();
|
|
|
|
|
+ // var upds = infos.Where(x => x.Id > 0).ToList();
|
|
|
|
|
+
|
|
|
|
|
+ // if (adds.Count > 0)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var add = await _sqlSugar.Insertable(adds).ExecuteCommandAsync();
|
|
|
|
|
+ // if (add < 1) return Ok(JsonView(false));
|
|
|
|
|
+
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (upds.Count > 0)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var upd = await _sqlSugar.Updateable(adds)
|
|
|
|
|
+ // .UpdateColumns(x => new
|
|
|
|
|
+ // {
|
|
|
|
|
+ // x.Days,
|
|
|
|
|
+ // x.NationalTravelFeeId,
|
|
|
|
|
+ // x.Cost,
|
|
|
|
|
+ // x.Currency,
|
|
|
|
|
+ // x.SubTotal
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .WhereColumns(x => new { x.Id })
|
|
|
|
|
+ // .ExecuteCommandAsync();
|
|
|
|
|
+ // if (upd < 1) return Ok(JsonView(false));
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // 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 }));
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ ///// <summary>
|
|
|
|
|
+ ///// 团组模块 - 出入境费用-移动端 - OP --> 单条(住宿、伙食、公杂、培训) Step3-Step6
|
|
|
|
|
+ ///// </summary>
|
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
|
+ //[HttpPost]
|
|
|
|
|
+ //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
|
+ //public async Task<IActionResult> EnterExitCostMobileOpSingleStep3To6(PostEnterExitCostMobileOpSingleStep3To6Dto dto)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // var feeTypeIds = new List<int>() { 3, 4, 5, 6 };
|
|
|
|
|
+ // int subId = dto.SubId, feeType = dto.FeeType;
|
|
|
|
|
+
|
|
|
|
|
+ // if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
|
|
+ // if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
|
|
+ // if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
|
|
+
|
|
|
|
|
+ // if (!feeTypeIds.Contains(dto.FeeType)) return Ok(JsonView(false, "请传入有效的费用类型!"));
|
|
|
|
|
+
|
|
|
|
|
+ // var subInfo = _mapper.Map<Grp_DayAndCost>(dto);
|
|
|
|
|
+ // subInfo.Id = subId;
|
|
|
|
|
+ // subInfo.DiId = dto.DiId;
|
|
|
|
|
+
|
|
|
|
|
+ // if (feeType == 3) subInfo.Type = 1;
|
|
|
|
|
+ // else if (feeType == 4) subInfo.Type = 2;
|
|
|
|
|
+ // else if (feeType == 5) subInfo.Type = 3;
|
|
|
|
|
+ // else if (feeType == 6) subInfo.Type = 4;
|
|
|
|
|
+
|
|
|
|
|
+ // subInfo.CreateUserId = dto.CurrUserId;
|
|
|
|
|
+
|
|
|
|
|
+ // int parentId = await EnterExitCostVerifyIsNull(dto.DiId, dto.CurrUserId); //主表验证
|
|
|
|
|
+ // if (parentId < 1) return Ok(JsonView(false));
|
|
|
|
|
+
|
|
|
|
|
+ // //子表op
|
|
|
|
|
+ // if (subId < 1)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var subAdd = await _sqlSugar.Insertable(subInfo).ExecuteCommandAsync();
|
|
|
|
|
+ // if (subAdd < 1) return Ok(JsonView(false));
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var subUpd = await _sqlSugar.Updateable(subInfo)
|
|
|
|
|
+ // .UpdateColumns(x => new
|
|
|
|
|
+ // {
|
|
|
|
|
+ // x.Days,
|
|
|
|
|
+ // x.NationalTravelFeeId,
|
|
|
|
|
+ // x.Cost,
|
|
|
|
|
+ // x.Currency,
|
|
|
|
|
+ // x.SubTotal
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .WhereColumns(x => new { x.Id })
|
|
|
|
|
+ // .ExecuteCommandAsync();
|
|
|
|
|
+ // if (subUpd < 1) return Ok(JsonView(false));
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // var itemTotal = _sqlSugar.Queryable<Grp_DayAndCost>().Where(x => x.IsDel == 0 && x.DiId == dto.DiId && x.Type == feeType).Sum(x => x.SubTotal);
|
|
|
|
|
+
|
|
|
|
|
+ // await EnterExitCostMobileOpNotice(dto.DiId, parentId, dto.CurrUserId);
|
|
|
|
|
+
|
|
|
|
|
+ // return Ok(JsonView(new { parentId = parentId, itemTotal = itemTotal }));
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ ///// <summary>
|
|
|
|
|
+ ///// 团组模块 - 出入境费用-移动端 - OP --> 其他费用-批量 Step7
|
|
|
|
|
+ ///// </summary>
|
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
|
+ //[HttpPost]
|
|
|
|
|
+ //[ApiExplorerSettings(IgnoreApi = true)]
|
|
|
|
|
+ //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
|
+ //public async Task<IActionResult> EnterExitCostMobileOpBatchStep7(PostEnterExitCostMobileOpStep7Dto dto)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
|
|
+ // if (dto.DiId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
|
|
+ // if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
|
|
+
|
|
|
|
|
+ // var infos1 = _mapper.Map<List<Grp_DayOtherPrice>>(dto.Infos);
|
|
|
|
|
+ // var infos = infos1.Select(x => new Grp_DayOtherPrice()
|
|
|
|
|
+ // {
|
|
|
|
|
+ // Id = x.Id,
|
|
|
|
|
+ // Diid = dto.DiId,
|
|
|
|
|
+ // SetDataId = x.SetDataId,
|
|
|
|
|
+ // Index = x.Index,
|
|
|
|
|
+ // Cost = x.Cost,
|
|
|
|
|
+ // Currency = x.Currency,
|
|
|
|
|
+ // SubTotal = x.SubTotal,
|
|
|
|
|
+ // CreateUserId = dto.CurrUserId,
|
|
|
|
|
+ // Remark = x.Remark
|
|
|
|
|
+ // }).ToList();
|
|
|
|
|
+
|
|
|
|
|
+ // var adds = infos.Where(x => x.Id <= 0).ToList();
|
|
|
|
|
+ // var upds = infos.Where(x => x.Id > 0).ToList();
|
|
|
|
|
+
|
|
|
|
|
+ // if (adds.Count > 0)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var add = await _sqlSugar.Insertable(adds).ExecuteCommandAsync();
|
|
|
|
|
+ // if (add < 1) return Ok(JsonView(false));
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (upds.Count > 0)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var upd = await _sqlSugar.Updateable(adds)
|
|
|
|
|
+ // .UpdateColumns(x => new
|
|
|
|
|
+ // {
|
|
|
|
|
+ // x.Index,
|
|
|
|
|
+ // x.SetDataId,
|
|
|
|
|
+ // x.Cost,
|
|
|
|
|
+ // x.Currency,
|
|
|
|
|
+ // x.SubTotal,
|
|
|
|
|
+ // x.Remark
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .WhereColumns(x => new { x.Id })
|
|
|
|
|
+ // .ExecuteCommandAsync();
|
|
|
|
|
+ // if (upd < 1) return Ok(JsonView(false));
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // 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 }));
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ ///// <summary>
|
|
|
|
|
+ ///// 团组模块 - 出入境费用-移动端 - OP --> 其他费用-单条 Step7
|
|
|
|
|
+ ///// </summary>
|
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
|
+ //[HttpPost]
|
|
|
|
|
+ //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
|
+ //public async Task<IActionResult> EnterExitCostMobileOpSingleStep7(PostEnterExitCostMobileOpSingleStep7Dto dto)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // int subId = dto.SubId;
|
|
|
|
|
+ // int diId = dto.Diid;
|
|
|
|
|
+ // if (!_portTypeData.Contains(dto.PortType)) return Ok(JsonView(false, MsgTips.Port));
|
|
|
|
|
+ // if (diId < 1) return Ok(JsonView(false, MsgTips.DiId));
|
|
|
|
|
+ // if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
|
|
|
|
|
+
|
|
|
|
|
+ // var subInfo = _mapper.Map<Grp_DayOtherPrice>(dto);
|
|
|
|
|
+ // subInfo.Id = subId;
|
|
|
|
|
+ // subInfo.Diid = dto.Diid;
|
|
|
|
|
+ // subInfo.CreateUserId = dto.CurrUserId;
|
|
|
|
|
+
|
|
|
|
|
+ // int parentId = await EnterExitCostVerifyIsNull(diId, dto.CurrUserId); //主表验证
|
|
|
|
|
+ // if (parentId < 1) return Ok(JsonView(false));
|
|
|
|
|
+
|
|
|
|
|
+ // #region 子表op
|
|
|
|
|
+ // if (subId < 1)//add
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var subAdd = await _sqlSugar.Insertable(subInfo).ExecuteCommandAsync();
|
|
|
|
|
+ // if (subAdd < 1) return Ok(JsonView(false));
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else //upd
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var subUpd = await _sqlSugar.Updateable(subInfo)
|
|
|
|
|
+ // .UpdateColumns(x => new
|
|
|
|
|
+ // {
|
|
|
|
|
+ // x.Index,
|
|
|
|
|
+ // x.SetDataId,
|
|
|
|
|
+ // x.Cost,
|
|
|
|
|
+ // x.Currency,
|
|
|
|
|
+ // x.SubTotal,
|
|
|
|
|
+ // x.Remark
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .WhereColumns(x => new { x.Id })
|
|
|
|
|
+ // .ExecuteCommandAsync();
|
|
|
|
|
+ // if (subUpd < 1) return Ok(JsonView(false));
|
|
|
|
|
+ // }
|
|
|
|
|
+ // #endregion
|
|
|
|
|
+
|
|
|
|
|
+ // var itemTotal = _sqlSugar.Queryable<Grp_DayOtherPrice>().Where(x => x.IsDel == 0 && x.Diid == diId).Sum(x => x.SubTotal);
|
|
|
|
|
+
|
|
|
|
|
+ // //消息通知
|
|
|
|
|
+ // await EnterExitCostMobileOpNotice(dto.Diid, parentId, dto.CurrUserId);
|
|
|
|
|
+
|
|
|
|
|
+ // return Ok(JsonView(new { parentId = parentId, itemTotal = itemTotal }));
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ ///// <summary>
|
|
|
|
|
+ ///// 团组模块 - 出入境费用-移动端 - 3-6子项删除
|
|
|
|
|
+ ///// </summary>
|
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
|
+ //[HttpPost]
|
|
|
|
|
+ //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
|
+ //public async Task<IActionResult> EnterExitCostMobileSubItemDel(EnterExitCostSubItemDelDto dto)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // var data = await _enterExitCostRep.PostEnterExitCostSubItemDel(dto);
|
|
|
|
|
+
|
|
|
|
|
+ // if (data.Code != 0)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // return Ok(JsonView(false, data.Msg));
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // return Ok(JsonView(true, "操作成功!", data.Data));
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ ///// <summary>
|
|
|
|
|
+ ///// 团组模块 - 出入境费用-移动端 - 其他费用删除
|
|
|
|
|
+ ///// </summary>
|
|
|
|
|
+ ///// <param name="dto"></param>
|
|
|
|
|
+ ///// <returns></returns>
|
|
|
|
|
+ //[HttpPost]
|
|
|
|
|
+ //public IActionResult EnterExitCostMobileOtherFeeDel(EnterExitCostSubItemDelDto dto)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // var data = new Grp_DayOtherPrice()
|
|
|
|
|
+ // {
|
|
|
|
|
+ // Id = dto.Id,
|
|
|
|
|
+ // IsDel = 1,
|
|
|
|
|
+ // DeleteUserId = dto.DeleteUserId,
|
|
|
|
|
+ // DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")
|
|
|
|
|
+ // };
|
|
|
|
|
+
|
|
|
|
|
+ // var del = _sqlSugar.Updateable(data).UpdateColumns(it => new { it.IsDel, it.DeleteUserId, it.DeleteTime }).ExecuteCommand();
|
|
|
|
|
+
|
|
|
|
|
+ // if (del > 0) return Ok(JsonView(true, "删除成功!"));
|
|
|
|
|
+
|
|
|
|
|
+ // return Ok(JsonView(false, "删除失败!"));
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ //#endregion
|
|
|
|
|
+
|
|
|
|
|
+ //#endregion
|
|
|
|
|
+
|
|
|
#region 签证费用录入
|
|
#region 签证费用录入
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|