diff --git a/fuintAdmin_zt/src/views/indexBanner/index.vue b/fuintAdmin_zt/src/views/indexBanner/index.vue index ff255dec4..fa310f486 100644 --- a/fuintAdmin_zt/src/views/indexBanner/index.vue +++ b/fuintAdmin_zt/src/views/indexBanner/index.vue @@ -3,7 +3,7 @@ - + - + + :label="item.name" :value="item.id+''"> @@ -235,18 +235,17 @@ export default { if (valid) { if (this.form.id){ updateIndexBanner(this.form).then(res => { - console.log(res) if (res.data==1){ this.$modal.msgSuccess("修改成功") this.dialogVisible = false this.flag = false + this.queryParams.page = 1 this.getList() this.getStoreList() } }) }else { addIndexBanner(this.form).then(res => { - console.log(res) if (res.data==1){ this.$modal.msgSuccess("添加成功") this.dialogVisible = false diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/indexBanner/controller/IndexBannerController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/indexBanner/controller/IndexBannerController.java index f89ce22a3..3f4a46ae7 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/indexBanner/controller/IndexBannerController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/indexBanner/controller/IndexBannerController.java @@ -56,7 +56,7 @@ public class IndexBannerController extends BaseController { */ @PostMapping public ResponseObject add(@RequestBody IndexBanner indexBanner){ - return getSuccessResult(indexBannerService.insertIndexBanner(indexBanner,null)); + return getSuccessResult(indexBannerService.insertIndexBanner(indexBanner,indexBanner.getStoreId())); } /** 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/fuintCashierWeb/src/views/details/userInfoOrder/couponList.vue b/fuintCashierWeb/src/views/details/userInfoOrder/couponList.vue index f4cf9ece7..369b024a9 100644 --- a/fuintCashierWeb/src/views/details/userInfoOrder/couponList.vue +++ b/fuintCashierWeb/src/views/details/userInfoOrder/couponList.vue @@ -115,7 +115,7 @@ export default { getList(){ this.loading = true - // this.queryParams.mtUserId = this.userId + this.queryParams.mtUserId = this.userId getCardFavorableList(this.queryParams).then(res=>{ if (res.code == 200) { diff --git a/gasStation-uni/App.vue b/gasStation-uni/App.vue index b4f0c3eac..1a8130a14 100644 --- a/gasStation-uni/App.vue +++ b/gasStation-uni/App.vue @@ -1,6 +1,6 @@