md
This commit is contained in:
parent
175ccda4ee
commit
54fe327fe1
@ -77,9 +77,9 @@ public class EmisExchangeRateController extends BaseController
|
||||
|
||||
|
||||
@GetMapping("/getValidExchangeRate")
|
||||
public AjaxResult getValidExchangeRate(String from,String to)
|
||||
public AjaxResult getValidExchangeRate(String from,String to,String rateDate)
|
||||
{
|
||||
EmisExchangeRate emisExchangeRate=emisExchangeRateService.getValidExchangeRate(from,to);
|
||||
EmisExchangeRate emisExchangeRate=emisExchangeRateService.getValidExchangeRate(from,to,rateDate);
|
||||
float rate=0.0f;
|
||||
if(emisExchangeRate!=null){
|
||||
rate=Float.valueOf(emisExchangeRate.getRate());
|
||||
|
||||
@ -48,7 +48,7 @@ public interface EmisExchangeRateMapper extends BaseMapper<EmisExchangeRate>
|
||||
public int checkUnique(EmisExchangeRate emisExchangeRate);
|
||||
|
||||
|
||||
public EmisExchangeRate getValidExchangeRate(@Param("from") String from,@Param("to") String to);
|
||||
public EmisExchangeRate getValidExchangeRate(@Param("from") String from,@Param("to") String to,@Param("rateDate") String rateDate);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
|
||||
@ -50,7 +50,7 @@ public interface IEmisExchangeRateService
|
||||
* @param to
|
||||
* @return
|
||||
*/
|
||||
public EmisExchangeRate getValidExchangeRate(String from, String to);
|
||||
public EmisExchangeRate getValidExchangeRate(String from, String to,String rateDate);
|
||||
|
||||
/**
|
||||
* 新增汇率维护
|
||||
|
||||
@ -67,9 +67,9 @@ public class EmisExchangeRateServiceImpl implements IEmisExchangeRateService
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmisExchangeRate getValidExchangeRate(String from, String to)
|
||||
public EmisExchangeRate getValidExchangeRate(String from, String to,String rateDate)
|
||||
{
|
||||
return emisExchangeRateMapper.getValidExchangeRate(from, to);
|
||||
return emisExchangeRateMapper.getValidExchangeRate(from, to,rateDate);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1888,7 +1888,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
|
||||
// 汇率计算
|
||||
if( !StringUtils.isEmpty(feeItem.getCurrency()) && !"CNY".equals(feeItem.getCurrency()) ){
|
||||
EmisExchangeRate emisExchangeRate=emisExchangeRateMapper.getValidExchangeRate(feeItem.getCurrency(),"CNY");
|
||||
EmisExchangeRate emisExchangeRate=emisExchangeRateMapper.getValidExchangeRate(feeItem.getCurrency(),"CNY",null);
|
||||
|
||||
if(emisExchangeRate!=null){
|
||||
BigDecimal rate=BigDecimal.valueOf(Double.valueOf(emisExchangeRate.getRate()));
|
||||
@ -2271,7 +2271,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
if(realFee!=null){
|
||||
// 汇率计算
|
||||
if( !StringUtils.isEmpty(feeItem.getCurrency()) && !"CNY".equals(feeItem.getCurrency()) ){
|
||||
EmisExchangeRate emisExchangeRate=emisExchangeRateMapper.getValidExchangeRate(feeItem.getCurrency(),"CNY");
|
||||
EmisExchangeRate emisExchangeRate=emisExchangeRateMapper.getValidExchangeRate(feeItem.getCurrency(),"CNY",null);
|
||||
|
||||
if(emisExchangeRate!=null){
|
||||
BigDecimal rate=BigDecimal.valueOf(Double.valueOf(emisExchangeRate.getRate()));
|
||||
@ -3096,7 +3096,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
|
||||
// 汇率计算
|
||||
if (!StringUtils.isEmpty(feeItem.getCurrency()) && !"CNY".equals(feeItem.getCurrency())) {
|
||||
EmisExchangeRate emisExchangeRate = emisExchangeRateMapper.getValidExchangeRate(feeItem.getCurrency(), "CNY");
|
||||
EmisExchangeRate emisExchangeRate = emisExchangeRateMapper.getValidExchangeRate(feeItem.getCurrency(), "CNY",null);
|
||||
|
||||
if (emisExchangeRate != null) {
|
||||
BigDecimal rate = BigDecimal.valueOf(Double.valueOf(emisExchangeRate.getRate()));
|
||||
|
||||
@ -72,7 +72,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select id, currency, dest_currency, rate, start_date, end_date, bl_valid, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site
|
||||
from emis_exchange_rate a
|
||||
where a.currency=#{from} and a.dest_currency=#{to}
|
||||
and start_date <![CDATA[ <= ]]> now() and now() <![CDATA[ <= ]]> end_date
|
||||
<if test="rateDate != null and rateDate != ''">
|
||||
and start_date <![CDATA[ <= ]]> #{rateDate} and #{rateDate} <![CDATA[ <= ]]> end_date
|
||||
</if>
|
||||
<if test="rateDate == null">
|
||||
and start_date <![CDATA[ <= ]]> now() and now() <![CDATA[ <= ]]> end_date
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user