diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java index 7deea9176..963d0b08f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java @@ -666,93 +666,95 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { if (StringUtils.isNotEmpty(gradeId)) { LJStore store = iljStoreService.selectStoreByStoreId(storeId); ChainStoreConfig chainStoreConfig = chainStoreConfigService.selectChainStoreById(store.getChainStoreId()); - String isEnableLevel = chainStoreConfig.getIsEnableLevel(); - if (isEnableLevel.equals("yes")) { + if (ObjectUtils.isNotEmpty(chainStoreConfig)) { + String isEnableLevel = chainStoreConfig.getIsEnableLevel(); + if (isEnableLevel.equals("yes")) { - LJUserGrade ljUserGrade = ljUserGradeMapper.selectAllByGradeId(gradeId); - if (ObjectUtils.isNotEmpty(ljUserGrade)) { - if (oilTypebyId.equals("汽油")) { - if (ljUserGrade.getGasolineDiscount().equals("无优惠")) { + LJUserGrade ljUserGrade = ljUserGradeMapper.selectAllByGradeId(gradeId); + if (ObjectUtils.isNotEmpty(ljUserGrade)) { + if (oilTypebyId.equals("汽油")) { + if (ljUserGrade.getGasolineDiscount().equals("无优惠")) { - } else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")) { - String gasolineRule = ljUserGrade.getGasolineRule(); - List jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class); - JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get(); - BigDecimal bigDecimal = jsonObject.getBigDecimal("gasolineRule1"); - if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) { - //升数 - BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1, 2, RoundingMode.HALF_UP); - BigDecimal gasolineRule3 = jsonObject.getBigDecimal("gasolineRule3"); - BigDecimal multiply = divide.multiply(gasolineRule3); - paymentActiveVO.setMemberFavorableAmount(multiply); - } - } else { - String gasolineRule = ljUserGrade.getGasolineRule(); - List jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class); - JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get(); - BigDecimal gasolineRule1 = jsonObject.getBigDecimal("gasolineRule1"); - if (paymentActiveDTO.getAmount().compareTo(gasolineRule1) >= 0) { - //升数 - Integer gasolineRule3 = jsonObject.getInteger("gasolineRule2"); - BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3); - paymentActiveVO.setMemberFavorableAmount(bigDecimal2); + } else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")) { + String gasolineRule = ljUserGrade.getGasolineRule(); + List jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class); + JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get(); + BigDecimal bigDecimal = jsonObject.getBigDecimal("gasolineRule1"); + if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) { + //升数 + BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1, 2, RoundingMode.HALF_UP); + BigDecimal gasolineRule3 = jsonObject.getBigDecimal("gasolineRule3"); + BigDecimal multiply = divide.multiply(gasolineRule3); + paymentActiveVO.setMemberFavorableAmount(multiply); + } + } else { + String gasolineRule = ljUserGrade.getGasolineRule(); + List jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class); + JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get(); + BigDecimal gasolineRule1 = jsonObject.getBigDecimal("gasolineRule1"); + if (paymentActiveDTO.getAmount().compareTo(gasolineRule1) >= 0) { + //升数 + Integer gasolineRule3 = jsonObject.getInteger("gasolineRule2"); + BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3); + paymentActiveVO.setMemberFavorableAmount(bigDecimal2); + } } } - } - if (oilTypebyId.equals("柴油")) { - if (ljUserGrade.getGasolineDiscount().equals("无优惠")) { + if (oilTypebyId.equals("柴油")) { + if (ljUserGrade.getGasolineDiscount().equals("无优惠")) { - } else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")) { - String gasolineRule = ljUserGrade.getDieselRule(); - List jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class); - JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get(); - BigDecimal bigDecimal = jsonObject.getBigDecimal("dieselRule1"); - if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) { - //升数 - BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1, 2, RoundingMode.HALF_UP); - BigDecimal bigDecimal2 = jsonObject.getBigDecimal("dieselRule3"); - BigDecimal multiply = divide.multiply(bigDecimal2); - paymentActiveVO.setMemberFavorableAmount(multiply); - } - } else { - String gasolineRule = ljUserGrade.getDieselRule(); - List jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class); - JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get(); - BigDecimal bigDecimal = jsonObject.getBigDecimal("dieselRule1"); - if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) { - //升数 - Integer gasolineRule3 = jsonObject.getInteger("dieselRule2"); - BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3); - paymentActiveVO.setMemberFavorableAmount(bigDecimal2); + } else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")) { + String gasolineRule = ljUserGrade.getDieselRule(); + List jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class); + JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get(); + BigDecimal bigDecimal = jsonObject.getBigDecimal("dieselRule1"); + if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) { + //升数 + BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1, 2, RoundingMode.HALF_UP); + BigDecimal bigDecimal2 = jsonObject.getBigDecimal("dieselRule3"); + BigDecimal multiply = divide.multiply(bigDecimal2); + paymentActiveVO.setMemberFavorableAmount(multiply); + } + } else { + String gasolineRule = ljUserGrade.getDieselRule(); + List jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class); + JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get(); + BigDecimal bigDecimal = jsonObject.getBigDecimal("dieselRule1"); + if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) { + //升数 + Integer gasolineRule3 = jsonObject.getInteger("dieselRule2"); + BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3); + paymentActiveVO.setMemberFavorableAmount(bigDecimal2); + } } + } + if (oilTypebyId.equals("天然气")) { + if (ljUserGrade.getGasolineDiscount().equals("无优惠")) { - } - if (oilTypebyId.equals("天然气")) { - if (ljUserGrade.getGasolineDiscount().equals("无优惠")) { - - } else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")) { - String gasolineRule = ljUserGrade.getNaturalGasRule(); - List jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class); - JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get(); - BigDecimal bigDecimal = jsonObject.getBigDecimal("naturalGas1"); - if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) { - //升数 - BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1, 2, RoundingMode.HALF_UP); - BigDecimal bigDecimal2 = jsonObject.getBigDecimal("naturalGas3"); - BigDecimal multiply = divide.multiply(bigDecimal2); - paymentActiveVO.setMemberFavorableAmount(multiply); - } - } else { - String gasolineRule = ljUserGrade.getGasolineRule(); - List jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class); - JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get(); - BigDecimal bigDecimal = jsonObject.getBigDecimal("naturalGas1"); - if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) { - //升数 - Integer gasolineRule3 = jsonObject.getInteger("naturalGas2"); - BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3); - paymentActiveVO.setMemberFavorableAmount(bigDecimal2); + } else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")) { + String gasolineRule = ljUserGrade.getNaturalGasRule(); + List jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class); + JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get(); + BigDecimal bigDecimal = jsonObject.getBigDecimal("naturalGas1"); + if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) { + //升数 + BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1, 2, RoundingMode.HALF_UP); + BigDecimal bigDecimal2 = jsonObject.getBigDecimal("naturalGas3"); + BigDecimal multiply = divide.multiply(bigDecimal2); + paymentActiveVO.setMemberFavorableAmount(multiply); + } + } else { + String gasolineRule = ljUserGrade.getGasolineRule(); + List jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class); + JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get(); + BigDecimal bigDecimal = jsonObject.getBigDecimal("naturalGas1"); + if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) { + //升数 + Integer gasolineRule3 = jsonObject.getInteger("naturalGas2"); + BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3); + paymentActiveVO.setMemberFavorableAmount(bigDecimal2); + } } } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java index 05815516e..5ab13171b 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java @@ -95,8 +95,10 @@ public class LJStaffServiceImpl extends ServiceImpl impl */ @Override public LJStaff selectStaffByMobile(String mobile) { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.eq("mobile",mobile); + queryWrapper.eq("store_id",nowAccountInfo.getStoreId()); LJStaff staff = baseMapper.selectOne(queryWrapper); return staff; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/ChainStoreConfigServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/ChainStoreConfigServiceImpl.java index b21441ddf..475c5326f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/ChainStoreConfigServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/ChainStoreConfigServiceImpl.java @@ -96,6 +96,18 @@ public class ChainStoreConfigServiceImpl extends ServiceImpl(); queryWrapper.eq("chain_store_id",store.getChainStoreId()); - return baseMapper.selectOne(queryWrapper); + ChainStoreConfig chainStoreConfig = baseMapper.selectOne(queryWrapper); + if (ObjectUtil.isEmpty(chainStoreConfig)){ + ChainStoreConfig chainStoreConfig1 = new ChainStoreConfig(); + chainStoreConfig1.setChainStoreId(store.getChainStoreId()); + chainStoreConfig1.setIsEnableLevel("no"); + chainStoreConfig1.setIsMonthClear("clear_month"); + chainStoreConfig1.setGasGrowthValue("1"); + chainStoreConfig1.setDieselGrowthValue("1"); + chainStoreConfig1.setNaturalGrowthValue("1"); + baseMapper.insert(chainStoreConfig1); + } + chainStoreConfig = baseMapper.selectOne(queryWrapper); + return chainStoreConfig; } } diff --git a/gasStation-uni/pages/index/index.vue b/gasStation-uni/pages/index/index.vue index dce772d72..509e08877 100644 --- a/gasStation-uni/pages/index/index.vue +++ b/gasStation-uni/pages/index/index.vue @@ -10,8 +10,8 @@ :autoplay="autoplay" :interval="interval" :duration="duration"> - - + + @@ -257,12 +257,20 @@ import { callWithErrorHandling } from "vue" }, // 获取首页轮播图信息 getIndexBanner() { + let _this = this if (uni.getStorageSync("storeId")) { request({ url: 'business/indexBanner/list/' + uni.getStorageSync("storeId"), method: 'get', }).then(res => { - this.list1 = res.data + _this.list1 = res.data + for (let i = 0;i评价有礼 - + 去支付 @@ -403,8 +403,10 @@ // this.getBalanceOrder() } }, - goPayment(){ - + goPayment(orderNo){ + uni.navigateTo({ + url: '/pagesRefuel/orderDetail/index?orderNo=' + orderNo, + }) }, goComment() { uni.navigateTo({ diff --git a/gasStation-uni/pagesMy/setup/index.vue b/gasStation-uni/pagesMy/setup/index.vue index 812a98274..b4eda43e1 100644 --- a/gasStation-uni/pagesMy/setup/index.vue +++ b/gasStation-uni/pagesMy/setup/index.vue @@ -7,6 +7,7 @@ + + + + + 昵称 @@ -99,6 +110,30 @@ }, }) }, + // 用户选择头像 + onChooseAvatar1(e){ + let _this = this; + //从本地相册选择图片或使用相机拍照 + uni.chooseImage({ + sourceType: ['album', 'camera'],//选择方式相册或者相机 + success: (res) => { + console.log('图片', res) + var tempFilePath = res.tempFilePaths; + var filePath = tempFilePath[0]; + console.log(filePath);//输出本地头像路径 + //调用上传下载api + // 将图片上传服务器 + upload({ + url: '/clientApi/file/upload', + filePath: filePath, + }).then((res) => { + console.log('images', res.data.fileName); + _this.user.avatar = res.data.fileName + _this.editUser() + }) + } + }); + }, // 修改用户信息 editUser(){ request({