|
@@ -1,5 +1,8 @@
|
|
|
|
|
|
|
|
|
+using NetTaste;
|
|
|
+using System.Drawing.Printing;
|
|
|
+
|
|
|
namespace OASystem.API.Controllers
|
|
|
{
|
|
|
/// <summary>
|
|
@@ -251,7 +254,7 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> LocalGuideOperation(LocalGuideOperationDto dto)
|
|
|
+ public async Task<IActionResult> OperationLocalGuide(LocalGuideOperationDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
@@ -277,7 +280,7 @@ namespace OASystem.API.Controllers
|
|
|
{
|
|
|
return Ok(JsonView(false, result.Msg));
|
|
|
}
|
|
|
- return Ok(JsonView(true, result.Msg, new { Id = result.Data }));
|
|
|
+ return Ok(JsonView(true, result.Msg));
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -292,7 +295,7 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> LocalGuideDel(LocalGuideDelDto dto)
|
|
|
+ public async Task<IActionResult> DelLocalGuide(LocalGuideDelDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
@@ -335,13 +338,18 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
else if (dto.PortType == 2)
|
|
|
{
|
|
|
- var ThreeCode = _localGuideDataRep.QueryDto<Res_ThreeCode, ThreeCodeView>().ToList();
|
|
|
- if (ThreeCode.Count == 0)
|
|
|
+ //分页写法
|
|
|
+ if (dto.PageIndex==0 || dto.PageSize==0)
|
|
|
{
|
|
|
- return Ok(JsonView(false, "暂无数据!"));
|
|
|
+ return Ok(JsonView(false, "请传入PageIndex和PageSize参数"));
|
|
|
}
|
|
|
- ThreeCode = ThreeCode.OrderByDescending(s => s.CreateTime).ToList();
|
|
|
- return Ok(JsonView(true, "查询成功", ThreeCode));
|
|
|
+ JsonView _ThreeCode = await _ThreeCodeRep.QuerThreeCode(dto.PageIndex, dto.PageSize);
|
|
|
+ if (_ThreeCode.Code != 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, _ThreeCode.Msg));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(_ThreeCode);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -358,6 +366,71 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 机场编辑,添加操作
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> OperationThreeCode(ThreeCodeOperationDto dto)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (dto.Three == "")
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "请检查三字码是否填写!"));
|
|
|
+ }
|
|
|
+ if (dto.Country == "")
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "请检查国家是否填写!"));
|
|
|
+ }
|
|
|
+ if (dto.City == "")
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "请检查城市是否填写正确!"));
|
|
|
+ }
|
|
|
+ if (dto.AirPort == "")
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "请检查机场是否填写正确!"));
|
|
|
+ }
|
|
|
+
|
|
|
+ Result result = await _ThreeCodeRep.ThreeCodeOperation(dto);
|
|
|
+ if (result.Code != 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, result.Msg));
|
|
|
+ }
|
|
|
+ return Ok(JsonView(true, result.Msg));
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "程序错误!"));
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 机场三字码资料操作(删除)
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> DelThreeCode(ThreeCodeDelDto dto)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var res = await _ThreeCodeRep.SoftDeleteByIdAsync<Res_ThreeCode>(dto.Id.ToString(), dto.DeleteUserId);
|
|
|
+ if (!res)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "删除失败"));
|
|
|
+ }
|
|
|
+ return Ok(JsonView(true, "删除成功!"));
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "程序错误!"));
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+ }
|
|
|
#endregion
|
|
|
}
|
|
|
}
|