Commit 489667cb by jianan

Merge branch 'refs/heads/test_zjn' into test

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