diff --git a/play-admin/src/main/java/com/starry/admin/modules/custom/service/impl/PlayCustomUserInfoServiceImpl.java b/play-admin/src/main/java/com/starry/admin/modules/custom/service/impl/PlayCustomUserInfoServiceImpl.java index d60f7e1..e6c22b8 100644 --- a/play-admin/src/main/java/com/starry/admin/modules/custom/service/impl/PlayCustomUserInfoServiceImpl.java +++ b/play-admin/src/main/java/com/starry/admin/modules/custom/service/impl/PlayCustomUserInfoServiceImpl.java @@ -49,7 +49,6 @@ public class PlayCustomUserInfoServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -84,11 +83,37 @@ public class PlayCustomUserInfoServiceImpl extends ServiceImpl= 0) { + giftAmount = new BigDecimal(5); + } + if (rechargeAmount.compareTo(new BigDecimal(100)) >= 0) { + giftAmount = new BigDecimal(10); + } + if (rechargeAmount.compareTo(new BigDecimal(200)) >= 0) { + giftAmount = new BigDecimal(20); + } + if (rechargeAmount.compareTo(new BigDecimal(300)) >= 0) { + giftAmount = new BigDecimal(30); + } + if (rechargeAmount.compareTo(new BigDecimal(400)) >= 0) { + giftAmount = new BigDecimal(40); + } + if (rechargeAmount.compareTo(new BigDecimal(500)) >= 0) { + giftAmount = new BigDecimal(50); + } + return giftAmount; + } + + /** * 查询顾客 * @@ -220,7 +245,7 @@ public class PlayCustomUserInfoServiceImpl extends ServiceImpl page = this.baseMapper.selectJoinPage(new Page<>(vo.getPageNum(), vo.getPageSize()), PlayCustomUserReturnVo.class, lambdaQueryWrapper); for (PlayCustomUserReturnVo record : page.getRecords()) { - List orderInfoEntities = playOrderInfoService.list(Wrappers.lambdaQuery(PlayOrderInfoEntity.class).eq(PlayOrderInfoEntity::getPurchaserBy,record.getId()).in(PlayOrderInfoEntity::getPlaceType, "0","2")); + List orderInfoEntities = playOrderInfoService.list(Wrappers.lambdaQuery(PlayOrderInfoEntity.class).eq(PlayOrderInfoEntity::getPurchaserBy, record.getId()).in(PlayOrderInfoEntity::getPlaceType, "0", "2")); BigDecimal orderTotalAmount = new BigDecimal("0"); for (PlayOrderInfoEntity orderInfoEntity : orderInfoEntities) { orderTotalAmount = orderTotalAmount.add(orderInfoEntity.getFinalAmount()); @@ -326,10 +351,10 @@ public class PlayCustomUserInfoServiceImpl extends ServiceImpl wrapper = Wrappers.lambdaUpdate(PlayCustomUserInfoEntity.class).eq(PlayCustomUserInfoEntity::getId, id).set(PlayCustomUserInfoEntity::getLastPurchaseTime, new Date()); PlayCustomUserInfoEntity userInfoEntity = selectById(id); - if(Objects.isNull(userInfoEntity.getFirstPurchaseTime())){ - wrapper.set(PlayCustomUserInfoEntity::getFirstPurchaseTime,new Date()); + if (Objects.isNull(userInfoEntity.getFirstPurchaseTime())) { + wrapper.set(PlayCustomUserInfoEntity::getFirstPurchaseTime, new Date()); } - wrapper.set(PlayCustomUserInfoEntity::getWeiChatCode,entity.getWeiChatCode()); + wrapper.set(PlayCustomUserInfoEntity::getWeiChatCode, entity.getWeiChatCode()); this.update(wrapper); } }