|
@@ -115,7 +115,7 @@ public class StatementServiceImpl extends ServiceImpl<StatementMapper, Statement
|
|
detail.setCompanyId(statement.getCompanyId());
|
|
detail.setCompanyId(statement.getCompanyId());
|
|
detail.setNum(StringUtils.generateNumber());
|
|
detail.setNum(StringUtils.generateNumber());
|
|
detail.setServiceMoney(platform.getRate().divide(new BigDecimal("100")).multiply(detail.getMoney()));
|
|
detail.setServiceMoney(platform.getRate().divide(new BigDecimal("100")).multiply(detail.getMoney()));
|
|
- detail.setRealMoney(detail.getMoney().subtract(detail.getServiceMoney()));
|
|
|
|
|
|
+ detail.setRealMoney(detail.getMoney().add(detail.getServiceMoney()));
|
|
if (!detailService.save(detail)) {
|
|
if (!detailService.save(detail)) {
|
|
throw new ServiceException("导入失败,请联系平台");
|
|
throw new ServiceException("导入失败,请联系平台");
|
|
}
|
|
}
|
|
@@ -211,7 +211,7 @@ public class StatementServiceImpl extends ServiceImpl<StatementMapper, Statement
|
|
}
|
|
}
|
|
Platform platform = redisCache.getCacheObject(CacheConstants.APP_PLATFORM);
|
|
Platform platform = redisCache.getCacheObject(CacheConstants.APP_PLATFORM);
|
|
detail.setServiceMoney(platform.getRate().divide(new BigDecimal("100")).multiply(detail.getMoney()));
|
|
detail.setServiceMoney(platform.getRate().divide(new BigDecimal("100")).multiply(detail.getMoney()));
|
|
- detail.setRealMoney(detail.getMoney().subtract(detail.getServiceMoney()));
|
|
|
|
|
|
+ detail.setRealMoney(detail.getMoney().add(detail.getServiceMoney()));
|
|
if (!detailService.updateById(detail)) {
|
|
if (!detailService.updateById(detail)) {
|
|
throw new ServiceException("编辑结算单明细失败");
|
|
throw new ServiceException("编辑结算单明细失败");
|
|
}
|
|
}
|
|
@@ -346,7 +346,7 @@ public class StatementServiceImpl extends ServiceImpl<StatementMapper, Statement
|
|
if (!updateById(statement)) {
|
|
if (!updateById(statement)) {
|
|
throw new ServiceException("当前结算业务发放失败,请联系管理员");
|
|
throw new ServiceException("当前结算业务发放失败,请联系管理员");
|
|
}
|
|
}
|
|
- company.setMoney(company.getMoney().subtract(statement.getMoney()));
|
|
|
|
|
|
+ company.setMoney(company.getMoney().subtract(statement.getRealMoney()));
|
|
if (!companyService.updateById(company)) {
|
|
if (!companyService.updateById(company)) {
|
|
throw new ServiceException("更新企业余额失败,请联系管理员");
|
|
throw new ServiceException("更新企业余额失败,请联系管理员");
|
|
}
|
|
}
|
|
@@ -357,7 +357,7 @@ public class StatementServiceImpl extends ServiceImpl<StatementMapper, Statement
|
|
record.setType(2);
|
|
record.setType(2);
|
|
record.setCompanyId(statement.getCompanyId());
|
|
record.setCompanyId(statement.getCompanyId());
|
|
record.setOpId(statement.getId());
|
|
record.setOpId(statement.getId());
|
|
- record.setMoney(statement.getMoney());
|
|
|
|
|
|
+ record.setMoney(statement.getRealMoney());
|
|
if (!recordService.save(record)) {
|
|
if (!recordService.save(record)) {
|
|
throw new ServerException("添加发放记录失败,请联系管理员");
|
|
throw new ServerException("添加发放记录失败,请联系管理员");
|
|
}
|
|
}
|