提交 99e63789 authored 作者: 吕本才's avatar 吕本才

修改直接进入2轮查询

上级 dc4e6b48
......@@ -57,11 +57,13 @@ public class DealerBaseInfoImpl extends ServiceImpl<DealerBaseInfoMapper, Dealer
@Override
public WechatDealerRoundInfoRes getDealerRoundInfoByDealerId(Long dealerId) {
String config = configService.selectConfigByKeyFromDb(Constants.DEALER_ROUND);
Integer round = Integer.parseInt(config);
if (round <= 0) {
throw new ServiceException("轮次未开始");
String config = configService.selectConfigByKeyFromDb(Constants.DEALER_ROUND_OVER);
Boolean roundOver = Boolean.parseBoolean(config);
if (roundOver) {
throw new ServiceException("当前轮次活动未开始");
}
String roundConfig = configService.selectConfigByKeyFromDb(Constants.DEALER_ROUND);
Integer round = Integer.parseInt(roundConfig);
DealerBaseInfo dealerBaseInfo = this.getById(dealerId);
if (dealerBaseInfo == null) {
......@@ -75,7 +77,6 @@ public class DealerBaseInfoImpl extends ServiceImpl<DealerBaseInfoMapper, Dealer
// 轮次
roundInfoRes.setRoundTime(round);
// 区分分组信息
// roundInfoRes.setReward("老铺黄金-葫芦1号吊坠");
// 查询结果表,如果有值,更新覆盖
DealerRoundResult result = resultService.getOne(new LambdaQueryWrapper<DealerRoundResult>()
.eq(DealerRoundResult::getRoundTime, round)
......@@ -83,18 +84,18 @@ public class DealerBaseInfoImpl extends ServiceImpl<DealerBaseInfoMapper, Dealer
if (result != null) {
roundInfoRes.setPaymentTtl(result.getPaymentTtl());
roundInfoRes.setPaymentPercentage(Math.round(result.getPaymentTtl() * 100.0 / dealerBaseInfo.getGoalTtlAct()) + "%");
}
if (round == 2) {
roundInfoRes.setGroupName(dealerBaseInfo.getSalesRegionGroupName());
// 第二轮第一次 查询结果
if (result == null) {
}else{
// 第二轮还没有结果时 ,默认使用第一轮的结果
if (round == 2) {
roundInfoRes.setGroupName(dealerBaseInfo.getSalesRegionGroupName());
// 查询第一轮的结果
result = resultService.getOne(new LambdaQueryWrapper<DealerRoundResult>()
.eq(DealerRoundResult::getRoundTime, 1)
.eq(DealerRoundResult::getDealerId, dealerId));
roundInfoRes.setPaymentTtl(result.getPaymentTtl());
roundInfoRes.setPaymentPercentage(Math.round(result.getPaymentTtl() * 100.0 / dealerBaseInfo.getGoalTtlAct()) + "%");
if (result != null) {
roundInfoRes.setPaymentTtl(result.getPaymentTtl());
roundInfoRes.setPaymentPercentage(Math.round(result.getPaymentTtl() * 100.0 / dealerBaseInfo.getGoalTtlAct()) + "%");
}
}
}
return roundInfoRes;
......
......@@ -67,7 +67,7 @@ public class DealerRoundResultServiceImpl extends ServiceImpl<DealerRoundResultM
}
@Override
public List<DealerRoundDetailListRes> groupRoundList(Integer roundTime ,String phone,String dealerName) {
public List<DealerRoundDetailListRes> groupRoundList(Integer roundTime, String phone, String dealerName) {
List<DealerRoundResult> dealerBigScreenGroupResultRes = this.list(new LambdaQueryWrapper<DealerRoundResult>()
.eq(DealerRoundResult::getRoundTime, roundTime)
.like(ObjectUtil.isNotEmpty(phone), DealerRoundResult::getPhone, phone)
......@@ -117,6 +117,6 @@ public class DealerRoundResultServiceImpl extends ServiceImpl<DealerRoundResultM
item.setGroupName(item.getSalesRegionGroupName());
});
this.saveBatch(resultList);
return 0;
return resultList.size();
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论