From 237466ee755dac6c3532fbf0f166b25f1e8fa1a1 Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Mon, 29 Jan 2024 11:51:24 +0800 Subject: [PATCH] bug --- .../service/impl/OilConfigServiceImpl.java | 12 +++-- .../impl/ActiveExchangeServiceImpl.java | 6 +-- .../impl/CardFavorableRecordServiceImpl.java | 4 +- .../service/impl/OilOrderServiceImpl.java | 20 +++++++-- .../userManager/service/LJUserService.java | 7 +++ .../service/impl/LJUserServiceImpl.java | 6 +++ gasStation-uni/pages/index/index.vue | 44 +++++++++---------- gasStation-uni/pages/refuel/refuel.vue | 42 +++++++++--------- .../pagesRefuel/orderDetail/index.vue | 1 + 9 files changed, 87 insertions(+), 55 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/OilConfigServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/OilConfigServiceImpl.java index 70ad6a72c..493b88c8e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/OilConfigServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/OilConfigServiceImpl.java @@ -42,10 +42,14 @@ public class OilConfigServiceImpl extends ServiceImpl distanceList = new ArrayList<>(); for (int i = 0; i < list.size(); i++) { MerchantConfig merchantConfig = merchantConfigService.selectMerchById(list.get(i).getMerchConfigId()); - amountAll += merchantConfig.getAmount(); - proList.add(list.get(i).getProportion()/100.0); - radioList.add(merchantConfig.getAmount()/amountAll); - distanceList.add(proList.get(i) - radioList.get(i)); + if (ObjectUtil.isNotEmpty(merchantConfig)){ + amountAll += merchantConfig.getAmount(); + proList.add(list.get(i).getProportion()/100.0); + radioList.add(merchantConfig.getAmount()/amountAll); + distanceList.add(proList.get(i) - radioList.get(i)); + + } + } int index = 0; Double max = Collections.max(distanceList); 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 3225fc56e..222707f6e 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 @@ -836,9 +836,9 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { //消费有礼 List activeConsumptionVOS = oilOrderMapper.selectActiveConsumption(paymentActiveDTO.getStoreId(), paymentActiveDTO.getAmount()); //连锁店信息 - if (paymentActiveDTO.getUserId()==null){ - paymentActiveDTO.setUserId(TokenUtil.getNowAccountInfo().getId()); - } +// if (paymentActiveDTO.getUserId()==null){ +// paymentActiveDTO.setUserId(TokenUtil.getNowAccountInfo().getId()); +// } LJUser ljUserVo = userService.queryUserByUserId(paymentActiveDTO.getUserId()); Integer storeId1 = paymentActiveDTO.getStoreId(); Integer chainStoreId = iljStoreService.selectStoreByStoreId(storeId1).getChainStoreId(); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java index 690fb3375..3e376bffe 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java @@ -267,12 +267,12 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl i Double goodsActualPay = Double.valueOf(map.get("goodsActualPay")); // 找零金额 Double seekZero = Double.valueOf(map.get("seekZero")); +// 找零金额 + Integer cardFavorableId = null; + if (StringUtils.isNotEmpty(map.get("cardFavorableId"))){ + cardFavorableId = Integer.valueOf(map.get("cardFavorableId")); + } // 付款用户 String payUser = null; if (map.get("payUser") != null && !map.get("payUser").equals("")){ @@ -347,6 +352,7 @@ public class OilOrderServiceImpl extends ServiceImpl i if (payType.equals("CASH")){ staffCommissionService.countStaffCommission(staffId,storeId,oilAmount,oilActualPay,oilLiters,"1",orderNo); } + order.setCouponId(cardFavorableId); }else { order.setOrderType("子订单"); order.setOrderAmount(amount); @@ -372,9 +378,12 @@ public class OilOrderServiceImpl extends ServiceImpl i order.setInvoicing("未开票"); order.setOrderStatus(payStatus); order.setTankId(Integer.valueOf(jsonObjects.get(0).get("tankId").toString())); - order.setActiveId(Integer.valueOf(jsonObjects.get(i).get("activeId").toString())); - order.setCouponId(Integer.valueOf(jsonObjects.get(i).get("cardFavorableId").toString())); - order.setActiveType(jsonObjects.get(i).get("type").toString()); + if (ObjectUtil.isNotEmpty(jsonObjects.get(i).get("activeId"))){ + order.setActiveId(Integer.valueOf(jsonObjects.get(i).get("activeId").toString())); + } + if (ObjectUtil.isNotEmpty(jsonObjects.get(i).get("type"))){ + order.setActiveType(jsonObjects.get(i).get("type").toString()); + } if (payType.equals("CASH")){ order.setPayTime(new Date()); this.addOilTrack(jsonObjects.get(i),storeId); @@ -471,7 +480,7 @@ public class OilOrderServiceImpl extends ServiceImpl i // 调用消费有礼接口 public void updateCardAndActiveById(Integer storeId,Integer userId,Integer activeId,Integer cardFavorableId,String type,Double orderAmount,Integer oilId){ if (userId!=null){ - LJUserVo userVo = userService.selectUserById(userId, storeId); + LJUserVo userVo = userService.queryUserById(userId, storeId); PaymentActiveVO paymentActiveVO = new PaymentActiveVO(); paymentActiveVO.setUserId(userId); paymentActiveVO.setMtUserLevel(userVo.getGradeId()); @@ -987,6 +996,8 @@ public class OilOrderServiceImpl extends ServiceImpl i String activeId = map.get("activeId"); // 优惠券id String cardFavorableId = map.get("cardFavorableId"); +// 活动类型 + String type = map.get("type"); Integer tankId = Integer.valueOf(map.get("tankId")); Map applet = new HashMap<>(); @@ -1123,6 +1134,7 @@ public class OilOrderServiceImpl extends ServiceImpl i oilOrder.setPayAmount(payAmount); oilOrder.setActiveId(Integer.valueOf(activeId)); oilOrder.setCouponId(Integer.valueOf(cardFavorableId)); + oilOrder.setActiveType(type); this.updateOilOrder(oilOrder); return applet; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java index 15e752271..5709ebf3e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java @@ -53,6 +53,13 @@ public interface LJUserService extends IService { */ public LJUserVo selectUserById(int id,Integer storeId); + /** + * 根据id查询会员信息 + * @param id + * @return + */ + public LJUserVo queryUserById(int id,Integer storeId); + /** * 根据storeId获取连锁店id 根据连锁店id查询用户信息 * @param storeId diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java index 028f9821b..721162492 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java @@ -149,6 +149,12 @@ public class LJUserServiceImpl extends ServiceImpl impleme return baseMapper.queryUserByChainStoreId(id,store.getChainStoreId()); } + @Override + public LJUserVo queryUserById(int id, Integer storeId) { + LJStore store = storeService.selectStoreByStoreId(storeId); + return baseMapper.queryUserByChainStoreId(id,store.getChainStoreId()); + } + @Autowired @Lazy private CardValudChildrensService cardValudChildrensService; diff --git a/gasStation-uni/pages/index/index.vue b/gasStation-uni/pages/index/index.vue index 51bb39447..822a5fb18 100644 --- a/gasStation-uni/pages/index/index.vue +++ b/gasStation-uni/pages/index/index.vue @@ -401,29 +401,29 @@ } }) - - // 判断当前登录的code是否相同 - wx.login({ - success(res) { - if (res.code) { - //发起网络请求 - request({ - url: 'clientApi/sign/mpWxLogin2', - method: "POST", - data: { - code: res.code - } - }).then(res => { - if (!res.data) { - uni.removeStorageSync("App-Token"); - } - }) - } else { - console.log('登录失败!' + res.errMsg) + if (uni.getStorageSync("appltType")== "WECHAT") { + // 判断当前登录的code是否相同 + wx.login({ + success(res) { + if (res.code) { + //发起网络请求 + request({ + url: 'clientApi/sign/mpWxLogin2', + method: "POST", + data: { + code: res.code + } + }).then(res => { + if (!res.data) { + uni.removeStorageSync("App-Token"); + } + }) + } else { + console.log('登录失败!' + res.errMsg) + } } - } - }) - + }) + } }, diff --git a/gasStation-uni/pages/refuel/refuel.vue b/gasStation-uni/pages/refuel/refuel.vue index f922206c1..c9400c669 100644 --- a/gasStation-uni/pages/refuel/refuel.vue +++ b/gasStation-uni/pages/refuel/refuel.vue @@ -507,27 +507,29 @@ } }) - // 判断当前登录的code是否相同 - wx.login({ - success(res) { - if (res.code) { - //发起网络请求 - request({ - url: 'clientApi/sign/mpWxLogin2', - method: "POST", - data: { - code: res.code - } - }).then(res => { - if (!res.data) { - uni.removeStorageSync("App-Token"); - } - }) - } else { - console.log('登录失败!' + res.errMsg) + if (uni.getStorageSync("appltType")== "WECHAT") { + // 判断当前登录的code是否相同 + wx.login({ + success(res) { + if (res.code) { + //发起网络请求 + request({ + url: 'clientApi/sign/mpWxLogin2', + method: "POST", + data: { + code: res.code + } + }).then(res => { + if (!res.data) { + uni.removeStorageSync("App-Token"); + } + }) + } else { + console.log('登录失败!' + res.errMsg) + } } - } - }) + }) + } }, // 退格键被点击 backspace() { diff --git a/gasStation-uni/pagesRefuel/orderDetail/index.vue b/gasStation-uni/pagesRefuel/orderDetail/index.vue index 292a497e2..0a1841724 100644 --- a/gasStation-uni/pagesRefuel/orderDetail/index.vue +++ b/gasStation-uni/pagesRefuel/orderDetail/index.vue @@ -310,6 +310,7 @@ isUseChildCard:this.isUseChildCard, activeId:this.preferentialData.activeId, cardFavorableId:this.preferentialData.cardFavorableId, + type:this.preferentialData.type, }; let _this = this; request({