Commit c181cc5c by jianan

出账检核-增加币种8

parent fa12ff4e
......@@ -115,6 +115,8 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
private FeignResultHelper feignResultHelper;
@Resource
private ApiAnnouncementCommissionRatioFeignClient ratioFeignClient;
@Resource
private FortuneService fortuneService;
@Autowired
private ApiCommissionConditionService apiCommissionConditionService;
......@@ -480,19 +482,28 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
log.info("结算汇率:{}", exchangeRate);
for (ExpectedFortune expectedFortune : expectedFortuneList) {
//设置保单币种
expectedFortune.setRuleCurrency(currency);
//设置默认保单币种 -> 港币汇率
expectedFortune.setDefaultExchangeRate(exchangeRate);
//设置港币金额(标准发佣金额 * 默认保单币种 -> 港币汇率)
expectedFortune.setHkdAmount(expectedFortune.getRuleAmount().multiply(exchangeRate));
ExpectedFortune updateObj = new ExpectedFortune();
updateObj.setId(expectedFortune.getId());
//原币种
updateObj.setOriginalCurrency(currency);
//原币种金额
updateObj.setOriginalAmount(expectedFortune.getRuleAmount());
//原币种 -> 港币汇率
updateObj.setOriginalToHkdRate(exchangeRate);
//保单币种
updateObj.setRuleCurrency(currency);
//默认保单币种 -> 港币汇率
updateObj.setDefaultExchangeRate(exchangeRate);
//港币金额(标准发佣金额 * 默认保单币种 -> 港币汇率)
updateObj.setHkdAmount(expectedFortune.getRuleAmount().multiply(exchangeRate));
//默认值
expectedFortune.setPaidAmount(BigDecimal.ZERO);
expectedFortune.setPaidRatio(BigDecimal.ZERO);
expectedFortune.setUnpaidAmount(expectedFortune.getHkdAmount());
expectedFortune.setUnpaidRatio(BigDecimal.valueOf(100));
updateObj.setPaidAmount(BigDecimal.ZERO);
updateObj.setPaidRatio(BigDecimal.ZERO);
updateObj.setUnpaidAmount(expectedFortune.getHkdAmount());
updateObj.setUnpaidRatio(BigDecimal.valueOf(100));
iExpectedFortuneService.updateById(expectedFortune);
iExpectedFortuneService.updateById(updateObj);
}
}
}
......@@ -620,18 +631,25 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
//获取当前序号作为起点
int currentSeq = 0;
if (!Objects.isNull(latest)) {
currentSeq = Integer.parseInt(latest.getPayableNo().substring(12));
String payableNo = latest.getPayableNo();
currentSeq = Integer.parseInt(payableNo.substring(payableNo.length() - 6));
}
//批量更新应付款编号,每个item递增
ExpectedFortune expectedFortune;
List<ExpectedFortune> updateList = new ArrayList<>();
for (int i = 0; i < expectedFortuneList.size(); i++) {
expectedFortune = expectedFortuneList.get(i);
expectedFortune.setPayableNo(this.createPayableNo("R", currentSeq + i + 1));
expectedFortune.setFortuneType(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
ExpectedFortune updateObj = new ExpectedFortune();
updateObj.setId(expectedFortune.getId());
updateObj.setPayableNo(this.createPayableNo("R", currentSeq + i + 1));
updateObj.setFortuneType(GetDictItemListByDictTypeResponse.getItemValue(dictTypeResponses,
"csf_fortune_type", expectedFortune.getFortuneName()));
updateList.add(updateObj);
}
iExpectedFortuneService.updateBatchById(expectedFortuneList);
iExpectedFortuneService.updateBatchById(updateList);
return expectedFortuneList;
}
......@@ -870,6 +888,9 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
fortune.setRuleAmount(standardAmount);
}
// 创建人
fortune.setCreatorName("系统生成");
fortuneList.add(fortune);
}
}
......@@ -892,6 +913,9 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
List<ExpectedFortune> fortuneList = iExpectedFortuneService.list(queryWrapper);
ExpectedFortuneStatisticsVO statisticsVO = this.getStatistics(fortuneList.stream().map(ExpectedFortune::getId).collect(Collectors.toList()));
// 查询实际发佣列表
List<Fortune> expectedFortuneList = fortuneService.list();
// 组装返回结果
ApiExpectedFortunePageResponseVO response = new ApiExpectedFortunePageResponseVO();
response.setStatisticsVO(statisticsVO);
......
......@@ -281,10 +281,16 @@ public class ExpectedFortune implements Serializable {
/**
* 创建人ID
*/
@TableField(value = "creator_id", fill = FieldFill.INSERT)
@TableField(value = "creator_id")
private String creatorId;
/**
* 创建人名称
*/
@TableField(value = "creator_name")
private String creatorName;
/**
* 更新人ID
*/
@TableField(value = "updater_id", fill = FieldFill.UPDATE)
......
......@@ -192,7 +192,8 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
//获取当前序号作为起点
int currentSeq = 0;
if (!Objects.isNull(latest)) {
currentSeq = Integer.parseInt(latest.getPayableNo().substring(12));
String payableNo = latest.getPayableNo();
currentSeq = Integer.parseInt(payableNo.substring(payableNo.length() - 6));
}
return currentSeq;
......
......@@ -932,6 +932,7 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
newExpectedFortune.setRemark(expectedRemark);
newExpectedFortune.setCreatorId(loginUserId);
newExpectedFortune.setCreatorName(username);
newExpectedFortune.setCreateTime(localDateTime);
newExpectedFortune.setUpdaterId(loginUserId);
newExpectedFortune.setUpdateTime(localDateTime);
......
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