bug修改+中泰

This commit is contained in:
wangh 2024-01-02 11:21:12 +08:00
parent b2bf1bd8ba
commit 9e403cd413
55 changed files with 800 additions and 707 deletions

View File

@ -6,7 +6,7 @@ import 'nprogress/nprogress.css'
import {getToken, removeToken, setToken} from '@/utils/auth'
import { isRelogin } from '@/utils/request'
import { loginVerificationApi } from '@/api/login'
// import BigNumber from 'bignumber.js';
import BigNumber from 'bignumber.js';
NProgress.configure({ showSpinner: false })
@ -34,8 +34,6 @@ router.beforeEach(async (to, from, next) => {
next({ path: '/' })
NProgress.done()
}else {
console.log("111113",store.getters.roles)
if (store.getters.roles.length === 0) {
console.log("111114")
isRelogin.show = true

View File

@ -50,7 +50,7 @@ service.interceptors.request.use(config => {
const s_data = sessionObj.data; // 请求数据
const s_time = sessionObj.time; // 请求时间
const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交
if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) {
if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url && s_url!='backendApi/store/loginVerification') {
const message = '数据正在处理,请耐心等待';
console.warn(`[${s_url}]: ` + message)
return Promise.reject(new Error(message))

View File

@ -25,12 +25,12 @@
<span>{{ this.statisticsData.today_sum_chain }}</span>
</div>
<div class="icon-lv" v-else>
<i class="el-icon-top"></i>
<span>{{ this.statisticsData.today_sum_chain }}</span>
</div>
<div>环比</div>
<div> <i class="el-icon-arrow-right"></i> </div>
</div>
@ -52,7 +52,7 @@
<span>{{ this.statisticsData.week_sum_chain?this.statisticsData.week_sum_chain:0 }}</span>
</div>
<div class="icon-lv" v-else>
<i class="el-icon-top"></i>
<span>{{ this.statisticsData.week_sum_chain?this.statisticsData.week_sum_chain:0 }}</span>
@ -70,18 +70,18 @@
<span style="margin-right: 5px">本月流水总额</span>
</div>
<div class="box-size">
{{this.statisticsData.this_month_sum}}
{{this.statisticsData.this_month_sum?this.statisticsData.this_month_sum:0}}
</div>
<div class="box-but">
<div class="icon-lv2" v-if="this.statisticsData.month_sum_chain<=0">
<i v-if="this.statisticsData.month_sum_chain==0" class="el-icon-minus"></i>
<i v-else class="el-icon-bottom"></i>
<span>{{ this.statisticsData.month_sum_chain?this.statisticsData.month_sum_chain:0 }}</span>
</div>
<div class="icon-lv" v-else>
<i class="el-icon-top"></i>
<span>{{ this.statisticsData.month_sum_chain?this.statisticsData.month_sum_chain:0 }}</span>
@ -111,7 +111,7 @@
<span>{{ this.statisticsData.today_count_chain?this.statisticsData.today_count_chain:0 }}</span>
</div>
<div class="icon-lv" v-else>
<i class="el-icon-top"></i>
<span>{{ this.statisticsData.today_count_chain?this.statisticsData.today_count_chain:0 }}</span>
@ -143,7 +143,7 @@
<span>{{ this.statisticsData.week_count_chain?this.statisticsData.week_count_chain:0 }}</span>
</div>
<div class="icon-lv" v-else>
<i class="el-icon-top"></i>
<span>{{ this.statisticsData.week_count_chain?this.statisticsData.week_count_chain:0 }}</span>
@ -169,14 +169,14 @@
</div> -->
<div class="icon-lv2" v-if="this.statisticsData.month_count_chain<=0">
<i v-if="this.statisticsData.month_count_chain==0" class="el-icon-minus"></i>
<i v-else class="el-icon-bottom"></i>
<span>{{ this.statisticsData.month_count_chain?this.statisticsData.month_count_chain:0 }}</span>
</div>
<div class="icon-lv" v-else>
<i class="el-icon-top"></i>
<span>{{ this.statisticsData.month_count_chain?this.statisticsData.month_count_chain:0 }}</span>
@ -218,7 +218,7 @@ export default {
this_week_sum: 0.0,
week_count_chain: 0.0,
week_sum_chain: 0.0,
}
}
},
@ -233,7 +233,7 @@ export default {
this.statisticsData = res.data
this.loading = false
}
})
}
}

View File

@ -1,6 +1,6 @@
<template>
<div class="app-container">
<el-card >
<div class="app-container">
<el-card >
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="礼品名称" prop="giftName">
<el-input
@ -86,15 +86,16 @@
<el-table-column label="配送类型" align="center" >
<el-table-column label="配送方式" align="center" prop="deliveryMethod" width="80px">
<template slot-scope="scope">
<span v-for="(row, index) in JSON.parse(scope.row.deliveryMethod)" :key="index">
<!-- <span v-for="(row, index) in JSON.parse(scope.row.deliveryMethod)" :key="index">-->
<span v-for="(row, index) in scope.row.deliveryMethod" :key="index">
{{row}}<br>
</span>
</template>
</el-table-column>
<el-table-column label="快递费用" align="center" prop="shippingFeeAmount">
<template slot-scope="scope">
<span v-if ="scope.row.expressShippingFee!= '统一运费' && !scope.row.deliveryMethod.includes('物流配送')">--</span>
<span v-else-if="scope.row.expressShippingFee == '包邮' && scope.row.deliveryMethod.includes('物流配送')" effect="plain" type="warning" size="medium">包邮</span>
<span v-if ="scope.row.expressShippingFee!= '统一运费' && scope.row.deliveryMethod && !scope.row.deliveryMethod.includes('物流配送')">--</span>
<span v-else-if="scope.row.expressShippingFee === '包邮' && scope.row.deliveryMethod && scope.row.deliveryMethod.includes('物流配送')" effect="plain" type="warning" size="medium">包邮</span>
<span v-else effect="plain" type="warning" size="medium">{{scope.row.shippingFeeAmount}}</span>
</template>
</el-table-column>
@ -772,23 +773,23 @@ export default {
getList() {
getGiftApi(this.queryParams).then(res=>{
this.dataList = res.data.records
this.dataList.forEach(res=>{
res.deliveryMethod = JSON.parse(res.deliveryMethod)
})
this.total = res.data.total
})
},
submitForm: function() {
let this_ = this
// if (this.dataForm.deliveryMethod.length === 0) {
// this.$message.warning('');
// return;
// }
this_.$refs["form"].validate(valid => {
if (valid) {
if (Array.isArray(this_.giftImages)) {
this_.dataForm.giftImages = JSON.stringify(this_.giftImages);
if (Array.isArray(this_.dataForm.giftImages)) {
this_.dataForm.giftImages = JSON.stringify(this_.dataForm.giftImages);
}
if (this_.dataForm.deliveryMethod != null && Array.isArray(this_.dataForm.deliveryMethod)) {
this_.dataForm.deliveryMethod = JSON.stringify(this.dataForm.deliveryMethod);
@ -843,7 +844,6 @@ export default {
}
},
//
giftAdd() {
this.reset();
@ -853,6 +853,7 @@ export default {
this.selectGiftCategory();
this.cardFavorableApi();
this.cardExchangeApi();
this.$forceUpdate();
},
//
@ -860,13 +861,10 @@ export default {
this.open = false;
this.reset();
},
//
cancelInventory() {
this.openInventory = false;
this.resInventoryForm()
},
//
handleQuery() {
@ -881,15 +879,28 @@ export default {
await this.selectGiftCategory();
//
let fileList = JSON.parse(data.giftImages);
this.giftImages = [],
this.giftImages = fileList;
this.giftImages.forEach(image=>{
let sp = image.url.split('//')
image.url = this.imagePath + '/'+sp[2]
})
// let fileList = JSON.parse(data.giftImages);
// this.giftImages = [],
// this.giftImages = fileList;
// this.giftImages.forEach(image=>{
// let sp = image.url.split('//')
// image.url = this.imagePath + '/'+sp[2]
// })
//
this.giftImages = []
data.giftImages = JSON.parse(data.giftImages);
data.giftImages.forEach(res=> {
let newImage = {
url: this.imagePath + res,
fileName: res
}
this.giftImages.push(newImage);
}),
// data.deliveryMethod = JSON.parse(data.deliveryMethod);
console.log("data",data)
this.dataForm = data;
this.changeGiftType(this.dataForm.giftType)
this.changeExchange(this.dataForm.exchangeMethod)
@ -925,10 +936,10 @@ export default {
},
reset(){
this.dataForm={
id: null,
giftName: '', //
categoryId:'', // id
goodsId:'', // Id
goodsName:'', // Id
voucherId:'', // id
coverImage:'', //
giftImages: [], //
@ -943,13 +954,30 @@ export default {
expressShippingFee:'', //
shippingFeeAmount:'', //
exchangeamount:'', //
deliveryMethod:['门店自提'], //
// deliveryMethod:[''], //
deliveryMethod:[], //
detailedDescription:'', //
categoryName: 1,
sort: null,
status: '启用',
market:null
}
this.showList = {
//
coupon: true,
voucher: false,
goods: false,
//
jf:true,
je:false,
jfje:false,
jfjq:false,
//
delivery:false,
express: false,
shippingFee: false
},
this.giftImages=[]
},
@ -960,7 +988,6 @@ export default {
this.openInventory = true
this.inventoryForm.id = data.id
console.log("data.usedInventory",data.usedInventory)
if (data.usedInventory == null || data.usedInventory == undefined) {
this.inventoryForm.usedInventory = 0
}else {
@ -1014,7 +1041,6 @@ export default {
},
//
changeGiftType(newVal) {
console.log("")
let this_ = this
if (newVal == '优惠券') {
this_.showList.coupon = true
@ -1033,7 +1059,6 @@ export default {
this_.showList.delivery = true
}
},
//
changeExchange(newVal){
let this_ = this
@ -1059,9 +1084,7 @@ export default {
changeExpress(data,flag){
let this_ = this
// express: false,
// shippingFee: false
console.log("flag",flag)
console.log("this.dataForm.deliveryMethod",this.dataForm.deliveryMethod)
// shippingFee: false
if(flag === 1) {
if (!this.dataForm.deliveryMethod) {
this.dataForm.deliveryMethod = [];
@ -1079,13 +1102,11 @@ export default {
// const jsonArray = JSON.parse(this.dataForm.deliveryMethod);
// jsonArray.push(data)
// this.dataForm.deliveryMethod = jsonArray
console.log("data1",data)
if(data == '物流配送') {
this.showList.express= true
}
} else {
console.log("data2",data)
this.dataForm.deliveryMethod.splice(index, 1)
// const jsonArray = JSON.parse(this.dataForm.deliveryMethod);
// jsonArray.splice(index, 1);
@ -1103,7 +1124,6 @@ export default {
}
}
},
//
changeExpressEDIT(){
if (!this.dataForm.deliveryMethod) {
@ -1118,7 +1138,7 @@ export default {
if (!Array.isArray(this_.dataForm.deliveryMethod)) {
this_.dataForm.deliveryMethod = JSON.parse(this_.dataForm.deliveryMethod);
}
if (this_.dataForm.deliveryMethod.includes("物流配送")) {
if (this_.dataForm.deliveryMethod && this_.dataForm.deliveryMethod.includes("物流配送")) {
this.showList.express= true
}
@ -1140,43 +1160,37 @@ export default {
//
handleUploadSuccessGift(file) {
let newImage = {
name: file.data.original,
url: process.env.VUE_APP_SERVER_URL + file.data.fileName,
type: file.data.type,
fileName: file.data.fileName
}
if (this.giftImages == undefined) {
this.giftImages = [];
}
this.giftImages.push(newImage);
this.dataForm.giftImages.push(file.data.fileName);
console.log("this.giftImage",this.giftImages)
console.log(" this.dataForm.giftImages", this.dataForm.giftImages)
},
// handleUploadSuccessGift(file) {
// // let newImage = {
// // name: file.data.original,
// // url: process.env.VUE_APP_SERVER_URL + file.data.fileName,
// // type: file.data.type,
// // fileName: file.data.fileName
// // }
// if (this.giftImages == undefined) {
// this.giftImages = [];
// }
// this.giftImages.push(file.fileName);
// console.log("")
// },
handleRemove(file, fileList) {
console.log(file, fileList)
this.giftImages.forEach((image, index) => {
if (file.url === image.url) {
this.giftImages.splice(index, 1);
}
});
console.log(file, fileList);
},
this.dataForm.giftImages.forEach((image, index) => {
if (file.fileName === image) {
this.dataForm.giftImages.splice(index, 1);
}
})
console.log("this.giftImage",this.giftImages)
console.log(" this.dataForm.giftImages", this.dataForm.giftImages) },
handlePictureCardPreview(file) {
console.log(file);
this.dialogImageUrl = file.url;
@ -1246,6 +1260,12 @@ export default {
<style scoped>
.app-container{
width: 100%;
height: 100%;
background: #f6f8f9;
}
.d-dialog >>> .el-upload--picture-card {
width: 100px;
height: 100px;
@ -1262,7 +1282,7 @@ export default {
}
.list-img{
width: 100px;
height: 100px;
width: 98px;
height: 98px;
}
</style>

View File

@ -60,7 +60,8 @@
"vue-print-nb": "^1.7.5",
"vue-router": "3.4.9",
"vuedraggable": "2.24.3",
"vuex": "3.6.0"
"vuex": "3.6.0",
"vuex-persistedstate": "^4.1.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "4.4.6",

View File

@ -95,7 +95,7 @@ Router.prototype.push = function push(location) {
}
export default new Router({
// mode: 'history', // 去掉url中的#
mode: 'history', // 去掉url中的#
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
})

View File

@ -7,10 +7,12 @@ import permission from './modules/permission'
import settings from './modules/settings'
import token from './modules/token'
import getters from './getters'
import createPersistedState from "vuex-persistedstate";
Vue.use(Vuex)
const store = new Vuex.Store({
modules: {
app,
user,
@ -20,6 +22,13 @@ const store = new Vuex.Store({
token
},
plugins:[
createPersistedState({
key:'token',// 存数据的key名 自定义的 要有语义化
paths: ['token'] // 要把那些模块加入缓存
})
],
getters
})

View File

@ -1,4 +1,5 @@
const token = {
state: {
token:''

View File

@ -33,6 +33,8 @@ import store from '@/store/index'
import Cookies from 'js-cookie'
// import localStorage from 'localStorage';
const TokenKey = 'Access-Token-Admin'
const UserKey = 'User-Id'
@ -56,6 +58,9 @@ export function setToken(token) {
}
export function removeToken() {
// 从本地存储中删除持久化的信息
localStorage.removeItem('token');
return store.state.token = ''
}

View File

@ -65,8 +65,9 @@
<div class="pur-box" @click="godetails(items.id)">
<el-tag type="success">{{items.status=='qy'?'启用':'禁用'}}</el-tag>
<div class="disper-box">
<div class="box-img">
<img :src="imagePath + items.logo" style="width: 96px;height: 96px">
<div class="box-img">
<img v-if="items.logo" :src="imagePath + items.logo" style="width: 96px;height: 96px">
<img v-else src="https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png" style="width: 96px;height: 96px">
</div>
<div >
<div class="title">{{items.name || ''}}</div>

View File

@ -261,7 +261,7 @@
</el-row>
</template>
<el-row>
<el-col :span="24">
<el-form-item label="真实姓名" prop="realName">
@ -287,7 +287,7 @@
v-for="item in rolelist"
:key="item.id"
:label="item.name"
:value="item.id"
:value="item.id"
></el-option>
</el-select>
@ -661,7 +661,7 @@
//
//
append(data) {
console.log('新增',data)
console.log('新增',data)
//
this.cleanRuleForm()
this.activeName = 'info'
@ -682,6 +682,9 @@
leader_phone:'',
// parentName:'',
deptName: '',
turnoverLimit: '',
turnoverType: "1",
turnoverTime: '',
}
},
//
@ -691,8 +694,15 @@
// _this.ruleForm.deptType = '1'
//
Userlist(id).then(res=>{
this.parentName = res.data.parentName
this.ruleForm.parentId = res.data.parentId
console.log("新增树的返回",res)
if (res.data.deptType === "3") {
this.parentName = res.data.parentName
this.ruleForm.parentId = res.data.parentId
} else {
this.parentName = res.data.deptName
this.ruleForm.parentId = res.data.deptId
}
})
},
@ -783,7 +793,7 @@
this.form.deptType = this.Thetree[0].deptType
console.log("this.Thetree",this.Thetree[0])
}
});
this.loading = true;
// this.addDateRange(this.queryParams, this.dateRange)
@ -947,7 +957,7 @@
accountStatus:1
}
},
/** 修改按钮操作 */
handleUpdate(row) {
console.log('修改用户信息',row)
@ -956,7 +966,7 @@
app.reset();
app.open = true;
app.form = row
app.form.roleIds = Number(app.form.roleIds);
app.form.password1 = row.password

View File

@ -11,9 +11,8 @@
<!-- -->
<!-- </div>-->
<div class="block">
<el-avatar shape="square" :size="96" :key="fullImagePath" :src="fullImagePath">
</el-avatar>
<el-avatar v-if="fullImagePath" shape="square" :size="96" :key="fullImagePath" :src="fullImagePath"></el-avatar>
<el-avatar v-else shape="square" :size="96" src="https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png"></el-avatar>
</div>
<div style="width: 100%">
<div class="dis-box" style="align-items: center;cursor: pointer;margin-bottom: 20px">
@ -61,16 +60,25 @@
</div>
<!-- <div class="bottom-box2"> -->
<div class="bottom-box2">
<div style="height: 200px;">
<div style="height: 200px; width: 300px;">
<span class="demonstration" >营业执照</span>
<el-image :src="imagePath+from.license" style="margin-top: 10px;"></el-image>
<br/>
<el-image v-if="from.license" :src="imagePath+from.license" style="margin-top: 10px;"></el-image>
<el-image v-else src="https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png" ></el-image>
</div>
<div style="height: 200px; margin-left: 100px;">
<div style="height: 200px; width: 300px; margin-left: 100px;">
<span class="demonstration">门头照</span>
<el-image :src="imagePath+from.doorstepPhoto[0]" style="margin-top: 10px;"></el-image>
<br/>
<el-image v-if="from.doorstepPhoto[0]" :src="imagePath+from.doorstepPhoto[0]" style="margin-top: 10px;"></el-image>
<el-image v-else src="https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png" ></el-image>
</div>
</div>
<!-- <div class="bottom-box">
@ -79,7 +87,7 @@
<div class="bott-box"><el-tag type="danger">删除油站</el-tag></div>
</div> -->
<el-dialog title="编辑油站" :visible.sync="editDialog" width="900px" style="padding-right: 10px;">
<el-dialog title="编辑油站" class="d-dialog" :visible.sync="editDialog" width="900px" style="padding-right: 10px;">
<el-form :model="from" ref="form" :rules="rules">
@ -114,11 +122,11 @@
<i v-if="!this.from.logo" class="el-icon-plus"></i>
</el-upload>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="联系电话" prop="phone" :label-width="formLabelWidth">
@ -134,13 +142,13 @@
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="店铺地址" prop="address" :label-width="formLabelWidth">
@ -166,10 +174,10 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
@ -219,7 +227,7 @@
</el-col>
</el-row>
@ -267,7 +275,7 @@
return{
dataForm:{coverImage:''},
//
uploadAction: process.env.VUE_APP_SERVER_URL + 'backendApi/file/upload',
uploadAction: 'http://192.168.0.178:8008/backendApi/file/upload',
uploadHeader: { 'Access-Token' : getToken() },
//
hideUpload: false,
@ -278,7 +286,7 @@
url:'http://localhost:8008/static/uploadImages/20231103/ffbbe7d3ee1441fdaf706802fa0f176a.png'}
],
imagePath: process.env.VUE_APP_SERVER_URL,
//
uploadImages: [],
dialogImageUrl: "",
@ -310,7 +318,7 @@
doorstepPhoto:[],
},
squareUrl: "https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png",
dialogFormVisible: false,
@ -332,7 +340,7 @@
desc: ''
},
formLabelWidth: '120px',
rules: {
name: [
@ -353,6 +361,9 @@
},
computed: {
uploadAction(){
},
fullImagePath() {
return this.imagePath + this.from.logo;
}
@ -395,7 +406,7 @@
if(this.id){
Storedetails(this.id).then(res=>{
// console.log("hello1",res.data)
if (res.code == 200) {
if (res.code == 200) {
// this.from = {}
@ -422,8 +433,8 @@
this.uploadImages.push(newImage);
})
}
}
}
this.$forceUpdate();
}
@ -436,10 +447,18 @@
enterThePetrolStation() {
singleSignOnApi(this.id).then(res=>{
window.open('http://localhost:82/index?entrance='+this.id)
// '_blank');
if (this.from.status == 'jy') {
this.$message('该油站已被禁用');
return
}
singleSignOnApi(this.id).then(res=>{
if (res.code == 200) {
let url =
// let url = process.env.VUE_APP_SERVER_URL
console.log("url",url)
window.open( 'http://localhost:81/index?entrance='+this.id)
}
})
// token+
},
@ -447,6 +466,7 @@
//
handleUploadSuccessLogo(file) {
console.log("1231231231231")
this.from.logo = file.data.fileName;
},
handleUploadSuccessLicence(file) {
@ -498,7 +518,7 @@
// Check if the number of files exceeds 3
if (this.uploadImages.length >= 3) {
this.$message.warning('You can only upload up to three images.');
this.$message.warning('最多只可以上传三张');
return false; // Cancel upload
}
return true; // Continue with the upload
@ -560,17 +580,17 @@
.bottom-box2{
width: 1400px;
/* width: 1400px; */
/* position: absolute;
bottom: 0px; */
margin-top: 30px;
margin-bottom: 30px;
height: 350px;
/* margin-top: 30px; */
/* margin-bottom: 30px; */
/* height: 350px; */
background: rgb(255, 255, 255);
/* background-color: #006cff; */
display: flex;
/* align-items: center; */
justify-content: center;
justify-content: left;
}
.bottom-box{
@ -595,11 +615,11 @@
/* 上传头像 */
.list-img{
width: 100px;
height: 100px;
width: 98px;
height: 98px;
}
.d-dialog >>> .el-upload--picture-card {
width: 100px;
height: 100px;
@ -630,8 +650,8 @@
/* //去掉过渡动画,不然删除操作的时候,布局会闪一下。 */
/deep/ .el-upload-list__item {
/* /deep/ .el-upload-list__item {
transition: none !important
}
</style>
} */
</style>

View File

@ -588,7 +588,7 @@
defaultSort: {prop: 'createTime', order: 'descending'},
//
form: {
id:'', category:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:'', auditedStatus:'',
id:'', category:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:this.id, auditedStatus:'',
auditedTime:'', description:'', isRefuel:'yc', handoverMode:'dqmdtyjb', handoverPrem:'yqx', handoverOut:'jbtc', record:'qbjl',
merchantStatus:'qy',screen:'qy', posPrem:'', appletPrem:'', notice:'advice_jy', oilGunId:'', timeFrame:'bx', refund:'yqx',
transaction:'qbjy', writeOff:'',specialPrem:'', official:'', status:'qy',pos:'jy',role:''
@ -763,7 +763,7 @@
this.appletPrem = '';
this.writeOff = []
this.form = {
id:'', category:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:'', auditedStatus:'A',
id:'', category:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:this.id, auditedStatus:'A',
auditedTime:'', description:'', isRefuel:'yc', handoverMode:'dqmdtyjb', handoverPrem:'yqx', handoverOut:'jbtc', record:'qbjl',
merchantStatus:'qy',screen:'qy', posPrem:'', appletPrem:'', notice:'advice_jy', oilGunId:'', timeFrame:'bx', refund:'yqx',
transaction:'qbjy', writeOff:'',specialPrem:'', official:'', status:'qy',pos:'jy',role:''

View File

@ -332,7 +332,8 @@ public class FyPayServiceImpl implements FyPayService {
Map<String, Object> res = new HashMap<>();
try {
// 查询商户配置信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameter.getStoreId());
// MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameter.getStoreId());
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(16);
// 查询用户信息
LJUserVo userVo = userService.selectUserById(receiveParameter.getUserId());

View File

@ -233,6 +233,10 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
* @param orderNo
* @return
*/
// todo 判断积分商城兑换类型 根据类型在进行处理
@Override
public IntegralOrders checkTheStatusOfYourPaymentByIntegral(String orderNo) {
@ -298,6 +302,7 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
}
@Override
public Map<String, Object> integralOrdersProcessingUni(IntegralOrdersRequest integralOrdersList) {
double epsilon = 1e-10; // 阈值

View File

@ -163,9 +163,18 @@
CROSS JOIN (SELECT 0 AS a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9) c
) date_range
LEFT JOIN
(
SELECT
DATE(create_time) AS create_time,
recharge_balance
FROM
card_value_record
WHERE
store_id = #{storeId}
)
card_value_record ON DATE(card_value_record.create_time) = date_range.date
WHERE
date_range.date BETWEEN CURDATE() - INTERVAL 30 DAY AND CURDATE()
(date_range.date BETWEEN CURDATE() - INTERVAL 30 DAY AND CURDATE())
GROUP BY
date_range.date
ORDER BY
@ -187,6 +196,15 @@
CROSS JOIN (SELECT 0 AS a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9) c
) date_range
LEFT JOIN
(
SELECT
DATE(create_time) AS create_time,
recharge_balance
FROM
card_fuel_record
WHERE
store_id = #{storeId}
)
card_fuel_record ON DATE(card_fuel_record.create_time) = date_range.date
WHERE
date_range.date BETWEEN CURDATE() - INTERVAL 30 DAY AND CURDATE()

View File

@ -116,6 +116,9 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
public int insertStaff(LJStaff staff) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
if (ObjectUtil.isNotEmpty(staff.getStoreId())) {
storeId = staff.getStoreId();
}
staff.setStoreId(storeId);
if (StringUtils.isNotEmpty(staff.getRefundPassword())){
this.entryptPassword(staff);

View File

@ -2,6 +2,13 @@ package com.fuint.business.order.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.store.entity.MtStore;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
public interface AllOrderInfoMapper extends BaseMapper<AllOrderInfo> {
// 根据storeId List查询总流水
BigDecimal allStream(@Param("list") List<MtStore> mtStoreList);
}

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.business.order.mapper.AllOrderInfoMapper">
<select id="allStream" resultType="java.math.BigDecimal">
select sum(pay_money)
from all_order_info
<where>
dept_id IN
<foreach collection="list" item="list" separator="," open="(" close=")">
#{list.storeId}
</foreach>
</where>
</select>
</mapper>

View File

@ -134,10 +134,19 @@
CROSS JOIN (SELECT 0 AS a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9) c
) date_range
LEFT JOIN
mt_order ON DATE(mt_order.create_time) = date_range.date
(
SELECT
DATE(create_time) AS order_date,
pay_amount
FROM
mt_order
WHERE
store_id = #{storeId}
) mt_order ON date_range.date = mt_order.order_date
WHERE
(date_range.date BETWEEN CURDATE() - INTERVAL 30 DAY AND CURDATE())
GROUP BY
date_range.date
@ -146,3 +155,4 @@
</select>
</mapper>

View File

@ -204,11 +204,17 @@
CROSS JOIN (SELECT 0 AS a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9) c
) date_range
LEFT JOIN
oil_order ON DATE(oil_order.create_time) = date_range.date
(
SELECT
DATE(create_time) AS order_date,
pay_amount
FROM
oil_order
WHERE
store_id = #{storeId}
) oil_order ON date_range.date = oil_order.order_date
WHERE
store_id = #{storeId}
and
(date_range.date BETWEEN CURDATE() - INTERVAL 30 DAY AND CURDATE())
date_range.date BETWEEN CURDATE() - INTERVAL 30 DAY AND CURDATE()
GROUP BY
date_range.date
ORDER BY
@ -271,20 +277,21 @@
<select id="salesByOilProduct" resultType="java.util.Map">
SELECT
<if test="type == 'week'">
CONCAT(YEAR(oo.create_time), '年第', WEEK(oo.create_time),'周') AS year_week
</if>
CONCAT(YEAR(oo.create_time), '年第', WEEK(oo.create_time),'周') AS year_week,
</if>
<if test="type == 'month'">
CONCAT(YEAR(oo.create_time), '年', MONTH(oo.create_time),'月') AS year_week
CONCAT(YEAR(oo.create_time), '年', MONTH(oo.create_time),'月') AS year_week,
</if>
<if test="type == 'year'">
CONCAT(YEAR(oo.create_time), '年') AS year_week
CONCAT(YEAR(oo.create_time), '年') AS year_week,
</if>
<foreach collection="list" item="list" separator=",">
SUM(CASE WHEN oo.oils = #{list.id} THEN oo.pay_amount ELSE 0 END) AS #{list.oilName}
</foreach>
FROM
oil_order oo
left join oil_name onn on onn.id = oo.oils

View File

@ -1062,9 +1062,11 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// 获取所有油品名称
List<OilNumber> oilNames = oilNumberMapper.getOilName(storeId);
// 构建结果列表
List<List<Object>> resultList = new ArrayList<>();
if (ObjectUtil.isEmpty(oilNames)) return resultList;
// 添加油品名称作为第一行
List<Object> headerRow = new ArrayList<>();
headerRow.add("product");

View File

@ -1,6 +1,8 @@
package com.fuint.business.petrolStationManagement.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fuint.repository.model.base.BaseEntity;
import lombok.Data;
@ -19,6 +21,7 @@ public class OilGun extends BaseEntity {
/**
* 油枪ID
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 油枪名称

View File

@ -1,5 +1,7 @@
package com.fuint.business.petrolStationManagement.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fuint.repository.model.base.BaseEntity;
import lombok.Data;
@ -18,6 +20,7 @@ public class OilInventory extends BaseEntity {
/**
* 盘点id
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 盘点单号

View File

@ -1,5 +1,7 @@
package com.fuint.business.petrolStationManagement.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fuint.repository.model.base.BaseEntity;
import lombok.Data;
@ -19,6 +21,7 @@ public class OilInventoryOrder extends BaseEntity {
/**
* 订单id主键
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 盘点id

View File

@ -1,5 +1,7 @@
package com.fuint.business.petrolStationManagement.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fuint.repository.model.base.BaseEntity;
import lombok.Data;
@ -19,6 +21,7 @@ public class OilPurchase extends BaseEntity {
/**
* 进油ID
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 进货单号

View File

@ -1,5 +1,7 @@
package com.fuint.business.petrolStationManagement.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fuint.repository.model.base.BaseEntity;
import lombok.Data;
@ -17,6 +19,7 @@ public class OilPurchaseOrder extends BaseEntity {
/**
* 进货单表id
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 进油id

View File

@ -1,5 +1,7 @@
package com.fuint.business.petrolStationManagement.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fuint.repository.model.base.BaseEntity;
import io.swagger.models.auth.In;
import lombok.Data;
@ -19,6 +21,7 @@ public class OilSuppliers extends BaseEntity {
/**
* 供应商ID
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 供应商名称

View File

@ -1,5 +1,7 @@
package com.fuint.business.petrolStationManagement.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fuint.repository.model.base.BaseEntity;
import lombok.Data;
@ -18,6 +20,7 @@ public class OilTank extends BaseEntity {
/**
* 油罐ID
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 油罐名称

View File

@ -1,5 +1,7 @@
package com.fuint.business.petrolStationManagement.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fuint.repository.model.base.BaseEntity;
import lombok.Data;
@ -18,6 +20,7 @@ public class OilTracking extends BaseEntity {
/**
* 库存跟踪id
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 单据

View File

@ -1,5 +1,7 @@
package com.fuint.business.store.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.fuint.common.util.Constants;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.dto.StoreDto;
@ -18,6 +20,7 @@ import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import com.fuint.repository.model.MtMerchant;
import com.fuint.business.store.entity.MtStore;
import com.fuint.system.role.entity.TDuty;
import com.fuint.utils.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -307,7 +310,7 @@ public class BackendStoreController extends BaseController {
@PostMapping("editStoreInfo")
public ResponseObject editStoreInfo( @RequestBody MtStore mtStore) throws BusinessCheckException {
return getSuccessResult( storeService.editStoreInfo(mtStore));
return getSuccessResult(storeService.editStoreInfo(mtStore));
}
@Autowired
@ -319,12 +322,15 @@ public class BackendStoreController extends BaseController {
* singleSignOn
* @return
*/
@PostMapping("singleSignOn")
public ResponseObject singleSignOn(@RequestBody String flag) {
redisTemplate.opsForValue().set(flag,flag,300, TimeUnit.SECONDS);
// Object codeInRedis = redisTemplate.opsForValue().get(flag);
Boolean aBoolean = redisTemplate.hasKey(flag);
return getSuccessResult(aBoolean);
if (storeService.singleSignOn(flag)) {
return getSuccessResult(true);
}else {
return getFailureResult(201,"登录失败,请先设置站长账号或稍后再试");
}
}
@PostMapping("loginVerification")

View File

@ -3,6 +3,7 @@ package com.fuint.business.store.mapper;
import com.fuint.repository.bean.StoreDistanceBean;
import com.fuint.business.store.entity.MtStore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fuint.system.dept.entity.SysDept;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -26,4 +27,17 @@ public interface MtStoreMapper extends BaseMapper<MtStore> {
int editStoreInfo(@Param("mtStore") MtStore mtStore);
// getAccountByRole
/**
* 根据部门修改
* @param sysDeptsByjy
* @return
*/
int editStatusBydeptIdList(@Param("list") List<SysDept> sysDeptsByjy);
// 批量修改该状态根据部门
int editStatusBydeptId(Long deptId);
int editStatusByExpirationTime();
}

View File

@ -38,5 +38,29 @@
where id = #{mtStore.id}
</update>
<update id="editStatusBydeptId">
update mt_store
status = 'jy'
<where>
contract_dept_id =
#{deptId}
</where>
</update>
<update id="editStatusBydeptIdList">
update mt_store
status = 'jy'
<where>
contract_dept_id IN
<foreach collection="list" item="list" separator="," open="(" close=")">
#{list.deptId}
</foreach>
</where>
</update>
<update id="editStatusByExpirationTime">
update mt_store
status = 'jy'
where expiration_time > NOW() and status = 'qy'
</update>
</mapper>

View File

@ -103,5 +103,10 @@ public interface StoreService extends IService<MtStore> {
boolean editStoreInfo(MtStore mtStore);
boolean singleSignOn(String flag);
Map<String,Object> loginVerification(String flag);
void flowflowConfiguration();
void petrolStationsAreExpired();
}

View File

@ -4,6 +4,8 @@ import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.order.mapper.AllOrderInfoMapper;
import com.fuint.business.store.service.StoreService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.dto.StoreDto;
@ -13,6 +15,7 @@ import com.fuint.common.service.MerchantService;
import com.fuint.common.util.TokenUtil;
import com.fuint.framework.annoation.OperationServiceLog;
import com.fuint.framework.exception.BusinessCheckException;
import com.fuint.framework.exception.GlobalExceptionHandler;
import com.fuint.framework.pagination.PaginationRequest;
import com.fuint.framework.pagination.PaginationResponse;
import com.fuint.module.backendApi.response.LoginResponse;
@ -23,6 +26,8 @@ import com.fuint.repository.mapper.TAccountMapper;
import com.fuint.repository.model.MtMerchant;
import com.fuint.business.store.entity.MtStore;
import com.fuint.repository.model.TAccount;
import com.fuint.system.dept.entity.SysDept;
import com.fuint.system.dept.mapper.SysDeptMapper;
import com.fuint.system.role.entity.TDuty;
import com.fuint.system.role.mapper.TDutyMapper;
import com.fuint.utils.StringUtil;
@ -42,6 +47,8 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
/**
* 店铺管理业务实现类
@ -360,6 +367,36 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
@Resource
TDutyMapper tDutyMapper;
@Override
public boolean singleSignOn(String flag) {
// 先查询是否有对应的站长
// 根据storeId查出店铺信息
MtStore mtStore = mtStoreMapper.selectById(Integer.parseInt(flag));
// 找到对应的站长deptId
LambdaQueryWrapper<TDuty> lambdaQueryWrapper = Wrappers.lambdaQuery();
lambdaQueryWrapper.eq(TDuty::getCode,"z001");
TDuty tDuty = tDutyMapper.selectOne(lambdaQueryWrapper);
// 查找对应的用户信息
TAccount tAccount = new TAccount();
tAccount.setDeptId(mtStore.getContractDeptId());
tAccount.setRoleIds(tDuty.getDutyId().toString());
List<TAccount> accountList = tAccountMapper.getStationmasterByStoreId(tAccount);
if (accountList != null && accountList.size() > 0) {
redisTemplate.opsForValue().set(flag,flag,300, TimeUnit.SECONDS);
// Object codeInRedis = redisTemplate.opsForValue().get(flag);
return redisTemplate.hasKey(flag);
}else {
return false;
}
}
@Override
public Map<String,Object> loginVerification(String flag) {
Map<String,Object> res = new HashMap<>();
@ -451,6 +488,63 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
return accountInfo;
}
@Resource
SysDeptMapper sysDeptMapper;
@Resource
AllOrderInfoMapper allOrderInfoMapper;
// 将流水上限和时间上限的部门全部设置为不可用
@Override
public void flowflowConfiguration() {
// 查询第三方 的所有部门
LambdaQueryWrapper<SysDept> sysDeptWrapper = Wrappers.lambdaQuery();
sysDeptWrapper.eq(SysDept::getDeptType,"4");
List<SysDept> sysDepts = sysDeptMapper.selectList(sysDeptWrapper);
for (SysDept sysDept : sysDepts) {
// 查询所有的子部门
List<SysDept> sysDeptsList = sysDeptMapper.selectChildrenDeptById(sysDept.getDeptId());
// 判断部门的流水方式
if ("1".equals(sysDept.getTurnoverType())) {
LambdaQueryWrapper<MtStore> storeWrapper = Wrappers.lambdaQuery();
storeWrapper.eq(MtStore::getContractDeptId,sysDeptsList);
List<MtStore> mtStores = mtStoreMapper.selectList(storeWrapper);
// 计算总流水
BigDecimal bigDecimal = allOrderInfoMapper.allStream(mtStores);
if (bigDecimal.compareTo(sysDept.getTurnoverLimit()) >= 0) {
// 设置当前部门为禁用
sysDeptMapper.updateStatusById(sysDept.getDeptId());
// 将所部门设置为禁用
sysDeptMapper.updateStatusByList(sysDeptsList);
// 将有油站设置为未启用
mtStoreMapper.editStatusBydeptIdList(sysDeptsList);
// mtStoreMapper.editStatusBydeptId(sysDept.getDeptId());
}
}else if ("2".equals(sysDept.getTurnoverType())) {
// 时间上限
SysDept sysDeptsByjy = sysDeptMapper.selectStatusByTurnoverTime(sysDept.getDeptId());
if (ObjectUtil.isEmpty(sysDeptsByjy)) {
// 设置当前部门为禁用
sysDeptMapper.updateStatusById(sysDept.getDeptId());
// 将所部门设置为禁用
sysDeptMapper.updateStatusByList(sysDeptsList);
// 将有油站设置为未启用
mtStoreMapper.editStatusBydeptIdList(sysDeptsList);
}
}
}
}
// 将过期油站设置为不可用
@Override
public void petrolStationsAreExpired() {
// 直接修改
mtStoreMapper.editStatusByExpirationTime();
}
}

View File

@ -0,0 +1,67 @@
package com.fuint.business.store.task;
import lombok.extern.slf4j.Slf4j;
import org.quartz.*;
import org.quartz.impl.StdSchedulerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.scheduling.quartz.JobDetailFactoryBean;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
import org.springframework.scheduling.quartz.SimpleTriggerFactoryBean;
import org.springframework.scheduling.support.CronTrigger;
import java.util.Date;
@Configuration
@Slf4j
public class QuartzConfig {
@Bean
public void job() {
//1.创建Scheduler的工厂
SchedulerFactory sf = new StdSchedulerFactory();
//2.从工厂中获取调度器实例
Scheduler scheduler = null;
try {
scheduler = sf.getScheduler();
} catch (SchedulerException e) {
e.printStackTrace();
}
//3.创建JobDetail
JobDetail jb = JobBuilder.newJob(streamTask.class) // Show 为一个job,是要执行的一个任务
.withDescription("这是我的测试定时任务。") //job的描述
.withIdentity("jy2Job", "jy2Group") //job 的name和group
.build();
//任务运行的时间SimpleSchedle类型触发器有效
long time = System.currentTimeMillis() + 3 * 1000L; // 3秒后启动任务
Date statTime = new Date(time);
//4.创建Trigger
//使用SimpleScheduleBuilder或者CronScheduleBuilder
// Trigger t = TriggerBuilder.newTrigger()
// .withDescription("")
// .withIdentity("jyTrigger", "jyTriggerGroup")
// //.withSchedule(SimpleScheduleBuilder.simpleSchedule())
// .startAt(statTime) //默认当前时间启动 ,也可以写为.startNow();
// .withSchedule(CronScheduleBuilder.cronSchedule("0/2 * * * * ?")) //两秒执行一次
// .build();
//5.注册任务和定时器
// try {
// scheduler.scheduleJob(jb, t);
// } catch (SchedulerException e) {
// e.printStackTrace();
// }
//6.启动 调度器
try {
scheduler.start();
} catch (SchedulerException e) {
e.printStackTrace();
}
log.info("启动时间 " + new Date());
}
}

View File

@ -0,0 +1,29 @@
package com.fuint.business.store.task;
import com.fuint.business.store.controller.BackendStoreController;
import com.fuint.business.store.service.StoreService;
import org.quartz.*;
import org.springframework.context.annotation.Bean;
import javax.annotation.Resource;
/**
* 每日12点执行逻辑
*/
public class streamTask implements Job {
@Resource
StoreService storeService;
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
// 执行任务的逻辑
System.out.println("24点定时任务执行中...");
// 将流水上限和时间上限的部门全部设置为不可用
storeService.flowflowConfiguration();
// 将过期油站设置为不可用
storeService.petrolStationsAreExpired();
}
}

View File

@ -123,7 +123,10 @@
<select id="selectUserByIdUni" resultType="com.fuint.business.userManager.vo.LJUserVo"
parameterType="java.lang.Integer">
<include refid="selectUser"></include>
select mu.*,mub.grade_id,mub.card_balance,mub.points,mub.consume_num,mub.growth_value,mub.refuel_money,
mub.second_card,mub.fixing_level
FROM mt_user mu
LEFT JOIN mt_user_balance mub ON mu.id = mub.mt_user_id
<where>
mu.id = #{id}
and mub.chain_store_id =#{chainStoreId}

View File

@ -66,6 +66,12 @@ public interface LJUserGradeService extends IService<LJUserGrade> {
*/
public LJUserGrade selectUserGradeByStoreId(int storeId);
/**
* 根据chainStoreId查询会员最低等级信息
* @param chainStoreId
* @return
*/
LJUserGrade selectUserGradeByChainStoreId(int chainStoreId);
/**
* 根据id删除会员等级信息
* @param id

View File

@ -54,4 +54,7 @@ public interface UserBalanceService extends IService<UserBalance> {
*/
UserBalance getUserBalance();
int initBalance(Integer userId , Integer chainStoreId);
}

View File

@ -116,6 +116,15 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
return list.get(0);
}
@Override
public LJUserGrade selectUserGradeByChainStoreId(int chainStoreId) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("chain_store_id",chainStoreId);
queryWrapper.orderByAsc("grade");
List<LJUserGrade> list = baseMapper.selectList(queryWrapper);
return list.get(0);
}
@Override
public void deleteUserGradeById(Integer id) {
baseMapper.deleteById(id);

View File

@ -130,12 +130,17 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
return baseMapper.selectUserById(id);
}
@Resource
UserBalanceService userBalanceService;
@Override
public LJUserVo getByUniApp(Integer chainStoreId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LJUserVo ljUserVo = baseMapper.selectUserByIdUni(nowAccountInfo.getId(), chainStoreId);
if (ObjectUtil.isEmpty(ljUserVo)) {
userBalanceService.initBalance(nowAccountInfo.getId(), chainStoreId);
ljUserVo = baseMapper.selectUserByIdUni(nowAccountInfo.getId(), chainStoreId);
}
return ljUserVo;
}

View File

@ -1,19 +1,29 @@
package com.fuint.business.userManager.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.userManager.entity.LJUserGrade;
import com.fuint.business.userManager.entity.UserBalance;
import com.fuint.business.userManager.mapper.UserBalanceMapper;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.business.userManager.service.UserBalanceService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* 会员储值卡信息 业务层
*/
@Service
public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserBalance> implements UserBalanceService {
@Resource
LJUserGradeService ljUserGradeService;
@Override
public int insertUserBalance(UserBalance balance) {
int row = baseMapper.insert(balance);
@ -72,4 +82,27 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
UserBalance balance = baseMapper.selectOne(queryWrapper);
return balance;
}
/**
* 初始化用户余额信息
* @param userId
* @param chainStoreId
* @return
*/
public int initBalance(Integer userId, Integer chainStoreId) {
// 新增余额信息
UserBalance userBalanceAdd = new UserBalance();
userBalanceAdd.setMtUserId(userId);
userBalanceAdd.setChainStoreId(chainStoreId);
userBalanceAdd.setCardBalance(0.0);
userBalanceAdd.setPoints(0);
userBalanceAdd.setGrowthValue(0);
userBalanceAdd.setConsumeNum(0);
// todo 12-29 没有连锁店id
// LJUserGrade ljUserGrade = ljUserGradeService.selectUserGradeByChainStoreId(chainStoreId);
// if (ObjectUtil.isNotEmpty(ljUserGrade) && ObjectUtil.isNotEmpty(ljUserGrade.getId())) {
// userBalanceAdd.setGradeId(ljUserGrade.getId());
// }
// 新增会员余额信息
return insertUserBalance(userBalanceAdd);
}
}

View File

@ -94,4 +94,19 @@ public interface SysDeptMapper extends BaseMapper<SysDept>
*/
public int updateDeptChildren(@Param("depts") List<SysDept> depts);
/**
* 查询所有过期
*/
SysDept selectStatusByTurnoverTime(Long deptId);
/**
* 查询是否过期 直接将过期的部门设置为未启用
*/
int updateStatusByTurnoverTime();
int updateStatusById(Long deptId);
int updateStatusByList(@Param("sysDeptsList") List<SysDept> sysDeptsList);
}

View File

@ -71,7 +71,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<update id="updateDeptChildren" parameterType="java.util.List">
update sys_dept set ancestors =
<foreach collection="depts" item="item" index="index"
@ -89,5 +88,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update sys_dept set status = 'jy' where ancestors like concat(#{ancestor},'%')
</update>
<select id="selectStatusByTurnoverTime" resultType="com.fuint.system.dept.entity.SysDept">
select * from sys_dept where turnover_time > NOW() and turnoverType = 2 and status = 'qy'
<if test="deptId != null">
dept_id = #{deptId}
</if>
</select>
<update id="updateStatusByTurnoverTime" >
update sys_dept set status = 'jy' where turnover_time > NOW() and turnoverType = 2
</update>
<update id="updateStatusById">
update sys_dept set status = 'jy' where deptId = #{deptId}
</update>
<update id="updateStatusByList">
update sys_dept set status = 'jy' where deptId = #{deptId}
<where>
dept_id IN
<foreach collection="list" item="list" separator="," open="(" close=")">
#{list.deptId}
</foreach>
</where>
</update>
</mapper>

View File

@ -1,7 +1,9 @@
package com.fuint.system.user.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.store.mapper.MtStoreMapper;
import com.fuint.common.dto.AccountDto;
@ -24,6 +26,7 @@ import com.fuint.business.store.entity.MtStore;
import com.fuint.repository.model.TAccount;
import com.fuint.system.role.entity.TDuty;
import com.fuint.utils.StringUtil;
import com.thoughtworks.xstream.mapper.LambdaMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@ -220,7 +223,9 @@ public class BackendAccountController extends BaseController {
MtStore mtStore = new MtStore();
if ("3".equals(deptType)) {
// 查出storeId
mtStore = mtStoreMapper.selectById(Integer.parseInt(deptId));
LambdaQueryWrapper<MtStore> lambdaQueryWrapper = Wrappers.lambdaQuery();
lambdaQueryWrapper.eq(MtStore::getContractDeptId,deptId);
mtStore = mtStoreMapper.selectOne(lambdaQueryWrapper);
}
@ -264,6 +269,7 @@ public class BackendAccountController extends BaseController {
tAccount.setPassword(password);
tAccount.setIsActive(1);
tAccount.setLocked(0);
if (ObjectUtil.isEmpty(mtStore)) mtStore.setId(0);
tAccount.setStoreId(mtStore.getId());
tAccount.setMerchantId(Integer.parseInt(merchantId));
tAccount.setStaffId(Integer.parseInt(staffId));

View File

@ -1,8 +1,8 @@
# \u57FA\u672C\u914D\u7F6E
server.port=8080
server.port=8008
env.profile=dev
#env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/
env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/
env.properties.path=D:/code/oilSystem/fuintBackend/configure/
# \u6570\u636E\u5E93\u914D\u7F6E

View File

@ -1,3 +1,4 @@
import com.fuint.business.store.service.StoreService;
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
@ -18,6 +19,7 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.UnsupportedEncodingException;
import java.util.List;
@ -153,4 +155,23 @@ public class UserSeriviceTest {
System.out.printf("Consumer Started.%n");
}
@Resource
StoreService storeService;
@Test
public void test2() {
// 将流水上限和时间上限的部门全部设置为不可用
storeService.flowflowConfiguration();
// 将过期油站设置为不可用
storeService.petrolStationsAreExpired();
}
}

Binary file not shown.

View File

@ -1,458 +1,6 @@
{
"name": "gasStation-uni",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"dependencies": {
"@dcloudio/uni-ui": "^1.4.28",
"bignumber.js": "^9.1.2",
"crypto-js": "^4.2.0",
"uview-ui": "^2.0.36"
},
"devDependencies": {
"sass": "^1.69.5",
"sass-loader": "^10.5.0"
}
},
"node_modules/@dcloudio/uni-ui": {
"version": "1.4.28",
"resolved": "https://registry.npmjs.org/@dcloudio/uni-ui/-/uni-ui-1.4.28.tgz",
"integrity": "sha512-e/lSbvR79KH9+d3D4ueNbvD6szigjO/5IyjBNmiTqaj0PTS324fBV3L6f3s1qpkYonM4rdOl000hVOcAg6Gh/A=="
},
"node_modules/@types/json-schema": {
"version": "7.0.15",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
"integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
"dev": true
},
"node_modules/ajv": {
"version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
"dev": true,
"dependencies": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"node_modules/ajv-keywords": {
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
"dev": true,
"peerDependencies": {
"ajv": "^6.9.1"
}
},
"node_modules/anymatch": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
"integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
"dev": true,
"dependencies": {
"normalize-path": "^3.0.0",
"picomatch": "^2.0.4"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/big.js": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
"dev": true,
"engines": {
"node": "*"
}
},
"node_modules/bignumber.js": {
"version": "9.1.2",
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz",
"integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==",
"engines": {
"node": "*"
}
},
"node_modules/binary-extensions": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
"integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/braces": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"dev": true,
"dependencies": {
"fill-range": "^7.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/chokidar": {
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
"integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
"dev": true,
"dependencies": {
"anymatch": "~3.1.2",
"braces": "~3.0.2",
"glob-parent": "~5.1.2",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
"normalize-path": "~3.0.0",
"readdirp": "~3.6.0"
},
"engines": {
"node": ">= 8.10.0"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
}
},
"node_modules/crypto-js": {
"version": "4.2.0",
"resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.2.0.tgz",
"integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q=="
},
"node_modules/emojis-list": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
"dev": true,
"engines": {
"node": ">= 4"
}
},
"node_modules/fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"dev": true
},
"node_modules/fast-json-stable-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
"dev": true
},
"node_modules/fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"dev": true,
"dependencies": {
"to-regex-range": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/fsevents": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
"dev": true,
"hasInstallScript": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"dev": true,
"dependencies": {
"is-glob": "^4.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/immutable": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.4.tgz",
"integrity": "sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA==",
"dev": true
},
"node_modules/is-binary-path": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
"dev": true,
"dependencies": {
"binary-extensions": "^2.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-glob": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
"dev": true,
"dependencies": {
"is-extglob": "^2.1.1"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true,
"engines": {
"node": ">=0.12.0"
}
},
"node_modules/json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true
},
"node_modules/json5": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
"dev": true,
"bin": {
"json5": "lib/cli.js"
},
"engines": {
"node": ">=6"
}
},
"node_modules/klona": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/klona/-/klona-2.0.6.tgz",
"integrity": "sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==",
"dev": true,
"engines": {
"node": ">= 8"
}
},
"node_modules/loader-utils": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz",
"integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
"dev": true,
"dependencies": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
},
"engines": {
"node": ">=8.9.0"
}
},
"node_modules/lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dev": true,
"dependencies": {
"yallist": "^4.0.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/neo-async": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
"dev": true
},
"node_modules/normalize-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/picomatch": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
"dev": true,
"engines": {
"node": ">=8.6"
}
},
"node_modules/punycode": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
"integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
"dev": true,
"engines": {
"node": ">=6"
}
},
"node_modules/readdirp": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
"dev": true,
"dependencies": {
"picomatch": "^2.2.1"
},
"engines": {
"node": ">=8.10.0"
}
},
"node_modules/sass": {
"version": "1.69.5",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.69.5.tgz",
"integrity": "sha512-qg2+UCJibLr2LCVOt3OlPhr/dqVHWOa9XtZf2OjbLs/T4VPSJ00udtgJxH3neXZm+QqX8B+3cU7RaLqp1iVfcQ==",
"dev": true,
"dependencies": {
"chokidar": ">=3.0.0 <4.0.0",
"immutable": "^4.0.0",
"source-map-js": ">=0.6.2 <2.0.0"
},
"bin": {
"sass": "sass.js"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/sass-loader": {
"version": "10.5.0",
"resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-10.5.0.tgz",
"integrity": "sha512-VsU71W7VR6SChMJZUqtrfLeMSA8ns7QTHbnA7cfevtjb3c392mX93lr0Dmr4uU1ch5uIbEmfmHjdrDYcXXkQ7w==",
"dev": true,
"dependencies": {
"klona": "^2.0.4",
"loader-utils": "^2.0.0",
"neo-async": "^2.6.2",
"schema-utils": "^3.0.0",
"semver": "^7.3.2"
},
"engines": {
"node": ">= 10.13.0"
},
"peerDependencies": {
"fibers": ">= 3.1.0",
"node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0",
"sass": "^1.3.0",
"webpack": "^4.36.0 || ^5.0.0"
},
"peerDependenciesMeta": {
"fibers": {
"optional": true
},
"node-sass": {
"optional": true
},
"sass": {
"optional": true
}
}
},
"node_modules/schema-utils": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz",
"integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==",
"dev": true,
"dependencies": {
"@types/json-schema": "^7.0.8",
"ajv": "^6.12.5",
"ajv-keywords": "^3.5.2"
},
"engines": {
"node": ">= 10.13.0"
}
},
"node_modules/semver": {
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
},
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/source-map-js": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"dependencies": {
"is-number": "^7.0.0"
},
"engines": {
"node": ">=8.0"
}
},
"node_modules/uri-js": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
"integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
"dev": true,
"dependencies": {
"punycode": "^2.1.0"
}
},
"node_modules/uview-ui": {
"version": "2.0.36",
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.36.tgz",
"integrity": "sha512-ASSZT6M8w3GTO1eFPbsgEFV0U5UujK+8pTNr+MSUbRNcRMC1u63DDTLJVeArV91kWM0bfAexK3SK9pnTqF9TtA==",
"engines": {
"HBuilderX": "^3.1.0"
}
},
"node_modules/yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
"dev": true
}
},
"lockfileVersion": 1,
"dependencies": {
"@dcloudio/uni-ui": {
"version": "1.4.28",
@ -481,8 +29,7 @@
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
"dev": true,
"requires": {}
"dev": true
},
"anymatch": {
"version": "3.1.3",

View File

@ -6,16 +6,15 @@
<view class="conttainer-top">
<!-- 轮播图 -->
<view style="width: 100%;height: 300px;">
<swiper class="swiper" style="width: 100%;height: 300px;" circular :indicator-dots="indicatorDots"
:autoplay="autoplay" :interval="interval"
:duration="duration">
<swiper class="swiper" style="width: 100%;height: 300px;" circular :indicator-dots="indicatorDots"
:autoplay="autoplay" :interval="interval" :duration="duration">
<swiper-item v-for="(item,index) in list1" :key="index" @click="goPage(item.routeUrl)">
<view class="swiper-item uni-bg-red"></view>
<image style="width: 100%;" :src="item.bannerUrl"></image>
</swiper-item>
</swiper>
</view>
<!-- 标题 -->
<view class="top-title">
出行服务 优惠加油
@ -183,10 +182,10 @@
},
onLoad(query) {
const q = decodeURIComponent(query.q) //
if (q == undefined) {
if (query.q) {
let str = q.split("?")[1];
let arr = str.split("&");
let storeId = "";
let storeId = "12";
let staffId = "";
arr.forEach(item => {
if (item.includes("storeId")) {
@ -199,6 +198,13 @@
uni.setStorageSync("inviteStaffId", staffId)
this.storeId = uni.getStorageSync("storeId")
this.staffId = uni.getStorageSync("inviteStaffId")
} else {
let storeId = "12";
uni.setStorageSync("storeId", storeId)
this.storeId = uni.getStorageSync("storeId")
}
// this.isExistStoreId();
@ -215,16 +221,16 @@
},
methods: {
// banner
goPage(url){
goPage(url) {
uni.navigateTo({
url:url,
url: url,
})
},
//
getIndexBanner(){
if (uni.getStorageSync("storeId")){
getIndexBanner() {
if (uni.getStorageSync("storeId")) {
request({
url: 'business/indexBanner/list/'+uni.getStorageSync("storeId"),
url: 'business/indexBanner/list/' + uni.getStorageSync("storeId"),
method: 'get',
}).then(res => {
console.log(res)
@ -299,7 +305,7 @@
uni.getSetting({
success(res) {
console.log(res,111)
console.log(res, 111)
if (!res.authSetting['scope.userLocation']) {
uni.authorize({
scope: 'scope.userLocation',

View File

@ -86,7 +86,6 @@
<span v-if="item.exchangeMethod == '积分+金额'">+</span>
<span
v-if="item.exchangeMethod == '金额' || item.exchangeMethod == '积分+金额'">{{item.exchangeAmount}}</span>
</view>
</view>
<view class="hui-time">
@ -94,16 +93,18 @@
</view>
</view>
<view class="anniux">
<text>立即兑换</text>
<text v-if="!item.remainingInventory || item.remainingInventory==0"
style="color: darkgray;">库存不足</text>
<text v-else-if="(
item.exchangeMethod == '积分' ||
item.exchangeMethod == '积分+金额' ) &&
item.remainingInventory>myPoints" style="color: darkgray;">积分不足</text>
<text v-else>立即兑换</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
@ -207,13 +208,27 @@
},
godetails(data) {
uni.$on('un', function() {
uni.$emit('goodsInfo', data)
if (data.remainingInventory == 0) {
uni.showToast({
title: "该商品库存不足!",
icon: "none"
})
} else if (data.remainingInventory > this.myPoints && (
data.exchangeMethod == '积分' ||
data.exchangeMethod == '积分+金额')) {
uni.showToast({
title: "您的账户积分不足!",
icon: "none"
})
} else {
uni.$on('un', function() {
uni.$emit('goodsInfo', data)
})
uni.navigateTo({
url: '/pagesHome/goodsDetails/goodsDetails',
})
}
})
uni.navigateTo({
url: '/pagesHome/goodsDetails/goodsDetails',
})
},
goback() {
uni.navigateBack()
@ -434,6 +449,7 @@
width: 100%;
margin: 10px auto;
color: #1678ff;
// color: #a2a2a2;
font-weight: bold;
}

View File

@ -28,17 +28,25 @@
<view class="bai-box">
<view style="margin-bottom: 10px;">商品详情</view>
<u-line v-html="goodsInfo.detailedDescription"></u-line>
<!-- <u-line v-html="goodsInfo.detailedDescription"></u-line> -->
<!-- <view class="" v-html="html" ></view> -->
<u-line></u-line>
<u-parse :content="goodsInfo.detailedDescription"></u-parse>
</view>
<view class="bottom-d">
<view class="anniux" @click="goorder()">
<text>立即兑换</text>
</view>
</view>
<!-- <view class="centen-siez"> -->
</view>
<view class="bottom-d">
<view class="anniux" @click="goorder()">
<text>立即兑换</text>
</view>
</view>
</view>
</view>
</template>
@ -56,9 +64,6 @@
}
},
components: {
},
onLoad() {
},
@ -72,22 +77,17 @@
uni.$emit('un')
},
methods: {
change() {},
click() {},
//
dataProcessing() {
this.giftImages = []
if (this.goodsInfo.giftImages != null && this.goodsInfo.giftImages != undefined) {
const myGiftImages = JSON.parse(this.goodsInfo.giftImages);
myGiftImages.forEach(res => {
if (res.fileName == undefined || res.fileName == null) {
this.giftImages.push(res.url)
} else {
let url = this.baseUrl + res.fileName
this.giftImages.push(url);
}
let url = this.baseUrl + res
this.giftImages.push(url);
})
}
if (this.goodsInfo.deliveryMethod != null && this.goodsInfo.deliveryMethod != undefined) {
@ -97,13 +97,12 @@
} else {
this.deliveryMethod = '无配送信息'
}
},
//
goorder() {
//
request({
url: '/business/userManager/user/getByUniApp',
url: 'business/userManager/user/getByUniApp',
method: 'get',
params: {
chainStoreId: uni.getStorageSync('chainStoreId')
@ -111,29 +110,41 @@
}).then((res) => {
if (res.code == 200 && res.data) {
this.myPoints = res.data.points
if (res.data.points) {
console.log("this.goodsInfo1", this.goodsInfo)
console.log("this.goodsInfo1", res.data)
if (res.data.points != undefined) {
if (!this.goodsInfo.exchangePoints) {
uni.navigateTo({
url: '/pagesHome/order/order'
})
} else if (res.data.points >= this.goodsInfo.exchangePoints) {
uni.navigateTo({
url: '/pagesHome/order/order'
})
} else {
} else if (res.data.points < this.goodsInfo.exchangePoints && (
this.goodsInfo.exchangeMethod == '积分' ||
this.goodsInfo.exchangeMethod == '积分+金额')) {
//
uni.showToast({
icon: 'none',
title: "积分不足"
})
} else {
uni.navigateTo({
url: '/pagesHome/order/order'
})
}
}
} else {
//
uni.showToast({
icon: 'none',
title: "积分不足"
})
}
})
},
//
goback() {
uni.navigateBack()
}

View File

@ -138,9 +138,8 @@
address: ''
},
paymentType: '',
// chainStoreId: uni.getStorageSync('chainStoreId'),
storeId: uni.getStorageSync('storeId'),
chainStoreId: 1,
chainStoreId: uni.getStorageSync('chainStoreId'),
tapList: [{
text: '到店自提'
},
@ -197,7 +196,7 @@
// //
//
async choose() {
let _this = this
let integralOrdersList = []
@ -227,7 +226,8 @@
storeId: _this.storeId,
},
}).then(res => {
if (res.data.code === "error") {
// if (res.data.code === "error") {
if (res.data.code === "success") {
console.log(res)
let payProvider = "wxpay"
_this.orderInfo = JSON.parse(res.data.data.reservedPayInfo);
@ -348,11 +348,6 @@
if (this.goodsInfo.exchangePoints) {
allPoints = new BigNumber(this.goodsInfo.exchangePoints)
}
//
// if (this.value < 1) {
// this.value = 1
// }
let value = new BigNumber(this.value)
allPoints = allPoints.times(value)
@ -365,21 +360,18 @@
allAmout = 0
}
this.allAmout = Number(allAmout).toFixed(2);
}
//
if (this.goodsInfo.exchangeMethod === '积分+加钱购') {
//
let data = this.shoppingCart[0]; //
// let data = this.shoppingCart[0]; //
//
let markPurchases = new BigNumber(data.markPurchases);
let exchangePoints = allPoints.multipliedBy(new BigNumber(data.exchangePoints));
// let markPurchases = new BigNumber(data.markPurchases);
// let exchangePoints = allPoints.multipliedBy(new BigNumber(data.exchangePoints));
//
this.member.points = this.member.points ? this.member.points : 0
this.myPoints = this.myPoints ? this.member.points : 0
let points = this.myPoints - allPoints; // 使 toNumber() BigNumber
//
@ -389,8 +381,8 @@
points = Math.abs(points);
allAmout = points * this.goodsInfo.moneyRatio; // 使 JavaScript
this.allAmout = allAmout.toFixed(2);
this.allAmout = points * this.goodsInfo.moneyRatio.toFixed(2); // 使 JavaScript
// this.allAmout = allAmout.toFixed(2);
// this.allAmout = Number(allAmout).toFixed(2);
} else {

View File

@ -37,7 +37,7 @@
title: '',
qindex: false,
baseUrl: this.$baseUrl,
appltType:uni.getStorageSync("appltType"),
appltType: uni.getStorageSync("appltType"),
}
},
onLoad() {
@ -57,40 +57,40 @@
// return;
// }
console.log(e)
let _this = this;
my.getAuthCode({
scopes: 'auth_base',
success: res => {
const authCode = res.authCode;
console.log(res)
request({
url: "clientApi/sign/alipayLogin/getUserid",
method: 'post',
data: {
authCode:authCode,
storeId:0,
staffId:"",
phone:"18457621459",
},
}).then((resp)=>{
console.log(resp)
if (resp.code == 200) {
uni.setStorageSync('App-Token', resp.data.token);
uni.setStorageSync('chainStoreId', resp.data.chainStoreId);
uni.navigateTo({
url: '/pages/index/index'
})
}
console.log("swq", uni.getStorageSync(
'App-Token'));
})
},
fail: err => {
console.log('my.getAuthCode 调用失败', err)
}
scopes: 'auth_base',
success: res => {
const authCode = res.authCode;
console.log(res)
request({
url: "clientApi/sign/alipayLogin/getUserid",
method: 'post',
data: {
authCode: authCode,
storeId: 0,
staffId: "",
phone: "18457621459",
},
}).then((resp) => {
console.log(resp)
if (resp.code == 200) {
uni.setStorageSync('App-Token', resp.data.token);
uni.setStorageSync('chainStoreId', resp.data.chainStoreId);
uni.navigateTo({
url: '/pages/index/index'
})
}
console.log("swq", uni.getStorageSync(
'App-Token'));
})
},
fail: err => {
console.log('my.getAuthCode 调用失败', err)
}
});
},
wxlogin() {},
@ -126,7 +126,7 @@
encryptedIv: e.detail.iv,
encryptedData: e.detail.encryptedData,
userInfo: {
storeId: 0,
storeId: 12,
staffId: "",
phone: '18457621459'
},