|
@@ -399,7 +399,6 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
#region 团组前期信息
|
|
|
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// 团组前期信息 List
|
|
|
/// </summary>
|
|
@@ -7489,44 +7488,37 @@ FROM
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> GetNationalTravelFeeData(PortDtoBase dto)
|
|
|
{
|
|
|
- try
|
|
|
- {
|
|
|
- Stopwatch sw = new Stopwatch();
|
|
|
- sw.Start();
|
|
|
- string nationalTravelFeeSql = string.Format(@"Select ssd.Name as CurrencyCode, ssd.Remark as CurrencyName,su.CnName as LastUpdateUserName,gntf.* From Grp_NationalTravelFee gntf
|
|
|
+ Stopwatch sw = new Stopwatch();
|
|
|
+ sw.Start();
|
|
|
+ string nationalTravelFeeSql = string.Format(@"Select ssd.Name as CurrencyCode, ssd.Remark as CurrencyName,su.CnName as LastUpdateUserName,gntf.* From Grp_NationalTravelFee gntf
|
|
|
Left Join Sys_SetData ssd On ssd.STid = 66 And gntf.Currency = ssd.Id
|
|
|
Left Join Sys_Users su On gntf.LastUpdateUserId = su.Id
|
|
|
Where gntf.Isdel = 0");
|
|
|
- var nationalTravelFeeData = _sqlSugar.SqlQueryable<NationalTravelFeeInfoView>(nationalTravelFeeSql).ToList();
|
|
|
+ var nationalTravelFeeData = _sqlSugar.SqlQueryable<NationalTravelFeeInfoView>(nationalTravelFeeSql).ToList();
|
|
|
|
|
|
- //var nationalTravel = nationalTravelFeeData.GroupBy(it => it.Country).Select(it1 => it1.FirstOrDefault());
|
|
|
+ //var nationalTravel = nationalTravelFeeData.GroupBy(it => it.Country).Select(it1 => it1.FirstOrDefault());
|
|
|
|
|
|
- //List<dynamic> nationalTravelFeeData1 = new List<dynamic>();
|
|
|
+ //List<dynamic> nationalTravelFeeData1 = new List<dynamic>();
|
|
|
|
|
|
- //foreach (var item in nationalTravel)
|
|
|
- //{
|
|
|
- // var cityData = nationalTravelFeeData.Where(it => it.Country == item.Country).ToList();
|
|
|
- // var otherData = cityData.Where(it => it.City.Contains("其他城市")).FirstOrDefault();
|
|
|
- // if (otherData != null)
|
|
|
- // {
|
|
|
- // cityData.Remove(otherData);
|
|
|
- // cityData.Add(otherData);
|
|
|
- // }
|
|
|
- // nationalTravelFeeData1.Add(new
|
|
|
- // {
|
|
|
- // Country = item.Country,
|
|
|
- // CityData = cityData
|
|
|
- // });
|
|
|
- //}
|
|
|
+ //foreach (var item in nationalTravel)
|
|
|
+ //{
|
|
|
+ // var cityData = nationalTravelFeeData.Where(it => it.Country == item.Country).ToList();
|
|
|
+ // var otherData = cityData.Where(it => it.City.Contains("其他城市")).FirstOrDefault();
|
|
|
+ // if (otherData != null)
|
|
|
+ // {
|
|
|
+ // cityData.Remove(otherData);
|
|
|
+ // cityData.Add(otherData);
|
|
|
+ // }
|
|
|
+ // nationalTravelFeeData1.Add(new
|
|
|
+ // {
|
|
|
+ // Country = item.Country,
|
|
|
+ // CityData = cityData
|
|
|
+ // });
|
|
|
+ //}
|
|
|
+
|
|
|
+ sw.Stop();
|
|
|
+ return Ok(JsonView(true, "查询成功!耗时:" + sw.ElapsedMilliseconds + "ms", nationalTravelFeeData));
|
|
|
|
|
|
- sw.Stop();
|
|
|
- return Ok(JsonView(true, "查询成功!耗时:" + sw.ElapsedMilliseconds + "ms", nationalTravelFeeData));
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
- return Ok(JsonView(false, ex.Message));
|
|
|
- throw;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -7572,22 +7564,18 @@ FROM
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> PostNationalTravelFeePage(NationalTravelFeePageDto dto)
|
|
|
{
|
|
|
- int portId = dto.PortType;
|
|
|
+ int portId = dto.PortType,
|
|
|
+ pageIndex = dto.PageIndex,
|
|
|
+ pageSize = dto.PageSize;
|
|
|
if (portId != 1 && portId != 2 && portId != 3) return Ok(JsonView(false, "请输入正确的端口号!\r\n请求端口分类1 Web 2 Android 3 IOS"));
|
|
|
|
|
|
- if (dto.PageIndex == 0) return Ok(JsonView(false, "当前页码数不能为0!"));
|
|
|
- if (dto.PageSize == 0) return Ok(JsonView(false, "每页条数不能0!"));
|
|
|
+ if (pageIndex == 0) pageIndex = 1;
|
|
|
+ if (pageSize == 0) pageSize = 10;
|
|
|
|
|
|
string whereSql = string.Empty;
|
|
|
- if (!string.IsNullOrEmpty(dto.Country))
|
|
|
- {
|
|
|
- whereSql += string.Format(@" And gntf.Country ='{0}'", dto.Country);
|
|
|
- }
|
|
|
+ if (!string.IsNullOrEmpty(dto.Country)) whereSql += string.Format(@" And gntf.Country ='{0}'", dto.Country);
|
|
|
|
|
|
- if (!string.IsNullOrEmpty(dto.City))
|
|
|
- {
|
|
|
- whereSql += string.Format(@" And gntf.City='{0}'", dto.City);
|
|
|
- }
|
|
|
+ if (!string.IsNullOrEmpty(dto.City)) whereSql += string.Format(@" And gntf.City='{0}'", dto.City);
|
|
|
|
|
|
string pageSql = string.Format(@"Select * From (
|
|
|
Select row_number() over(order by gntf.LastUpdateTime Desc) as RowNumber,
|
|
@@ -7597,9 +7585,7 @@ FROM
|
|
|
Left Join Sys_Users su On gntf.LastUpdateUserId = su.Id
|
|
|
Where gntf.Isdel = 0 {0} ) temp ", whereSql);
|
|
|
RefAsync<int> total = 0;
|
|
|
- var nationalTravelFeeData = await _groupRepository._sqlSugar.SqlQueryable<NationalTravelFeePageInfoView>(pageSql).ToPageListAsync(dto.PageIndex, dto.PageSize, total);
|
|
|
-
|
|
|
-
|
|
|
+ var nationalTravelFeeData = await _sqlSugar.SqlQueryable<NationalTravelFeePageInfoView>(pageSql).ToPageListAsync(dto.PageIndex, dto.PageSize, total);
|
|
|
|
|
|
return Ok(JsonView(true, "查询成功!", nationalTravelFeeData, (int)total));
|
|
|
|
|
@@ -7629,9 +7615,8 @@ FROM
|
|
|
whereSql = string.Format(@"And City = '{0}' ", dto.City);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
string sql = string.Format(@"Select gntf.Country,gntf.City,gntf.Currency,ssd.Name as CurrencyCode,
|
|
|
- ssd.Remark as CurrencyName,gntf.RoomCost,gntf.FoodCost,gntf.PublicCost,
|
|
|
+ ssd.Remark as CurrencyName,gntf.RoomCost,gntf.FoodCost,gntf.PublicCost,gntf.TrainCost,
|
|
|
gntf.LastUpdateUserId,su.CnName as LastUpdateUserName,gntf.LastUpdateTime
|
|
|
From Grp_NationalTravelFee gntf
|
|
|
Left Join Sys_SetData ssd On ssd.STid = 66 And gntf.Currency = ssd.Id
|
|
@@ -7640,8 +7625,6 @@ FROM
|
|
|
|
|
|
var nationalTravelFeeData = await _groupRepository._sqlSugar.SqlQueryable<NationalTravelFeeInfoByCountryAndCityView>(sql).FirstAsync();
|
|
|
|
|
|
-
|
|
|
-
|
|
|
return Ok(JsonView(true, "查询成功!", nationalTravelFeeData));
|
|
|
|
|
|
}
|
|
@@ -7654,16 +7637,7 @@ FROM
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> PostNationalTravelFeeOperate(NationalTravelFeeOperateDto dto)
|
|
|
{
|
|
|
-
|
|
|
- var data = await _enterExitCostRep.PostNationalTravelFeeOperate(dto);
|
|
|
-
|
|
|
- if (data.Code != 0)
|
|
|
- {
|
|
|
- return Ok(JsonView(false, data.Msg));
|
|
|
- }
|
|
|
-
|
|
|
- return Ok(JsonView(true, "操作成功!", data.Data));
|
|
|
-
|
|
|
+ return Ok(await _enterExitCostRep.PostNationalTravelFeeOperate(dto));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|