Commit 1729a577 by wutong

管理成本报表如果是原币付款的,统计费用的时候要换成人民币,明细里面“金额”这一列保留原币种金额,“人民币金额”这一列换成人民币即可,而不是原币。

parent 70e1f364
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.blt</groupId> <groupId>com.blt</groupId>
<artifactId>other</artifactId> <artifactId>cost-core</artifactId>
<version>1.1.13</version> <version>1.1.13</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>other</name> <name>cost-core</name>
<description>blt other purcharse</description> <description>blt other purcharse</description>
<parent> <parent>
......
...@@ -26,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -26,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -173,6 +174,14 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -173,6 +174,14 @@ public class CostApiServiceImpl implements CostApiService {
} }
} }
List<ManageCostDto> manageCostDtoList = costDao.selectManageCost(startDate, DateTimeUtil.addDays(endDate, 1), feeSuperType, feeSubType, companyValueList, companyName, departmentName, createUserId, payUserId); List<ManageCostDto> manageCostDtoList = costDao.selectManageCost(startDate, DateTimeUtil.addDays(endDate, 1), feeSuperType, feeSubType, companyValueList, companyName, departmentName, createUserId, payUserId);
if (manageCostDtoList != null && !manageCostDtoList.isEmpty()) {
for (ManageCostDto manageCostDto : manageCostDtoList) {
if (!manageCostDto.getCurrency().equals("CNY")) {
BigDecimal exhcnageRate = CurUtils.getCur(manageCostDto.getCurrency(), "CNY", getExchangeRateApi);
manageCostDto.setAmountRmb(manageCostDto.getAmount().multiply(exhcnageRate).setScale(4, RoundingMode.HALF_EVEN));
}
}
}
if ((companyValue == null || companyValue == 2) && ((feeSuperType == null && departmentName == null) || if ((companyValue == null || companyValue == 2) && ((feeSuperType == null && departmentName == null) ||
(("耗材".equals(feeSuperType) || "耗材".equals(feeSubType)) && "采购部".equals(departmentName)) || (("耗材".equals(feeSuperType) || "耗材".equals(feeSubType)) && "采购部".equals(departmentName)) ||
(("耗材".equals(feeSuperType) || "耗材".equals(feeSubType)) && departmentName == null))){ (("耗材".equals(feeSuperType) || "耗材".equals(feeSubType)) && departmentName == null))){
...@@ -190,6 +199,10 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -190,6 +199,10 @@ public class CostApiServiceImpl implements CostApiService {
manageCostDto.setCompanyName("香港百伦科技有限公司"); manageCostDto.setCompanyName("香港百伦科技有限公司");
manageCostDto.setFeeSuperType("耗材"); manageCostDto.setFeeSuperType("耗材");
manageCostDto.setFeeSubType("耗材"); manageCostDto.setFeeSubType("耗材");
if (!manageCostDto.getCurrency().equals("CNY")) {
BigDecimal exhcnageRate = CurUtils.getCur(manageCostDto.getCurrency(), "CNY", getExchangeRateApi);
manageCostDto.setAmountRmb(manageCostDto.getAmount().multiply(exhcnageRate).setScale(4, RoundingMode.HALF_EVEN));
}
manageCostDtoList.add(manageCostDto); manageCostDtoList.add(manageCostDto);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment