Merge branch 'master' of http://192.168.31.244:3000/byx/oilSystem
This commit is contained in:
commit
9269d6cbb3
@ -217,10 +217,15 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
||||
queryWrapper.eq(CardFuelRecord::getStoreId,cardFuelRecordDTO.getStoreId());
|
||||
queryWrapper.eq(CardFuelRecord::getMtUserId,cardFuelRecordDTO.getMtUserId());
|
||||
List<CardFuelRecord> cardFuelRecords = cardFuelRecordMapper.selectList(queryWrapper);
|
||||
Optional<CardFuelRecord> max = cardFuelRecords.stream().min(Comparator.comparing(CardFuelRecord::getLockupPrice));
|
||||
CardFuelRecord cardFuelRecord = max.get();
|
||||
CardFuelRecord cardFuelRecord = new CardFuelRecord();
|
||||
|
||||
if (ObjectUtils.isNotEmpty(cardFuelRecords)){
|
||||
Optional<CardFuelRecord> max = cardFuelRecords.stream().max(Comparator.comparing(CardFuelRecord::getLockupPrice));
|
||||
cardFuelRecord = max.get();
|
||||
}
|
||||
CardFuelDiesel cardFuelDiesel = cardFuelDieselService.getById(cardFuelRecord.getCardFuelId());
|
||||
if ("2".equals(cardFuelDiesel.getActiveTime())){
|
||||
|
||||
if (ObjectUtils.isNotEmpty(cardFuelDiesel) && "2".equals(cardFuelDiesel.getActiveTime())){
|
||||
cardFuelRecordDTO.setExpireTime(cardFuelDiesel.getEndTime());
|
||||
}else {
|
||||
LocalDate today = LocalDate.now(); // 获取当前日期
|
||||
|
@ -114,6 +114,17 @@ public class OilOrderController extends BaseController {
|
||||
return getSuccessResult(order);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加订单信息 并支付
|
||||
* @param oilOrderVo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/scanAppletQrCodePos")
|
||||
public ResponseObject scanAppletQrCodePos(@Validated @RequestBody OilOrderVo oilOrderVo){
|
||||
Map<String, String> order = orderService.scanAppletQrCodePos(oilOrderVo);
|
||||
return getSuccessResult(order);
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序支付接口
|
||||
* @param map
|
||||
|
@ -108,6 +108,12 @@ public interface OilOrderService extends IService<OilOrder> {
|
||||
*/
|
||||
Map<String,String> scanAppletQrCode(Map<String,String> map);
|
||||
|
||||
/**
|
||||
* 扫描小程序中二维码所处理的逻辑POS端
|
||||
* @param oilOrderVo
|
||||
*/
|
||||
Map<String,String> scanAppletQrCodePos(OilOrderVo oilOrderVo);
|
||||
|
||||
/**
|
||||
* 小程序添加油品订单信息
|
||||
* @param oilOrder
|
||||
@ -216,5 +222,5 @@ public interface OilOrderService extends IService<OilOrder> {
|
||||
* @param oilOrderVo
|
||||
* @return
|
||||
*/
|
||||
int addOrderPosScan(OilOrderVo oilOrderVo) throws Exception;
|
||||
Map<String, String> addOrderPosScan(OilOrderVo oilOrderVo) throws Exception;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -64,6 +64,13 @@
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "AddVip/AddCode",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增会员",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "changeShifts/changeShifts",
|
||||
"style": {
|
||||
@ -95,7 +102,7 @@
|
||||
{
|
||||
"path": "PaymentCode/SetUpCode",
|
||||
"style": {
|
||||
"navigationBarTitleText": "收款码",
|
||||
"navigationBarTitleText": "设置金额",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
|
@ -20,7 +20,7 @@
|
||||
</view>
|
||||
<view class="">收款</view>
|
||||
</view>
|
||||
<view class="s-box">
|
||||
<view class="s-box" @click="goRecharge()">
|
||||
<view class="">
|
||||
<image src="/static/imgs/cz.png" mode=""></image>
|
||||
</view>
|
||||
@ -110,6 +110,11 @@
|
||||
tabbar
|
||||
},
|
||||
methods: {
|
||||
goRecharge() {
|
||||
uni.navigateTo({
|
||||
url: "/pagesHome/MemberRecharge/MemberRecharge"
|
||||
})
|
||||
},
|
||||
goCode() {
|
||||
uni.navigateTo({
|
||||
url: '/pagesHome/PaymentCode/PaymentCode'
|
||||
@ -123,7 +128,7 @@
|
||||
|
||||
goAdd() {
|
||||
uni.navigateTo({
|
||||
url: '/pagesHome/AddVip/AddVip'
|
||||
url: '/pagesHome/AddVip/AddCode'
|
||||
})
|
||||
},
|
||||
goCollection() {
|
||||
|
@ -8,12 +8,12 @@
|
||||
<view class="input_box">
|
||||
|
||||
<u-icon name="account" color="#0864E9" size="22"></u-icon>
|
||||
<input type="text" v-model="form.username" placeholder="请输入账号" />
|
||||
<input type="text" style="color: #333;" v-model="form.username" placeholder="请输入账号" />
|
||||
</view>
|
||||
<view class="input_box">
|
||||
|
||||
<u-icon name="lock" color="#0864E9" size="22"></u-icon>
|
||||
<input type="text" v-model="form.password" placeholder="请输入密码" />
|
||||
<input type="text" style="color: #333;" v-model="form.password" placeholder="请输入密码" />
|
||||
</view>
|
||||
|
||||
<view class="anniu" @click="goGoGo">
|
||||
@ -81,10 +81,10 @@
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}else{
|
||||
} else {
|
||||
uni.showToast({
|
||||
title:res.data,
|
||||
icon:"none"
|
||||
title: res.data,
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
})
|
||||
|
139
pos-uni/pagesHome/AddVip/AddCode.vue
Normal file
139
pos-uni/pagesHome/AddVip/AddCode.vue
Normal file
@ -0,0 +1,139 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="container">
|
||||
<headers :titles="titles"><u-icon name="arrow-left" color="#fff" size="22"></u-icon></headers>
|
||||
|
||||
<view class="box-">
|
||||
<view class="title_">扫码成为京博加油站会员</view>
|
||||
<view
|
||||
style="background: #fff;width: 215px; height: 220px; border-radius: 8px ; margin: 15px auto; box-sizing: border-box; padding-top: 10px; ">
|
||||
<canvas id="qrcode" canvas-id="qrcode"
|
||||
style="width: 200px;height: 200px; margin: 0px auto; "></canvas>
|
||||
</view>
|
||||
|
||||
<view class="title_">长按识别领取会员卡</view>
|
||||
</view>
|
||||
|
||||
<view class="p-bottom">
|
||||
<view class="anniu" @click="goback()">
|
||||
手动添加
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import headers from '../../components/header/headers.vue'
|
||||
import UQRCode from '../../uni_modules/Sansnn-uQRCode/js_sdk/uqrcode/uqrcode.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
titles: "新增会员",
|
||||
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.onReady()
|
||||
// this.actList = ["1", "1", "1", "1", "1", ]
|
||||
// this.status = "nomore" 底部刷新结束
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
console.log("刷新");
|
||||
uni.stopPullDownRefresh()
|
||||
},
|
||||
onReachBottom() {
|
||||
// this.show = true
|
||||
setTimeout(() => {
|
||||
console.log("加载执行");
|
||||
}, 2000)
|
||||
},
|
||||
components: {
|
||||
headers
|
||||
},
|
||||
methods: {
|
||||
onReady() {
|
||||
// 获取uQRCode实例
|
||||
var qr = new UQRCode();
|
||||
// 设置二维码内容
|
||||
qr.data = "https://uqrcode.cn/doc";
|
||||
// 设置二维码大小,必须与canvas设置的宽高一致
|
||||
qr.size = 200;
|
||||
// 调用制作二维码方法
|
||||
qr.make();
|
||||
// 获取canvas上下文
|
||||
var canvasContext = uni.createCanvasContext('qrcode', this); // 如果是组件,this必须传入
|
||||
// 设置uQRCode实例的canvas上下文
|
||||
qr.canvasContext = canvasContext;
|
||||
// 调用绘制方法将二维码图案绘制到canvas上
|
||||
qr.drawCanvas();
|
||||
},
|
||||
goback() {
|
||||
uni.navigateTo({
|
||||
url: '/pagesHome/AddVip/AddVip'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.content {
|
||||
background: #fff;
|
||||
// background: linear-gradient(180deg, #B2D2FC 0%, #B2D2FC 14%, rgba(255, 255, 255, 0.84) 24%, rgba(255, 255, 255, 0.84) 100%);
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
box-sizing: border-box;
|
||||
padding-top: 88px;
|
||||
}
|
||||
|
||||
.img-box {
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.p-bottom {
|
||||
width: 100%;
|
||||
height: 68px;
|
||||
background: #fff;
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
.anniu {
|
||||
height: 40px;
|
||||
background: #0864E9;
|
||||
width: 80%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #fff;
|
||||
border-radius: 50px;
|
||||
margin: 5px auto;
|
||||
}
|
||||
|
||||
.box- {
|
||||
width: 95%;
|
||||
margin: 15px auto;
|
||||
border-radius: 8px;
|
||||
background: #0864E9;
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
.title_ {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
color: #FFFFFF;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
@ -58,18 +58,19 @@
|
||||
</view>
|
||||
<view class="Centralimg" v-if="item.type == 'img' ">
|
||||
<view class="icon-box">
|
||||
<image src="/static/imgs/smzf.png" v-if="item.value == 'smzf' " @click="scanQrcode">
|
||||
<image src="/static/imgs/smzf.png" v-if="item.value == 'smzf' " @click="scanQrcode()">
|
||||
</image>
|
||||
<image src="/static/imgs/skzf.png" v-if="item.value == 'skzf' "></image>
|
||||
<image src="/static/imgs/hyzf.png" v-if="item.value == 'hyzf' "></image>
|
||||
<image src="/static/imgs/xjzf.png" v-if="item.value == 'xjzf' " @click="cashPay">
|
||||
<image src="/static/imgs/skzf.png" v-if="item.value == 'skzf' " @click="swipeCard()"></image>
|
||||
<image src="/static/imgs/hyzf.png" v-if="item.value == 'hyzf' "
|
||||
@click="scanAppletQrCode()"></image>
|
||||
<image src="/static/imgs/xjzf.png" v-if="item.value == 'xjzf' " @click="cashPay()">
|
||||
</image>
|
||||
<image src="/static/imgs/scjian.png" style="height: 30px;" v-if="!item.value"></image>
|
||||
</view>
|
||||
<view class="icon-size" v-if="item.value == 'smzf' " @click="scanQrcode">扫码支付</view>
|
||||
<view class="icon-size" v-if="item.value == 'skzf' ">刷卡支付</view>
|
||||
<view class="icon-size" v-if="item.value == 'hyzf' ">会员支付</view>
|
||||
<view class="icon-size" v-if="item.value == 'xjzf' " @click="cashPay">现金支付</view>
|
||||
<view class="icon-size" v-if="item.value == 'smzf' " @click="scanQrcode()">扫码支付</view>
|
||||
<view class="icon-size" v-if="item.value == 'skzf' " @click="swipeCard()">刷卡支付</view>
|
||||
<view class="icon-size" v-if="item.value == 'hyzf' " @click="scanAppletQrCode()">会员支付</view>
|
||||
<view class="icon-size" v-if="item.value == 'xjzf' " @click="cashPay()">现金支付</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -117,7 +118,7 @@
|
||||
"1号枪", "2号枪", "3号枪"
|
||||
],
|
||||
spearIndex: 0,
|
||||
orderNo:"",
|
||||
orderNo: "",
|
||||
preferentialData: {},
|
||||
// 键盘
|
||||
keyboardList: [{
|
||||
@ -278,7 +279,8 @@
|
||||
this.paymentAmount = 0
|
||||
} else {
|
||||
this.balanceRedece = this.balance
|
||||
this.paymentAmount = (this.AmountCollected - this.DiscountAmount - this.balance - this.oilCardAmount).toFixed(2)
|
||||
this.paymentAmount = (this.AmountCollected - this.DiscountAmount - this.balance - this.oilCardAmount)
|
||||
.toFixed(2)
|
||||
}
|
||||
},
|
||||
// 二维码
|
||||
@ -303,6 +305,78 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
// 扫描小程序会员码支付
|
||||
scanAppletQrCode() {
|
||||
if (!this.AmountCollected) {
|
||||
uni.showToast({
|
||||
title: "请先输入收款金额",
|
||||
icon: "none"
|
||||
})
|
||||
return;
|
||||
}
|
||||
this.oilOrder.payType = "APPLET_CODE"
|
||||
this.oilOrder.orderNo = this.orderNo
|
||||
this.oilOrder.orderAmount = this.AmountCollected
|
||||
this.oilOrder.payAmount = this.paymentAmount
|
||||
this.oilOrder.discountAmount = this.DiscountAmount
|
||||
this.oilOrder.balanceAmount = this.balanceRedece
|
||||
this.oilOrder.isOilStorageCard = this.isOilStorageCard
|
||||
this.oilOrder.isUseChildCard = this.isUseChildCard
|
||||
this.oilOrder.activeId = this.preferentialData.activeId
|
||||
this.oilOrder.cardFavorableId = this.preferentialData.cardFavorableId
|
||||
this.oilOrder.recordId = this.preferentialData.recordId
|
||||
this.oilOrder.type = this.preferentialData.type
|
||||
this.oilOrder.balanceAmountSale = this.balanceRedece
|
||||
this.oilOrder.levelAmount = this.levelAmount
|
||||
this.oilOrder.activeAmount = this.activeAmount
|
||||
this.oilOrder.oils = this.oilName
|
||||
this.oilOrder.tankId = this.tankId
|
||||
this.oilOrder.oilPrice = this.oilPrice
|
||||
this.oilOrder.oilCardAmount1 = this.oilCardAmount
|
||||
this.oilOrder.userId = this.userInfo.id
|
||||
this.oilOrder.oilGunNum = this.oilGunNum
|
||||
this.oilOrder.payUser = this.userInfo.mobile
|
||||
let _this = this
|
||||
uni.scanCode({
|
||||
onlyFromCamera: true,
|
||||
success: (res) => {
|
||||
console.log('扫描二维码成功,结果:' + JSON.stringify(res) + res.result);
|
||||
_this.authCode = res.result
|
||||
_this.oilOrder.authCode = _this.authCode
|
||||
request({
|
||||
url: '/business/oilOrder/scanAppletQrCodePos',
|
||||
method: 'post',
|
||||
data: _this.oilOrder
|
||||
}).then((resp) => {
|
||||
if (resp.data.success == 'success') {
|
||||
_this.reset()
|
||||
// uni.showToast({
|
||||
// title: "支付成功",
|
||||
// icon: "success"
|
||||
// })
|
||||
uni.navigateTo({
|
||||
url:"/pagesHome/PaymentResults/PaymentResults"
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: resp.data.error,
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
error: (res) => {
|
||||
console.log('扫描二维码出现错误')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 刷卡支付
|
||||
swipeCard(){
|
||||
uni.showToast({
|
||||
title:"暂未开发",
|
||||
icon:"error"
|
||||
})
|
||||
},
|
||||
// 现金支付
|
||||
cashPay() {
|
||||
if (!this.AmountCollected) {
|
||||
@ -315,17 +389,19 @@
|
||||
this.oilOrder.payType = "CASH"
|
||||
this.payMent()
|
||||
},
|
||||
getOilCardAmount(){
|
||||
if(!this.userInfo){
|
||||
getOilCardAmount() {
|
||||
if (!this.userInfo) {
|
||||
return;
|
||||
}
|
||||
request({
|
||||
url: '/business/marketingActivity/cardFuelRecord/getRecordByUserId',
|
||||
method: 'get',
|
||||
params:{mtUserId:this.userInfo.id}
|
||||
params: {
|
||||
mtUserId: this.userInfo.id
|
||||
}
|
||||
}).then((res) => {
|
||||
res.data.forEach(item => {
|
||||
if (item.oilType==this.oilName){
|
||||
if (item.oilType == this.oilName) {
|
||||
let liters = this.AmountCollected / this.oilPrice
|
||||
this.oilCardAmount = item.lockupPrice * liters
|
||||
}
|
||||
@ -364,13 +440,14 @@
|
||||
this.orderNo = res.data.orderNo
|
||||
if (res.data.code == 1) {
|
||||
this.reset()
|
||||
uni.showToast({
|
||||
title: "支付成功",
|
||||
icon: "success"
|
||||
})
|
||||
// uni.navigateTo({
|
||||
// url:"/pages/index/index"
|
||||
// uni.showToast({
|
||||
// title: "支付成功",
|
||||
// icon: "success"
|
||||
// })
|
||||
|
||||
uni.navigateTo({
|
||||
url:"/pagesHome/PaymentResults/PaymentResults"
|
||||
})
|
||||
} else if (res.data.code == 2) {
|
||||
uni.showToast({
|
||||
title: "请先配置商户号",
|
||||
@ -436,12 +513,12 @@
|
||||
if (!data.value) {
|
||||
this.AmountCollected = this.AmountCollected.substring(0, this.AmountCollected.length - 1);
|
||||
}
|
||||
if (data.value == 'skzf') {
|
||||
uni.navigateTo({
|
||||
url: '/pagesHome/CardPayment/CardPayment'
|
||||
})
|
||||
// if (data.value == 'skzf') {
|
||||
// uni.navigateTo({
|
||||
// url: '/pagesHome/CardPayment/CardPayment'
|
||||
// })
|
||||
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
},
|
||||
@ -450,7 +527,7 @@
|
||||
},
|
||||
getspearIndex(num, data) {
|
||||
this.spearIndex = num
|
||||
this.oilGunNum = data.id
|
||||
this.oilGunNum = data.id
|
||||
this.oils = data.oilName
|
||||
this.tankId = data.tankId
|
||||
this.oilPrice = data.oilPrice
|
||||
|
@ -47,9 +47,9 @@
|
||||
},
|
||||
methods: {
|
||||
// 设置金额
|
||||
setAmount(){
|
||||
setAmount() {
|
||||
uni.navigateTo({
|
||||
url:"/pagesHome/PaymentCode/SetUpCode"
|
||||
url: "/pagesHome/PaymentCode/SetUpCode"
|
||||
})
|
||||
},
|
||||
onReady() {
|
||||
|
@ -4,11 +4,11 @@
|
||||
<headers :titles="titles"><u-icon name="arrow-left" color="#fff" size="22"></u-icon></headers>
|
||||
<view class="b-box">
|
||||
<view class="">金额</view>
|
||||
<view class=""><input type="text" placeholder="请输入金额" /></view>
|
||||
<view style="text-align: right;"><input type="text" placeholder="请输入金额" /></view>
|
||||
</view>
|
||||
<view class="b-box">
|
||||
<view class="">备注</view>
|
||||
<view class=""><input type="text" placeholder="请输入金额" /></view>
|
||||
<view style="text-align: right;"><input type="text" placeholder="请输入备注" /></view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@ -80,5 +80,8 @@
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
color: #333333;
|
||||
background: #fff;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user