Commit ec412660 by jianan

新增应付

parent ae0022b3
......@@ -953,11 +953,12 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
expectedFortune.setFortuneName(queryByDict(expectedFortuneDto.getFortuneType()));
// 应付款编号(序号递增)
expectedFortune.setPayableNo(this.createPayableNo(expectedFortune.getFortuneBizType(), ++currentSeq));
// 默认结算汇率
expectedFortune.setDefaultExchangeRate(
queryExchangeRateByFeign(expectedFortuneDto.getCurrency(), "HKD"));
// 计算港币金额
expectedFortune.setHkdAmount(expectedFortuneDto.getAmount().multiply(expectedFortune.getDefaultExchangeRate()));
// // 默认结算汇率
// expectedFortune.setDefaultExchangeRate(
// queryExchangeRateByFeign(expectedFortuneDto.getCurrency(), "HKD"));
// // 计算港币金额
// expectedFortune.setHkdAmount(expectedFortuneDto.getAmount().multiply(expectedFortune.getDefaultExchangeRate()));
// 已出帐金额、待出帐金额、已出帐比例、待出帐比例
expectedFortune.setPaidAmount(BigDecimal.ZERO);
// 转介人比例默认100%
......@@ -1013,7 +1014,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
private void validateAdd(List<ExpectedFortuneAddRequest> fortuneAddRequestList) {
for (ExpectedFortuneAddRequest expectedFortuneDto : fortuneAddRequestList) {
if (Objects.isNull(expectedFortuneDto.getAmount())) {
if (Objects.isNull(expectedFortuneDto.getHkdAmount())) {
throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), "预计出账金额不能为空");
}
if (Objects.isNull(expectedFortuneDto.getCurrency())) {
......
......@@ -76,10 +76,10 @@ public class ExpectedFortuneAddRequest {
private String fortuneType;
/**
* 出账金额
* 出账金额 单位:港币
*/
@Schema(description = "出账金额")
private BigDecimal amount;
@Schema(description = "出账金额 单位:港币")
private BigDecimal hkdAmount;
/**
* 出账币种
......
......@@ -169,12 +169,6 @@ public class ExpectedFortune implements Serializable {
private String statusDesc;
/**
* 本次出账金额
*/
// @TableField("current_payment_amount")
// private BigDecimal currentPaymentAmount;
/**
* 预计出账日期
*/
@TableField("payout_date")
......
......@@ -18,10 +18,7 @@ import com.yd.common.utils.RandomStringGenerator;
import com.yd.csf.service.dto.*;
import com.yd.csf.service.enums.FortuneAccountStatusEnum;
import com.yd.csf.service.enums.FortuneStatusEnum;
import com.yd.csf.service.model.ExpectedFortune;
import com.yd.csf.service.model.Fortune;
import com.yd.csf.service.model.FortuneAccount;
import com.yd.csf.service.model.FortuneAccountEditRecord;
import com.yd.csf.service.model.*;
import com.yd.csf.service.service.FortuneAccountEditRecordService;
import com.yd.csf.service.service.FortuneAccountService;
import com.yd.csf.service.dao.FortuneAccountMapper;
......@@ -222,7 +219,9 @@ public class FortuneAccountServiceImpl extends ServiceImpl<FortuneAccountMapper,
AuthUserDto currentLoginUser = SecurityUtil.getCurrentLoginUser();
Long loginUserId = currentLoginUser.getId();
FortuneAccount fortuneAccount = this.getByFortuneAccountBizId(fortuneAccountUpdateRequest.getFortuneAccountBizId());
String fortuneAccountBizId = fortuneAccountUpdateRequest.getFortuneAccountBizId();
FortuneAccount fortuneAccount = this.getByFortuneAccountBizId(fortuneAccountBizId);
if (fortuneAccount == null) {
throw new BusinessException(ResultCode.NULL_ERROR.getCode(), ResultCode.NULL_ERROR.getMessage());
}
......@@ -235,6 +234,18 @@ public class FortuneAccountServiceImpl extends ServiceImpl<FortuneAccountMapper,
this.updateById(fortuneAccount);
// // 更新关联 expected_fortune、fortune的出账日期
// if (fortuneAccountUpdateRequest.getFortuneAccountDate() != null) {
// List<Fortune> fortuneList = fortuneService.lambdaQuery().eq(Fortune::getFortuneAccountBizId, fortuneAccountBizId).list();
// if (CollectionUtils.isNotEmpty(fortuneList)) {
// Set<String> expectedBizIdSet = fortuneList.stream().map(Fortune::getExpectedFortuneBizId).collect(Collectors.toSet());
// // 查询 expected_fortune 列表
// List<ExpectedFortune> expectedList = expectedFortuneService.lambdaQuery()
// .in(ExpectedFortune::getExpectedFortuneBizId, expectedBizIdSet)
// .list();
//
// }
// }
return true;
}
......@@ -361,7 +372,7 @@ public class FortuneAccountServiceImpl extends ServiceImpl<FortuneAccountMapper,
.set(ExpectedFortune::getUnpaidRatio,
unpaid.divide(totalAmount, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)))
.set(ExpectedFortune::getStatus, newStatus)
.set(ExpectedFortune::getActualPayoutDate, new Date())
// .set(ExpectedFortune::getActualPayoutDate, new Date())
.set(ExpectedFortune::getUpdaterId, loginUserId.toString())
.set(ExpectedFortune::getUpdateTime, LocalDateTime.now())
.eq(ExpectedFortune::getId, ef.getId())
......
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