diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/AllOrderInfoController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/AllOrderInfoController.java index 9ab8e3c1a..c76767e20 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/AllOrderInfoController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/AllOrderInfoController.java @@ -325,6 +325,16 @@ public class AllOrderInfoController extends BaseController { return getSuccessResult(iPageList); } + /** + * 获取消费金额(小程序) + * @param storeId + * @return + */ + @GetMapping("getConsumptionMoney/{storeId}") + public ResponseObject getConsumptionMoney(@PathVariable Integer storeId){ + return getSuccessResult(allOrderInfoService.getConsumptionMoney(storeId)); + } + /** * 根据订单号查询(小程序) * diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml index 538be5249..7b8cb41e4 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml @@ -784,7 +784,18 @@ when type = 6 then '收银台订单' when type = 7 then '挂账订单' when type = 8 then 'pos' - else '未知' end as type_name + else '未知' end as typeName, + case when pay_type = 'ALIPAY' then '支付宝' + when pay_type = 'WECHAT' then '微信' + when pay_type = 'UNIONPAY' then '银联二维码' + when pay_type = 'CASH' then '现金' + when pay_type = 'APPLET_CODE' then '小程序码' + when pay_type = 'card_value' then '储值卡' + when pay_type = 'fule_card' then '囤油卡' + when pay_type = 'car_card_value' then '车队卡' + when pay_type = 'car_fule_card' then '车队囤油卡' + when pay_type = 'after_pay' then '挂账' + else '未知' end as payType from all_order_info a join mt_store m on a.store_id = m.id diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/AllOrderInfoService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/AllOrderInfoService.java index 01a9fddab..92c543fce 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/AllOrderInfoService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/AllOrderInfoService.java @@ -161,6 +161,13 @@ public interface AllOrderInfoService { */ IPage queryByPageUni(Page page, AllOrderInfo allOrderInfo); + /** + * 获取消费金额(小程序) + * @param storeId + * @return + */ + Double getConsumptionMoney(Integer storeId); + // 根据订单id 查询订单 并且有且只有一个关联油品订单 AllOrderActivityVo getOneByOrderId(Integer orderId); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java index 7b372d4c7..009c0d23d 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java @@ -1669,6 +1669,27 @@ public class AllOrderInfoServiceImpl extends ServiceImpl paid = baseMapper.selectList(new LambdaQueryWrapper() + .eq(AllOrderInfo::getStoreId, storeId) + .ne(AllOrderInfo::getPayType, "refund") + .eq(AllOrderInfo::getUserId, id)); + + //计算实付金额 + double sum = paid.stream() + .mapToDouble(order -> Optional.ofNullable(order.getPayMoney()).orElse(0.0)) + .sum(); + return sum; + } + @Override public AllOrderActivityVo getOneByOrderId(Integer orderId) { AllOrderActivityVo allOrderInfoVo = allOrderInfoMapper.getOneByOrderId(orderId); diff --git a/gasStation-uni/pagesMy/myorder/myorder.vue b/gasStation-uni/pagesMy/myorder/myorder.vue index b1003a439..7da1b3fd1 100644 --- a/gasStation-uni/pagesMy/myorder/myorder.vue +++ b/gasStation-uni/pagesMy/myorder/myorder.vue @@ -3,8 +3,11 @@ - 当前积分 - {{ cardBalance.points || 0 }} + 消费金额(元) + {{ cardBalance || 0 }} + + 消费次数: {{ total || 0 }} + 类型筛选 @@ -21,14 +24,13 @@ - {{ item.changeReason }} - {{ item.pointsChange }} - -{{ item.pointsChange }} - 0 + {{ item.typeName }} + +{{ item.payMoney }} + -{{ item.payMoney }} - 会员积分 - 余额{{ item.currentPoints || 0 }} + {{ item.payType }} + {{ item.storeName }} @@ -98,7 +100,7 @@ export default { pageNo: 1, pageSize: 10 }, - cardBalance: {}, + cardBalance: 0, show: false, show1: false, value1: Number(new Date()), @@ -183,10 +185,10 @@ export default { methods: { // 获取余额信息 getUserBalance() { + console.log('this.queryParams:', this.queryParams.storeId) request({ - url: '/business/userManager/user/getUserBalanceApplet', - method: 'get', - params: this.query + url: '/business/allOrderInfo/getConsumptionMoney/' + this.queryParams.storeId, + method: 'get' }).then(res => { if (res.code == 200) { this.cardBalance = res.data @@ -195,7 +197,7 @@ export default { }, getList() { request({ - url: '/business/integral/integralDetail/queryByPageUni', + url: '/business/allOrderInfo/queryByPageUni', method: 'get', params: this.queryParams }).then(res => {