|
@@ -783,39 +783,31 @@ namespace OASystem.API.Controllers
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> QueryCountryFeeCost(DtoBase dto)
|
|
|
{
|
|
|
- try
|
|
|
+
|
|
|
+ if (dto.PortType == 1)
|
|
|
{
|
|
|
- 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)
|
|
|
{
|
|
|
- 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));
|
|
|
+ return Ok(JsonView(false, "暂无数据!"));
|
|
|
}
|
|
|
- else
|
|
|
+ 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, "请传入PortType参数!1:Web,2:Android,3:IOS"));
|
|
|
+ return Ok(JsonView(false, "暂无数据!"));
|
|
|
}
|
|
|
+ CountryFee = CountryFee.OrderByDescending(s => s.CreateTime).ToList();
|
|
|
+ return Ok(JsonView(true, "查询成功", CountryFee));
|
|
|
}
|
|
|
- catch (Exception ex)
|
|
|
+ else
|
|
|
{
|
|
|
- return Ok(JsonView(false, ex.Message));
|
|
|
- throw;
|
|
|
+ return Ok(JsonView(false, "请传入PortType参数!1:Web,2:Android,3:IOS"));
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
@@ -827,45 +819,30 @@ namespace OASystem.API.Controllers
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> OperationCountryFeeCost(OperationCountryFeeCostDto dto)
|
|
|
{
|
|
|
- try
|
|
|
+ if (string.IsNullOrWhiteSpace(dto.VisaContinent))
|
|
|
{
|
|
|
- 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));
|
|
|
+ return Ok(JsonView(false, "请检查州名是否填写!"));
|
|
|
}
|
|
|
- catch (Exception ex)
|
|
|
+ if (string.IsNullOrWhiteSpace(dto.VisaCountry))
|
|
|
{
|
|
|
- return Ok(JsonView(false, "程序错误!"));
|
|
|
- throw;
|
|
|
+ return Ok(JsonView(false, "请检查国家名是否填写!"));
|
|
|
+ }
|
|
|
+ if (string.IsNullOrWhiteSpace(dto.VisaTime))
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "请检一般签证时间是否填写正确!"));
|
|
|
+ }
|
|
|
+ if (string.IsNullOrWhiteSpace(dto.UrgentTime))
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "请检加急时间是否填写正确!"));
|
|
|
}
|
|
|
|
|
|
+ Result result = await _countryFeeRep.OperationCountryFeeCost(dto);
|
|
|
+ if (result.Code == 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(true, result.Msg));
|
|
|
+ }
|
|
|
+ return Ok(JsonView(false, result.Msg));
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -876,20 +853,13 @@ namespace OASystem.API.Controllers
|
|
|
[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)
|
|
|
+ var res = await _countryFeeRep.SoftDeleteByIdAsync<Res_CountryFeeCost>(dto.Id.ToString(), dto.DeleteUserId);
|
|
|
+ if (!res)
|
|
|
{
|
|
|
- return Ok(JsonView(false, "程序错误!"));
|
|
|
- throw;
|
|
|
+ return Ok(JsonView(false, "删除失败"));
|
|
|
}
|
|
|
+ return Ok(JsonView(true, "删除成功!"));
|
|
|
+
|
|
|
}
|
|
|
#endregion
|
|
|
|