|
@@ -28,6 +28,7 @@ import com.fjhx.common.service.documentary.GetDocumentaryBusinessTemplate;
|
|
|
import com.fjhx.customer.entity.customer.dto.CustomerDto;
|
|
|
import com.fjhx.customer.entity.customer.po.Customer;
|
|
|
import com.fjhx.customer.service.customer.CustomerService;
|
|
|
+import com.fjhx.sale.entity.contract.bo.ContractCurrencyRate;
|
|
|
import com.fjhx.sale.entity.purchase.po.EhsdPurchaseProduct;
|
|
|
import com.fjhx.sale.entity.purchase.vo.EhsdPurchaseProductVo;
|
|
|
import com.fjhx.sale.entity.serviceContract.po.ServiceContract;
|
|
@@ -239,7 +240,8 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
|
|
|
}
|
|
|
}
|
|
|
if(StringUtils.isNotEmpty(v.getCurrencyRateJson())){//如果此条合同有汇率了
|
|
|
- Map<String,Object> map = JSON.parseObject(v.getCurrencyRateJson());
|
|
|
+ List<ContractCurrencyRate> contractCurrencyRates = JSON.parseArray(v.getCurrencyRateJson(), ContractCurrencyRate.class);
|
|
|
+ Map<String,BigDecimal> map = contractCurrencyRates.stream().collect(Collectors.toMap(ContractCurrencyRate::getType,ContractCurrencyRate::getRate));
|
|
|
//计算收入总计=合同金额(转人民币)+应退税金额(转人民币)
|
|
|
v.setIncomeAmount(v.getAmount().multiply(new BigDecimal(map.getOrDefault(v.getCurrency(), BigDecimal.ONE).toString())).add(v.getRefundableAmount()));
|
|
|
//计算支出总计 除合同金额(转人民币)+应退税金额(转人民币) 其他金额相加
|