|
@@ -17,6 +17,7 @@ import com.fjhx.account.entity.account.po.AccountRunningWater;
|
|
|
import com.fjhx.account.entity.account.vo.AccountRunningWaterVo;
|
|
|
import com.fjhx.account.entity.tax.po.TaxRefundDetails;
|
|
|
import com.fjhx.account.mapper.account.AccountRunningWaterMapper;
|
|
|
+import com.fjhx.account.service.AccountService;
|
|
|
import com.fjhx.account.service.account.AccountManagementService;
|
|
|
import com.fjhx.account.service.account.AccountRemainderService;
|
|
|
import com.fjhx.account.service.account.AccountRunningWaterService;
|
|
@@ -67,11 +68,14 @@ public class AccountRunningWaterServiceImpl extends ServiceImpl<AccountRunningWa
|
|
|
@Autowired
|
|
|
private TaxRefundDetailsService taxRefundDetailsService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private AccountService accountService;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 分页条件抽取
|
|
|
*/
|
|
|
- private QueryWrapper<Object> getPageWrapper(AccountRunningWaterSelectDto dto){
|
|
|
+ private QueryWrapper<Object> getPageWrapper(AccountRunningWaterSelectDto dto) {
|
|
|
QueryWrapper<Object> wrapper = Wrappers.query();
|
|
|
// 资金账户
|
|
|
wrapper.eq(ObjectUtil.isNotEmpty(dto.getAccountManagementId()), "arw.account_management_id", dto.getAccountManagementId());
|
|
@@ -298,6 +302,9 @@ public class AccountRunningWaterServiceImpl extends ServiceImpl<AccountRunningWa
|
|
|
changeRemainder(accountRunningWaterDto);
|
|
|
|
|
|
this.updateById(accountRunningWaterDto);
|
|
|
+
|
|
|
+ //修改流水时候也需要重新汇算
|
|
|
+ settleAccounts(accountRunningWaterDto);
|
|
|
}
|
|
|
|
|
|
@DSTransactional
|
|
@@ -526,4 +533,24 @@ public class AccountRunningWaterServiceImpl extends ServiceImpl<AccountRunningWa
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 汇算(流水金额转人民币金额重新计算)
|
|
|
+ */
|
|
|
+ @DSTransactional
|
|
|
+ @Override
|
|
|
+ public synchronized void settleAccounts(AccountRunningWater dto) {
|
|
|
+ AccountRunningWater oldAccountRunningWater = this.getById(dto.getId());
|
|
|
+ BigDecimal amountCny = dto.getAmountCny();
|
|
|
+ BigDecimal rate = amountCny.divide(oldAccountRunningWater.getAmount());
|
|
|
+
|
|
|
+ //只修改以下字段
|
|
|
+ AccountRunningWater newAccountRunningWater = new AccountRunningWater();
|
|
|
+ newAccountRunningWater.setId(oldAccountRunningWater.getId());
|
|
|
+ newAccountRunningWater.setRate(rate);
|
|
|
+ newAccountRunningWater.setAmountCny(amountCny);
|
|
|
+ this.updateById(newAccountRunningWater);
|
|
|
+ //将已经到账的合同按新汇率重新计算到账人民币金额
|
|
|
+ accountService.updateClaimInfo(newAccountRunningWater);
|
|
|
+ }
|
|
|
+
|
|
|
}
|