|
@@ -21,6 +21,7 @@ import com.fjhx.account.entity.tax.po.TaxRefundDetails;
|
|
|
import com.fjhx.account.entity.transaction.po.Transaction;
|
|
|
import com.fjhx.account.entity.transaction.po.TransactionDepartment;
|
|
|
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;
|
|
@@ -82,6 +83,8 @@ public class AccountRunningWaterServiceImpl extends ServiceImpl<AccountRunningWa
|
|
|
private TransactionService transactionService;
|
|
|
@Autowired
|
|
|
private TransactionDepartmentService transactionDepartmentService;
|
|
|
+ @Autowired
|
|
|
+ private AccountService accountService;
|
|
|
|
|
|
@Override
|
|
|
public Page<AccountRunningWaterVo> getPage(AccountRunningWaterSelectDto dto) {
|
|
@@ -681,4 +684,24 @@ public class AccountRunningWaterServiceImpl extends ServiceImpl<AccountRunningWa
|
|
|
DynamicDataSourceContextHolder.poll();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 汇算(流水金额转人民币金额重新计算)
|
|
|
+ */
|
|
|
+ @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);
|
|
|
+ }
|
|
|
+
|
|
|
}
|