Commit 944ef8fb by jianan

应付明细1

parent 40306bcb
...@@ -982,7 +982,6 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune> ...@@ -982,7 +982,6 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
List<ExpectedFortune> newExpectedFortuneList = new ArrayList<>(); List<ExpectedFortune> newExpectedFortuneList = new ArrayList<>();
Date now = new Date(); Date now = new Date();
LocalDateTime localDateTime = LocalDateTime.now();
AuthUserDto currentLoginUser = SecurityUtil.getCurrentLoginUser(); AuthUserDto currentLoginUser = SecurityUtil.getCurrentLoginUser();
String loginUserId = currentLoginUser.getId().toString(); String loginUserId = currentLoginUser.getId().toString();
...@@ -991,53 +990,10 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune> ...@@ -991,53 +990,10 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
for (int i = 0; i < splitList.size(); i++) { for (int i = 0; i < splitList.size(); i++) {
FortuneSplitDto splitDto = splitList.get(i); FortuneSplitDto splitDto = splitList.get(i);
// 4.1 生成新的 ExpectedFortune
ExpectedFortune newExpectedFortune = new ExpectedFortune();
BeanUtils.copyProperties(originalExpectedFortune, newExpectedFortune,
"id", "expectedFortuneBizId", "amount", "hkdAmount",
"paidAmount", "unpaidAmount", "paidRatio", "unpaidRatio",
"status", "payoutDate", "actualPayoutDate", "remark");
String newExpectedFortuneBizId = RandomStringGenerator.generateBizId16(CommonEnum.UID_TYPE_EXPECTED_FORTUNE.getCode());
newExpectedFortune.setExpectedFortuneBizId(newExpectedFortuneBizId);
// 赋值分期出账信息
BeanUtils.copyProperties(splitDto, newExpectedFortune);
// 生成应付款编号 // 生成应付款编号
String payableNo = originalExpectedFortune.getPayableNo() + "_" + (i + 1); String payableNo = originalFortune.getPayableNo() + "_" + (i + 1);
newExpectedFortune.setPayableNo(payableNo);
newExpectedFortune.setIsPart(1);
newExpectedFortune.setDefaultExchangeRate(splitDto.getExchangeRate());
newExpectedFortune.setPaidAmount(BigDecimal.ZERO);
newExpectedFortune.setUnpaidAmount(splitDto.getHkdAmount());
newExpectedFortune.setPaidRatio(BigDecimal.ZERO);
newExpectedFortune.setUnpaidRatio(BigDecimal.valueOf(100));
newExpectedFortune.setStatus(FortuneStatusEnum.CAN_SEND.getItemValue()); // 4.1 生成新的 Fortune
newExpectedFortune.setPayoutDate(LocalDate.parse(splitDto.getPayoutYearMonth() + "-01"));
String expectedRemark = StringUtils.isBlank(splitDto.getRemark()) ? "" : splitDto.getRemark();
if (StringUtils.isNotBlank(originalExpectedFortune.getRemark())) {
expectedRemark = StringUtils.isBlank(expectedRemark) ?
originalExpectedFortune.getRemark() :
originalExpectedFortune.getRemark() + "; " + expectedRemark;
}
newExpectedFortune.setRemark(expectedRemark);
newExpectedFortune.setCreatorId(loginUserId);
newExpectedFortune.setCreatorName(realName);
newExpectedFortune.setCreateTime(localDateTime);
newExpectedFortune.setUpdaterId(loginUserId);
newExpectedFortune.setUpdateTime(localDateTime);
newExpectedFortuneList.add(newExpectedFortune);
// 4.2 生成新的 Fortune
Fortune newFortune = new Fortune(); Fortune newFortune = new Fortune();
BeanUtils.copyProperties(originalFortune, newFortune, BeanUtils.copyProperties(originalFortune, newFortune,
...@@ -1047,8 +1003,8 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune> ...@@ -1047,8 +1003,8 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
"payoutDate", "actualPayoutDate", "remark"); "payoutDate", "actualPayoutDate", "remark");
newFortune.setFortuneBizId(RandomStringGenerator.generateBizId16(CommonEnum.UID_TYPE_FORTUNE.getCode())); newFortune.setFortuneBizId(RandomStringGenerator.generateBizId16(CommonEnum.UID_TYPE_FORTUNE.getCode()));
// 新记录的预计出账记录业务 id 与原记录相同
newFortune.setExpectedFortuneBizId(newExpectedFortuneBizId); newFortune.setExpectedFortuneBizId(originalFortune.getExpectedFortuneBizId());
// 应付款编号 // 应付款编号
newFortune.setPayableNo(payableNo); newFortune.setPayableNo(payableNo);
...@@ -1063,7 +1019,7 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune> ...@@ -1063,7 +1019,7 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
newFortune.setStatus(FortuneStatusEnum.CAN_SEND.getItemValue()); newFortune.setStatus(FortuneStatusEnum.CAN_SEND.getItemValue());
newFortune.setIsPart(1); newFortune.setIsPart(1);
newFortune.setPayoutDate(newExpectedFortune.getPayoutDate()); // newFortune.setPayoutDate();
String fortuneRemark = StringUtils.isBlank(splitDto.getRemark()) ? "" : splitDto.getRemark(); String fortuneRemark = StringUtils.isBlank(splitDto.getRemark()) ? "" : splitDto.getRemark();
if (StringUtils.isNotBlank(originalFortune.getRemark())) { if (StringUtils.isNotBlank(originalFortune.getRemark())) {
......
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