bug
This commit is contained in:
parent
9669f7ea6b
commit
1de2f106b6
@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 囤油充值订单(CardFuleOrders)表控制层
|
||||
@ -84,5 +85,12 @@ public class CardFuleOrdersController extends BaseController {
|
||||
public ResponseObject delete(@RequestParam("idList") List<Long> idList) {
|
||||
return getSuccessResult(this.cardFuleOrdersService.removeByIds(idList));
|
||||
}
|
||||
|
||||
@PostMapping("/updateOrderStatus")
|
||||
public void updateOrderStatus(@RequestBody Map<String,String> map){
|
||||
String orderNo = map.get("orderNo");
|
||||
String status = map.get("status");
|
||||
cardFuleOrdersService.updateOrderStatus(orderNo,status);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,5 +12,12 @@ import com.fuint.business.marketingActivity.cardFuleOrders.entity.CardFuleOrders
|
||||
public interface CardFuleOrdersService extends IService<CardFuleOrders> {
|
||||
|
||||
CardFuleOrders getOneByOrderNo(String orderNo);
|
||||
|
||||
/**
|
||||
* 修改订单支付状态信息
|
||||
* @param orderNo
|
||||
* @param status
|
||||
*/
|
||||
void updateOrderStatus(String orderNo,String status);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.marketingActivity.cardFuleOrders.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.marketingActivity.cardFuleOrders.mapper.CardFuleOrdersMapper;
|
||||
import com.fuint.business.marketingActivity.cardFuleOrders.entity.CardFuleOrders;
|
||||
@ -28,5 +29,14 @@ public class CardFuleOrdersServiceImpl extends ServiceImpl<CardFuleOrdersMapper,
|
||||
public CardFuleOrders getOneByOrderNo(String orderNo) {
|
||||
return cardFuleOrdersMapper.getOneByOrderNo(orderNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOrderStatus(String orderNo, String status) {
|
||||
CardFuleOrders oneByOrderNo = cardFuleOrdersMapper.getOneByOrderNo(orderNo);
|
||||
if (ObjectUtil.isNotEmpty(oneByOrderNo)){
|
||||
oneByOrderNo.setStatus(status);
|
||||
baseMapper.updateById(oneByOrderNo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -199,31 +199,33 @@ public class CardGiftServiceImpl extends ServiceImpl<CardGiftMapper, CardGift> i
|
||||
queryWrapper.eq(CardGift::getActivateStatus,"0");
|
||||
//验证兑换卡的卡密
|
||||
CardGift one = getOne(queryWrapper);
|
||||
if (one.getSailStatus().equals("1") || one.getUseStatus().equals("1")){
|
||||
return cardGift;
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(one) && ObjectUtils.isNotEmpty(cardGift.getCardPassword()) && cardGift.getCardPassword().equals(one.getCardPassword())){
|
||||
one.setUserId(userId);
|
||||
String name = ljUserVo.getName();
|
||||
String mobile = ljUserVo.getMobile();
|
||||
one.setRemark("姓名:"+name+",手机号:"+mobile);
|
||||
one.setUseStatus("1");
|
||||
one.setUseTime(new Date());
|
||||
updateById(one);
|
||||
//更新用户余额
|
||||
Double cardAmount = one.getCardAmount();
|
||||
//会员信息
|
||||
if (ObjectUtils.isNotEmpty(one) && one.getSailStatus().equals("1") && one.getUseStatus().equals("0")){
|
||||
|
||||
if (ObjectUtils.isNotEmpty(cardGift.getCardPassword()) && cardGift.getCardPassword().equals(one.getCardPassword())){
|
||||
one.setUserId(userId);
|
||||
String name = ljUserVo.getName();
|
||||
String mobile = ljUserVo.getMobile();
|
||||
one.setRemark("姓名:"+name+",手机号:"+mobile);
|
||||
one.setUseStatus("1");
|
||||
one.setUseTime(new Date());
|
||||
updateById(one);
|
||||
//更新用户余额
|
||||
Double cardAmount = one.getCardAmount();
|
||||
//会员信息
|
||||
// LJUserVo ljUserVo = ljUserMapper.selectUserById(userId);
|
||||
// UserBalance userBalance = userBalanceService.selectUserBalance(userId,ljUserVo.getChainStoreId());
|
||||
//MtStore store = storeService.getById(cardGift.getStoreId());
|
||||
UserBalance userBalance = userBalanceService.selectUserBalance(userId,TokenUtil.getNowAccountInfo().getChainStoreId());
|
||||
Double cardBalance = userBalance.getCardBalance();
|
||||
BigDecimal bigDecimal = BigDecimal.valueOf(cardAmount);
|
||||
BigDecimal bigDecimal1 = BigDecimal.valueOf(cardBalance);
|
||||
BigDecimal add = bigDecimal1.add(bigDecimal);
|
||||
userBalance.setCardBalance(add.doubleValue());
|
||||
userBalanceService.updateUserBalance(userBalance);
|
||||
return one;
|
||||
//MtStore store = storeService.getById(cardGift.getStoreId());
|
||||
UserBalance userBalance = userBalanceService.selectUserBalance(userId,TokenUtil.getNowAccountInfo().getChainStoreId());
|
||||
Double cardBalance = userBalance.getCardBalance();
|
||||
BigDecimal bigDecimal = BigDecimal.valueOf(cardAmount);
|
||||
BigDecimal bigDecimal1 = BigDecimal.valueOf(cardBalance);
|
||||
BigDecimal add = bigDecimal1.add(bigDecimal);
|
||||
userBalance.setCardBalance(add.doubleValue());
|
||||
userBalanceService.updateUserBalance(userBalance);
|
||||
return one;
|
||||
}else {
|
||||
return cardGift;
|
||||
}
|
||||
}else {
|
||||
return cardGift;
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 储值充值表(CardValueRecord)表控制层
|
||||
@ -199,6 +200,18 @@ public class CardValueRecordController extends BaseController {
|
||||
this.cardValueRecordService.rechargeFinallDeal(orderNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值失败后修改订单状态
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/changeOrderPayStatus")
|
||||
public void changeOrderPayStatus(@RequestBody Map<String,String> map) {
|
||||
String orderNo = map.get("orderNo");
|
||||
String status = map.get("status");
|
||||
this.cardValueRecordService.changeOrderPayStatus(orderNo,status);
|
||||
}
|
||||
|
||||
|
||||
// 订单统计
|
||||
@GetMapping("/orderStatistics")
|
||||
|
@ -62,6 +62,13 @@ public interface CardValueRecordService extends IService<CardValueRecord> {
|
||||
void export(HttpServletResponse response, CardValueRecord cardValueRecord);
|
||||
void rechargeFinallDeal(String orderNo);
|
||||
|
||||
/**
|
||||
* 修改订单状态信息
|
||||
* @param orderNo
|
||||
* @param payStatus
|
||||
*/
|
||||
void changeOrderPayStatus(String orderNo,String payStatus);
|
||||
|
||||
/**
|
||||
* 会员等级优惠送券
|
||||
* @param userId
|
||||
|
@ -990,6 +990,18 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
|
||||
save(cardValueRecord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeOrderPayStatus(String orderNo, String payStatus) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("payment_no",orderNo);
|
||||
CardValueRecord cardValueRecord = baseMapper.selectOne(queryWrapper);
|
||||
if (ObjectUtil.isNotEmpty(cardValueRecord)){
|
||||
cardValueRecord.setPayStatus(payStatus);
|
||||
baseMapper.updateById(cardValueRecord);
|
||||
}
|
||||
cardValueOrdersService.updateOrderStatus(orderNo,payStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void giveCoupon(Integer userId,Integer storeId,LJUserVo ljUserVos,LJStaff ljStaff) {
|
||||
List<MtUserGradeChild> mtUserGradeChildren = userGradeChildService.selectListByUserId(userId,storeId);
|
||||
|
@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 储值卡订单表(CardValueOrders)表控制层
|
||||
@ -105,5 +106,12 @@ public class CardValueOrdersController extends BaseController {
|
||||
public ResponseObject delete(@RequestParam("idList") List<Long> idList) {
|
||||
return getSuccessResult(this.cardValueOrdersService.removeByIds(idList));
|
||||
}
|
||||
|
||||
@PostMapping("updateOrderStatus")
|
||||
public void updateOrderStatus(@RequestBody Map<String,String> map){
|
||||
String orderNo = map.get("orderNo");
|
||||
String status = map.get("status");
|
||||
cardValueOrdersService.updateOrderStatus(orderNo,status);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,5 +26,12 @@ public interface CardValueOrdersService extends IService<CardValueOrders> {
|
||||
* @return
|
||||
*/
|
||||
IPage<CardValueOrders> selectCardValueOrders(Page page, CardValueOrders order);
|
||||
|
||||
/**
|
||||
* 修改订单支付状态
|
||||
* @param orderNo 订单号
|
||||
* @param status 支付状态
|
||||
*/
|
||||
void updateOrderStatus(String orderNo,String status);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.marketingActivity.cardValueOrders.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -39,5 +40,14 @@ public class CardValueOrdersServiceImpl extends ServiceImpl<CardValueOrdersMappe
|
||||
order.setMtUserId(nowAccountInfo.getId());
|
||||
return baseMapper.selectCardValueOrders(page,order);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOrderStatus(String orderNo, String status) {
|
||||
CardValueOrders oneByOrderNo = cardValueOrdersMapper.getOneByOrderNo(orderNo);
|
||||
if (ObjectUtil.isNotEmpty(oneByOrderNo)){
|
||||
oneByOrderNo.setStatus(status);
|
||||
baseMapper.updateById(oneByOrderNo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
||||
<view style="width: 100%;display: flex;align-items: center;justify-content: space-between; ">
|
||||
<view class="bai-box">
|
||||
<view class="title-card">电子囤油卡</view>
|
||||
<view class="">{{cardsList[cardsIndex].type || '暂无囤油'}}:{{cardsList[cardsIndex].oilName || '0'}}
|
||||
<view class="">{{cardsList[cardsIndex].type || '暂无囤油'}}:{{cardsList[cardsIndex].refuelMoney || '0'}}L
|
||||
</view>
|
||||
<view>剩余油量:{{cardsList[cardsIndex].refuelMoney || '0'}}L</view>
|
||||
<!-- <view style="lins"> **** **** **** 970 </view> -->
|
||||
@ -96,8 +96,8 @@
|
||||
<view style="lins"> 卡密: **** **** **** **** </view>
|
||||
</view>
|
||||
<view class="">
|
||||
<uni-icons type="eye-slash-filled" color="#ffffff" size="30"
|
||||
style="margin-right: 15px;"></uni-icons>
|
||||
<!-- <uni-icons type="eye-slash-filled" color="#ffffff" size="30"
|
||||
style="margin-right: 15px;"></uni-icons> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="z_yw">
|
||||
@ -176,7 +176,7 @@
|
||||
console.log(res)
|
||||
if (res.code == 200) {
|
||||
this.cardsList = res.data.records
|
||||
console.log(this.toil);
|
||||
console.log(this.toil,111,res);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -342,10 +342,10 @@
|
||||
},
|
||||
fail: function(err) {
|
||||
request({
|
||||
url: "/business/marketingActivity/activeExchange/cardValueOrders",
|
||||
method: 'put',
|
||||
url: "/business/marketingActivity/cardFuleOrders/updateOrderStatus",
|
||||
method: 'post',
|
||||
data: {
|
||||
"orderNo": res.data.data.orderNo,
|
||||
"orderNo": res.data.orderNo,
|
||||
"status": "payFail"
|
||||
},
|
||||
}).then((res) => {
|
||||
@ -377,10 +377,10 @@
|
||||
})
|
||||
} else {
|
||||
request({
|
||||
url: "/business/marketingActivity/activeExchange/cardValueOrders",
|
||||
method: 'put',
|
||||
url: "/business/marketingActivity/cardFuleOrders/updateOrderStatus",
|
||||
method: 'post',
|
||||
data: {
|
||||
"orderNo": res.data.data.orderNo,
|
||||
"orderNo": res.data.orderNo,
|
||||
"status": "payFail"
|
||||
},
|
||||
}).then((res) => {
|
||||
@ -453,19 +453,18 @@
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
// request({
|
||||
// url: "business/oilOrder/orderStatus",
|
||||
// method: 'post',
|
||||
// data: {
|
||||
// "orderNo": res.data.data.orderNo,
|
||||
// "status": "payFail"
|
||||
// },
|
||||
// }).then((res) => {
|
||||
// uni.showToast({
|
||||
// title: "支付失败!",
|
||||
// icon: "error"
|
||||
// })
|
||||
// })
|
||||
request({
|
||||
url: "business/marketingActivity/cardValueRecord/changeOrderPayStatus",
|
||||
method: 'post',
|
||||
data: {
|
||||
"orderNo": res.data.orderNo,
|
||||
"status": "payFail"
|
||||
},
|
||||
}).then((res) => {})
|
||||
uni.showToast({
|
||||
title: "支付失败!",
|
||||
icon: "error"
|
||||
})
|
||||
// console.log('fail:', err);
|
||||
}
|
||||
});
|
||||
@ -489,17 +488,16 @@
|
||||
})
|
||||
} else {
|
||||
request({
|
||||
url: "/business/allOrderInfo/orderStatus",
|
||||
url: "/business/marketingActivity/cardValueRecord/changeOrderPayStatus",
|
||||
method: 'post',
|
||||
data: {
|
||||
"orderNo": res.data.orderNo,
|
||||
"status": "payFail"
|
||||
},
|
||||
}).then((res) => {
|
||||
uni.showToast({
|
||||
title: "支付失败!",
|
||||
icon: "error"
|
||||
})
|
||||
}).then((res) => {})
|
||||
uni.showToast({
|
||||
title: "支付失败!",
|
||||
icon: "error"
|
||||
})
|
||||
console.log('支付失败,' + resp.resultCode);
|
||||
}
|
||||
@ -624,7 +622,9 @@
|
||||
} else {
|
||||
this.shows = true
|
||||
this.message = '兑换成功!',
|
||||
this.money = res.data.cardAmount + '元'
|
||||
this.money = res.data.cardAmount + '元'
|
||||
this.number = ""
|
||||
this.cardPassword = ""
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -14,7 +14,7 @@
|
||||
<view class="gang" :class="{ 'lan' : tindex == index }"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="ail" v-if="list.length != 0 ">
|
||||
<view class="ail" v-if="list.length > 0 ">
|
||||
<view class="box-order" v-for="(item,index) in list" :key="index">
|
||||
<view class="or-box-top">
|
||||
<view class="">{{item.recordName}}</view>
|
||||
@ -56,7 +56,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
appltType: "",
|
||||
appltType: uni.getStorageSync("appltType"),
|
||||
title: '',
|
||||
tindex: 0,
|
||||
status: 'loading',
|
||||
@ -92,7 +92,7 @@
|
||||
|
||||
},
|
||||
onLoad() {
|
||||
this.appltType = uni.getstorageSync("appltType");
|
||||
|
||||
},
|
||||
onShow() {
|
||||
this.getAllOrderList();
|
||||
@ -130,6 +130,7 @@
|
||||
|
||||
// 查询全部充值订单
|
||||
getAllOrderList() {
|
||||
this.query.storeId = uni.getStorageSync("storeId")
|
||||
request({
|
||||
url: 'business/marketingActivity/cardValueRecord/selectAllRecord',
|
||||
method: 'get',
|
||||
@ -137,7 +138,7 @@
|
||||
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
if (this.pageNo != 1) {
|
||||
if (this.query.pageNo > 1) {
|
||||
this.list = this.list.concat(res.data.records)
|
||||
} else {
|
||||
this.list = res.data.records
|
||||
@ -145,6 +146,7 @@
|
||||
this.totalDetail = res.data.total
|
||||
this.show = false
|
||||
uni.hideLoading();
|
||||
console.log(this.list,123);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -58,6 +58,22 @@
|
||||
</view>
|
||||
<view class="box-title" v-if="AppToken && oilOrder.discountAmount>0">优惠信息</view>
|
||||
<view class="dis-fx" v-if="AppToken && oilOrder.activeId && oilOrder.activeType=='1'">
|
||||
<view class="hui-size">满减活动优惠</view>
|
||||
<view class="">{{oilOrder.discountAmount}}元</view>
|
||||
</view>
|
||||
<view class="dis-fx" v-if="AppToken && oilOrder.activeId && oilOrder.activeType=='2'">
|
||||
<view class="hui-size">折扣活动优惠</view>
|
||||
<view class="">{{oilOrder.discountAmount}}元</view>
|
||||
</view>
|
||||
<view class="dis-fx" v-if="AppToken && oilOrder.cardFavorableId">
|
||||
<view class="hui-size">优惠券优惠</view>
|
||||
<view class="">{{oilOrder.discountAmount}}元</view>
|
||||
</view>
|
||||
<view class="dis-fx" v-if="AppToken && oilOrder.discountAmount>0 && !oilOrder.cardFavorableId && !oilOrder.activeId">
|
||||
<view class="hui-size">会员等级优惠</view>
|
||||
<view class="">{{oilOrder.discountAmount}}元</view>
|
||||
</view>
|
||||
<!-- <view class="dis-fx" v-if="AppToken && oilOrder.activeId && oilOrder.activeType=='2'">
|
||||
<view class="hui-size">满减活动优惠</view>
|
||||
<view class="">{{fullOrDiscount.deductionAmount || oilOrder.discountAmount}}元</view>
|
||||
</view>
|
||||
@ -76,7 +92,7 @@
|
||||
<view class="dis-fx" v-if="AppToken && oilOrder.cardFavorableId && oilOrder.activeId && (oilOrder.discountAmount - fullOrDiscount.deductionAmount)>0">
|
||||
<view class="hui-size">会员等级优惠</view>
|
||||
<view class="">{{fullOrDiscount.deductionAmount ? (oilOrder.discountAmount - fullOrDiscount.deductionAmount) : oilOrder.discountAmount}}元</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view class="dis-fx" v-if="AppToken && oilOrder.discountAmount>0">
|
||||
<view class="hui-size">优惠合计金额</view>
|
||||
@ -141,15 +157,15 @@
|
||||
if(res.data){
|
||||
this.oilOrder = res.data
|
||||
this.getOilNumber(res.data.storeId)
|
||||
this.getCardFavorable(res.data.cardFavorableId)
|
||||
if ( res.data.activeId && res.data.activeType){
|
||||
if (res.data.activeType == "2"){
|
||||
this.getFullFavorable(res.data.activeId)
|
||||
}
|
||||
if (res.data.activeType == "1"){
|
||||
this.getDiscountFavorable(res.data.activeId)
|
||||
}
|
||||
}
|
||||
// this.getCardFavorable(res.data.cardFavorableId)
|
||||
// if ( res.data.activeId && res.data.activeType){
|
||||
// if (res.data.activeType == "1"){
|
||||
// this.getFullFavorable(res.data.activeId)
|
||||
// }
|
||||
// if (res.data.activeType == "2"){
|
||||
// this.getDiscountFavorable(res.data.activeId)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
})
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user