|
@@ -7196,29 +7196,27 @@ FROM
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> EnterExitCostDraftDataSource(PortDtoBase dto)
|
|
|
{
|
|
|
- try
|
|
|
- {
|
|
|
- var draftNameDatas = await _sqlSugar.Queryable<Grp_EnterExitCostDraft>()
|
|
|
- .Where(x => x.IsDel == 0)
|
|
|
- .OrderByDescending(x => x.CreateTime)
|
|
|
- .Select(x => new { x.Id, x.DraftName })
|
|
|
- .ToListAsync();
|
|
|
+ var draftNameDatas = await _sqlSugar.Queryable<Grp_EnterExitCostDraft>()
|
|
|
+ .Where(x => x.IsDel == 0)
|
|
|
+ .OrderByDescending(x => x.CreateTime)
|
|
|
+ .Select(x => new { x.Id, x.DraftName })
|
|
|
+ .ToListAsync();
|
|
|
|
|
|
- string sql = string.Format("Select * From Sys_SetData Where IsDel = 0");
|
|
|
- //SetDataInfoView
|
|
|
- var dataSource = await _sqlSugar.SqlQueryable<Sys_SetData>(sql).ToListAsync();
|
|
|
+ string sql = string.Format("Select * From Sys_SetData Where IsDel = 0");
|
|
|
+ //SetDataInfoView
|
|
|
+ var dataSource = await _sqlSugar.SqlQueryable<Sys_SetData>(sql).ToListAsync();
|
|
|
|
|
|
- var currencyData = dataSource.Where(it => it.STid == 66).ToList(); //所有币种
|
|
|
- var _CurrencyData = _mapper.Map<List<SetDataInfoView>>(currencyData);
|
|
|
+ var currencyData = dataSource.Where(it => it.STid == 66).ToList(); //所有币种
|
|
|
+ var _CurrencyData = _mapper.Map<List<SetDataInfoView>>(currencyData);
|
|
|
|
|
|
- var wordTypeData = dataSource.Where(it => it.STid == 72).ToList(); //三公费用-Word明细类型
|
|
|
- var _WordTypeData = _mapper.Map<List<SetDataInfoView>>(wordTypeData);
|
|
|
+ var wordTypeData = dataSource.Where(it => it.STid == 72).ToList(); //三公费用-Word明细类型
|
|
|
+ var _WordTypeData = _mapper.Map<List<SetDataInfoView>>(wordTypeData);
|
|
|
|
|
|
- var excelTypeData = dataSource.Where(it => it.STid == 73).ToList(); //三公费用-Excel明细类型
|
|
|
- var _ExcelTypeData = _mapper.Map<List<SetDataInfoView>>(excelTypeData);
|
|
|
+ var excelTypeData = dataSource.Where(it => it.STid == 73).ToList(); //三公费用-Excel明细类型
|
|
|
+ var _ExcelTypeData = _mapper.Map<List<SetDataInfoView>>(excelTypeData);
|
|
|
|
|
|
- //默认币种显示
|
|
|
- List<CurrencyInfo> _currencyInfos = new List<CurrencyInfo>()
|
|
|
+ //默认币种显示
|
|
|
+ List<CurrencyInfo> _currencyInfos = new List<CurrencyInfo>()
|
|
|
{
|
|
|
new CurrencyInfo (){ CurrencyCode="USD",CurrencyName = "美元",Rate = 7.5000M },
|
|
|
new CurrencyInfo (){ CurrencyCode="EUR",CurrencyName = "欧元",Rate = 8.0000M },
|
|
@@ -7228,36 +7226,30 @@ FROM
|
|
|
|
|
|
};
|
|
|
|
|
|
- var _currencyRate = await _juHeApi.PostItemRateAsync(_currencyInfos.Select(it => it.CurrencyCode).ToArray());
|
|
|
- if (_currencyRate.Count > 0)
|
|
|
+ var _currencyRate = await _juHeApi.PostItemRateAsync(_currencyInfos.Select(it => it.CurrencyCode).ToArray());
|
|
|
+ if (_currencyRate.Count > 0)
|
|
|
+ {
|
|
|
+ foreach (var item in _currencyInfos)
|
|
|
{
|
|
|
- foreach (var item in _currencyInfos)
|
|
|
+ var rateInfo = _currencyRate.Where(it => it.Name.Equals(item.CurrencyName)).FirstOrDefault();
|
|
|
+ if (rateInfo != null)
|
|
|
{
|
|
|
- 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;
|
|
|
+ decimal rate1 = Convert.ToDecimal(rateInfo.FSellPri) / 100.00M;
|
|
|
+ rate1 *= 1.035M;
|
|
|
|
|
|
- item.Rate = Convert.ToDecimal(rate1.ToString("#0.00")) + 0.01M;
|
|
|
- }
|
|
|
+ item.Rate = Convert.ToDecimal(rate1.ToString("#0.00")) + 0.01M;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- return Ok(JsonView(true, "查询成功!", new
|
|
|
- {
|
|
|
- DraftNameDatas = draftNameDatas,
|
|
|
- CurrencyData = _CurrencyData,
|
|
|
- WordTypeData = _WordTypeData,
|
|
|
- ExcelTypeData = _ExcelTypeData,
|
|
|
- CurrencyInit = _currencyInfos
|
|
|
- }));
|
|
|
}
|
|
|
- catch (Exception ex)
|
|
|
+
|
|
|
+ return Ok(JsonView(true, "查询成功!", new
|
|
|
{
|
|
|
- return Ok(JsonView(false, ex.Message));
|
|
|
- throw;
|
|
|
- }
|
|
|
+ DraftNameDatas = draftNameDatas,
|
|
|
+ CurrencyData = _CurrencyData,
|
|
|
+ WordTypeData = _WordTypeData,
|
|
|
+ ExcelTypeData = _ExcelTypeData,
|
|
|
+ CurrencyInit = _currencyInfos
|
|
|
+ }));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -7320,7 +7312,7 @@ FROM
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> EnterExitCostDraftInfobyDiId(EnterExitCostDraftInfobyDiIdDto dto)
|
|
|
+ public async Task<IActionResult> EnterExitCostDraftInfoById(EnterExitCostDraftInfoByIdDto dto)
|
|
|
{
|
|
|
return Ok(await _enterExitCostDraftRep.EnterExitCostDraftInfoById(dto));
|
|
|
}
|