更新10.12

This commit is contained in:
许允枞 2024-10-12 13:08:23 +08:00
parent 4ed8126d60
commit d61f30cb08
5 changed files with 65 additions and 14 deletions

View File

@ -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));
}
/**
* 根据订单号查询小程序
*

View File

@ -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

View File

@ -161,6 +161,13 @@ public interface AllOrderInfoService {
*/
IPage<AllOrderInfoUniVo> queryByPageUni(Page page, AllOrderInfo allOrderInfo);
/**
* 获取消费金额小程序
* @param storeId
* @return
*/
Double getConsumptionMoney(Integer storeId);
// 根据订单id 查询订单 并且有且只有一个关联油品订单
AllOrderActivityVo getOneByOrderId(Integer orderId);

View File

@ -1669,6 +1669,27 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
return this.allOrderInfoMapper.queryAllByLimit(page, allOrderInfo);
}
/**
* 获取消费金额小程序
*
* @param storeId
* @return
*/
@Override
public Double getConsumptionMoney(Integer storeId) {
Integer id = TokenUtil.getNowAccountInfo().getId();
List<AllOrderInfo> paid = baseMapper.selectList(new LambdaQueryWrapper<AllOrderInfo>()
.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);

View File

@ -3,8 +3,11 @@
<view class="Candywrapper">
<view class="card_box">
<view style="margin: 13px 0px;">当前积分</view>
<view class="r-num">{{ cardBalance.points || 0 }}</view>
<view >消费金额</view>
<view class="r-num">{{ cardBalance || 0 }}</view>
<view style="margin-top: 10rpx;">
<view>消费次数: {{ total || 0 }}</view>
</view>
</view>
<view class="tab-bs">
<view class="w_box" @click="show1 = true">类型筛选
@ -21,14 +24,13 @@
</view>
<view style="width: 85%;">
<view class="right-box">
<view class="l-text">{{ item.changeReason }}</view>
<view class="r-text" v-if="item.changeType==1">{{ item.pointsChange }}</view>
<view class="r-text" v-else-if="item.changeType==0">-{{ item.pointsChange }}</view>
<view class="r-text" v-else>0</view>
<view class="l-text">{{ item.typeName }}</view>
<view class="r-text" v-if="item.updateBy!=null">+{{ item.payMoney }}</view>
<view class="r-text" v-else>-{{ item.payMoney }}</view>
</view>
<view class="right-box">
<view class="">会员积分</view>
<view class="">余额{{ item.currentPoints || 0 }}</view>
<view class="">{{ item.payType }}</view>
<!-- <view class="">余额{{ item.currentPoints || 0 }}</view>-->
</view>
<view class="right-box">
<view class="">{{ item.storeName }}</view>
@ -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 => {