|
@@ -1,4 +1,6 @@
|
|
|
|
|
|
+using OASystem.Infrastructure.Repositories.System;
|
|
|
+
|
|
|
namespace OASystem.API.Controllers
|
|
|
{
|
|
|
/// <summary>
|
|
@@ -15,10 +17,12 @@ namespace OASystem.API.Controllers
|
|
|
private readonly ThreeCodeRepository _ThreeCodeRep;
|
|
|
private readonly HotelDataRepository _hotelDataRep;
|
|
|
private readonly ResItemInfoRepository _resItemInfoRep;
|
|
|
+ private readonly SetDataRepository _setDataRepository;
|
|
|
+ private readonly CountryFeeRepository _countryFeeRep;
|
|
|
|
|
|
public ResourceController(IMapper mapper, IConfiguration config, CarDataRepository carDataRep,
|
|
|
LocalGuideDataRepository localGuideDataRep, ThreeCodeRepository threeCodeRep,
|
|
|
- HotelDataRepository hotelDataRep, ResItemInfoRepository resItemInfoRep)
|
|
|
+ HotelDataRepository hotelDataRep, ResItemInfoRepository resItemInfoRep, SetDataRepository setDataRepository, CountryFeeRepository countryFeeRep)
|
|
|
{
|
|
|
_mapper = mapper;
|
|
|
_config = config;
|
|
@@ -27,7 +31,35 @@ namespace OASystem.API.Controllers
|
|
|
_ThreeCodeRep = threeCodeRep;
|
|
|
_hotelDataRep = hotelDataRep;
|
|
|
_resItemInfoRep = resItemInfoRep;
|
|
|
+ _setDataRepository = setDataRepository;
|
|
|
+ _countryFeeRep = countryFeeRep;
|
|
|
}
|
|
|
+ #region 数据类型资料
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> QuerySetData(SetDataDto dto)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (dto.DataType == 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "请传类型Id!"));
|
|
|
+ }
|
|
|
+ var setData = _setDataRepository.QueryDto<Sys_SetData, SetDataView>(s => s.STid == dto.DataType).ToList();
|
|
|
+ if (setData.Count == 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "暂无数据!"));
|
|
|
+ }
|
|
|
+ return Ok(JsonView(true, "查询成功!", setData));
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "程序错误!"));
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
#region 车公司资料板块
|
|
|
|
|
|
/// <summary>
|
|
@@ -279,7 +311,7 @@ namespace OASystem.API.Controllers
|
|
|
data.Add(Local);
|
|
|
}
|
|
|
}
|
|
|
- return Ok(JsonView(true, "查询成功", LocalGuide));
|
|
|
+ return Ok(JsonView(true, "查询成功", data));
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|
|
@@ -587,6 +619,126 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
+ #region 签证费用资料
|
|
|
+ /// <summary>
|
|
|
+ /// 签证费用资料查询
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> QueryCountryFeeCost(DtoBase dto)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (dto.PortType == 1)
|
|
|
+ {
|
|
|
+ var CountryFee = _countryFeeRep.QueryDto<Res_CountryFeeCost, CountryFeeCostView>().ToList();
|
|
|
+ if (CountryFee.Count == 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "暂无数据!"));
|
|
|
+ }
|
|
|
+ CountryFee = CountryFee.OrderByDescending(s => s.CreateTime).ToList();
|
|
|
+ return Ok(JsonView(true, "查询成功", CountryFee));
|
|
|
+ }
|
|
|
+ else if (dto.PortType == 2)
|
|
|
+ {
|
|
|
+ var CountryFee = _countryFeeRep.QueryDto<Res_CountryFeeCost, CountryFeeCostView>().ToList();
|
|
|
+ if (CountryFee.Count == 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "暂无数据!"));
|
|
|
+ }
|
|
|
+ CountryFee = CountryFee.OrderByDescending(s => s.CreateTime).ToList();
|
|
|
+ return Ok(JsonView(true, "查询成功", CountryFee));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "请传入PortType参数!1:Web,2:Android,3:IOS"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "程序错误!"));
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 签证费用资料操作(Status:1.新增,2.修改)
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> OperationCountryFeeCost(OperationCountryFeeCostDto dto)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (dto.VisaContinent == "")
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "请检查州名是否填写!"));
|
|
|
+ }
|
|
|
+ if (dto.VisaCountry == "")
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "请检查国家名是否填写!"));
|
|
|
+ }
|
|
|
+ if (dto.VisaTime == "1")
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "请检一般签证时间是否填写正确!"));
|
|
|
+ }
|
|
|
+ if (dto.UrgentTime == "1")
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "请检加急时间是否填写正确!"));
|
|
|
+ }
|
|
|
+ if (dto.VisaPrice == 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "请检查签证费用是否填写正确,小数点后可1到2位!"));
|
|
|
+ }
|
|
|
+ if (dto.VisaPrice == 1)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "请检查签证加急费用是否填写正确,小数点后可1到2位!"));
|
|
|
+ }
|
|
|
+ Result result = await _countryFeeRep.OperationCountryFeeCost(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> DelCountryFeeCost(DelCountryFeeCostDto dto)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var res = await _countryFeeRep.SoftDeleteByIdAsync<Res_CountryFeeCost>(dto.Id.ToString(), dto.DeleteUserId);
|
|
|
+ if (!res)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "删除失败"));
|
|
|
+ }
|
|
|
+ return Ok(JsonView(true, "删除成功!"));
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "程序错误!"));
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
#region 物料信息、供应商维护
|
|
|
#region 供应商
|
|
|
/// <summary>
|
|
@@ -831,4 +983,6 @@ namespace OASystem.API.Controllers
|
|
|
#endregion
|
|
|
#endregion
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|