Commit 77225d3a by zhangxingmin

Merge remote-tracking branch 'origin/test' into test

parents 2a96b3b7 72756004
...@@ -25,11 +25,14 @@ public class FortuneAccountExportDTO implements Serializable { ...@@ -25,11 +25,14 @@ public class FortuneAccountExportDTO implements Serializable {
private String teamBizId; private String teamBizId;
@ExcelProperty("出账币种") @ExcelProperty("发放币种")
private String currency; private String payoutCurrency;
@ExcelProperty("出账总额") @ExcelProperty("发放金额")
private BigDecimal amount; private BigDecimal payoutAmount;
@ExcelProperty("出账港币总额")
private BigDecimal hkdAmount;
private List<Fortune> fortuneList; private List<Fortune> fortuneList;
......
...@@ -54,17 +54,17 @@ public class FortuneAccount implements Serializable { ...@@ -54,17 +54,17 @@ public class FortuneAccount implements Serializable {
private String teamBizId; private String teamBizId;
/** /**
* 出账币种 * 发放币种
*/ */
private String currency; private String payoutCurrency;
/** /**
* 出账总 * 发放金
*/ */
private BigDecimal amount; private BigDecimal payoutAmount;
/** /**
* 港币出账金额 * 港币金额
*/ */
private BigDecimal hkdAmount; private BigDecimal hkdAmount;
......
...@@ -167,8 +167,9 @@ public class FortuneAccountServiceImpl extends ServiceImpl<FortuneAccountMapper, ...@@ -167,8 +167,9 @@ public class FortuneAccountServiceImpl extends ServiceImpl<FortuneAccountMapper,
fortuneAccount.setBrokerBizId(accountExportDTO.getBrokerBizId()); fortuneAccount.setBrokerBizId(accountExportDTO.getBrokerBizId());
fortuneAccount.setTeam(accountExportDTO.getTeam()); fortuneAccount.setTeam(accountExportDTO.getTeam());
fortuneAccount.setTeamBizId(accountExportDTO.getTeamBizId()); fortuneAccount.setTeamBizId(accountExportDTO.getTeamBizId());
fortuneAccount.setCurrency(accountExportDTO.getCurrency()); fortuneAccount.setPayoutCurrency(accountExportDTO.getPayoutCurrency());
fortuneAccount.setHkdAmount(accountExportDTO.getAmount()); fortuneAccount.setPayoutAmount(accountExportDTO.getPayoutAmount());
fortuneAccount.setHkdAmount(accountExportDTO.getHkdAmount());
fortuneAccount.setFortuneAccountDate(this.getActualPayoutDate(accountExportDTO.getActualPayoutDate())); fortuneAccount.setFortuneAccountDate(this.getActualPayoutDate(accountExportDTO.getActualPayoutDate()));
// 出账状态默认待出账 // 出账状态默认待出账
fortuneAccount.setStatus(FortuneStatusEnum.CHECKED.getItemValue()); fortuneAccount.setStatus(FortuneStatusEnum.CHECKED.getItemValue());
......
...@@ -431,7 +431,7 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune> ...@@ -431,7 +431,7 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
for (Map.Entry<String, List<Fortune>> entry : fortuneMap.entrySet()) { for (Map.Entry<String, List<Fortune>> entry : fortuneMap.entrySet()) {
String broker = entry.getKey().split("_")[0]; String broker = entry.getKey().split("_")[0];
String actualPayoutDate = entry.getKey().split("_")[1]; String actualPayoutDate = entry.getKey().split("_")[1];
String currency = entry.getKey().split("_")[2]; String payoutCurrency = entry.getKey().split("_")[2];
List<Fortune> brokerFortunes = entry.getValue(); List<Fortune> brokerFortunes = entry.getValue();
FortuneAccountExportDTO accountDTO = new FortuneAccountExportDTO(); FortuneAccountExportDTO accountDTO = new FortuneAccountExportDTO();
...@@ -443,15 +443,19 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune> ...@@ -443,15 +443,19 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
if (CollUtil.isNotEmpty(brokerFortunes)) { if (CollUtil.isNotEmpty(brokerFortunes)) {
accountDTO.setTeam(brokerFortunes.get(0).getTeam()); accountDTO.setTeam(brokerFortunes.get(0).getTeam());
accountDTO.setTeamBizId(brokerFortunes.get(0).getTeamBizId()); accountDTO.setTeamBizId(brokerFortunes.get(0).getTeamBizId());
accountDTO.setCurrency(currency); accountDTO.setPayoutCurrency(payoutCurrency);
accountDTO.setActualPayoutDate(LocalDate.parse(actualPayoutDate)); accountDTO.setActualPayoutDate(LocalDate.parse(actualPayoutDate));
} }
// 计算出账总额 // 计算出账港币总额、发放币种总额
BigDecimal totalAmount = brokerFortunes.stream() BigDecimal totalHkdAmount = BigDecimal.ZERO;
.map(Fortune::getCurrentPaymentHkdAmount) BigDecimal totalPayoutAmount = BigDecimal.ZERO;
.reduce(BigDecimal.ZERO, BigDecimal::add); for (Fortune fortune : brokerFortunes) {
accountDTO.setAmount(totalAmount); totalHkdAmount = totalHkdAmount.add(fortune.getCurrentPaymentHkdAmount());
totalPayoutAmount = totalPayoutAmount.add(fortune.getPayoutAmount());
}
accountDTO.setHkdAmount(totalHkdAmount);
accountDTO.setPayoutAmount(totalPayoutAmount);
// 按fortune项目分组并累加金额 // 按fortune项目分组并累加金额
Map<String, BigDecimal> fortuneAmountMap = brokerFortunes.stream() Map<String, BigDecimal> fortuneAmountMap = brokerFortunes.stream()
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
<result property="brokerBizId" column="broker_biz_id" /> <result property="brokerBizId" column="broker_biz_id" />
<result property="team" column="team" /> <result property="team" column="team" />
<result property="teamBizId" column="team_biz_id" /> <result property="teamBizId" column="team_biz_id" />
<result property="currency" column="currency" /> <result property="payoutCurrency" column="payout_currency" />
<result property="amount" column="amount" /> <result property="payoutAmount" column="payout_amount" />
<result property="hkdAmount" column="hkd_amount" /> <result property="hkdAmount" column="hkd_amount" />
<result property="status" column="status" /> <result property="status" column="status" />
<result property="fortuneAccountDate" column="fortune_account_date" /> <result property="fortuneAccountDate" column="fortune_account_date" />
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id,fortune_account_biz_id,broker,broker_biz_id,team,team_biz_id, id,fortune_account_biz_id,broker,broker_biz_id,team,team_biz_id,
currency,amount,hkd_amount,status,fortune_account_date,content,remark, payout_currency,payout_amount,hkd_amount,status,fortune_account_date,content,remark,
is_deleted,creator_id,updater_id,create_time,update_time is_deleted,creator_id,updater_id,create_time,update_time
</sql> </sql>
</mapper> </mapper>
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