Merge remote-tracking branch 'origin/master'

This commit is contained in:
@QQNZX 2023-11-25 09:04:31 +08:00
commit 1088d21953
45 changed files with 888 additions and 398 deletions

View File

@ -9,10 +9,11 @@ export function listOilConfig() {
} }
// 是否开启支付规则 // 是否开启支付规则
export function isOpenOilConfig(isOpen) { export function isOpenOilConfig(data) {
return request({ return request({
url: '/api/oilConfig/'+isOpen, url: '/api/oilConfig/isOpen',
method: 'get', method: 'post',
data: data
}) })
} }

View File

@ -85,12 +85,12 @@
<span v-if="scope.row.timeType == 2" >领券后第{{ scope.row.validityDay}}天生效</span> <span v-if="scope.row.timeType == 2" >领券后第{{ scope.row.validityDay}}天生效</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="生效时间" align="center" prop="effectiveDateType" > <!-- <el-table-column label="生效时间" align="center" prop="effectiveDateType" >
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.effectiveDateType == 0" >领取时间</span> <span v-if="scope.row.effectiveDateType == 0" >领取时间</span>
<span v-if="scope.row.effectiveDateType == 1" >指定{{scope.row. effectiveDateStart}}</span> <span v-if="scope.row.effectiveDateType == 1" >指定{{scope.row. effectiveDateStart}}</span>
</template> </template>
</el-table-column> </el-table-column>-->
<el-table-column label="发放数量" align="center" prop="count" /> <el-table-column label="发放数量" align="center" prop="count" />
<el-table-column label="满足金额" align="center" prop="satisfiedAmount" /> <el-table-column label="满足金额" align="center" prop="satisfiedAmount" />
<el-table-column label="二维码链接" align="center" prop="qrCodeLink" > <el-table-column label="二维码链接" align="center" prop="qrCodeLink" >
@ -218,20 +218,20 @@
<!-- <el-form-item label="满减金额" prop="fullDeduction">--> <!-- <el-form-item label="满减金额" prop="fullDeduction">-->
<!-- <el-input v-model="form.fullDeduction" placeholder="请输入满减金额" />--> <!-- <el-input v-model="form.fullDeduction" placeholder="请输入满减金额" />-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item label="生效时间" prop="effectiveDateType"> <!-- <el-form-item label="生效时间" prop="effectiveDateType">
<el-radio-group v-model="form.effectiveDateType"> <el-radio-group v-model="form.effectiveDateType">
<el-radio label="0">领取时间</el-radio> <el-radio label="0">领取时间</el-radio>
<el-radio label="1">指定时间</el-radio> <el-radio label="1">指定时间</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>-->
<el-form-item label="生效时间" v-if="form.effectiveDateType == 1" prop="effectiveDateStart"> <!-- <el-form-item label="生效时间" v-if="form.effectiveDateType == 1" prop="effectiveDateStart">
<el-time-picker <el-time-picker
arrow-control arrow-control
v-model="form.effectiveDateStart" v-model="form.effectiveDateStart"
placeholder="任意时间点"> placeholder="任意时间点">
</el-time-picker> </el-time-picker>
</el-form-item> </el-form-item>-->
<el-form-item label="可用时段" prop="availablePeriod"> <el-form-item label="可用时段" prop="availablePeriod">
<el-checkbox-group v-model="form.availablePeriod" size="mini" > <el-checkbox-group v-model="form.availablePeriod" size="mini" >
<el-checkbox-button v-for="city in cities" :label="city" :key="city">{{city}}</el-checkbox-button> <el-checkbox-button v-for="city in cities" :label="city" :key="city">{{city}}</el-checkbox-button>

View File

@ -48,7 +48,7 @@
<el-button type="primary" v-if="state=='await'" :disabled="saveFlag" @click="save()">保存</el-button> <el-button type="primary" v-if="state=='await'" :disabled="saveFlag" @click="save()">保存</el-button>
<el-button type="success" v-if="state=='await'" :disabled="auditFlag" @click="audit()">保存并审核</el-button> <el-button type="success" v-if="state=='await'" :disabled="auditFlag" @click="audit()">保存并审核</el-button>
<el-button type="success" v-if="state=='ysh'" :disabled="storageFlag" @click="storage">退货处理库存</el-button> <el-button type="success" v-if="state=='ysh'" :disabled="storageFlag" @click="storage">退货处理库存</el-button>
<el-button type="warning" v-if="state =='await' || state=='ysh'" :disabled="voidFlag" @click="abolition()">作废</el-button> <el-button type="warning" v-if="state !='await' || state=='ysh'" :disabled="voidFlag" @click="abolition()">作废</el-button>
<el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button> <el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button>
</div> </div>

View File

@ -49,7 +49,7 @@
<el-button type="primary" v-if="state=='await'" :disabled="saveFlag" @click="save()">保存</el-button> <el-button type="primary" v-if="state=='await'" :disabled="saveFlag" @click="save()">保存</el-button>
<el-button type="success" v-if="state=='await'" :disabled="auditFlag" @click="audit()">生成差异单</el-button> <el-button type="success" v-if="state=='await'" :disabled="auditFlag" @click="audit()">生成差异单</el-button>
<el-button type="success" v-if="state=='ysh'" :disabled="storageFlag" @click="storage">退货处理库存</el-button> <el-button type="success" v-if="state=='ysh'" :disabled="storageFlag" @click="storage">退货处理库存</el-button>
<el-button type="warning" v-if="state =='await' || state=='ysh'" :disabled="voidFlag" @click="abolition()">作废</el-button> <el-button type="warning" v-if="state !='await' || state=='ysh'" :disabled="voidFlag" @click="abolition()">作废</el-button>
<el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button> <el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button>
</div> </div>

View File

@ -73,7 +73,7 @@
<el-tag v-if ="scope.row.approvalStatus == 'await'" size="medium">待审核</el-tag> <el-tag v-if ="scope.row.approvalStatus == 'await'" size="medium">待审核</el-tag>
<el-tag v-if ="scope.row.approvalStatus == 'qrts'" type="success" size="medium">已审核入库</el-tag> <el-tag v-if ="scope.row.approvalStatus == 'qrts'" type="success" size="medium">已审核入库</el-tag>
<el-tag v-if ="scope.row.approvalStatus == 'yzf'" type="danger" size="medium">已作废</el-tag> <el-tag v-if ="scope.row.approvalStatus == 'yzf'" type="danger" size="medium">已作废</el-tag>
<el-tag v-if ="scope.row.approvalStatus == 'ysh'" type="danger" size="medium">已审核</el-tag> <el-tag v-if ="scope.row.approvalStatus == 'ysh'" type="success" size="medium">已审核</el-tag>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -246,6 +246,8 @@ export default {
// //
resetQuery() { resetQuery() {
this.queryParams = {} this.queryParams = {}
this.getList();
}, },
// //
handleDel(data) { handleDel(data) {

View File

@ -50,7 +50,7 @@
<el-button type="primary" v-if="state=='await'" :disabled="saveFlag" @click="save()">保存</el-button> <el-button type="primary" v-if="state=='await'" :disabled="saveFlag" @click="save()">保存</el-button>
<el-button type="success" v-if="state=='await'" :disabled="auditFlag" @click="audit">保存并审核</el-button> <el-button type="success" v-if="state=='await'" :disabled="auditFlag" @click="audit">保存并审核</el-button>
<el-button type="success" v-if="state=='ysh'" :disabled=" storageFlag" @click="storage()">进货并入库</el-button> <el-button type="success" v-if="state=='ysh'" :disabled=" storageFlag" @click="storage()">进货并入库</el-button>
<el-button type="warning" v-if="state =='await' || state=='ysh'" :disabled="voidFlag" @click="abolition()">作废</el-button> <el-button type="warning" v-if="state =='!await' || state=='ysh'" :disabled="voidFlag" @click="abolition()">作废</el-button>
<el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button> <el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button>
</div> </div>

View File

@ -123,10 +123,15 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="姓名" align="center" prop="name" /> <el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="车牌号" align="center" prop="carNumber"/> <el-table-column label="车牌号" align="center" prop="carNumber">
<template slot-scope="scope">
<span>{{scope.row.carNumber ? scope.row.carNumber:"--"}}</span>
</template>
</el-table-column>
<el-table-column label="认证资料" align="center" prop="attestationData"> <el-table-column label="认证资料" align="center" prop="attestationData">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <p v-for="(item,index) in scope.row.imgUrlList" :key="index">{{item.imageUrl1}}</p>--> <!-- <p v-for="(item,index) in scope.row.imgUrlList" :key="index">{{item.imageUrl1}}</p>-->
<span v-if="scope.row.imgUrlList==null || scope.row.imgUrlList==''">--</span>
<span v-for="(item,index) in scope.row.imgUrlList" :key="index"> <span v-for="(item,index) in scope.row.imgUrlList" :key="index">
<img v-if="item.imageUrl1" :src="'/dev-api'+item.imageUrl1" class="attImg"> <img v-if="item.imageUrl1" :src="'/dev-api'+item.imageUrl1" class="attImg">
<img v-if="item.imageUrl2" :src="'/dev-api'+item.imageUrl2" class="attImg"> <img v-if="item.imageUrl2" :src="'/dev-api'+item.imageUrl2" class="attImg">
@ -134,7 +139,11 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remark"/> <el-table-column label="备注" align="center" prop="remark">
<template slot-scope="scope">
<span>{{scope.row.remark ? scope.row.remark:"--"}}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status"> <el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.rzzt" :value="scope.row.status"/> <dict-tag :options="dict.type.rzzt" :value="scope.row.status"/>

View File

@ -3,7 +3,7 @@
<el-card > <el-card >
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="来源油站" prop="storeIds"> <el-form-item label="来源油站" prop="storeIds">
<el-select v-model="storeIds" filterable clearable placeholder="来源油站" style="width: 100%;"> <el-select v-model="queryParams.storeId" filterable clearable placeholder="来源油站" style="width: 100%;">
<el-option v-for="item in storeList" :key="item.id+''" :label="item.name" :value="item.id+''"/> <el-option v-for="item in storeList" :key="item.id+''" :label="item.name" :value="item.id+''"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -623,7 +623,9 @@ export default {
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = [];
this.resetForm("queryForm"); this.resetForm("queryForm");
this.queryParams.storeIds = ''; this.queryParams.storeId = '';
this.queryParams.official = "";
this.ifBalance = ""
this.storeIds = []; this.storeIds = [];
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order); this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order);
this.handleQuery(); this.handleQuery();

View File

@ -320,7 +320,7 @@
</el-col> </el-col>
<el-col :span="22"> <el-col :span="22">
<div v-if="cardValueList.length>0" style="display: flex;margin: 13px 5px;box-sizing: border-box;flex-wrap: wrap; "> <div v-if="cardValueList.length>0" style="display: flex;margin: 13px 5px;box-sizing: border-box;flex-wrap: wrap; ">
<div class="mon" <div class="mon"
v-for="(item,index) in cardValueList" :key="index" v-for="(item,index) in cardValueList" :key="index"
@ -359,7 +359,7 @@
<span class="bom">赠送金额 仅自定义金额模式下可手动输入赠送活动充值赠送金额不可手动更改</span> <span class="bom">赠送金额 仅自定义金额模式下可手动输入赠送活动充值赠送金额不可手动更改</span>
</div> </div>
</div> </div>
<div class="jine"> <div class="jine">
<div class="zeng">赠送积分</div> <div class="zeng">赠送积分</div>
<div> <div>
@ -433,7 +433,7 @@
<div style="display: flex"> <div style="display: flex">
<div style="width: 7%;line-height: 40px">油品类型</div> <div style="width: 7%;line-height: 40px">油品类型</div>
<el-radio-group v-model="tabOilType" style="margin-bottom: 30px;"> <el-radio-group v-model="tabOilType" style="margin-bottom: 30px;">
<el-radio-button v-for="item,index in oilTypeList" :label="item.oilType" @click.native="tabOilTypeClick(item.status)">{{ item.type }}</el-radio-button> <el-radio-button v-for="(item,index) in oilTypeList" :label="item.oilType" @click.native="tabOilTypeClick(item.status)">{{ item.type }}</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
</el-col> </el-col>
@ -467,14 +467,14 @@
<span class="bom">升数卡充值不支持自定义积分,选择对应充值活动获得对应积分[需开启积分活动有效]</span> <span class="bom">升数卡充值不支持自定义积分,选择对应充值活动获得对应积分[需开启积分活动有效]</span>
</div> </div>
</div> </div>
<!-- <div style="display:flex;margin-left: 20px"> <div style="display:flex;margin-left: 20px">
<div style="line-height: 40px;width: 20%">提成员工</div> <div style="line-height: 40px;width: 20%">提成员工</div>
<div> <div>
<el-input :readonly="true" placeholder="请选择提成员工" v-model="cardFuelDieselForm.realName"> <el-input :readonly="true" placeholder="请选择提成员工" v-model="cardFuelDieselForm.realName">
<el-button slot="append" @click="chooseStaff">选择员工</el-button> <el-button slot="append" @click="chooseStaff">选择员工</el-button>
</el-input> </el-input>
</div> </div>
</div> --> </div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -519,9 +519,9 @@
</el-dialog> </el-dialog>
<!-- 确认充值--> <!-- 确认充值-->
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openConfirm" width="500px" append-to-body> <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openConfirm" width="500px" append-to-body>
<div v-if="isPay == true" <div v-if="isPay"
v-loading="loading"> v-loading="loading">
<div style="text-align: center;font-size: 15px;font-weight: bold">付款金额</div> <div style="text-align: center;font-size: 15px;font-weight: bold">付款金额</div>
<div style="text-align: center;font-size: 30px;font-weight: bold;color: red;margin: 10px 0"> <div style="text-align: center;font-size: 30px;font-weight: bold;color: red;margin: 10px 0">
{{ realyPayBills }} {{ realyPayBills }}
@ -833,7 +833,7 @@ export default {
cardValueList:[], cardValueList:[],
cardValueForm: { cardValueForm: {
cardValueId:'', // id cardValueId:'', // id
mtStaffId: '', // mtStaffId: '', //
realName: '', realName: '',
staffMobile: '', staffMobile: '',
amount:'', // amount:'', //
@ -859,7 +859,7 @@ export default {
staffMobile: '', staffMobile: '',
points:'', points:'',
remark:'', remark:'',
rechargeBalance:'', // rechargeBalance:'', //
paymentType:'', paymentType:'',
oilType:'', oilType:'',
type:'', type:'',
@ -873,7 +873,7 @@ export default {
realyPayBills:0, realyPayBills:0,
oilTypeList: {}, oilTypeList: {},
isPay:true, isPay:true,
@ -1021,7 +1021,11 @@ export default {
}, },
valueAmoutChange(data) { valueAmoutChange(data) {
if(data == '' || data == null) {
data = 0
this.cardValueForm.amount = 0
}
this.cardValueForm.points = '' this.cardValueForm.points = ''
this.cardValueForm.bidBalance ='' this.cardValueForm.bidBalance =''
@ -1105,6 +1109,15 @@ export default {
this.cardValueForm.staffMobile= data.staffMobile this.cardValueForm.staffMobile= data.staffMobile
}, },
refStaff() {
this.cardFuelDieselForm.mtStaffId= ''
this.cardFuelDieselForm.realName= ''
this.cardFuelDieselForm.staffMobile= ''
this.cardValueForm.mtStaffId= ''
this.cardValueForm.realName= ''
this.cardValueForm.staffMobile= ''
},
// //
getCountOilType() { getCountOilType() {
getCountOilTypeApi().then(res => { getCountOilTypeApi().then(res => {
@ -1172,8 +1185,12 @@ export default {
this.realyPayBills = this.cardFuelDieselForm.rechargeBalance this.realyPayBills = this.cardFuelDieselForm.rechargeBalance
} }
this.isPay = true
this.openConfirm = true; this.openConfirm = true;
this.isPay = true
console.log("11111",this.isPay)
// this.isPaySuccess=false
this.title = this.payment this.title = this.payment
}, },
// //
@ -1230,8 +1247,9 @@ export default {
this.cardValueForm.giftBalance = 0 this.cardValueForm.giftBalance = 0
this.cardValueForm.growthValue = 0 this.cardValueForm.growthValue = 0
this.cardValueForm.bidBalance = 0 this.cardValueForm.bidBalance = 0
// this.cardValueForm.bidBalance = 1 // this.cardValueForm.bidBalance = 1
// this.cardValueForm.amount = 0 this.cardValueForm.amount = 0
}else { }else {
let file={} let file={}
@ -1283,7 +1301,7 @@ export default {
}, },
async collection(){ async collection(){
let userForm = this.form let userForm = this.form
if (this.flag === 1) { if (this.flag === 1) {
@ -1307,7 +1325,7 @@ export default {
} }
}); });
let this_ = this let this_ = this
//
let timer = setInterval(async () => { let timer = setInterval(async () => {
getCheckTheStatusOfYourPaymentApi(id).then(response => { getCheckTheStatusOfYourPaymentApi(id).then(response => {
if (response.data!=null){ if (response.data!=null){
@ -1331,10 +1349,12 @@ export default {
this_.loading = false; this_.loading = false;
this_.isPay = false; this_.isPay = false;
clearInterval(timer); clearInterval(timer);
clearTimeout(timer3);
} }
},500) },500)
setTimeout(function (){ var timer3 = setTimeout(function (){
clearInterval(timer2); clearInterval(timer2);
clearInterval(timer); clearInterval(timer);
this_.loading = false; this_.loading = false;
@ -1411,17 +1431,19 @@ export default {
// //
handClose(){ handClose(){
this.isPay = true; this.isPay=true,
this.isPaySuccess=false,
this.isQuery=true,
this.openConfirm = false this.openConfirm = false
this.openRecharge = false this.openRecharge = false
this.isPaySuccess = false; // this.isPaySuccess = false;
this.authCode = null this.authCode = null
this.activeRecharge='balance', this.activeRecharge='balance',
this.cardValueForm = {} this.cardValueForm = {}
this.cardFuelDieselForm = {} this.cardFuelDieselForm = {}
}, },
// //
submitForm: function() { submitForm: function() {
@ -1456,7 +1478,7 @@ export default {
this.isPay = true; this.isPay = true;
this.openConfirm = false this.openConfirm = false
this.openRecharge = false this.openRecharge = false
this.isPaySuccess = false; this.isPaySuccess = false;
this.authCode = null this.authCode = null
this.activeRecharge='balance', this.activeRecharge='balance',
@ -1469,6 +1491,7 @@ export default {
}, },
handleClick(tab, event) { handleClick(tab, event) {
// console.log(tab, event); // console.log(tab, event);
this.refStaff()
this.realyPayBills = 0 this.realyPayBills = 0
}, },
handleChange(value) { handleChange(value) {

View File

@ -144,7 +144,7 @@ import {cleanTankApi} from "@/api/oilConfig/oilTank";
}, },
rules: { rules: {
gunName: [ gunName: [
{ required: true, message: '请输入油名称', trigger: 'blur' }, { required: true, message: '请输入油名称', trigger: 'blur' },
], ],
tankId: [ tankId: [

View File

@ -54,9 +54,9 @@
<div style="display: flex;align-items: center"> <div style="display: flex;align-items: center">
<div class="mingc">规则周期</div> <div class="mingc">规则周期</div>
<el-radio-group v-model="labelPosition" size="small"> <el-radio-group v-model="labelPosition" @input="ruleCycle == labelPosition" size="small">
<el-radio-button label="left">永久</el-radio-button> <el-radio-button label="permanent">永久</el-radio-button>
<el-radio-button label="right">单日</el-radio-button> <el-radio-button label="singleDay">单日</el-radio-button>
</el-radio-group> </el-radio-group>
<div class="mingc">功能状态</div> <div class="mingc">功能状态</div>
<el-switch <el-switch
@ -79,8 +79,8 @@
<!-- <div> 交易满 </div>--> <!-- <div> 交易满 </div>-->
<div> 交易占比 </div> <div> 交易占比 </div>
<div class="jiaong"> {{ item.proportion }} </div> <div class="jiaong"> {{ item.proportion }} </div>
<div> %更换支付通道 参与次数 </div> <div style="margin-right: 20px"> %更换支付通道 </div>
<div class="jiaong"> 不固定次数 </div> <!-- <div class="jiaong"> 参与次数不固定次数 </div>-->
<el-button type="primary" icon="el-icon-edit" @click="editOilConfig(item.id)">编辑</el-button> <el-button type="primary" icon="el-icon-edit" @click="editOilConfig(item.id)">编辑</el-button>
<el-button type="danger" icon="el-icon-close" @click="deleteOilConfig(item.id)">删除</el-button> <el-button type="danger" icon="el-icon-close" @click="deleteOilConfig(item.id)">删除</el-button>
@ -101,7 +101,9 @@
<!-- </div>--> <!-- </div>-->
<div class="hsize">:规则按照顺序进行处理并自动更换支付通道新增或变更规则后需要发布当前规则才生效,发布生效后的规则将从序号1的配置生效</div> <div class="hsize">:规则按照顺序进行处理并自动更换支付通道新增或变更规则后需要发布当前规则才生效,发布生效后的规则将从序号1的配置生效</div>
<el-dialog title="编辑通道规则" :visible.sync="dialogFormVisible"> <!-- 编辑通道规则-->
<el-dialog title="编辑通道规则" :visible.sync="dialogFormVisible"
width="30%">
<el-form :model="form" ref="form"> <el-form :model="form" ref="form">
<el-form-item label="支付通道" :label-width="formLabelWidth" width="300px"> <el-form-item label="支付通道" :label-width="formLabelWidth" width="300px">
@ -116,24 +118,24 @@
<el-form-item label="商户号" :label-width="formLabelWidth"> <el-form-item label="商户号" :label-width="formLabelWidth">
<el-input v-model="form.mchntCd" disabled autocomplete="off"></el-input> <el-input v-model="form.mchntCd" disabled autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="消费满笔数" :label-width="formLabelWidth"> <el-form-item label="交易占比" :label-width="formLabelWidth">
<el-input v-model="form.proportion" autocomplete="off"> <el-input v-model="form.proportion" autocomplete="off">
<template slot="append">%</template> <template slot="append">%</template>
</el-input> </el-input>
<div>消费笔数满足后切换到下一个支付通道</div> <div>交易占比满足规则后切换到下一个支付通道</div>
</el-form-item>
<el-form-item label="参与次数" :label-width="formLabelWidth">
<el-radio-group v-model="form.resource" >
<el-radio label="不固定次数"></el-radio>
<el-radio label="固定次数"></el-radio>
</el-radio-group>
<div>是否限制当前配置在生效期间内的参与次数</div>
</el-form-item> </el-form-item>
<!-- <el-form-item label="参与次数" :label-width="formLabelWidth">-->
<!-- <el-radio-group v-model="form.resource" >-->
<!-- <el-radio label="不固定次数"></el-radio>-->
<!-- <el-radio label="固定次数"></el-radio>-->
<!-- </el-radio-group>-->
<!-- <div>是否限制当前配置在生效期间内的参与次数</div>-->
<!-- </el-form-item>-->
<el-form-item label="排序" :label-width="formLabelWidth"> <!-- <el-form-item label="排序" :label-width="formLabelWidth">-->
<el-input-number v-model="form.num" controls-position="right" :min="1" :max="100"></el-input-number> <!-- <el-input-number v-model="form.num" controls-position="right" :min="1" :max="100"></el-input-number>-->
<div>数值越大顺序越在前</div> <!-- <div>数值越大顺序越在前</div>-->
</el-form-item> <!-- </el-form-item>-->
</el-form> </el-form>
@ -168,6 +170,8 @@ export default {
merchantList:[], merchantList:[],
// //
oilConfigList:[], oilConfigList:[],
//
ruleCycle:"singleDay",
form: { form: {
name: '', name: '',
region: '', region: '',
@ -179,11 +183,11 @@ export default {
resource: '', resource: '',
desc: '' desc: ''
}, },
formLabelWidth: '120px', formLabelWidth: '70px',
dialogFormVisible:false, dialogFormVisible:false,
value:false, value:false,
value1:true, value1:true,
labelPosition: 'right', labelPosition: 'singleDay',
} }
}, },
created() { created() {
@ -197,12 +201,15 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delOilConfig(id).then( response => {}) delOilConfig(id).then( response => {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '规则数据删除成功' message: '规则数据删除成功'
}); });
this.getList(); this.getList();
this.value1 = true;
this.changeStatus1();
})
}).catch(() => {}); }).catch(() => {});
}, },
// //
@ -270,20 +277,50 @@ export default {
// //
changeStatus(){ changeStatus(){
if (this.value){ if (this.value){
this.value1 = false; isOpenOilConfig({isOpen:1,ruleCycle:this.ruleCycle}).then( response => {
isOpenOilConfig(1).then( response => {}) if (response.data!=1){
this.$message({
type: 'error',
message: '支付通道切换失败,请确保交易占比相加满足百分之百'
});
this.value = false;
this.value1 = true;
}else {
this.$message({
type: 'success',
message: '发布成功!'
});
this.value1 = false;
}
})
}else { }else {
this.value1 = true; isOpenOilConfig({isOpen:0,ruleCycle:this.ruleCycle}).then( response => {
isOpenOilConfig(0).then( response => {}) this.value1 = true;
})
} }
}, },
changeStatus1(){ changeStatus1(){
if (this.value1){ if (this.value1){
this.value = false; isOpenOilConfig({isOpen:0,ruleCycle:this.ruleCycle}).then( response => {
isOpenOilConfig(0).then( response => {}) this.value = false;
})
}else { }else {
this.value = true; isOpenOilConfig({isOpen:1,ruleCycle:this.ruleCycle}).then( response => {
isOpenOilConfig(1).then( response => {}) if (response.data!=1){
this.$message({
type: 'error',
message: '支付通道切换失败,请确保交易占比相加满足百分之百'
});
this.value = false;
this.value1 = true;
}else {
this.$message({
type: 'success',
message: '发布成功!'
});
this.value = true;
}
})
} }
}, },
// 使 // 使
@ -294,12 +331,13 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
data.isUse = isUse data.isUse = isUse
editMerchant(data).then( response => {}) editMerchant(data).then( response => {
this.$message({ this.getList();
type: 'success', this.$message({
message: '支付通道切换成功,已实时切换为商户号('+data.mchntCd+')' type: 'success',
}); message: '支付通道切换成功,已实时切换为商户号('+data.mchntCd+')'
this.getList(); });
})
}).catch(() => {}); }).catch(() => {});
}, },
// //
@ -323,10 +361,8 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$message({ this.value1 = false;
type: 'success', this.changeStatus1()
message: '发布成功!'
});
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',

View File

@ -642,7 +642,7 @@ export default {
], ],
mobile: [ mobile: [
{ required: true, message: "手机号不能为空", trigger: "blur" }, { required: true, message: "手机号不能为空", trigger: "blur" },
{ min: 11, max: 20, message: '手机号长度必须11', trigger: 'blur' }, { min: 6, max: 13, message: '手机号不正确', trigger: 'blur' }
], ],
roleId: [ roleId: [
{ required: true, message: "请选择员工角色", trigger: "blur" } { required: true, message: "请选择员工角色", trigger: "blur" }

View File

@ -2,7 +2,7 @@
<div class="app-container"> <div class="app-container">
<el-card class="card"> <el-card class="card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ store.oilStationName }}({{ store.description }})</span> <span>{{ store.name }}{{store.description? "("+store.description+")":"" }}</span>
</div> </div>
<map-componment :pform="form" ref="mapRef" @pform="getForm"></map-componment> <map-componment :pform="form" ref="mapRef" @pform="getForm"></map-componment>
@ -116,7 +116,9 @@ export default {
this.form.lat = this.store.latitude; this.form.lat = this.store.latitude;
this.form.lng = this.store.longitude; this.form.lng = this.store.longitude;
this.form.address = this.store.address; this.form.address = this.store.address;
this.welfare = this.store.welfare.split(",") if (this.store.welfare!=null){
this.welfare = this.store.welfare.split(",")
}
this.$refs.mapRef.initAMap(); this.$refs.mapRef.initAMap();
}) })
}, },
@ -157,17 +159,19 @@ export default {
light: "#fff"// light: "#fff"//
} }
}; };
//this.QRlink url if (this.qrcode.length > 0){
QRCode.toDataURL(this.qrcode[0].collection, opts , (err, url) => { //this.QRlink url
if (err) throw err QRCode.toDataURL(this.qrcode[0].collection, opts , (err, url) => {
//dataQRImgUrl if (err) throw err
this.collectionImg= url //dataQRImgUrl
}) this.collectionImg= url
QRCode.toDataURL(this.qrcode[0].payment, opts , (err, url) => { })
if (err) throw err QRCode.toDataURL(this.qrcode[0].payment, opts , (err, url) => {
//dataQRImgUrl if (err) throw err
this.paymentImg= url //dataQRImgUrl
}) this.paymentImg= url
})
}
}, },
// dom // dom
handleDownloadqrCode(id) { handleDownloadqrCode(id) {

View File

@ -456,6 +456,8 @@ export default {
return { return {
level1:true, level1:true,
level2:false, level2:false,
//
isEnableLevel:"",
// //
gasolinePreferential:[ gasolinePreferential:[
{ {
@ -564,16 +566,21 @@ export default {
this.getList(); this.getList();
this.getClearConfig(); this.getClearConfig();
this.getRule(); this.getRule();
this.getISEnableLevel();
}, },
methods: { methods: {
checkName(rule, value, callback){ //
queryUserGrade({name:this.form.name}).then( response => { getISEnableLevel(){
if(response.data!=null){ getSysConfig('is_enable_level').then(response => {
callback(new Error("会员等级名称已存在")) this.isEnableLevel = response.data
if (response.data=="no"){
this.level1 = true;
this.level2 = false;
}else { }else {
callback(); this.level1 = false;
this.level2 = true;
} }
}) });
}, },
editLevel1(){ editLevel1(){
this.level1 = false; this.level1 = false;
@ -744,7 +751,7 @@ export default {
this.reset(); this.reset();
}, },
// //
submitForm: function() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
this.form.gasolineRule = JSON.stringify(this.gasolinePreferential) this.form.gasolineRule = JSON.stringify(this.gasolinePreferential)
@ -761,19 +768,17 @@ export default {
if(response.data!=null){ if(response.data!=null){
this.$modal.msgError("会员等级名称已存在"); this.$modal.msgError("会员等级名称已存在");
}else { }else {
addUserGrade(this.form).then(response => { addUserGrade(this.form).then(res => {
this.$modal.msgSuccess("新增成功"); if (res.data==1){
this.open = false; this.$modal.msgSuccess("新增成功");
this.getList(); this.open = false;
this.getList();
}else {
this.$modal.msgError("新增失败最多支持20个等级");
}
}); });
} }
}) })
// saveUserGrade(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
} }
} }
}); });

View File

@ -165,6 +165,18 @@
<version>1.4</version> <version>1.4</version>
</dependency> </dependency>
<!-- 阿里云手机验证码-->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>4.5.16</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
<version>2.1.0</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -10,6 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Map;
/** /**
* 支付配置信息 controller层 * 支付配置信息 controller层
*/ */
@ -32,17 +34,28 @@ public class OilConfigController extends BaseController {
/** /**
* 查看支付配置规则是否开启 * 查看支付配置规则是否开启
* @param isOpen * @param map
* @return * @return
*/ */
@GetMapping("/{isOpen}") @PostMapping("/isOpen")
public ResponseObject isOpen(@PathVariable String isOpen){ public ResponseObject isOpen(@Validated @RequestBody Map<String,String> map){
String isOpen = map.get("isOpen");
String ruleCycle = map.get("ruleCycle");
// 2 代表不启用规则
int result = 2;
// isOpen=1开启规则
if (isOpen.equals("1")){ if (isOpen.equals("1")){
oilConfigService.oilRule(); result = oilConfigService.judgmentProportion();
if (result==1){
oilConfigService.oilRule();
// 开启定时关闭规则
oilConfigService.ruleCycle(ruleCycle);
}
}else { }else {
// 不开启规则
merchantConfigService.updateMerchIsOpen("0"); merchantConfigService.updateMerchIsOpen("0");
} }
return getSuccessResult(0); return getSuccessResult(result);
} }
/** /**

View File

@ -38,6 +38,10 @@ public class OilConfig extends BaseEntity implements Serializable {
* 交易占比 * 交易占比
*/ */
private Integer proportion; private Integer proportion;
/**
* 规则周期
*/
private String ruleCycle;
/** /**
* key值 * key值
*/ */

View File

@ -15,6 +15,17 @@ public interface OilConfigService extends IService<OilConfig> {
*/ */
public void oilRule(); public void oilRule();
/**
* 判断占比相加是否为100% 是返回1 不是返回0
* @return
*/
public int judgmentProportion();
/**
* 规则周期是否为当日
*/
public void ruleCycle(String ruleCycle);
/** /**
* 查询油品配置信息 * 查询油品配置信息
* @return * @return

View File

@ -12,6 +12,7 @@ import com.fuint.api.fuyou.vo.OilConfigVo;
import com.fuint.common.dto.AccountInfo; import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil; import com.fuint.common.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
@ -59,6 +60,28 @@ public class OilConfigServiceImpl extends ServiceImpl<OilConfigMapper, OilConfig
merchantConfigService.updateMerch(merchantConfig); merchantConfigService.updateMerch(merchantConfig);
} }
@Override
public int judgmentProportion() {
int result = 0;
int percentage = 0;
List<OilConfig> list = baseMapper.selectList(null);
for (OilConfig config : list) {
percentage += config.getProportion();
}
if (percentage==100){
result = 1;
}
return result;
}
@Override
public void ruleCycle(String ruleCycle) {
// 如果是单日的话则开启定时任务
if (ruleCycle.equals("singleDay")){
}
}
@Override @Override
public List<OilConfigVo> selectOilConfigList() { public List<OilConfigVo> selectOilConfigList() {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();

View File

@ -0,0 +1,17 @@
package com.fuint.api.fuyou.util;
import com.fuint.api.fuyou.service.MerchantConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
public class SchudelUtil {
@Autowired
private MerchantConfigService merchantConfigService;
@Scheduled(fixedDelay=86400000)
public void teak1(){
merchantConfigService.updateMerchIsOpen("0");
}
}

View File

@ -32,14 +32,16 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
commission.setStoreId(storeId); commission.setStoreId(storeId);
IPage<StaffCommission> staffCommissionIPage = baseMapper.selectCommissionList(page, commission); IPage<StaffCommission> staffCommissionIPage = baseMapper.selectCommissionList(page, commission);
for (StaffCommission record : staffCommissionIPage.getRecords()) { for (StaffCommission record : staffCommissionIPage.getRecords()) {
String substring = record.getTakeEffect().substring(24, 43); if (record.getTakeEffect()!=null && record.getTakeEffect().equals("")){
Date date = new Date(); String substring = record.getTakeEffect().substring(24, 43);
SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = new Date();
String now = dateFormat.format(date); SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
int row = substring.compareTo(now); String now = dateFormat.format(date);
if (row == -1){ int row = substring.compareTo(now);
record.setStatus("jy"); if (row == -1){
baseMapper.updateById(record); record.setStatus("jy");
baseMapper.updateById(record);
}
} }
} }
IPage<StaffCommission> commissionIPage = baseMapper.selectCommissionList(page, commission); IPage<StaffCommission> commissionIPage = baseMapper.selectCommissionList(page, commission);

View File

@ -108,7 +108,7 @@ public class MtPurchaseController extends BaseController {
/** /**
* 盘点审核 * 进货审核
* @param id * @param id
* @return * @return
*/ */
@ -117,11 +117,21 @@ public class MtPurchaseController extends BaseController {
return getSuccessResult(this.mtPurchaseService.audit(id)); return getSuccessResult(this.mtPurchaseService.audit(id));
} }
/**
* 进货废除
* @param id
* @return
*/
@GetMapping("abolition") @GetMapping("abolition")
public ResponseObject abolition(Integer id) { public ResponseObject abolition(Integer id) {
return getSuccessResult(this.mtPurchaseService.abolition(id)); return getSuccessResult(this.mtPurchaseService.abolition(id));
} }
/**
* 进货入库
* @param id
* @return
*/
@GetMapping("storage") @GetMapping("storage")
public ResponseObject storage(Integer id) { public ResponseObject storage(Integer id) {
return getSuccessResult(this.mtPurchaseService.storage(id)); return getSuccessResult(this.mtPurchaseService.storage(id));

View File

@ -144,6 +144,7 @@
left join mt_goods mg ON md.goods_id = mg.id left join mt_goods mg ON md.goods_id = mg.id
where where
damage_id = #{mtDamageDetails.damageId} damage_id = #{mtDamageDetails.damageId}
</select> </select>
<select id="getListByExcel" <select id="getListByExcel"
resultType="com.fuint.business.convenienceSore.vo.excel.MtDamageDetailsExcel"> resultType="com.fuint.business.convenienceSore.vo.excel.MtDamageDetailsExcel">

View File

@ -151,15 +151,14 @@
mg.supplier_id supplierId, mg.supplier_id supplierId,
mg.id goodsId, mg.id goodsId,
mg.stock stock, mg.stock stock,
mg.store_id storeId,
mp.order_number orderNumber mp.order_number orderNumber
from mt_purchase_details md from mt_purchase_details md
left join mt_purchase mp ON md.purchase_id = mp.id left join mt_purchase mp ON md.purchase_id = mp.id
left join mt_goods mg ON md.goods_id = mg.id left join mt_goods mg ON md.goods_id = mg.id
<where> <where>
purchase_id = #{mtPurchaseDetails.purchaseId} purchase_id = #{mtPurchaseDetails.purchaseId}
<if test="mtPurchaseDetails.storeId != null"> and md.store_id = #{mtPurchaseDetails.storeId}
and md.store_id = #{mtPurchaseDetails.storeId}
</if>
</where> </where>
</select> </select>
<select id="getListByExcel" <select id="getListByExcel"

View File

@ -191,7 +191,7 @@ public class MtDamageServiceImpl implements MtDamageService {
StockStatistic stockStatistic = stockStatisticService.selectStockByGoodsId(mtReturnsDetailsVO.getGoodsId()); StockStatistic stockStatistic = stockStatisticService.selectStockByGoodsId(mtReturnsDetailsVO.getGoodsId());
StockTrack stockTrack = new StockTrack(); StockTrack stockTrack = new StockTrack();
stockTrack.setStockId(stockStatistic.getId()); stockTrack.setStockId(stockStatistic.getId());
stockTrack.setStoreId(mtReturnsDetailsVO.getStoreId()); stockTrack.setStoreId(nowAccountInfo.getStoreId());
stockTrack.setDocument("商品报损"); stockTrack.setDocument("商品报损");
stockTrack.setChangeNumber(-mtReturnsDetailsVO.getDamageQuantity()); stockTrack.setChangeNumber(-mtReturnsDetailsVO.getDamageQuantity());
stockTrack.setOddNumber(mtReturnsDetailsVO.getOrderNumber()); stockTrack.setOddNumber(mtReturnsDetailsVO.getOrderNumber());

View File

@ -169,7 +169,7 @@ public class MtInventoryServiceImpl implements MtInventoryService {
StockStatistic stockStatistic = stockStatisticService.selectStockByGoodsId(mtReturnsDetailsVO.getGoodsId()); StockStatistic stockStatistic = stockStatisticService.selectStockByGoodsId(mtReturnsDetailsVO.getGoodsId());
StockTrack stockTrack = new StockTrack(); StockTrack stockTrack = new StockTrack();
stockTrack.setStockId(stockStatistic.getId()); stockTrack.setStockId(stockStatistic.getId());
stockTrack.setStoreId(mtReturnsDetailsVO.getStoreId()); stockTrack.setStoreId(nowAccountInfo.getStoreId());
stockTrack.setDocument("商品盘点"); stockTrack.setDocument("商品盘点");
stockTrack.setChangeNumber(mtReturnsDetailsVO.getInventoryDiscrepancy().intValue()); stockTrack.setChangeNumber(mtReturnsDetailsVO.getInventoryDiscrepancy().intValue());
stockTrack.setOddNumber(mtReturnsDetailsVO.getOrderNumber()); stockTrack.setOddNumber(mtReturnsDetailsVO.getOrderNumber());

View File

@ -186,11 +186,13 @@ public class MtPurchaseServiceImpl implements MtPurchaseService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean storage(Integer id) { public boolean storage(Integer id) {
String oilIntake = "进货入库"; String oilIntake = "进货入库";
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
int audit = iljStaffService.auditPrem(oilIntake); int audit = iljStaffService.auditPrem(oilIntake);
if (audit>0) { if (audit>0) {
// 1.查询所有的数据 // 1.查询所有的数据
MtPurchaseDetails mtPurchaseDetails = new MtPurchaseDetails(); MtPurchaseDetails mtPurchaseDetails = new MtPurchaseDetails();
mtPurchaseDetails.setPurchaseId(id); mtPurchaseDetails.setPurchaseId(id);
mtPurchaseDetails.setStoreId(nowAccountInfo.getStoreId());
List<MtPurchaseDetailsVO> allList2 = detailsMapper.getAllList2(mtPurchaseDetails); List<MtPurchaseDetailsVO> allList2 = detailsMapper.getAllList2(mtPurchaseDetails);
for (MtPurchaseDetailsVO mtPurchaseDetailsVO : allList2) { for (MtPurchaseDetailsVO mtPurchaseDetailsVO : allList2) {
// 修改库存 // 修改库存
@ -200,7 +202,7 @@ public class MtPurchaseServiceImpl implements MtPurchaseService {
StockStatistic stockStatistic = stockStatisticService.selectStockByGoodsId(mtPurchaseDetailsVO.getGoodsId()); StockStatistic stockStatistic = stockStatisticService.selectStockByGoodsId(mtPurchaseDetailsVO.getGoodsId());
StockTrack stockTrack = new StockTrack(); StockTrack stockTrack = new StockTrack();
stockTrack.setStockId(stockStatistic.getId()); stockTrack.setStockId(stockStatistic.getId());
stockTrack.setStoreId(mtPurchaseDetailsVO.getStoreId()); stockTrack.setStoreId(nowAccountInfo.getStoreId());
stockTrack.setDocument("商品进货"); stockTrack.setDocument("商品进货");
stockTrack.setChangeNumber(mtPurchaseDetailsVO.getQuantityPurchased()); stockTrack.setChangeNumber(mtPurchaseDetailsVO.getQuantityPurchased());
stockTrack.setOddNumber(mtPurchaseDetailsVO.getOrderNumber()); stockTrack.setOddNumber(mtPurchaseDetailsVO.getOrderNumber());

View File

@ -192,7 +192,7 @@ public class MtReturnsServiceImpl implements MtReturnsService {
StockStatistic stockStatistic = stockStatisticService.selectStockByGoodsId(mtReturnsDetailsVO.getGoodsId()); StockStatistic stockStatistic = stockStatisticService.selectStockByGoodsId(mtReturnsDetailsVO.getGoodsId());
StockTrack stockTrack = new StockTrack(); StockTrack stockTrack = new StockTrack();
stockTrack.setStockId(stockStatistic.getId()); stockTrack.setStockId(stockStatistic.getId());
stockTrack.setStoreId(mtReturnsDetailsVO.getStoreId()); stockTrack.setStoreId(nowAccountInfo.getStoreId());
stockTrack.setDocument("商品退货"); stockTrack.setDocument("商品退货");
stockTrack.setChangeNumber(-mtReturnsDetailsVO.getReturnQuantity()); stockTrack.setChangeNumber(-mtReturnsDetailsVO.getReturnQuantity());
stockTrack.setOddNumber(mtReturnsDetailsVO.getOrderNumber()); stockTrack.setOddNumber(mtReturnsDetailsVO.getOrderNumber());

View File

@ -28,6 +28,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -161,7 +162,9 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
MaxoutVO maxoutVO = new MaxoutVO(); MaxoutVO maxoutVO = new MaxoutVO();
// 会员等级判断符合油号判断 // 会员等级判断符合油号判断
if (activeFullminus.getDieselUserLevel().contains(String.valueOf(userGradeService.selectUserGradeById(transferDTO.getGradeId()).getId())) && if (activeFullminus.getDieselUserLevel().contains(String.valueOf(userGradeService.selectUserGradeById(transferDTO.getGradeId()).getId())) &&
activeFullminus.getAdaptOil().contains(String.valueOf(transferDTO.getOilName()))){ activeFullminus.getAdaptOil().contains(String.valueOf(transferDTO.getOilName())) &&
activeFullminus.getActiveStartTime().getTime()<=new Date().getTime() &&
new Date().getTime()<=activeFullminus.getActiveEndTime().getTime()){
BeanUtils.copyProperties(activeFullminus,maxoutVO); BeanUtils.copyProperties(activeFullminus,maxoutVO);
LambdaQueryWrapper<ActiveDiscountChild> queryWrappers = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ActiveDiscountChild> queryWrappers = new LambdaQueryWrapper<>();
queryWrappers.eq(ActiveDiscountChild::getActiveFullminusId,activeFullminus.getId()); queryWrappers.eq(ActiveDiscountChild::getActiveFullminusId,activeFullminus.getId());
@ -186,7 +189,9 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
MaxoutVO maxoutVO = new MaxoutVO(); MaxoutVO maxoutVO = new MaxoutVO();
// 会员等级判断符合油号判断 // 会员等级判断符合油号判断
if (activeDiscount.getDieselUserLevel().contains(String.valueOf(userGradeService.selectUserGradeById(transferDTO.getGradeId()).getId())) && if (activeDiscount.getDieselUserLevel().contains(String.valueOf(userGradeService.selectUserGradeById(transferDTO.getGradeId()).getId())) &&
activeDiscount.getAdaptOil().contains(String.valueOf(transferDTO.getOilName()))){ activeDiscount.getAdaptOil().contains(String.valueOf(transferDTO.getOilName()))&&
activeDiscount.getActiveStartTime().getTime()<=new Date().getTime() &&
new Date().getTime()<=activeDiscount.getActiveEndTime().getTime()){
BeanUtils.copyProperties(activeDiscount,maxoutVO); BeanUtils.copyProperties(activeDiscount,maxoutVO);
LambdaQueryWrapper<ActiveDiscountChild> queryWrappers = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ActiveDiscountChild> queryWrappers = new LambdaQueryWrapper<>();
queryWrappers.eq(ActiveDiscountChild::getActiveDiscountId,activeDiscount.getId()); queryWrappers.eq(ActiveDiscountChild::getActiveDiscountId,activeDiscount.getId());
@ -218,7 +223,23 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
cardFavorableLambdaQueryWrapper.le(CardFavorable::getSatisfiedAmount,transferDTO.getOilPrice() * transferDTO.getOilLiters()); cardFavorableLambdaQueryWrapper.le(CardFavorable::getSatisfiedAmount,transferDTO.getOilPrice() * transferDTO.getOilLiters());
List<CardFavorable> list1 = cardFavorableService.list(cardFavorableLambdaQueryWrapper); List<CardFavorable> list1 = cardFavorableService.list(cardFavorableLambdaQueryWrapper);
if (list1.size()>0){ if (list1.size()>0){
BeanUtils.copyProperties(list1.get(0), exchangeFavorableVO); CardFavorable cardFavorable = list1.get(0);
if (cardFavorable.getTimeType().equals("0") &&
new Date().getTime()<=cardFavorable.getCreateTime().getTime()+ 86400000L * cardFavorable.getValidityZero() ){
BeanUtils.copyProperties(cardFavorable, exchangeFavorableVO);
}
if (cardFavorable.getTimeType().equals("1") &&
new Date().getTime()<=cardFavorable.getEffectiveDate().getTime()+ 86400000L * cardFavorable.getValidityOne() ){
BeanUtils.copyProperties(cardFavorable, exchangeFavorableVO);
}
if (cardFavorable.getTimeType().equals("2") &&
new Date().getTime() >= cardFavorable.getCreateTime().getTime() + Integer.parseInt(cardFavorable.getValidityDay()) * 86400000L &&
new Date().getTime() <= cardFavorable.getCreateTime().getTime() + Integer.parseInt(cardFavorable.getValidityDay()) * 86400000L + 86400000L * cardFavorable.getValidityTwo()){
BeanUtils.copyProperties(cardFavorable, exchangeFavorableVO);
}
/*if (){
}*/
exchangeFavorableVOArrayList.add(exchangeFavorableVO); exchangeFavorableVOArrayList.add(exchangeFavorableVO);
} }
} }

View File

@ -7,9 +7,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.cardExchange.mapper.CardExchangeRecordMapper; import com.fuint.business.marketingActivity.cardExchange.mapper.CardExchangeRecordMapper;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord; import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService; import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
import com.fuint.business.store.service.StoreService;
import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/** /**
* 兑换券领取记录表(CardExchangeRecord)表服务实现类 * 兑换券领取记录表(CardExchangeRecord)表服务实现类
* *
@ -18,7 +22,8 @@ import org.springframework.stereotype.Service;
*/ */
@Service("cardExchangeRecordService") @Service("cardExchangeRecordService")
public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecordMapper, CardExchangeRecord> implements CardExchangeRecordService { public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecordMapper, CardExchangeRecord> implements CardExchangeRecordService {
@Resource
private StoreService storeService;
/** /**
* 分页查询 * 分页查询
* @param page * @param page
@ -27,6 +32,11 @@ public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecor
*/ */
@Override @Override
public IPage select(Page page, CardExchangeRecord cardExchangeRecord) { public IPage select(Page page, CardExchangeRecord cardExchangeRecord) {
//获取当前店铺的id和连锁店id
if (ObjectUtils.isNotEmpty(TokenUtil.getNowAccountInfo().getStoreId())) {
cardExchangeRecord.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
cardExchangeRecord.setChainStorId(storeService.getById(TokenUtil.getNowAccountInfo().getStoreId()).getChainStoreId());
}
//构建查询条件 //构建查询条件
LambdaQueryWrapper<CardExchangeRecord> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CardExchangeRecord> queryWrapper = new LambdaQueryWrapper<>();
if(ObjectUtils.isNotEmpty(cardExchangeRecord.getExchangeName())){ if(ObjectUtils.isNotEmpty(cardExchangeRecord.getExchangeName())){
@ -41,6 +51,7 @@ public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecor
if(ObjectUtils.isNotEmpty(cardExchangeRecord.getTicketCode())) { if(ObjectUtils.isNotEmpty(cardExchangeRecord.getTicketCode())) {
queryWrapper.eq(CardExchangeRecord::getTicketCode,cardExchangeRecord.getTicketCode()); queryWrapper.eq(CardExchangeRecord::getTicketCode,cardExchangeRecord.getTicketCode());
} }
queryWrapper.eq(CardExchangeRecord::getStoreId,cardExchangeRecord.getStoreId());
queryWrapper.orderByDesc(CardExchangeRecord::getCreateTime); queryWrapper.orderByDesc(CardExchangeRecord::getCreateTime);
return page(page, queryWrapper); return page(page, queryWrapper);
} }
@ -53,6 +64,11 @@ public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecor
*/ */
@Override @Override
public IPage selectIsUsed(Page page, CardExchangeRecord cardExchangeRecord) { public IPage selectIsUsed(Page page, CardExchangeRecord cardExchangeRecord) {
//获取当前店铺的id和连锁店id
if (ObjectUtils.isNotEmpty(TokenUtil.getNowAccountInfo().getStoreId())) {
cardExchangeRecord.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
cardExchangeRecord.setChainStorId(storeService.getById(TokenUtil.getNowAccountInfo().getStoreId()).getChainStoreId());
}
//构建查询条件 //构建查询条件
LambdaQueryWrapper<CardExchangeRecord> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CardExchangeRecord> queryWrapper = new LambdaQueryWrapper<>();
if(ObjectUtils.isNotEmpty(cardExchangeRecord.getExchangeName())){ if(ObjectUtils.isNotEmpty(cardExchangeRecord.getExchangeName())){
@ -70,6 +86,7 @@ public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecor
if (ObjectUtils.isNotEmpty(cardExchangeRecord.getStartTime()) && ObjectUtils.isNotEmpty(cardExchangeRecord.getEndTime()) ) { if (ObjectUtils.isNotEmpty(cardExchangeRecord.getStartTime()) && ObjectUtils.isNotEmpty(cardExchangeRecord.getEndTime()) ) {
queryWrapper.between(CardExchangeRecord::getCancelTime,cardExchangeRecord.getStartTime(),cardExchangeRecord.getEndTime()); queryWrapper.between(CardExchangeRecord::getCancelTime,cardExchangeRecord.getStartTime(),cardExchangeRecord.getEndTime());
} }
queryWrapper.eq(CardExchangeRecord::getStoreId,cardExchangeRecord.getStoreId());
queryWrapper.orderByDesc(CardExchangeRecord::getCreateTime); queryWrapper.orderByDesc(CardExchangeRecord::getCreateTime);
return page(page, queryWrapper); return page(page, queryWrapper);
} }

View File

@ -160,6 +160,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
Double theAmountToBePaid = 0.0; Double theAmountToBePaid = 0.0;
boolean flag = false; boolean flag = false;
System.out.println("cardFuelRecordDTO.getRechargeBalance():"+cardFuelRecordDTO.getRechargeBalance());
double epsilon = 1e-10; // 阈值 double epsilon = 1e-10; // 阈值
if (!ObjectUtil.isEmpty(cardFuelRecordDTO.getRechargeBalance()) if (!ObjectUtil.isEmpty(cardFuelRecordDTO.getRechargeBalance())

View File

@ -106,6 +106,9 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
double epsilon = 1e-10; // 阈值 double epsilon = 1e-10; // 阈值
Double theAmountToBePaid = 0.0; Double theAmountToBePaid = 0.0;
System.out.println("cardFuelRecordDTO.getRechargeBalance():"+cardValueRecordDTO.getRealyPayBills());
boolean flag = false; boolean flag = false;
// 先判断是否为自定义金额 // 先判断是否为自定义金额
if (!ObjectUtil.isEmpty(cardValueRecordDTO.getRealyPayBills()) if (!ObjectUtil.isEmpty(cardValueRecordDTO.getRealyPayBills())

View File

@ -9,6 +9,9 @@
<include refid="selectOrders"></include> <include refid="selectOrders"></include>
<where> <where>
store_id = #{order.storeId} store_id = #{order.storeId}
<if test="order.userId != null and order.userId != ''">
and user_id = #{order.userId}
</if>
<if test="order.staffId != null and order.staffId != ''"> <if test="order.staffId != null and order.staffId != ''">
and staff_id = #{order.staffId} and staff_id = #{order.staffId}
</if> </if>

View File

@ -147,7 +147,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// 支付状态 // 支付状态
String payStatus = "unpaid"; String payStatus = "unpaid";
if (payType.equals("CASH")){ if (payType.equals("CASH") && map.get("allAmount").equals("0")){
payStatus = "paid"; payStatus = "paid";
}else { }else {
payStatus = "unpaid"; payStatus = "unpaid";

View File

@ -3,7 +3,9 @@ package com.fuint.business.petrolStationManagement.service.impl;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.petrolStationManagement.entity.OilTank; import com.fuint.business.petrolStationManagement.entity.OilTank;
import com.fuint.business.petrolStationManagement.entity.OilTracking;
import com.fuint.business.petrolStationManagement.mapper.OilTankMapper; import com.fuint.business.petrolStationManagement.mapper.OilTankMapper;
import com.fuint.business.petrolStationManagement.mapper.OilTrackingMapper;
import com.fuint.business.petrolStationManagement.service.OilTankService; import com.fuint.business.petrolStationManagement.service.OilTankService;
import com.fuint.business.petrolStationManagement.vo.OilTankExcel; import com.fuint.business.petrolStationManagement.vo.OilTankExcel;
import com.fuint.common.dto.AccountInfo; import com.fuint.common.dto.AccountInfo;
@ -27,7 +29,8 @@ import java.util.List;
public class OilTankServiceImpl implements OilTankService { public class OilTankServiceImpl implements OilTankService {
@Resource @Resource
private OilTankMapper oilTankDao; private OilTankMapper oilTankDao;
@Resource
OilTrackingMapper oilTrackingMapper;
/** /**
* 通过ID查询单条数据 * 通过ID查询单条数据
* *
@ -80,6 +83,17 @@ public class OilTankServiceImpl implements OilTankService {
oilTank.setStoreId(nowAccountInfo.getStoreId()); oilTank.setStoreId(nowAccountInfo.getStoreId());
oilTank.setCreateBy(nowAccountInfo.getStaffId().toString()); oilTank.setCreateBy(nowAccountInfo.getStaffId().toString());
this.oilTankDao.insert(oilTank); this.oilTankDao.insert(oilTank);
// 添加到库存跟踪 初始化时
OilTracking oilTracking = new OilTracking();
oilTracking.setStoreId(nowAccountInfo.getStoreId());
oilTracking.setCreateBy(nowAccountInfo.getStaffId().toString());
oilTracking.setDocument("油罐库存初始化");
oilTracking.setQuantityChange(oilTank.getStoredQuantity());
oilTracking.setTankId(oilTank.getId());
oilTracking.setOrderNumber("-");
oilTrackingMapper.insert(oilTracking);
return oilTank; return oilTank;
} }

View File

@ -3,13 +3,15 @@
<mapper namespace="com.fuint.business.userManager.mapper.LJUserMapper"> <mapper namespace="com.fuint.business.userManager.mapper.LJUserMapper">
<sql id="selectUser"> <sql id="selectUser">
select mu.*,mub.card_balance,mub.points,mub.growth_value,mub.refuel_money from mt_user mu select mu.*,mub.card_balance,mub.points,mub.growth_value,mub.refuel_money from mt_user mu
inner join mt_user_balance mub on mu.id = mub.mt_user_id left join mt_user_balance mub on mu.id = mub.mt_user_id
</sql> </sql>
<select id="selectUserList" resultType="com.fuint.business.userManager.vo.LJUserVo"> <select id="selectUserList" resultType="com.fuint.business.userManager.vo.LJUserVo">
<include refid="selectUser"></include> <include refid="selectUser"></include>
<where> <where>
mu.store_id = #{user.storeId} <if test="user.storeId != null and user.storeId != ''">
and mu.store_id = #{user.storeId}
</if>
<if test="user.mobile != null and user.mobile != ''"> <if test="user.mobile != null and user.mobile != ''">
and mu.mobile like concat('%', #{user.mobile}, '%') and mu.mobile like concat('%', #{user.mobile}, '%')
</if> </if>
@ -26,10 +28,10 @@
and mu.official = #{user.official} and mu.official = #{user.official}
</if> </if>
<if test="user.cardBalance != null and user.cardBalance != '' and user.cardBalance == 2"> <if test="user.cardBalance != null and user.cardBalance != '' and user.cardBalance == 2">
and mub.cardBalance = 0 and mub.card_balance = 0
</if> </if>
<if test="user.cardBalance != null and user.cardBalance != '' and user.cardBalance == 1"> <if test="user.cardBalance != null and user.cardBalance != '' and user.cardBalance == 1">
and mub.cardBalance != 0 and mub.card_balance != 0
</if> </if>
<if test="user.params.beginTime != null and user.params.beginTime != ''"><!-- 开始时间检索 --> <if test="user.params.beginTime != null and user.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(mu.create_time,'%y%m%d') &gt;= date_format(#{user.params.beginTime},'%y%m%d') and date_format(mu.create_time,'%y%m%d') &gt;= date_format(#{user.params.beginTime},'%y%m%d')

View File

@ -59,7 +59,16 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
@Override @Override
public int insertUserGrade(LJUserGrade userGrade) { public int insertUserGrade(LJUserGrade userGrade) {
int row = baseMapper.insert(userGrade); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
Integer num = baseMapper.selectCount(null);
int row = 0;
if (num<20){
userGrade.setStoreId(storeId);
row = baseMapper.insert(userGrade);
}else {
row = 0;
}
return row; return row;
} }

View File

@ -37,9 +37,9 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
*/ */
@Override @Override
public IPage<LJUserVo> selectUserList(Page page, LJUserVo user) { public IPage<LJUserVo> selectUserList(Page page, LJUserVo user) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); // AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId(); // Integer storeId = nowAccountInfo.getStoreId();
user.setStoreId(storeId); // user.setStoreId(storeId);
IPage<LJUserVo> ljUserIPage = baseMapper.selectUserList(page, user); IPage<LJUserVo> ljUserIPage = baseMapper.selectUserList(page, user);
return ljUserIPage; return ljUserIPage;
} }

View File

@ -31,7 +31,9 @@ public class ShiroConfig {
filter.setFilters(filters); filter.setFilters(filters);
LinkedHashMap<String,String> filterMap=new LinkedHashMap<>(); LinkedHashMap<String,String> filterMap=new LinkedHashMap<>();
filterMap.put("/backendApi/login/doLogin","anon"); filterMap.put("/backendApi/login/doLogin","anon");
filterMap.put("/backendApi/login/sendMsg","anon");
filterMap.put("/clientApi/captcha/getCode","anon"); filterMap.put("/clientApi/captcha/getCode","anon");
filterMap.put("/backendApi/login/loginByPhone","anon");
filterMap.put("/static/**","anon"); filterMap.put("/static/**","anon");
//会员模板导出 //会员模板导出
filterMap.put("/excel/export","anon"); filterMap.put("/excel/export","anon");

View File

@ -0,0 +1,38 @@
package com.fuint.common.util;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.profile.DefaultProfile;
/**
* 短信发送工具类
*/
public class SMSUtils {
/**
* 发送短信
* @param signName 签名
* @param templateCode 模板
* @param phoneNumbers 手机号
* @param param 参数
*/
public static void sendMessage(String signName, String templateCode,String phoneNumbers,String param){
DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", "", "");
IAcsClient client = new DefaultAcsClient(profile);
SendSmsRequest request = new SendSmsRequest();
request.setSysRegionId("cn-hangzhou");
request.setPhoneNumbers(phoneNumbers);
request.setSignName(signName);
request.setTemplateCode(templateCode);
request.setTemplateParam("{\"code\":\""+param+"\"}");
try {
SendSmsResponse response = client.getAcsResponse(request);
System.out.println("短信发送成功"+response);
}catch (ClientException e) {
e.printStackTrace();
}
}
}

View File

@ -0,0 +1,49 @@
package com.fuint.common.util;
import java.util.Random;
public class ValidateCodeUtils {
/**
* 随机生成验证码
* @param a
* @return
*/
public static String verificationCode(int a) {
// 定义一个空字符串
String verification_code = "";
// 创建Random对象
Random r = new Random();
for (int i = 0; i < a; i++) {
// 确定字符类型(0代表数字1代表大写字母2代表小写字母)
int type = r.nextInt(3);
switch (type) {
case 0:
// 随机生成一个0~9数字
verification_code += r.nextInt(10);
break;
case 1:
// 随机生成一个65~90的数字然后强转为大写字母
verification_code += (char) (r.nextInt(26) + 65);
break;
case 2:
// 随机生成一个97~122的数字然后强转为小写字母
verification_code += (char) (r.nextInt(26) + 97);
break;
}
}
return verification_code;
}
/**
* 随机生成指定长度字符串验证码
* @param length 长度
* @return
*/
public static String generateValidateCode4String(int length){
Random rdm = new Random();
String hash1 = Integer.toHexString(rdm.nextInt());
String capstr = hash1.substring(0, length);
return capstr;
}
}

View File

@ -1,15 +1,17 @@
package com.fuint.module.backendApi.controller; package com.fuint.module.backendApi.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.api.R;
import com.fuint.common.dto.AccountInfo; import com.fuint.common.dto.AccountInfo;
import com.fuint.common.dto.UserDto;
import com.fuint.common.enums.AdminRoleEnum; import com.fuint.common.enums.AdminRoleEnum;
import com.fuint.common.service.*; import com.fuint.common.service.*;
import com.fuint.common.util.TokenUtil; import com.fuint.common.util.*;
import com.fuint.common.util.TreeUtil;
import com.fuint.common.vo.RouterVo; import com.fuint.common.vo.RouterVo;
import com.fuint.framework.annoation.OperationServiceLog; import com.fuint.framework.annoation.OperationServiceLog;
import com.fuint.framework.exception.BusinessCheckException; import com.fuint.framework.exception.BusinessCheckException;
import com.fuint.module.backendApi.request.LoginRequest; import com.fuint.module.backendApi.request.LoginRequest;
import com.fuint.common.util.Constants;
import com.fuint.framework.web.BaseController; import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject; import com.fuint.framework.web.ResponseObject;
import com.fuint.module.backendApi.response.LoginResponse; import com.fuint.module.backendApi.response.LoginResponse;
@ -23,11 +25,15 @@ import io.swagger.annotations.ApiOperation;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken; import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject; import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.fuint.common.domain.TreeNode; import com.fuint.common.domain.TreeNode;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit;
/** /**
* 后台登录接口 * 后台登录接口
@ -64,6 +70,9 @@ public class BackendLoginController extends BaseController {
@Resource @Resource
private CaptchaService captchaService; private CaptchaService captchaService;
@Autowired
public RedisTemplate redisTemplate;
/** /**
* 后台登录 * 后台登录
* */ * */
@ -110,8 +119,50 @@ public class BackendLoginController extends BaseController {
} }
/** /**
* 获取登录信息接口 * 后台登录
* */ * */
@ApiOperation(value = "发送手机验证码")
@RequestMapping(value="/sendMsg", method = RequestMethod.POST)
@OperationServiceLog(description = "发送手机验证码")
public ResponseObject sendMsg(@RequestBody UserDto userDto) {
//获取手机号
String phone = userDto.getMobile();
if(StringUtils.isNotEmpty(phone)){
//生成随机的四位验证码
String code = ValidateCodeUtils.verificationCode(4);
//调用阿里云提供的短信服务API完成发送短信
SMSUtils.sendMessage("蓝鲸智慧油站","SMS_154950909",phone,code);
//需要将生成的验证码保存到redis,过期时间60s
redisTemplate.opsForValue().set(phone,code,60, TimeUnit.SECONDS);
return getSuccessResult("手机验证码发送成功");
}
return getFailureResult("短信发送失败");
}
/**
*
* @param map
* @param session
* @return
*/
@PostMapping("/loginByPhone")
public ResponseObject loginByPhone(@RequestBody Map map) {
//获取手机号 1234
String phone = map.get("mobile").toString();
//获取验证码
String code = map.get("code").toString();
//从redis中获取保存的验证码
Object codeInRedis = redisTemplate.opsForValue().get(phone);
//进行验证码的比对
if (codeInRedis != null && codeInRedis.equals(code)) {
//如果能够比对成功说明登录成功
return getSuccessResult("登录成功!");
}
return getFailureResult("登录失败,请输入正确的验证码");
}
/**
* 获取登录信息接口
* */
@ApiOperation(value = "获取登录信息") @ApiOperation(value = "获取登录信息")
@RequestMapping(value = "/getInfo", method = RequestMethod.GET) @RequestMapping(value = "/getInfo", method = RequestMethod.GET)
public ResponseObject getInfo(HttpServletRequest request) throws BusinessCheckException { public ResponseObject getInfo(HttpServletRequest request) throws BusinessCheckException {

View File

@ -218,7 +218,7 @@
<div class="bottom-price">{{ oilActualPay + goodsActualPay }}</div> <div class="bottom-price">{{ oilActualPay + goodsActualPay }}</div>
<div class="price-red">优惠合计{{ oilDiscount + goodsDiscount }}/{{consumeRefuelMoney}}L</div> <div class="price-red">优惠合计{{ oilDiscount + goodsDiscount }}/{{consumeRefuelMoney}}L</div>
</div> </div>
<el-button class="center-left-lv" :disabled="(oilActualPay + goodsActualPay)==0" @click="settlement">立即结算</el-button> <el-button class="center-left-lv" :disabled="(oilAmount + goodsAmount)==0" @click="settlement">立即结算</el-button>
</div> </div>
</div> </div>
@ -789,6 +789,7 @@
import {selectCoupon, selectPreferential} from "@/api/cashier/preferential"; import {selectCoupon, selectPreferential} from "@/api/cashier/preferential";
import {addHangBill} from "@/api/cashier/hangbill"; import {addHangBill} from "@/api/cashier/hangbill";
import {addCreditUnit, listCreditUnit} from "@/api/cashier/creditunit"; import {addCreditUnit, listCreditUnit} from "@/api/cashier/creditunit";
import {getSysConfig} from "@/api/staff/user/sysconfig";
const cityOptions = ['上海', '北京']; const cityOptions = ['上海', '北京'];
export default { export default {
@ -808,7 +809,7 @@
cities2: cityOptions, cities2: cityOptions,
gradeDiscount: [], gradeDiscount: [],
// //
checkAll3: true, checkAll3: false,
isIndeterminate3: true, isIndeterminate3: true,
checkedCities3: [], checkedCities3: [],
cities3: cityOptions, cities3: cityOptions,
@ -863,8 +864,10 @@
oilActualPay:0, oilActualPay:0,
// //
oilDiscount:0, oilDiscount:0,
// //
hoardAmount:0, hoardAmount:0,
// 使
isOilStorageCard:false,
// //
goodsDiscount:0, goodsDiscount:0,
// //
@ -954,7 +957,7 @@
// id // id
couponIds:[], couponIds:[],
// 使id // 使id
useCouponIds:[], useCouponIds:"",
map:{ map:{
allAmount:0, allAmount:0,
// //
@ -1194,7 +1197,7 @@
if (val){ if (val){
this.fullReduction = 0; this.fullReduction = 0;
this.fullReduceDiscount.forEach(item => { this.fullReduceDiscount.forEach(item => {
this.fullReduction += item.reduce this.fullReduction += +item.reduce
}) })
this.isUseFull = false; this.isUseFull = false;
}else { }else {
@ -1214,7 +1217,7 @@
reduces = item.reduce reduces = item.reduce
} }
} }
this.fullReduction += reduces this.fullReduction += +reduces
}) })
let checkedCount = value.length; let checkedCount = value.length;
this.checkAll1 = checkedCount === this.fullReduceDiscount.length; this.checkAll1 = checkedCount === this.fullReduceDiscount.length;
@ -1256,8 +1259,10 @@
handleCheckAllChange3(val) { handleCheckAllChange3(val) {
if (val==false){ if (val==false){
this.consumeRefuelMoney = 0; this.consumeRefuelMoney = 0;
this.hoardAmount = 0; // this.hoardAmount = 0;
this.isOilStorageCard = false;
}else { }else {
this.isOilStorageCard = true;
this.changeRefuelMoney() this.changeRefuelMoney()
} }
this.isExclusion(); this.isExclusion();
@ -1363,9 +1368,9 @@
list.forEach(item => { list.forEach(item => {
num += item.num; num += item.num;
if (_this.isMember){ if (_this.isMember){
amount += item.memberPrice; amount += +item.memberPrice;
}else { }else {
amount += item.retailPrice; amount += +item.retailPrice;
} }
}) })
this.goodsTotal = num; this.goodsTotal = num;
@ -1414,231 +1419,235 @@
let _this = this; let _this = this;
this.oilDiscount = 0; this.oilDiscount = 0;
this.gradeDiscount = []; this.gradeDiscount = [];
getUserGrade(id).then( response => { getSysConfig('is_enable_level').then(res => {
let gasolineDiscount = 0; if (res.data=="yes") {
let dieselDiscount = 0; getUserGrade(id).then(response => {
let naturalGasDiscount = 0; let gasolineDiscount = 0;
_this.gradeDiscount = []; let dieselDiscount = 0;
_this.oilOrder.forEach(item => { let naturalGasDiscount = 0;
let discount = {type:"",full:0,reduce:0,liters:0} _this.gradeDiscount = [];
if (item.type == "汽油"){ _this.oilOrder.forEach(item => {
let gasolineRule = JSON.parse(response.data.gasolineRule); let discount = {type: "", full: 0, reduce: 0, liters: 0}
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy'){ if (item.type == "汽油") {
if (response.data.gasolineDiscount=="满减优惠"){ let gasolineRule = JSON.parse(response.data.gasolineRule);
let oilDiscount = 0; if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
discount.type = "满减优惠" if (response.data.gasolineDiscount == "满减优惠") {
for (let i = 1; i <= gasolineRule.length; i++){ let oilDiscount = 0;
// discount.type = "满减优惠"
if (gasolineRule.length>1){ for (let i = 1; i <= gasolineRule.length; i++) {
if (item.amount >= gasolineRule[gasolineRule.length-1].gasolineRule1){ //
discount.full = gasolineRule[gasolineRule.length-1].gasolineRule1 if (gasolineRule.length > 1) {
oilDiscount = gasolineRule[gasolineRule.length-1].gasolineRule2 if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
discount.reduce = gasolineRule[gasolineRule.length-1].gasolineRule2 discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
break; oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
discount.reduce = gasolineRule[gasolineRule.length - 1].gasolineRule2
break;
}
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = gasolineRule[i - 1].gasolineRule2
discount.reduce = gasolineRule[i - 1].gasolineRule2
}
} else {
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = gasolineRule[i - 1].gasolineRule2
discount.reduce = gasolineRule[i - 1].gasolineRule2
}
}
} }
if (item.amount >= gasolineRule[i-1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1){ if (discount.reduce != 0) {
discount.full = gasolineRule[i-1].gasolineRule1 _this.gradeDiscount.push(discount)
oilDiscount = gasolineRule[i-1].gasolineRule2 _this.checkedCities2.push('满减优惠')
discount.reduce = gasolineRule[i-1].gasolineRule2
} }
}else { gasolineDiscount += +oilDiscount
if (item.amount >= gasolineRule[i-1].gasolineRule1){ } else if (response.data.gasolineDiscount == "每升优惠") {
discount.full = gasolineRule[i-1].gasolineRule1 discount.type = "每升优惠"
oilDiscount = gasolineRule[i-1].gasolineRule2 let oilDiscount = 0;
discount.reduce = gasolineRule[i-1].gasolineRule2 for (let i = 1; i <= gasolineRule.length; i++) {
//
if (gasolineRule.length > 1) {
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
discount.reduce = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
discount.liters = gasolineRule[i - 1].gasolineRule3
break;
}
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.liters = gasolineRule[i - 1].gasolineRule3
}
} else {
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.liters = gasolineRule[i - 1].gasolineRule3
}
}
} }
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每升优惠')
}
gasolineDiscount += +oilDiscount
} else {
gasolineDiscount = 0;
} }
} }
if (discount.reduce!=0){
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('满减优惠')
}
gasolineDiscount += +oilDiscount
}else if (response.data.gasolineDiscount=="每升优惠"){
discount.type = "每升优惠"
let oilDiscount = 0;
for (let i = 1; i <= gasolineRule.length; i++){
//
if (gasolineRule.length>1){
if (item.amount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
discount.full = gasolineRule[gasolineRule.length-1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2);
discount.reduce = (item.liters * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2);
discount.liters = gasolineRule[i-1].gasolineRule3
break;
}
if (item.amount >= gasolineRule[i-1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1){
discount.full = gasolineRule[i-1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[i-1].gasolineRule3).toFixed(2)
discount.reduce = (item.liters * gasolineRule[i-1].gasolineRule3).toFixed(2)
discount.liters = gasolineRule[i-1].gasolineRule3
}
}else {
if (item.amount >= gasolineRule[i-1].gasolineRule1){
discount.full = gasolineRule[i-1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[i-1].gasolineRule3).toFixed(2)
discount.reduce = (item.liters * gasolineRule[i-1].gasolineRule3).toFixed(2)
discount.liters = gasolineRule[i-1].gasolineRule3
}
}
}
if (discount.reduce!=0){
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每升优惠')
}
gasolineDiscount += +oilDiscount
}else {
gasolineDiscount = 0;
} }
} if (item.type == "柴油") {
} let dieselRule = JSON.parse(response.data.dieselRule);
if (item.type == "柴油"){ if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
let dieselRule = JSON.parse(response.data.dieselRule); if (response.data.dieselDiscount == "满减优惠") {
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy'){ let oilDiscount = 0;
if (response.data.dieselDiscount=="满减优惠"){ discount.type = "满减优惠"
let oilDiscount = 0; for (let i = 1; i <= dieselRule.length; i++) {
discount.type = "满减优惠" //
for (let i = 1; i <= dieselRule.length; i++){ if (dieselRule.length > 1) {
// if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
if (dieselRule.length>1){ discount.full = dieselRule[dieselRule.length - 1].dieselRule1
if (item.amount >= dieselRule[dieselRule.length-1].dieselRule1){ oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
discount.full = dieselRule[dieselRule.length-1].dieselRule1 discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
oilDiscount = dieselRule[dieselRule.length-1].dieselRule2 break;
discount.reduce = dieselRule[dieselRule.length-1].dieselRule2 }
break; if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
discount.full = dieselRule[i - 1].dieselRule1
oilDiscount = dieselRule[i - 1].dieselRule2
discount.reduce = dieselRule[i - 1].dieselRule2
}
} else {
discount.full = dieselRule[i - 1].dieselRule1
if (item.amount >= dieselRule[i - 1].dieselRule1) {
oilDiscount = dieselRule[i - 1].dieselRule2
discount.reduce = dieselRule[i - 1].dieselRule2
}
}
} }
if (item.amount >= dieselRule[i-1].dieselRule1 && item.amount < dieselRule[i].dieselRule1){ if (discount.reduce != 0) {
discount.full = dieselRule[i-1].dieselRule1 _this.gradeDiscount.push(discount)
oilDiscount = dieselRule[i-1].dieselRule2 _this.checkedCities2.push('满减优惠')
discount.reduce = dieselRule[i-1].dieselRule2
} }
}else { dieselDiscount += +oilDiscount
discount.full = dieselRule[i-1].dieselRule1 } else if (response.data.dieselDiscount == "每升优惠") {
if (item.amount >= dieselRule[i-1].dieselRule1){ let oilDiscount = 0;
oilDiscount = dieselRule[i-1].dieselRule2 for (let i = 1; i <= dieselRule.length; i++) {
discount.reduce = dieselRule[i-1].dieselRule2 discount.type = "每升优惠"
//
if (dieselRule.length > 1) {
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
oilDiscount = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
discount.reduce = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
discount.liters = dieselRule[dieselRule.length - 1].dieselRule3
break;
}
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
discount.full = dieselRule[i - 1].dieselRule1
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.liters = dieselRule[i - 1].dieselRule3
}
} else {
discount.full = dieselRule[i - 1].dieselRule1
if (item.amount >= dieselRule[i - 1].dieselRule1) {
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.liters = dieselRule[i - 1].dieselRule3
}
}
} }
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每升优惠')
}
dieselDiscount += +oilDiscount
} else {
dieselDiscount = 0;
} }
} }
if (discount.reduce!=0){
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('满减优惠')
}
dieselDiscount += +oilDiscount
}else if (response.data.dieselDiscount=="每升优惠"){
let oilDiscount = 0;
for (let i = 1; i <= dieselRule.length; i++){
discount.type = "每升优惠"
//
if (dieselRule.length>1){
if (item.amount >= dieselRule[dieselRule.length-1].dieselRule1){
discount.full = dieselRule[dieselRule.length-1].dieselRule1
oilDiscount = (item.liters * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2);
discount.reduce = (item.liters * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2);
discount.liters = dieselRule[dieselRule.length-1].dieselRule3
break;
}
if (item.amount >= dieselRule[i-1].dieselRule1 && item.amount < dieselRule[i].dieselRule1){
discount.full = dieselRule[i-1].dieselRule1
oilDiscount = (item.liters * dieselRule[i-1].dieselRule3).toFixed(2)
discount.reduce = (item.liters * dieselRule[i-1].dieselRule3).toFixed(2)
discount.liters = dieselRule[i-1].dieselRule3
}
}else {
discount.full = dieselRule[i-1].dieselRule1
if (item.amount >= dieselRule[i-1].dieselRule1){
oilDiscount = (item.liters * dieselRule[i-1].dieselRule3).toFixed(2)
discount.reduce = (item.liters * dieselRule[i-1].dieselRule3).toFixed(2)
discount.liters = dieselRule[i-1].dieselRule3
}
}
}
if (discount.reduce!=0){
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每升优惠')
}
dieselDiscount += +oilDiscount
}else {
dieselDiscount = 0;
} }
} if (item.type == "天然气") {
} let naturalGasRule = JSON.parse(response.data.naturalGasRule);
if (item.type == "天然气"){ if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
let naturalGasRule = JSON.parse(response.data.naturalGasRule); if (response.data.naturalGasDiscount == "满减优惠") {
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy'){ let oilDiscount = 0;
if (response.data.naturalGasDiscount=="满减优惠"){ discount.type = "满减优惠"
let oilDiscount = 0; for (let i = 1; i <= naturalGasRule.length; i++) {
discount.type = "满减优惠" //
for (let i = 1; i <= naturalGasRule.length; i++){ if (naturalGasRule.length > 1) {
// if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
if (naturalGasRule.length>1){ discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
if (item.amount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){ oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
discount.full = naturalGasRule[naturalGasRule.length-1].naturalGasRule1 discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
oilDiscount = naturalGasRule[naturalGasRule.length-1].naturalGasRule2; break;
discount.reduce = naturalGasRule[naturalGasRule.length-1].naturalGasRule2 }
break; if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
}
} else {
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
}
}
} }
if (item.amount >= naturalGasRule[i-1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1){ if (discount.reduce != 0) {
discount.full = naturalGasRule[i-1].naturalGasRule1 _this.gradeDiscount.push(discount)
oilDiscount = naturalGasRule[i-1].naturalGasRule2 _this.checkedCities2.push('满减优惠')
discount.reduce = naturalGasRule[i-1].naturalGasRule2
} }
}else { naturalGasDiscount += +oilDiscount
if (item.amount >= naturalGasRule[i-1].naturalGasRule1){ } else if (response.data.naturalGasDiscount == "每单位优惠") {
discount.full = naturalGasRule[i-1].naturalGasRule1 let oilDiscount = 0;
oilDiscount = naturalGasRule[i-1].naturalGasRule2 discount.type = "每单位优惠"
discount.reduce = naturalGasRule[i-1].naturalGasRule2 for (let i = 1; i <= naturalGasRule.length; i++) {
//
if (naturalGasRule.length > 1) {
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[naturalGasRule.length - 1].naturalGasRule3
break;
}
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[i - 1].naturalGasRule3
}
} else {
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[i - 1].naturalGasRule3
}
}
} }
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每单位优惠')
}
naturalGasDiscount += +oilDiscount
} else {
naturalGasDiscount = 0;
} }
} }
if (discount.reduce!=0){
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('满减优惠')
}
naturalGasDiscount += +oilDiscount
}else if (response.data.naturalGasDiscount=="每单位优惠"){
let oilDiscount = 0;
discount.type = "每单位优惠"
for (let i = 1; i <= naturalGasRule.length; i++){
//
if (naturalGasRule.length>1){
if (item.amount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
discount.full = naturalGasRule[naturalGasRule.length-1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length-1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[gasolineRule.length-1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[naturalGasRule.length-1].naturalGasRule3
break;
}
if (item.amount >= naturalGasRule[i-1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1){
discount.full = naturalGasRule[i-1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[i-1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[i-1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[i-1].naturalGasRule3
}
}else {
if (item.amount >= naturalGasRule[i-1].naturalGasRule1){
discount.full = naturalGasRule[i-1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[i-1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[i-1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[i-1].naturalGasRule3
}
}
}
if (discount.reduce!=0){
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每单位优惠')
}
naturalGasDiscount += +oilDiscount
}else {
naturalGasDiscount = 0;
} }
} })
}
})
_this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount _this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount
_this.checkAll2 = true; _this.checkAll2 = true;
_this.isExclusion(); _this.isExclusion();
})
}
}) })
}, },
// //
@ -1748,15 +1757,29 @@
}) })
}) })
}, },
// 使
countOilCard(){
if (this.hoardAmount!=0){
if (this.balance!=0 && this.balance >= (this.oilAmount - this.hoardAmount)){
this.oilActualPay = 0
this.consumeAmount = this.hoardAmount
}else {
this.oilActualPay = this.oilAmount - this.hoardAmount -this.balance
}
}else {
this.oilActualPay = 0
this.consumeAmount = 0
}
},
// 使使 // 使使
countAmountFull(){ countAmountFull(){
if (this.isMember){ if (this.isMember){
// //
if (this.balance >= (this.oilAmount - this.oilDiscount - this.couponAmount)){ if (this.balance >= (this.oilAmount - this.oilDiscount - this.couponAmount)){
this.oilActualPay = 0 this.oilActualPay = 0
this.consumeAmount = this.oilAmount - this.oilDiscount - this.couponAmount - this.hoardAmount this.consumeAmount = this.oilAmount - this.oilDiscount - this.couponAmount
}else { }else {
this.oilActualPay = this.oilAmount -this.balance - this.oilDiscount - this.couponAmount - this.hoardAmount this.oilActualPay = this.oilAmount -this.balance - this.oilDiscount - this.couponAmount
this.consumeAmount = this.balance this.consumeAmount = this.balance
} }
}else { }else {
@ -1766,7 +1789,7 @@
// 使使 // 使使
countAmountUnBalance(){ countAmountUnBalance(){
if (this.isMember){ if (this.isMember){
this.oilActualPay = this.oilAmount - this.fullReduction - this.oilDiscount - this.couponAmount - this.hoardAmount this.oilActualPay = this.oilAmount - this.fullReduction - this.oilDiscount - this.couponAmount
}else { }else {
this.oilActualPay = this.oilAmount - this.oilDiscount this.oilActualPay = this.oilAmount - this.oilDiscount
} }
@ -1777,9 +1800,9 @@
if (this.isMember){ if (this.isMember){
if (this.balance >= (this.oilAmount - this.oilDiscount - this.fullReduction)){ if (this.balance >= (this.oilAmount - this.oilDiscount - this.fullReduction)){
this.oilActualPay = 0 this.oilActualPay = 0
this.consumeAmount = this.oilAmount - this.oilDiscount - this.fullReduction - this.hoardAmount this.consumeAmount = this.oilAmount - this.oilDiscount - this.fullReduction
}else { }else {
this.oilActualPay = this.oilAmount -this.balance - this.oilDiscount - this.fullReduction - this.hoardAmount this.oilActualPay = this.oilAmount -this.balance - this.oilDiscount - this.fullReduction
this.consumeAmount = this.balance this.consumeAmount = this.balance
} }
}else { }else {
@ -1828,6 +1851,18 @@
this.countAmountFull() this.countAmountFull()
return; return;
} }
// 使
if (this.isOilStorageCard){
this.checkAll1 = false;
this.fullReduction = 0;
this.checkAll2 = false;
this.checkedCities2 = [],
this.oilDiscount = 0;
this.checkAll5 = false;
this.couponAmount = 0;
this.countOilCard();
return;
}
this.countAmountBalance(); this.countAmountBalance();
} }
}, },
@ -1845,7 +1880,7 @@
if (response.data.length>0){ if (response.data.length>0){
_this.fullReduceDiscount = [] _this.fullReduceDiscount = []
response.data.forEach(item => { response.data.forEach(item => {
let discount = {type:item.name,full:0,reduce:0,discount:0} let discount = {type:item.name,full:0,reduce:0,discount:0,exclusion:item.participationCondition}
let activeList = item.activeDiscountChildList; let activeList = item.activeDiscountChildList;
for (let i = 1;i<=activeList.length;i++){ for (let i = 1;i<=activeList.length;i++){
if (activeList.length>0){ if (activeList.length>0){
@ -1927,9 +1962,9 @@
let amount = 0; let amount = 0;
for (let i = 0; i<goods.length; i++){ for (let i = 0; i<goods.length; i++){
if (_this.isMember){ if (_this.isMember){
amount += (goods[i].memberPrice * goods[i].num).toFixed(2) amount += +(goods[i].memberPrice * goods[i].num).toFixed(2)
}else { }else {
amount += (goods[i].retailPrice * goods[i].num).toFixed(2) amount += +(goods[i].retailPrice * goods[i].num).toFixed(2)
} }
if (goods[i].id == val.id){ if (goods[i].id == val.id){
goods[i].num = goods[i].num + 1; goods[i].num = goods[i].num + 1;
@ -1948,9 +1983,9 @@
if (result){ if (result){
val.num = 1; val.num = 1;
if (_this.isMember){ if (_this.isMember){
this.goodsAmount += val.memberPrice this.goodsAmount += +val.memberPrice
}else { }else {
this.goodsAmount += val.retailPrice this.goodsAmount += +val.retailPrice
} }
this.goodsActualPay = this.goodsAmount - this.goodsDiscount; this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
this.goodsOrder.push(val); this.goodsOrder.push(val);
@ -2036,35 +2071,30 @@
let _this = this; let _this = this;
_this.consumeRefuelMoney = 0; _this.consumeRefuelMoney = 0;
_this.oilActualPay = 0; _this.oilActualPay = 0;
let oilActPay = 0;
_this.hoardAmount = 0; _this.hoardAmount = 0;
_this.oilOrder.forEach(item => { _this.oilOrder.forEach(item => {
let conRefMon = 0; let conRefMon = 0;
let oilActualPay = 0;
let hoardAmount = 0; let hoardAmount = 0;
if (_this.refuelMoney!=null){ if (_this.refuelMoney!=null){
let result = false;
for (let i = 0;i < _this.refuelMoney.length;i++){ for (let i = 0;i < _this.refuelMoney.length;i++){
// //
if (_this.refuelMoney[i].oilType==item.oilType){ if (_this.refuelMoney[i].oilType==item.oilType){
if ((_this.refuelMoney[i].refuelMoney-item.liters)>=0){ if ((_this.refuelMoney[i].refuelMoney-item.liters)>=0){
conRefMon = item.liters conRefMon = item.liters
oilActualPay = 0;
}else { }else {
conRefMon = _this.refuelMoney[i].refuelMoney conRefMon = _this.refuelMoney[i].refuelMoney
oilActualPay = item.amount - (_this.refuelMoney[i].refuelMoney * item.oilPrice).toFixed(2) //
hoardAmount = (_this.refuelMoney[i].refuelMoney * item.oilPrice).toFixed(2) hoardAmount = item.amount - (_this.refuelMoney[i].refuelMoney * item.oilPrice).toFixed(2)
}
result = true;
}else {
if (result==false){
oilActualPay = item.amount
} }
} }
} }
} }
_this.consumeRefuelMoney += +conRefMon _this.consumeRefuelMoney += +conRefMon
oilActPay += +oilActualPay if (_this.consumeRefuelMoney!=0){
_this.isOilStorageCard = true;
_this.checkAll3 = true;
_this.consumeAmount = 0;
}
_this.hoardAmount += +hoardAmount _this.hoardAmount += +hoardAmount
}) })
_this.isExclusion(); _this.isExclusion();
@ -2381,9 +2411,9 @@
goods.forEach(item => { goods.forEach(item => {
num += item.num num += item.num
if (_this.isMember){ if (_this.isMember){
amount += (item.memberPrice*item.num).toFixed(2); amount += +(item.memberPrice*item.num).toFixed(2);
}else { }else {
amount += (item.retailPrice*item.num).toFixed(2); amount += +(item.retailPrice*item.num).toFixed(2);
} }
}) })
this.goodsTotal = num; this.goodsTotal = num;

View File

@ -493,7 +493,7 @@
</el-row> </el-row>
<div style="margin: 20px 0;text-align: center"> <div style="margin: 20px 0;text-align: center">
<el-button type="primary" @click="confirm(1)">确认充值</el-button> <el-button type="primary" @click="confirm(1)">确认充值</el-button>
<el-button @click="cancel"> </el-button> <el-button @click="openRecharge = false"> </el-button>
</div> </div>
</div> </div>
</el-tab-pane> </el-tab-pane>
@ -537,14 +537,14 @@
<span class="bom">升数卡充值不支持自定义积分,选择对应充值活动获得对应积分[需开启积分活动有效]</span> <span class="bom">升数卡充值不支持自定义积分,选择对应充值活动获得对应积分[需开启积分活动有效]</span>
</div> </div>
</div> </div>
<!-- <div style="display:flex;margin-left: 20px"> <div style="display:flex;margin-left: 20px">
<div style="line-height: 40px;width: 20%">提成员工</div> <div style="line-height: 40px;width: 20%">提成员工</div>
<div> <div>
<el-input :readonly="true" placeholder="请选择提成员工" v-model="cardFuelDieselForm.realName"> <el-input :readonly="true" placeholder="请选择提成员工" v-model="cardFuelDieselForm.realName">
<el-button slot="append" @click="chooseStaff">选择员工</el-button> <el-button slot="append" @click="chooseStaff">选择员工</el-button>
</el-input> </el-input>
</div> </div>
</div> --> </div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -575,12 +575,13 @@
</el-row> </el-row>
<div style="margin: 20px 0;text-align: center"> <div style="margin: 20px 0;text-align: center">
<el-button type="primary" @click="confirm(2)">确认充值</el-button> <el-button type="primary" @click="confirm(2)">确认充值</el-button>
<el-button @click="cancel"> </el-button> <el-button @click="openRecharge = false"> </el-button>
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</template> </template>
</el-dialog> </el-dialog>
<!-- 选择员工--> <!-- 选择员工-->
<el-dialog :close-on-click-modal="false" width="50%" height="50%" title="选择员工" :visible.sync="openStaff" append-to-body> <el-dialog :close-on-click-modal="false" width="50%" height="50%" title="选择员工" :visible.sync="openStaff" append-to-body>
<select-staff @send-data="handleDataFromChild"> <select-staff @send-data="handleDataFromChild">
@ -1217,6 +1218,15 @@ export default {
this.cardValueForm.staffMobile= data.staffMobile this.cardValueForm.staffMobile= data.staffMobile
}, },
refStaff() {
this.cardFuelDieselForm.mtStaffId= ''
this.cardFuelDieselForm.realName= ''
this.cardFuelDieselForm.staffMobile= ''
this.cardValueForm.mtStaffId= ''
this.cardValueForm.realName= ''
this.cardValueForm.staffMobile= ''
},
// //
getCountOilType() { getCountOilType() {
getCountOilTypeApi().then(res => { getCountOilTypeApi().then(res => {
@ -1448,11 +1458,13 @@ export default {
// //
handClose(){ handClose(){
this.isPay = true; this.isPay=true,
this.isPaySuccess=false,
this.isQuery=true,
this.openConfirm = false this.openConfirm = false
this.openRecharge = false this.openRecharge = false
this.isPaySuccess = false; // this.isPaySuccess = false;
this.authCode = null this.authCode = null
this.activeRecharge='balance', this.activeRecharge='balance',
@ -1533,6 +1545,9 @@ export default {
this.openConfirm = false; this.openConfirm = false;
}, },
handleClick(tab, event) { handleClick(tab, event) {
this.refStaff();
this.realyPayBills = 0
// console.log(tab, event); // console.log(tab, event);
}, },
handleChange(value) { handleChange(value) {

View File

@ -0,0 +1,59 @@
<template>
<div>
<el-table ref="tables" v-loading="loading" :data="list">
<el-table-column label="所属油站" prop="id" align="center"/>
<el-table-column label="订单时间" align="center"/>
<el-table-column label="交易终端" align="center" prop="userNo"/>
<el-table-column label="油品/油枪" align="center" prop="name" />
<el-table-column label="订单金额" align="center" prop="mobile"/>
<el-table-column label="优惠金额" align="center" prop="gradeId"/>
<el-table-column label="实付金额" align="center" prop="balance"/>
<el-table-column label="付款类型" align="center" prop="balance"/>
<el-table-column label="订单号" align="center" prop="balance"/>
<el-table-column label="订单类型" align="center" prop="point"/>
</el-table>
<pagination
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import {listOilOrder} from "@/api/cashier/oilorder";
export default {
props:["pid"],
data(){
return {
loading:false,
list:[],
total:0,
queryParams:{
page:1,
pageSize:10,
userId:"",
},
// id
userId:"",
}
},
created() {
this.getList();
},
methods:{
getList(){
listOilOrder(this.queryParams).then(res => {
console.log(res)
})
},
}
}
</script>
<style lang="scss" scoped>
</style>