|
@@ -250,6 +250,14 @@ public class AccountRunningWaterServiceImpl extends ServiceImpl<AccountRunningWa
|
|
|
transaction.setAccountId(dto.getAccountManagementId());
|
|
|
transaction.setRemark(dto.getRemarks());
|
|
|
transaction.setAccountRunningWaterId(dto.getId());
|
|
|
+
|
|
|
+ Assert.notEmpty(dto.getDeptType(), "往来单位类型不能为空");
|
|
|
+ transaction.setDeptType(dto.getDeptType());
|
|
|
+
|
|
|
+ //赋值归属公司
|
|
|
+ AccountManagement accountManagement = accountManagementService.getById(dto.getAccountManagementId());
|
|
|
+ transaction.setCorporationId(accountManagement.getCorporationId());
|
|
|
+
|
|
|
transactionService.save(transaction);
|
|
|
}
|
|
|
|
|
@@ -459,11 +467,15 @@ public class AccountRunningWaterServiceImpl extends ServiceImpl<AccountRunningWa
|
|
|
@DSTransactional
|
|
|
@Override
|
|
|
public void internalTransfer(AccountRunningWaterDto dto) {
|
|
|
+ AccountManagement outAccountManagement = accountManagementService.getById(dto.getAccountManagementId());
|
|
|
+ AccountManagement inAccountManagement = accountManagementService.getById(dto.getInAccountManagementId());
|
|
|
+
|
|
|
//生成转出流水
|
|
|
dto.setStatus("20");//支出
|
|
|
dto.setType("50");//内部转账
|
|
|
//操作余额
|
|
|
changeRemainder(dto);
|
|
|
+
|
|
|
this.save(dto);
|
|
|
|
|
|
//如果手续费不为0生成手续费
|
|
@@ -497,7 +509,58 @@ public class AccountRunningWaterServiceImpl extends ServiceImpl<AccountRunningWa
|
|
|
inAccountRunningWater.setCurrency(dto.getInCurrency());
|
|
|
//操作余额
|
|
|
changeRemainder(inAccountRunningWater);
|
|
|
+
|
|
|
this.save(inAccountRunningWater);
|
|
|
+
|
|
|
+ //如果是往来
|
|
|
+ if (ObjectUtil.isNotEmpty(dto.getIsTransaction()) && 1 == dto.getIsTransaction()) {
|
|
|
+ dto.setDeptType(1);
|
|
|
+ dto.setTransactionDeptId(inAccountManagement.getCorporationId());
|
|
|
+ this.updateById(dto);
|
|
|
+ inAccountRunningWater.setDeptType(1);
|
|
|
+ inAccountRunningWater.setTransactionDeptId(outAccountManagement.getCorporationId());
|
|
|
+ this.updateById(inAccountRunningWater);
|
|
|
+
|
|
|
+ //转入转出归属公司不同生成往来记录
|
|
|
+ if (inAccountManagement.getCorporationId() != outAccountManagement.getCorporationId()) {
|
|
|
+ //创建转入往来数据
|
|
|
+ Transaction transaction = new Transaction();
|
|
|
+ transaction.setType(1);//支出
|
|
|
+ transaction.setCurrency(dto.getCurrency());
|
|
|
+ transaction.setAmount(dto.getAmount());
|
|
|
+ transaction.setIsFlowingWater(1);
|
|
|
+ transaction.setAccountId(dto.getAccountManagementId());
|
|
|
+ transaction.setRemark(dto.getRemarks());
|
|
|
+ transaction.setAccountRunningWaterId(dto.getId());
|
|
|
+ transaction.setDeptType(1);
|
|
|
+
|
|
|
+ //赋值归属公司(转出账户归属公司)
|
|
|
+ transaction.setCorporationId(outAccountManagement.getCorporationId());
|
|
|
+ //赋值往来单位(转入账户归属公司)
|
|
|
+ transaction.setDepartmentId(inAccountManagement.getCorporationId());
|
|
|
+
|
|
|
+ transactionService.save(transaction);
|
|
|
+
|
|
|
+ //创建转出往来数据
|
|
|
+ Transaction transaction1 = new Transaction();
|
|
|
+ transaction1.setType(0);//收入
|
|
|
+ transaction1.setCurrency(inAccountRunningWater.getCurrency());
|
|
|
+ transaction1.setAmount(inAccountRunningWater.getAmount());
|
|
|
+ transaction1.setIsFlowingWater(1);
|
|
|
+ transaction1.setAccountId(inAccountRunningWater.getAccountManagementId());
|
|
|
+ transaction1.setRemark(inAccountRunningWater.getRemarks());
|
|
|
+ transaction1.setAccountRunningWaterId(inAccountRunningWater.getId());
|
|
|
+ transaction1.setDeptType(1);
|
|
|
+
|
|
|
+ //赋值归属公司(转入账户归属公司)
|
|
|
+ transaction1.setCorporationId(inAccountManagement.getCorporationId());
|
|
|
+ //赋值往来单位(转出账户归属公司)
|
|
|
+ transaction1.setDepartmentId(outAccountManagement.getCorporationId());
|
|
|
+
|
|
|
+ transactionService.save(transaction1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|