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({
url: '/api/oilConfig/'+isOpen,
method: 'get',
url: '/api/oilConfig/isOpen',
method: 'post',
data: data
})
}

View File

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

View File

@ -48,7 +48,7 @@
<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=='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>
</div>

View File

@ -49,7 +49,7 @@
<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=='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>
</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 == '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 == 'ysh'" type="danger" size="medium">已审核</el-tag>
<el-tag v-if ="scope.row.approvalStatus == 'ysh'" type="success" size="medium">已审核</el-tag>
</div>
</template>
</el-table-column>
@ -246,6 +246,8 @@ export default {
//
resetQuery() {
this.queryParams = {}
this.getList();
},
//
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="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="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>
</div>

View File

@ -123,10 +123,15 @@
</template>
</el-table-column>
<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">
<template slot-scope="scope">
<!-- <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">
<img v-if="item.imageUrl1" :src="'/dev-api'+item.imageUrl1" class="attImg">
<img v-if="item.imageUrl2" :src="'/dev-api'+item.imageUrl2" class="attImg">
@ -134,7 +139,11 @@
</span>
</template>
</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">
<template slot-scope="scope">
<dict-tag :options="dict.type.rzzt" :value="scope.row.status"/>

View File

@ -3,7 +3,7 @@
<el-card >
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<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-select>
</el-form-item>
@ -623,7 +623,9 @@ export default {
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.queryParams.storeIds = '';
this.queryParams.storeId = '';
this.queryParams.official = "";
this.ifBalance = ""
this.storeIds = [];
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order);
this.handleQuery();

View File

@ -433,7 +433,7 @@
<div style="display: flex">
<div style="width: 7%;line-height: 40px">油品类型</div>
<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>
</div>
</el-col>
@ -467,14 +467,14 @@
<span class="bom">升数卡充值不支持自定义积分,选择对应充值活动获得对应积分[需开启积分活动有效]</span>
</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>
<el-input :readonly="true" placeholder="请选择提成员工" v-model="cardFuelDieselForm.realName">
<el-button slot="append" @click="chooseStaff">选择员工</el-button>
</el-input>
</div>
</div> -->
</div>
</div>
</el-col>
</el-row>
@ -519,7 +519,7 @@
</el-dialog>
<!-- 确认充值-->
<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">
<div style="text-align: center;font-size: 15px;font-weight: bold">付款金额</div>
@ -1021,7 +1021,11 @@ export default {
},
valueAmoutChange(data) {
if(data == '' || data == null) {
data = 0
this.cardValueForm.amount = 0
}
this.cardValueForm.points = ''
this.cardValueForm.bidBalance =''
@ -1105,6 +1109,15 @@ export default {
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() {
getCountOilTypeApi().then(res => {
@ -1172,8 +1185,12 @@ export default {
this.realyPayBills = this.cardFuelDieselForm.rechargeBalance
}
this.isPay = true
this.openConfirm = true;
this.isPay = true
console.log("11111",this.isPay)
// this.isPaySuccess=false
this.title = this.payment
},
//
@ -1230,8 +1247,9 @@ export default {
this.cardValueForm.giftBalance = 0
this.cardValueForm.growthValue = 0
this.cardValueForm.bidBalance = 0
// this.cardValueForm.bidBalance = 1
// this.cardValueForm.amount = 0
this.cardValueForm.amount = 0
}else {
let file={}
@ -1307,7 +1325,7 @@ export default {
}
});
let this_ = this
//
let timer = setInterval(async () => {
getCheckTheStatusOfYourPaymentApi(id).then(response => {
if (response.data!=null){
@ -1331,10 +1349,12 @@ export default {
this_.loading = false;
this_.isPay = false;
clearInterval(timer);
clearTimeout(timer3);
}
},500)
setTimeout(function (){
var timer3 = setTimeout(function (){
clearInterval(timer2);
clearInterval(timer);
this_.loading = false;
@ -1411,11 +1431,13 @@ export default {
//
handClose(){
this.isPay = true;
this.isPay=true,
this.isPaySuccess=false,
this.isQuery=true,
this.openConfirm = false
this.openRecharge = false
this.isPaySuccess = false;
// this.isPaySuccess = false;
this.authCode = null
this.activeRecharge='balance',
@ -1469,6 +1491,7 @@ export default {
},
handleClick(tab, event) {
// console.log(tab, event);
this.refStaff()
this.realyPayBills = 0
},
handleChange(value) {

View File

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

View File

@ -54,9 +54,9 @@
<div style="display: flex;align-items: center">
<div class="mingc">规则周期</div>
<el-radio-group v-model="labelPosition" size="small">
<el-radio-button label="left">永久</el-radio-button>
<el-radio-button label="right">单日</el-radio-button>
<el-radio-group v-model="labelPosition" @input="ruleCycle == labelPosition" size="small">
<el-radio-button label="permanent">永久</el-radio-button>
<el-radio-button label="singleDay">单日</el-radio-button>
</el-radio-group>
<div class="mingc">功能状态</div>
<el-switch
@ -79,8 +79,8 @@
<!-- <div> 交易满 </div>-->
<div> 交易占比 </div>
<div class="jiaong"> {{ item.proportion }} </div>
<div> %更换支付通道 参与次数 </div>
<div class="jiaong"> 不固定次数 </div>
<div style="margin-right: 20px"> %更换支付通道 </div>
<!-- <div class="jiaong"> 参与次数不固定次数 </div>-->
<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>
@ -101,7 +101,9 @@
<!-- </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-item label="支付通道" :label-width="formLabelWidth" width="300px">
@ -116,24 +118,24 @@
<el-form-item label="商户号" :label-width="formLabelWidth">
<el-input v-model="form.mchntCd" disabled autocomplete="off"></el-input>
</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">
<template slot="append">%</template>
</el-input>
<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>
<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 label="排序" :label-width="formLabelWidth">
<el-input-number v-model="form.num" controls-position="right" :min="1" :max="100"></el-input-number>
<div>数值越大顺序越在前</div>
</el-form-item>
<!-- <el-form-item label="排序" :label-width="formLabelWidth">-->
<!-- <el-input-number v-model="form.num" controls-position="right" :min="1" :max="100"></el-input-number>-->
<!-- <div>数值越大顺序越在前</div>-->
<!-- </el-form-item>-->
</el-form>
@ -168,6 +170,8 @@ export default {
merchantList:[],
//
oilConfigList:[],
//
ruleCycle:"singleDay",
form: {
name: '',
region: '',
@ -179,11 +183,11 @@ export default {
resource: '',
desc: ''
},
formLabelWidth: '120px',
formLabelWidth: '70px',
dialogFormVisible:false,
value:false,
value1:true,
labelPosition: 'right',
labelPosition: 'singleDay',
}
},
created() {
@ -197,12 +201,15 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delOilConfig(id).then( response => {})
delOilConfig(id).then( response => {
this.$message({
type: 'success',
message: '规则数据删除成功'
});
this.getList();
this.value1 = true;
this.changeStatus1();
})
}).catch(() => {});
},
//
@ -270,20 +277,50 @@ export default {
//
changeStatus(){
if (this.value){
this.value1 = false;
isOpenOilConfig(1).then( response => {})
}else {
isOpenOilConfig({isOpen:1,ruleCycle:this.ruleCycle}).then( response => {
if (response.data!=1){
this.$message({
type: 'error',
message: '支付通道切换失败,请确保交易占比相加满足百分之百'
});
this.value = false;
this.value1 = true;
isOpenOilConfig(0).then( response => {})
}else {
this.$message({
type: 'success',
message: '发布成功!'
});
this.value1 = false;
}
})
}else {
isOpenOilConfig({isOpen:0,ruleCycle:this.ruleCycle}).then( response => {
this.value1 = true;
})
}
},
changeStatus1(){
if (this.value1){
isOpenOilConfig({isOpen:0,ruleCycle:this.ruleCycle}).then( response => {
this.value = false;
isOpenOilConfig(0).then( response => {})
})
}else {
isOpenOilConfig({isOpen:1,ruleCycle:this.ruleCycle}).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;
isOpenOilConfig(1).then( response => {})
}
})
}
},
// 使
@ -294,12 +331,13 @@ export default {
type: 'warning'
}).then(() => {
data.isUse = isUse
editMerchant(data).then( response => {})
editMerchant(data).then( response => {
this.getList();
this.$message({
type: 'success',
message: '支付通道切换成功,已实时切换为商户号('+data.mchntCd+')'
});
this.getList();
})
}).catch(() => {});
},
//
@ -323,10 +361,8 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '发布成功!'
});
this.value1 = false;
this.changeStatus1()
}).catch(() => {
this.$message({
type: 'info',

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -12,6 +12,7 @@ import com.fuint.api.fuyou.vo.OilConfigVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@ -59,6 +60,28 @@ public class OilConfigServiceImpl extends ServiceImpl<OilConfigMapper, OilConfig
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
public List<OilConfigVo> selectOilConfigList() {
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,6 +32,7 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
commission.setStoreId(storeId);
IPage<StaffCommission> staffCommissionIPage = baseMapper.selectCommissionList(page, commission);
for (StaffCommission record : staffCommissionIPage.getRecords()) {
if (record.getTakeEffect()!=null && record.getTakeEffect().equals("")){
String substring = record.getTakeEffect().substring(24, 43);
Date date = new Date();
SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@ -42,6 +43,7 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
baseMapper.updateById(record);
}
}
}
IPage<StaffCommission> commissionIPage = baseMapper.selectCommissionList(page, commission);
return commissionIPage;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -28,6 +28,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -161,7 +162,9 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
MaxoutVO maxoutVO = new MaxoutVO();
// 会员等级判断符合油号判断
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);
LambdaQueryWrapper<ActiveDiscountChild> queryWrappers = new LambdaQueryWrapper<>();
queryWrappers.eq(ActiveDiscountChild::getActiveFullminusId,activeFullminus.getId());
@ -186,7 +189,9 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
MaxoutVO maxoutVO = new MaxoutVO();
// 会员等级判断符合油号判断
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);
LambdaQueryWrapper<ActiveDiscountChild> queryWrappers = new LambdaQueryWrapper<>();
queryWrappers.eq(ActiveDiscountChild::getActiveDiscountId,activeDiscount.getId());
@ -218,7 +223,23 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
cardFavorableLambdaQueryWrapper.le(CardFavorable::getSatisfiedAmount,transferDTO.getOilPrice() * transferDTO.getOilLiters());
List<CardFavorable> list1 = cardFavorableService.list(cardFavorableLambdaQueryWrapper);
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);
}
}

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.entity.CardExchangeRecord;
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.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* 兑换券领取记录表(CardExchangeRecord)表服务实现类
*
@ -18,7 +22,8 @@ import org.springframework.stereotype.Service;
*/
@Service("cardExchangeRecordService")
public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecordMapper, CardExchangeRecord> implements CardExchangeRecordService {
@Resource
private StoreService storeService;
/**
* 分页查询
* @param page
@ -27,6 +32,11 @@ public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecor
*/
@Override
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<>();
if(ObjectUtils.isNotEmpty(cardExchangeRecord.getExchangeName())){
@ -41,6 +51,7 @@ public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecor
if(ObjectUtils.isNotEmpty(cardExchangeRecord.getTicketCode())) {
queryWrapper.eq(CardExchangeRecord::getTicketCode,cardExchangeRecord.getTicketCode());
}
queryWrapper.eq(CardExchangeRecord::getStoreId,cardExchangeRecord.getStoreId());
queryWrapper.orderByDesc(CardExchangeRecord::getCreateTime);
return page(page, queryWrapper);
}
@ -53,6 +64,11 @@ public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecor
*/
@Override
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<>();
if(ObjectUtils.isNotEmpty(cardExchangeRecord.getExchangeName())){
@ -70,6 +86,7 @@ public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecor
if (ObjectUtils.isNotEmpty(cardExchangeRecord.getStartTime()) && ObjectUtils.isNotEmpty(cardExchangeRecord.getEndTime()) ) {
queryWrapper.between(CardExchangeRecord::getCancelTime,cardExchangeRecord.getStartTime(),cardExchangeRecord.getEndTime());
}
queryWrapper.eq(CardExchangeRecord::getStoreId,cardExchangeRecord.getStoreId());
queryWrapper.orderByDesc(CardExchangeRecord::getCreateTime);
return page(page, queryWrapper);
}

View File

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

View File

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

View File

@ -9,6 +9,9 @@
<include refid="selectOrders"></include>
<where>
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 != ''">
and staff_id = #{order.staffId}
</if>

View File

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

View File

@ -3,7 +3,9 @@ package com.fuint.business.petrolStationManagement.service.impl;
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.OilTrackingMapper;
import com.fuint.business.petrolStationManagement.service.OilTankService;
import com.fuint.business.petrolStationManagement.vo.OilTankExcel;
import com.fuint.common.dto.AccountInfo;
@ -27,7 +29,8 @@ import java.util.List;
public class OilTankServiceImpl implements OilTankService {
@Resource
private OilTankMapper oilTankDao;
@Resource
OilTrackingMapper oilTrackingMapper;
/**
* 通过ID查询单条数据
*
@ -80,6 +83,17 @@ public class OilTankServiceImpl implements OilTankService {
oilTank.setStoreId(nowAccountInfo.getStoreId());
oilTank.setCreateBy(nowAccountInfo.getStaffId().toString());
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;
}

View File

@ -3,13 +3,15 @@
<mapper namespace="com.fuint.business.userManager.mapper.LJUserMapper">
<sql id="selectUser">
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>
<select id="selectUserList" resultType="com.fuint.business.userManager.vo.LJUserVo">
<include refid="selectUser"></include>
<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 != ''">
and mu.mobile like concat('%', #{user.mobile}, '%')
</if>
@ -26,10 +28,10 @@
and mu.official = #{user.official}
</if>
<if test="user.cardBalance != null and user.cardBalance != '' and user.cardBalance == 2">
and mub.cardBalance = 0
and mub.card_balance = 0
</if>
<if test="user.cardBalance != null and user.cardBalance != '' and user.cardBalance == 1">
and mub.cardBalance != 0
and mub.card_balance != 0
</if>
<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')

View File

@ -59,7 +59,16 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
@Override
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;
}

View File

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

View File

@ -31,7 +31,9 @@ public class ShiroConfig {
filter.setFilters(filters);
LinkedHashMap<String,String> filterMap=new LinkedHashMap<>();
filterMap.put("/backendApi/login/doLogin","anon");
filterMap.put("/backendApi/login/sendMsg","anon");
filterMap.put("/clientApi/captcha/getCode","anon");
filterMap.put("/backendApi/login/loginByPhone","anon");
filterMap.put("/static/**","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;
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.UserDto;
import com.fuint.common.enums.AdminRoleEnum;
import com.fuint.common.service.*;
import com.fuint.common.util.TokenUtil;
import com.fuint.common.util.TreeUtil;
import com.fuint.common.util.*;
import com.fuint.common.vo.RouterVo;
import com.fuint.framework.annoation.OperationServiceLog;
import com.fuint.framework.exception.BusinessCheckException;
import com.fuint.module.backendApi.request.LoginRequest;
import com.fuint.common.util.Constants;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
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.authc.UsernamePasswordToken;
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 com.fuint.common.domain.TreeNode;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
* 后台登录接口
@ -64,6 +70,9 @@ public class BackendLoginController extends BaseController {
@Resource
private CaptchaService captchaService;
@Autowired
public RedisTemplate redisTemplate;
/**
* 后台登录
* */
@ -109,6 +118,48 @@ 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("登录失败,请输入正确的验证码");
}
/**
* 获取登录信息接口
* */

View File

@ -218,7 +218,7 @@
<div class="bottom-price">{{ oilActualPay + goodsActualPay }}</div>
<div class="price-red">优惠合计{{ oilDiscount + goodsDiscount }}/{{consumeRefuelMoney}}L</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>
@ -789,6 +789,7 @@
import {selectCoupon, selectPreferential} from "@/api/cashier/preferential";
import {addHangBill} from "@/api/cashier/hangbill";
import {addCreditUnit, listCreditUnit} from "@/api/cashier/creditunit";
import {getSysConfig} from "@/api/staff/user/sysconfig";
const cityOptions = ['上海', '北京'];
export default {
@ -808,7 +809,7 @@
cities2: cityOptions,
gradeDiscount: [],
//
checkAll3: true,
checkAll3: false,
isIndeterminate3: true,
checkedCities3: [],
cities3: cityOptions,
@ -863,8 +864,10 @@
oilActualPay:0,
//
oilDiscount:0,
//
//
hoardAmount:0,
// 使
isOilStorageCard:false,
//
goodsDiscount:0,
//
@ -954,7 +957,7 @@
// id
couponIds:[],
// 使id
useCouponIds:[],
useCouponIds:"",
map:{
allAmount:0,
//
@ -1194,7 +1197,7 @@
if (val){
this.fullReduction = 0;
this.fullReduceDiscount.forEach(item => {
this.fullReduction += item.reduce
this.fullReduction += +item.reduce
})
this.isUseFull = false;
}else {
@ -1214,7 +1217,7 @@
reduces = item.reduce
}
}
this.fullReduction += reduces
this.fullReduction += +reduces
})
let checkedCount = value.length;
this.checkAll1 = checkedCount === this.fullReduceDiscount.length;
@ -1256,8 +1259,10 @@
handleCheckAllChange3(val) {
if (val==false){
this.consumeRefuelMoney = 0;
this.hoardAmount = 0;
// this.hoardAmount = 0;
this.isOilStorageCard = false;
}else {
this.isOilStorageCard = true;
this.changeRefuelMoney()
}
this.isExclusion();
@ -1363,9 +1368,9 @@
list.forEach(item => {
num += item.num;
if (_this.isMember){
amount += item.memberPrice;
amount += +item.memberPrice;
}else {
amount += item.retailPrice;
amount += +item.retailPrice;
}
})
this.goodsTotal = num;
@ -1414,6 +1419,8 @@
let _this = this;
this.oilDiscount = 0;
this.gradeDiscount = [];
getSysConfig('is_enable_level').then(res => {
if (res.data=="yes") {
getUserGrade(id).then(response => {
let gasolineDiscount = 0;
let dieselDiscount = 0;
@ -1640,6 +1647,8 @@
_this.checkAll2 = true;
_this.isExclusion();
})
}
})
},
//
chooseUser(data){
@ -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(){
if (this.isMember){
//
if (this.balance >= (this.oilAmount - this.oilDiscount - this.couponAmount)){
this.oilActualPay = 0
this.consumeAmount = this.oilAmount - this.oilDiscount - this.couponAmount - this.hoardAmount
this.consumeAmount = this.oilAmount - this.oilDiscount - this.couponAmount
}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
}
}else {
@ -1766,7 +1789,7 @@
// 使使
countAmountUnBalance(){
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 {
this.oilActualPay = this.oilAmount - this.oilDiscount
}
@ -1777,9 +1800,9 @@
if (this.isMember){
if (this.balance >= (this.oilAmount - this.oilDiscount - this.fullReduction)){
this.oilActualPay = 0
this.consumeAmount = this.oilAmount - this.oilDiscount - this.fullReduction - this.hoardAmount
this.consumeAmount = this.oilAmount - this.oilDiscount - this.fullReduction
}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
}
}else {
@ -1828,6 +1851,18 @@
this.countAmountFull()
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();
}
},
@ -1845,7 +1880,7 @@
if (response.data.length>0){
_this.fullReduceDiscount = []
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;
for (let i = 1;i<=activeList.length;i++){
if (activeList.length>0){
@ -1927,9 +1962,9 @@
let amount = 0;
for (let i = 0; i<goods.length; i++){
if (_this.isMember){
amount += (goods[i].memberPrice * goods[i].num).toFixed(2)
amount += +(goods[i].memberPrice * goods[i].num).toFixed(2)
}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){
goods[i].num = goods[i].num + 1;
@ -1948,9 +1983,9 @@
if (result){
val.num = 1;
if (_this.isMember){
this.goodsAmount += val.memberPrice
this.goodsAmount += +val.memberPrice
}else {
this.goodsAmount += val.retailPrice
this.goodsAmount += +val.retailPrice
}
this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
this.goodsOrder.push(val);
@ -2036,35 +2071,30 @@
let _this = this;
_this.consumeRefuelMoney = 0;
_this.oilActualPay = 0;
let oilActPay = 0;
_this.hoardAmount = 0;
_this.oilOrder.forEach(item => {
let conRefMon = 0;
let oilActualPay = 0;
let hoardAmount = 0;
if (_this.refuelMoney!=null){
let result = false;
for (let i = 0;i < _this.refuelMoney.length;i++){
//
if (_this.refuelMoney[i].oilType==item.oilType){
if ((_this.refuelMoney[i].refuelMoney-item.liters)>=0){
conRefMon = item.liters
oilActualPay = 0;
}else {
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)
}
result = true;
}else {
if (result==false){
oilActualPay = item.amount
//
hoardAmount = item.amount - (_this.refuelMoney[i].refuelMoney * item.oilPrice).toFixed(2)
}
}
}
}
_this.consumeRefuelMoney += +conRefMon
oilActPay += +oilActualPay
if (_this.consumeRefuelMoney!=0){
_this.isOilStorageCard = true;
_this.checkAll3 = true;
_this.consumeAmount = 0;
}
_this.hoardAmount += +hoardAmount
})
_this.isExclusion();
@ -2381,9 +2411,9 @@
goods.forEach(item => {
num += item.num
if (_this.isMember){
amount += (item.memberPrice*item.num).toFixed(2);
amount += +(item.memberPrice*item.num).toFixed(2);
}else {
amount += (item.retailPrice*item.num).toFixed(2);
amount += +(item.retailPrice*item.num).toFixed(2);
}
})
this.goodsTotal = num;

View File

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