Merge remote-tracking branch 'origin/master'

This commit is contained in:
齐天大圣 2024-05-17 10:50:19 +08:00
commit 9e2a581288
51 changed files with 2171 additions and 191 deletions

View File

@ -10,6 +10,7 @@ export function exportExcelCashierApi(data) {
});
}
// 导出油品订单
export function exportExcelOilOrderApi(data) {
return request({

View File

@ -106,12 +106,12 @@
<el-form-item label="应用公钥" prop="appPublicKey">
<el-input v-model="deviceInfo.appPublicKey"></el-input>
</el-form-item>
<el-form-item label="平台公钥" prop="platformPublicKey">
<el-input v-model="deviceInfo.platformPublicKey"></el-input>
</el-form-item>
<el-form-item label="token" prop="accessToken">
<el-input v-model="deviceInfo.accessToken"></el-input>
</el-form-item>
<!-- <el-form-item label="平台公钥" prop="platformPublicKey">-->
<!-- <el-input v-model="deviceInfo.platformPublicKey"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="token" prop="accessToken">-->
<!-- <el-input v-model="deviceInfo.accessToken"></el-input>-->
<!-- </el-form-item>-->
<el-form-item label="isAcquiesce" prop="isAcquiesce">
<el-switch
v-model="deviceInfo.isAcquiesce"

View File

@ -27,6 +27,12 @@
></el-checkbox>
</el-checkbox-group>
</div>
<div style="display: flex;margin-bottom: 20px">
<p>退款密码
<el-input v-model="store.refPass" style="width: 50%" show-password></el-input>
</p>
</div>
<el-button type="primary" @click="submitStore">保存信息</el-button>
</el-card>
@ -162,6 +168,7 @@ export default {
this.form.lat = this.store.latitude;
this.form.lng = this.store.longitude;
this.form.address = this.store.address;
this.form.refPass = this.store.refPass;
if (this.store.welfare!=null){
this.welfare = this.store.welfare.split(",")
}

View File

@ -0,0 +1,919 @@
<template>
<div class="app-container">
<!-- 搜索-->
<el-card >
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="姓名aaaa" prop="name">
<el-input
v-model="queryParams.realName"
placeholder="请输入姓名"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="手机号" prop="mobile">
<el-input
v-model="queryParams.mobile"
placeholder="请输入手机号"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="auditedStatus">
<el-select
v-model="queryParams.status"
placeholder="状态"
clearable
style="width: 240px"
>
<el-option
v-for="dict in dict.type.zhzt"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<!-- <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>-->
</el-form-item>
</el-form>
</el-card>
<!-- 列表信息-->
<el-card style="margin-top: 20px" >
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
@click="handleAdd"
>新增员工</el-button>
</el-col>
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
</el-row>
<el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
<el-table-column type="index" width="80" align="center" label="序号"/>
<el-table-column label="姓名" align="center" prop="realName" />
<el-table-column label="员工角色" align="center" prop="dutyName" >
<template slot-scope="scope">
<span>{{scope.row.dutyName || "--"}}</span>
</template>
</el-table-column>
<el-table-column label="手机号" align="center" prop="mobile" width="110"/>
<el-table-column label="员工码" align="center" prop="staffCode">
<template slot-scope="scope">
<span @click="getStaffQRcode(scope.row.id)">
<svg t="1701161298120" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4306" width="16" height="16"><path d="M384 64l-249.6 0c-51.2 0-89.6 41.6-89.6 89.6l0 227.2c0 51.2 41.6 89.6 89.6 89.6l249.6 0c51.2 0 89.6-41.6 89.6-89.6l0-227.2C473.6 105.6 435.2 64 384 64zM428.8 380.8c0 25.6-19.2 44.8-44.8 44.8l-249.6 0c-25.6 0-44.8-19.2-44.8-44.8l0-227.2c0-25.6 19.2-44.8 44.8-44.8l249.6 0c25.6 0 44.8 19.2 44.8 44.8L428.8 380.8z" p-id="4307"></path><path d="M192 192l134.4 0 0 134.4-134.4 0 0-134.4Z" p-id="4308"></path><path d="M377.6 544l-243.2 0c-48 0-86.4 38.4-86.4 89.6l0 220.8c0 48 38.4 89.6 86.4 89.6l243.2 0c48 0 86.4-38.4 86.4-89.6l0-220.8C467.2 582.4 425.6 544 377.6 544zM422.4 851.2c0 25.6-19.2 44.8-44.8 44.8l-243.2 0c-25.6 0-44.8-19.2-44.8-44.8l0-220.8c0-25.6 19.2-44.8 44.8-44.8l243.2 0c25.6 0 44.8 19.2 44.8 44.8L422.4 851.2z" p-id="4309"></path><path d="M192 668.8l131.2 0 0 131.2-131.2 0 0-131.2Z" p-id="4310"></path><path d="M633.6 470.4l249.6 0c51.2 0 89.6-41.6 89.6-89.6l0-227.2c0-51.2-41.6-89.6-89.6-89.6l-249.6 0c-51.2 0-89.6 41.6-89.6 89.6l0 227.2C544 432 585.6 470.4 633.6 470.4zM588.8 153.6c0-25.6 19.2-44.8 44.8-44.8l249.6 0c25.6 0 44.8 19.2 44.8 44.8l0 227.2c0 25.6-19.2 44.8-44.8 44.8l-249.6 0c-25.6 0-44.8-19.2-44.8-44.8L588.8 153.6z" p-id="4311"></path><path d="M700.8 192l134.4 0 0 134.4-134.4 0 0-134.4Z" p-id="4312"></path><path d="M572.8 716.8l137.6 0c12.8 0 22.4-9.6 22.4-22.4l0-137.6c0-12.8-9.6-22.4-22.4-22.4l-137.6 0c-12.8 0-22.4 9.6-22.4 22.4l0 137.6C550.4 707.2 560 716.8 572.8 716.8z" p-id="4313"></path><path d="M886.4 563.2l0 38.4c0 12.8 12.8 25.6 25.6 25.6l38.4 0c12.8 0 25.6-12.8 25.6-25.6l0-38.4c0-12.8-12.8-25.6-25.6-25.6l-38.4 0C899.2 537.6 886.4 547.2 886.4 563.2z" p-id="4314"></path><path d="M582.4 944l48 0c12.8 0 22.4-9.6 22.4-22.4l0-48c0-12.8-9.6-22.4-22.4-22.4l-48 0c-12.8 0-22.4 9.6-22.4 22.4l0 48C560 934.4 569.6 944 582.4 944z" p-id="4315"></path><path d="M944 704l-99.2 0c-16 0-28.8 12.8-28.8 28.8l0 44.8-48 0c-19.2 0-32 12.8-32 32l0 99.2c0 16 12.8 28.8 28.8 28.8l179.2 3.2c16 0 28.8-12.8 28.8-28.8l0-179.2C972.8 716.8 960 704 944 704z" p-id="4316"></path></svg>
</span>
</template>
</el-table-column>
<el-table-column label="员工状态" align="center" prop="status">
<template slot-scope="scope">
<el-tag v-if="scope.row.status=='qy'">启用</el-tag>
<el-tag type="info" v-if="scope.row.status=='jy'">禁用</el-tag>
</template>
</el-table-column>
<!-- </el-table-column>-->
<el-table-column label="一键加油" align="center" prop="isRefuel">
<template slot-scope="scope">
<dict-tag :options="dict.type.display" :value="scope.row.isRefuel"/>
</template>
</el-table-column>
<el-table-column label="收款通知" align="center" prop="notice">
<template slot-scope="scope">
<dict-tag :options="dict.type.notice" :value="scope.row.notice"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="150">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="更新时间" align="center" prop="updateTime" width="150">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ parseTime(scope.row.updateTime) }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="binding(scope.row)"
>一键绑定</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="nobinding(scope.row)"
v-if="scope.row.tagStatus == 1"
>解绑</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-card>
<!-- 添加或修改对话框 -->
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="50%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="8">
<el-form-item label="姓名" prop="realName">
<el-input v-model="form.realName" placeholder="请输入姓名" maxlength="30" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="手机号" prop="mobile">
<el-input v-model="form.mobile" placeholder="请输入联系人电话" maxlength="30"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="角色组" prop="roleId">
<el-select v-model="form.roleId" placeholder="请选择角色">
<el-option
v-for="item in roleList"
:key="item.dutyId+''"
:label="item.dutyName"
:value="item.dutyId+''"
></el-option>
</el-select>
</el-form-item>
</el-col>
<!-- </el-row>-->
<!-- <el-row>-->
<el-col :span="8">
<el-form-item label="登录密码" prop="password">
<el-input v-model="form.password" type="password" @input="changePassword" placeholder="不填写默认123456" maxlength="30"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="一键加油" prop="isRefuel">
<el-select v-model="form.isRefuel">
<el-option
v-for="dict in dict.type.display"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<br/>
<el-tooltip
class="item"
effect="dark"
placement="bottom">
<div slot="content">加油时选择加油员场景使用,选择不显示加油员将无法被指定<br/>(需系统开启加油选择加油员功能)终端支持:(PCPOS小程序)</div>
<span>加油时选择加油员场...</span>
</el-tooltip>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收款通知" prop="notice">
<el-select v-model="form.notice">
<el-option
v-for="dict in dict.type.notice"
v-if="dict.value!='zdyx'"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<br/>
<el-tooltip
class="item"
effect="dark"
placement="bottom">
<div slot="content"> 收款成功接收的公众号模板消息通知,<br/>关注公众号,且本站小程序中会员手机号<br/>信息与当前员工手机号一致 </div>
<span>收款成功接收的...</span>
</el-tooltip>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="账号状态" prop="status">
<el-select v-model="form.status">
<el-option
v-for="dict in dict.type.zhzt"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<br/>
<el-tooltip
class="item"
effect="dark"
placement="bottom">
<div slot="content"> 状态禁用后,当前账号则无法进行<br/>登录和操作</div>
<span>状态禁用后,当前账号...</span>
</el-tooltip>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="审核权限">
<el-select
v-model="auditPrem"
multiple
collapse-tags
@change="getCheckbox"
placeholder="请选择">
<el-checkbox style="margin-left: 100px" :checked="checked" v-model="checked" @change='selectAll'>全选</el-checkbox>
<!-- <el-option-->
<!-- v-for="dict in dict.type.shqx"-->
<!-- :key="dict.label"-->
<!-- :label="dict.label"-->
<!-- :value="dict.label"-->
<!-- >-->
<el-option
v-for="dict in shqxList"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictLabel"
>
</el-option>
</el-select>
<br/>
<el-tooltip
class="item"
effect="dark"
placement="bottom">
<div slot="content">可设置当前员工是否有油品/商品入库盘点审核废止等权限</div>
<span>可设置当前员工是否有...</span>
</el-tooltip>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注信息">
<el-input v-model="form.description" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog
:title="title"
:visible.sync="dialogVisible"
style="margin-top: 100px"
width="23%">
<div style="text-align: center">
<img id="qrCodeImg" class="qrcode" :src="baseUrl+imgUrl" />
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="handleDownloadqrCode('qrCodeImg')">保存图片到电脑</el-button>
</span>
</el-dialog>
<el-dialog title="码牌列表" :visible.sync="openShow" width="800px" append-to-body>
<div class="wrap-box">
<div class="gang-box">
<div class="rw">
序号
</div>
<div class="rw">
厂商名称
</div>
<div class="rw">
二维码ID
</div>
<div class="rw">
码牌SN号
</div>
<div class="rw">
操作
</div>
</div>
<div class="gang-box" :class="{'oilid' :oilid == item.id }" v-for="(item,index) in arrList" :key="index">
<!-- <el-table-column label="厂商名称" align="center" width="110">-->
<!-- <template slot-scope="item">-->
<!-- <span>{{item.companyName || ''}}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="二维码SN号" align="center" width="110">-->
<!-- <template slot-scope="item">-->
<!-- <span>{{item.tagCodeSn|| ''}}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="码牌SN号" align="center" width="110">-->
<!-- <template slot-scope="item">-->
<!-- <span>{{item.snCode|| ''}}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<div class="rw">
{{index+1}}
</div>
<div class="rw">
{{item.companyName}}
</div>
<div class="rw">
{{item.tagCodeSn}}
</div>
<div class="rw">
{{item.snCode}}
</div>
<div style="width: 25%; text-align: center; color: #00afff;cursor: pointer;" v-if="oilid != item.id" @click="getoil(item.id)">
选择
</div>
<div style="width: 25%; text-align: center; color: #adadad;cursor: pointer;" v-if="oilid == item.id">
已选择
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="yesyesyes">确定绑定</el-button>
<el-button @click="openShow=false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import QRCode from 'qrcode'
import {
addStaff,
createStaffQrCode,
delStaff,
getStaff,
listStaff, puttagCodeRecord,
queryStaff,
tagCodeRecord, tagCodeRecordStaff,
updateStaff
} from "@/api/staff/staff";
import {getDuty, listDuty} from "@/api/staff/duty";
import html2canvas from "html2canvas";
import {getDicts} from "@/api/order/data";
import {dutyList, dutyLists} from "@/api/duty/duty";
export default {
name: "TagList",
dicts: ['ywqx','write_off','display','zhzt','transaction','time_frame','handover','handover_quit',
'jbjl','official','notice','special_prem','role','shqx','staff_role'],
data() {
return {
//
type:"",
checked:false,
openShow:false,
arrList:[],
oilid:null,
staffId:null,
// url
imgUrl:"",
//
roleList:[],
drawer: false,
dialogVisible: false,
baseUrl:process.env.VUE_APP_BASE_API,
//
title: "",
//
loading: false,
//
ids: [],
//
multiple: true,
//
showSearch: true,
storeOptions: [],
shqxList: [],
// role:[],
posPrem:'',
props: { multiple: true },
appletPrem:'',
appletOptions:[
{value: '交易',label: '交易',children:[{value: '油品交易', label: '油品交易' },]},
{value: '库存',label: '库存',
children:[
{value: '库存盘点', label: '库存盘点' },
{value: '库存查询', label: '库存查询' },
]},
{value: '核销',label: '核销',
children:[
{value: '扫码核销', label: '扫码核销' },
{value: '核销记录', label: '核销记录' },
]},
],
writeOff:[],
write:[],
specialPrem:[],
auditPrem:[],
special:[],
//
total: 0,
//
list: [],
//
open: false,
//
dateRange: [],
//
defaultSort: {prop: 'createTime', order: 'descending'},
//
form: {
id:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:'', 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:'',auditPrem:'',specialPrem:'', official:'', status:'qy',pos:'jy',roleId:''
},
//
queryParams: {
page: 1,
pageSize: 10,
realName: '',
mobile: '',
status: ''
},
ifEditPassword:false,
//
rules: {
realName: [
{ required: true, message: "姓名不能为空", trigger: "blur" },
{ min: 2, max: 30, message: '姓名长度必须介于 2 和 20 之间', trigger: 'blur' }
],
mobile: [
{ required: true, message: "手机号不能为空", trigger: "blur" },
{ min: 6, max: 13, message: '手机号不正确', trigger: 'blur' }
],
roleId: [
{ required: true, message: "请选择员工角色", trigger: "blur" }
],
isRefuel: [
{ required: true, message: "请选择加油状态", trigger: "blur" }
],
pos: [
{ required: true, message: "请选择", trigger: "blur" }
],
transaction: [
{ required: true, message: "请选择", trigger: "blur" }
],
notice: [
{ required: true, message: "请选择", trigger: "blur" }
],
timeFrame: [
{ required: true, message: "请选择", trigger: "blur" }
],
handoverMode: [
{ required: true, message: "请选择", trigger: "blur" }
],
handoverPrem: [
{ required: true, message: "请选择", trigger: "blur" }
],
handoverOut: [
{ required: true, message: "请选择", trigger: "blur" }
],
record: [
{ required: true, message: "请选择", trigger: "blur" }
],
merchantStatus: [
{ required: true, message: "请选择", trigger: "blur" }
],
screen: [
{ required: true, message: "请选择", trigger: "blur" }
],
status: [
{ required: true, message: "请选择", trigger: "blur" }
]
}
};
},
created() {
this.getList();
//
// this.getDuty();
// this.getStoreList();
},
methods: {
binding(row){
this.staffId = row.id
this.openShow = true
this.gettagCodeRecord()
},
nobinding(row){
let data = {
staffId:row.id
}
puttagCodeRecord(data).then(res=>{
this.$modal.msgSuccess(res.data);
})
},
yesyesyes() {
let data = {
oilTagId: this.oilid,
staffId:this.staffId
}
tagCodeRecordStaff(data).then(res=>{
if(res.code == 200){
this.oilid = null
this.staffId = null
this.openShow = false
this.$modal.msgSuccess("绑定成功");
}
console.log(res)
})
},
getoil(id){
this.oilid = id
},
gettagCodeRecord(){
tagCodeRecord().then(res=>{
this.arrList = res.data.records
})
},
selectAll(val){
this.auditPrem = []
if (val) {
this.shqxList.forEach((item) => {
this.auditPrem.push(item.dictLabel)
this.form.auditPrem = this.auditPrem.toString();
})
} else {
this.auditPrem = []
this.form.auditPrem = ""
}
},
getAuditPrem(){
getDicts("shqx").then(res => {
this.shqxList = res.data
})
},
//
getStaffQRcode(id){
createStaffQrCode(id).then(res => {
if (res.code==200){
this.title = "员工二维码"
this.dialogVisible = true
this.imgUrl = res.data
}
})
},
// url
getQRcode(code,name){
this.type = name;
let opts = {
errorCorrectionLevel: "L",//
type: "image/png",//
quality: 0.3,//
margin: 0,//
width: 180,//
height: 180,//
text: "http://www.xxx.com",//
color: {
dark: "#666666",//
light: "#fff"//
}
};
//this.QRlink url
QRCode.toDataURL(code, opts , (err, url) => {
if (err) throw err
//dataQRImgUrl
this.imgUrl = url
})
if (name=="woc"){
this.title = "核销二维码"
}else {
this.title = "员工二维码"
}
this.dialogVisible = true
},
// dom
handleDownloadqrCode(id) {
html2canvas(document.getElementById(id)).then((canvas) => {
let imgUrl = canvas.toDataURL("image/png"); // canvas base64
let a = document.createElement('a')
a.href = imgUrl;
a.download = "员工二维码"; //
document.body.appendChild(a);
a.click(); //
document.body.removeChild(a); //
}).catch(err => {
console.log(err)
});
},
showDesc(){
this.drawer = true;
},
handleNodeClick1(data) {
this.form.posPrem = JSON.stringify(data);
},
handleNodeClick2(data) {
this.form.appletPrem = JSON.stringify(data);
},
getCheckbox(val){
console.log("this.auditPrem.toString()",this.auditPrem.toString())
// this.form.writeOff = this.writeOff.toString();
// this.form.specialPrem = this.specialPrem.toString();
this.form.auditPrem = this.auditPrem.toString();
if (val.length === this.shqxList.length) {
this.checked = true
} else {
this.checked = false
}
},
//
toTarget(url) {
this.$router.push( { path: url } );
}, //
getList() {
this.loading = true;
listStaff(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.list = response.data.records;
this.total = response.data.total;
this.loading = false;
}
);
},
//
getDuty(){
listDuty().then(response => {
this.roleList = response.data
})
},
//
getStoreList() {
listStaff().then(response => {
this.storeOptions = response.data.records;
}
);
},
//
handleQuery() {
this.queryParams.page = 1;
this.getList();
},
//
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
this.handleQuery();
},
//
handleStatusChange(row) {
let text = row.auditedStatus == "A" ? "启用" : "禁用";
this.$modal.confirm('确认要' + text + '"' + row.realName + '"吗?').then(function() {
// return updateStaffStatus(row.id, row.auditedStatus);
return updateStaff({id:row.id, auditedStatus:row.auditedStatus})
}).then(() => {
this.$modal.msgSuccess(text + "成功");
}).catch(function() {
row.auditedStatus = row.auditedStatus === "A" ? "A" : "N";
});
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.operId)
this.multiple = !selection.length
},
//
handleSortChange(column, prop, order) {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
this.getList();
},
//
async handleAdd() {
this.reset();
await this.getAuditPrem()
this.getRoleList1()
this.open = true;
this.title = "新增员工";
},
//
getRoleList1() {
let data = {
page:1,
pageSize:10000,
dutyType:3
}
dutyList(data).then(res => {
this.roleList = res.data.records
})
},
//
reset() {
this.posPrem = '';
this.appletPrem = '';
this.writeOff = [];
this.form.auditPrem = [];
this.auditPrem = []
this.form = {
id:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:'', 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:'',auditPrem:'',specialPrem:'', official:'', status:'qy',pos:'jy',roleId:''
};
this.resetForm("form");
},
//
cancel() {
this.open = false;
this.checked = false;
this.reset();
},
changePassword(){
this.ifEditPassword = true
},
//
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.auditPrem){
this.form.auditPrem = this.form.auditPrem.toString();
}
if (!this.form.id) {
queryStaff({mobile:this.form.mobile}).then( response => {
if(response.data){
this.$modal.msgError("手机号已存在");
}else {
this.form.posPrem = JSON.stringify(this.form.posPrem);
this.form.appletPrem = JSON.stringify(this.form.appletPrem);
addStaff(this.form).then(response => {
if (response.data==1){
this.$modal.msgSuccess("新增成功");
this.open = false;
this.checked = false;
this.getList();
}else {
this.$modal.msgError("新增失败");
}
});
}
})
} else {
if (!this.ifEditPassword){
this.form.password = ""
}
updateStaff(this.form).then(response => {
if (response.data==1){
this.$modal.msgSuccess("修改成功");
this.open = false;
this.checked = false;
this.getList();
}else {
this.$modal.msgError("手机号已存在");
}
});
}
}
});
},
//
async handleUpdate(row) {
this.reset();
this.open = true;
const id = row.id || this.ids;
await this.getAuditPrem()
await getStaff(id).then(response => {
this.form = response.data;
this.form.password = '123456'
// this.form.refundPassword = '123456'
this.open = true;
this.title = "编辑员工信息";
if (this.form.auditPrem && this.form.auditPrem.length > 0){
// this.form.auditPrem = this.form.auditPrem.split(",");
this.auditPrem = []
this.auditPrem = this.form.auditPrem.split(",");
console.log("this.form.auditPrem",this.auditPrem)
if (this.auditPrem.length === this.shqxList.length) {
this.checked = true
} else {
this.checked = false
}
}
if (this.writeOff.length > 0){
this.writeOff = this.form.writeOff.split(",");
}
if (this.specialPrem.length > 0){
this.specialPrem = this.form.specialPrem.split(",");
}
if (this.posPrem != null && this.posPrem != ""){
this.posPrem = JSON.parse(this.form.posPrem);
}
if (this.appletPrem != null && this.appletPrem != ""){
this.appletPrem = JSON.parse(this.form.appletPrem);
}
this.getRoleList1();
});
},
//
handleDelete(row) {
const name = row.realName || this.id;
this.$modal.confirm('是否确认删除"' + name + '"的员工信息?').then(function() {
return delStaff(row.id);
}).then(() => {
this.queryParams.page = 1
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
}
};
</script>
<style scoped>
.app-container{
width: 100%;
height: 100%;
background: #f6f8f9;
}
.pagin-box{
background: white;
box-sizing: border-box;
padding: 20px;
}
.baoguo{
background: white;
box-sizing: border-box;
padding: 20px;
margin-bottom: 20px;
}
.qrcode{
width: 80%;
margin: 0 auto;
margin-top: 15px;
}
.wrap-box{
width: 100%;
height: 300px;
overflow: auto;
margin: 10px auto;
}
.gang-box{
box-sizing: border-box;
padding: 10px 0px;
border-bottom: 1px solid #dcdfe6;
display: flex;
align-items: center;
justify-content: space-between;
}
.oilid{
background: #f6f8f9 !important;
}
.rw{
width: 25%;
text-align: center;
}
</style>

View File

@ -62,6 +62,14 @@ export function getDayListApi(query) {
})
}
export function getDayDatyListApi(query) {
return request({
url: 'business/allOrderInfo/getRunningWaterByDayData',
method: 'get',
params: query
})
}
//统计
export function getRunningWaterByDataApi(query) {
return request({
@ -90,3 +98,41 @@ export function getTissueByDataApi(query) {
})
}
export function exportExcelTradingApi(data) {
return request({
url: 'business/allOrderInfo/tradingExportExcel',
method: 'post',
responseType: 'blob', // 表明响应类型为二进制流
data: data // 通过 data 参数传递需要的数据
});
}
export function exportExcelTissueApi(data) {
return request({
url: 'business/allOrderInfo/runningWaterByTissueExportExcel',
method: 'post',
responseType: 'blob', // 表明响应类型为二进制流
data: data // 通过 data 参数传递需要的数据
});
}
export function exportExcelOilDeptApi(data) {
return request({
url: 'business/allOrderInfo/runningWaterByOilDeptExportExcel',
method: 'post',
responseType: 'blob', // 表明响应类型为二进制流
data: data // 通过 data 参数传递需要的数据
});
}
export function exportExcelDayApi(data) {
return request({
url: 'business/allOrderInfo/runningWaterByDayExportExcel',
method: 'post',
responseType: 'blob', // 表明响应类型为二进制流
data: data // 通过 data 参数传递需要的数据
});
}

View File

@ -29,22 +29,45 @@
placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="机构:" prop="staffId">
<el-form-item label="机构:" prop="deptId">
<el-select
v-model="queryParams.staffId"
v-model="queryParams.deptId"
clearable
placeholder="全部"
>
<el-option v-for="item in staffList" :key="item.id" :label="item.realName" :value="item.id">
<span style="float: left">{{ item.realName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.mobile }}</span>
<el-option v-for="item in deptList" :key="item.id" :label="item.deptName" :value="item.deptId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="支付渠道:" prop="payChannel">
<el-select
v-model="queryParams.payChannel"
clearable
placeholder="全部"
>
<el-option label="小程序" value="applet"/>
<el-option label="收银台" value="cashier"/>
<el-option label="POS端" value="POS"/>
</el-select>
</el-form-item>
<el-form-item label="支付方式:" prop="payType">
<el-select
v-model="queryParams.payType"
clearable
placeholder="全部"
>
<el-option label="现金" value="CASH"/>
<el-option label="微信" value="WECHAT"/>
<el-option label="支付宝" value="ALIPAY"/>
<el-option label="余额" value="balance"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<el-button type="primary" icon="el-icon-plus" @click = "exportExcelCashier()">导出订单</el-button>
<!-- <el-button type="primary" icon="el-icon-plus" @click = "exportExcelCashier()">导出订单</el-button>-->
</el-form-item>
</el-form>
@ -61,7 +84,7 @@
</div>
<div class="box">
<div class="size-hui">退款余额</div>
<div class="size-bole">{{ orderStatistics.refBalance }}</div>
<div class="size-bole">{{ orderStatistics.refBalance?orderStatistics.refBalance:0 }}</div>
</div>
</div>
@ -83,9 +106,18 @@
<el-table-column prop="mchntCd" align="center" label="商户号"> </el-table-column>
<el-table-column prop="amount" align="center" label="费率"> </el-table-column>
<el-table-column prop="type" align="center" label="订单来源">
<template slot-scope="scope">
<span v-if="scope.row.type=='1'">油品</span>
<span v-else-if="scope.row.type=='2'">商品</span>
<span v-else-if="scope.row.type=='3'">储值卡</span>
<span v-else-if="scope.row.type=='4'">积分</span>
<span v-else-if="scope.row.type=='5'">囤油卡</span>
<span v-else-if="scope.row.type=='6'">油品加商品(收银台订单)</span>
<span v-else-if="scope.row.type=='7'">挂账订单</span>
<span v-else="">其他</span>
</template>
</el-table-column>
<el-table-column prop="amount" align="center" label="所属模块"> </el-table-column>
<!-- <el-table-column prop="amount" align="center" label="所属模块"> </el-table-column>-->
<el-table-column prop="payType" align="center" label="支付方式">
<template slot-scope="scope">
<span v-if="scope.row.payType=='CASH'">现金</span>
@ -100,9 +132,9 @@
<el-table-column prop="payMoney" align="center" label="退款金额"> </el-table-column>
<!-- <el-table-column prop="payMoney" align="center" label="实收金额"> </el-table-column>-->
<!-- <el-table-column prop="payAmount" align="center" label="手续费"> </el-table-column>-->
<el-table-column prop="userName" align="center" label="付款用户" width="110"> </el-table-column>
<el-table-column prop="reasonRefund" align="content" label="备注" width="110"> </el-table-column>
<el-table-column label="操作" align="center" width="240" class-name="small-padding fixed-width">
<el-table-column prop="userName" align="center" label="付款用户"> </el-table-column>
<el-table-column prop="reasonRefund" align="content" label="备注" > </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button style="width: 60px" size="mini"
@click="getOrdersInfo(scope.row)"
@ -131,6 +163,59 @@
/>
</el-card>
<el-dialog
title="订单信息"
:visible.sync="dialogVisible">
<el-descriptions :title="'订单号:'+ordersInfo.orderNo">
<el-descriptions-item label="门店">{{ordersInfo.storeName}}</el-descriptions-item>
<el-descriptions-item label="收银员">{{ordersInfo.createBy}}</el-descriptions-item>
<el-descriptions-item label="支付渠道">{{ordersInfo.payChannel}}</el-descriptions-item>
<el-descriptions-item label="商户号">{{ordersInfo.mchntCd}}</el-descriptions-item>
<el-descriptions-item label="费率">{{ordersInfo.amount}}</el-descriptions-item>
<el-descriptions-item label="订单来源">{{ordersInfo.type}}</el-descriptions-item>
<el-descriptions-item label="所属模块">{{ordersInfo.amount}}</el-descriptions-item>
<el-descriptions-item label="支付方式">{{ordersInfo.payType}}</el-descriptions-item>
<el-descriptions-item label="付款用户">{{ordersInfo.userName}}</el-descriptions-item>
<el-descriptions-item label="支付状态">{{ordersInfo.status}}</el-descriptions-item>
<el-descriptions-item label="备注">{{ordersInfo.content}}</el-descriptions-item>
<!-- <el-descriptions-item label="备注">-->
<!-- <el-tag size="small">学校</el-tag>-->
<!-- </el-descriptions-item>-->
</el-descriptions>
<el-descriptions class="margin-top" title="金额详情" :column="3" border>
<el-descriptions-item>
<template slot="label">
订单金额
</template>
{{ordersInfo.goodsMoney?ordersInfo.goodsMoney:"--"}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
优惠后应付金额
</template>
{{ordersInfo.payMoney?ordersInfo.payMoney:"--"}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
退款金额
</template>
{{ordersInfo.refMoney?ordersInfo.refMoney:"--"}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
实收金额
</template>
{{ordersInfo.payMoney?ordersInfo.payMoney:"--"}}
</el-descriptions-item>
</el-descriptions>
</el-dialog>
</div>
</template>

View File

@ -31,41 +31,41 @@
placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="机构:" prop="deptId">
<el-select
v-model="queryParams.deptId"
clearable
placeholder="全部"
>
<el-option v-for="item in deptList" :key="item.id" :label="item.deptName" :value="item.deptId">
</el-option>
<el-form-item label="机构:" prop="deptId">
<el-select
v-model="queryParams.deptId"
clearable
placeholder="全部"
>
<el-option v-for="item in deptList" :key="item.id" :label="item.deptName" :value="item.deptId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="支付渠道:" prop="payChannel">
<el-select
v-model="queryParams.payChannel"
clearable
placeholder="全部"
>
<el-option label="小程序" value="applet"/>
<el-option label="收银台" value="cashier"/>
<el-option label="POS端" value="POS"/>
</el-select>
</el-form-item>
<el-form-item label="支付方式:" prop="payType">
<el-select
v-model="queryParams.payType"
clearable
placeholder="全部"
>
<el-option label="现金" value="CASH"/>
<el-option label="微信" value="WECHAT"/>
<el-option label="支付宝" value="ALIPAY"/>
<el-option label="余额" value="balance"/>
</el-select>
</el-form-item>
</el-select>
</el-form-item>
<el-form-item label="支付渠道:" prop="payChannel">
<el-select
v-model="queryParams.payChannel"
clearable
placeholder="全部"
>
<el-option label="小程序" value="applet"/>
<el-option label="收银台" value="cashier"/>
<el-option label="POS端" value="POS"/>
</el-select>
</el-form-item>
<el-form-item label="支付方式:" prop="payType">
<el-select
v-model="queryParams.payType"
clearable
placeholder="全部"
>
<el-option label="现金" value="CASH"/>
<el-option label="微信" value="WECHAT"/>
<el-option label="支付宝" value="ALIPAY"/>
<el-option label="余额" value="balance"/>
</el-select>
</el-form-item>
<el-form-item label="支付状态 " prop="status">
<el-select
v-model="queryParams.status"
@ -92,15 +92,15 @@
<div class="box-gang">
<div class="box">
<div class="size-hui">微信收款</div>
<div class="size-bole">{{ orderStatistics.cash }}/{{orderStatistics.cashcount}}</div>
<div class="size-bole">{{ orderStatistics.cash?orderStatistics.cash:0 }}/{{orderStatistics.cashcount}}</div>
</div>
<div class="box">
<div class="size-hui">支付宝收款</div>
<div class="size-bole">{{ orderStatistics.wechat }}/{{orderStatistics.wechatcount}}</div>
<div class="size-bole">{{ orderStatistics.wechat?orderStatistics.wechat:0 }}/{{orderStatistics.wechatcount}}</div>
</div>
<div class="box">
<div class="size-hui">会员钱包收款</div>
<div class="size-bole">{{ orderStatistics.alipay }}/{{orderStatistics.alipaycount}}</div>
<div class="size-bole">{{ orderStatistics.alipay?orderStatistics.alipay:0 }}/{{orderStatistics.alipaycount}}</div>
</div>
<!-- <div class="box">-->
<!-- <div class="size-hui">银行卡收款</div>-->
@ -112,13 +112,13 @@
<!-- </div>-->
<div class="box">
<div class="size-hui">现金支付收款</div>
<div class="size-bole">{{ orderStatistics.balance }}/{{orderStatistics.balanceCount}}</div>
<div class="size-bole">{{ orderStatistics.balance?orderStatistics.balance:0 }}/{{orderStatistics.balanceCount}}</div>
</div>
</div>
</el-card>
<el-card class="box-card">
<div class="wgang">
<div>机构流水分析列表</div>
<div>交易明细分析列表</div>
</div>
<div class="table-box">
<el-table
@ -133,9 +133,18 @@
<el-table-column prop="mchntCd" align="center" label="商户号"> </el-table-column>
<el-table-column prop="amount" align="center" label="费率"> </el-table-column>
<el-table-column prop="type" align="center" label="订单来源">
<template slot-scope="scope">
<span v-if="scope.row.type=='1'">油品</span>
<span v-else-if="scope.row.type=='2'">商品</span>
<span v-else-if="scope.row.type=='3'">储值卡</span>
<span v-else-if="scope.row.type=='4'">积分</span>
<span v-else-if="scope.row.type=='5'">囤油卡</span>
<span v-else-if="scope.row.type=='6'">油品加商品(收银台订单)</span>
<span v-else-if="scope.row.type=='7'">挂账订单</span>
<span v-else="">其他</span>
</template>
</el-table-column>
<el-table-column prop="amount" align="center" label="所属模块"> </el-table-column>
<!-- <el-table-column prop="amount" align="center" label="所属模块"> </el-table-column>-->
<el-table-column prop="payType" align="center" label="支付方式">
<template slot-scope="scope">
<span v-if="scope.row.payType=='CASH'">现金</span>
@ -154,12 +163,17 @@
</el-table-column>
<el-table-column prop="goodsMoney" align="center" label="订单金额"> </el-table-column>
<el-table-column prop="payMoney" align="center" label="优惠后应付金额"> </el-table-column>
<el-table-column prop="refMoney" align="center" label="退款金额"> </el-table-column>
<el-table-column prop="refMoney" align="center" label="退款金额">
<template slot-scope="scope">
<span v-if="scope.row.status == 'refund'">{{scope.row.payMoney}}</span>
<span type="danger" v-else>--</span>
</template>
</el-table-column>
<el-table-column prop="payMoney" align="center" label="实收金额"> </el-table-column>
<!-- <el-table-column prop="payAmount" align="center" label="手续费"> </el-table-column>-->
<el-table-column prop="userName" align="center" label="付款用户" width="110"> </el-table-column>
<el-table-column prop="content" align="content" label="备注" width="110"> </el-table-column>
<el-table-column label="操作" align="center" width="240" class-name="small-padding fixed-width">
<el-table-column prop="userName" align="center" label="付款用户" > </el-table-column>
<el-table-column prop="content" align="content" label="备注" > </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button style="width: 60px" size="mini"
@click="getOrdersInfo(scope.row)"
@ -251,6 +265,7 @@
<script>
import {
exportExcelTradingApi,
getRunningWaterByTissueApi,
getTissueByDataApi,
getTradingPageApi
@ -331,10 +346,10 @@ import {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
// exportExcelCashierApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
// const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
// this.$download.saveAs(blob,'.xLsx')
// })
exportExcelTradingApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
this.$download.saveAs(blob,'交易明细统计.xLsx')
})
},
//
@ -356,7 +371,7 @@ import {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
getTradingPageApi(this.addDateRange(this.queryParams),dateRange).then( response => {
getTradingPageApi(this.addDateRange(this.queryParams,dateRange)).then( response => {
this.orderList = response.data.records;
this.total = response.data.total;
this.isSysDate = false

View File

@ -8,24 +8,24 @@
<div class="box-gang">
<div class="box">
<div class="size-hui">交易金额</div>
<div class="size-bole">{{ 0 }}</div>
<div class="size-bole">{{ orderStatistics.amount }}</div>
</div>
<div class="box">
<div class="size-hui">交易笔数</div>
<div class="size-bole">{{ 0 }}</div>
<div class="size-bole">{{ orderStatistics.strokeCount }}</div>
</div>
<div class="box">
<div class="size-hui">笔单价</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">日均交易金额</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">日均交易笔数</div>
<div class="size-bole">{{ 0 }}</div>
<div class="size-bole">{{ orderStatistics.unitPrice }}</div>
</div>
<!-- <div class="box">-->
<!-- <div class="size-hui">日均交易金额</div>-->
<!-- <div class="size-bole">{{ orderStatistics.dailyAmount }}</div>-->
<!-- </div>-->
<!-- <div class="box">-->
<!-- <div class="size-hui">日均交易笔数</div>-->
<!-- <div class="size-bole">{{ orderStatistics.strokesPerDay }}</div>-->
<!-- </div>-->
</div>
</el-card>
<el-card class="box-card">
@ -59,18 +59,16 @@
placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="机构:" prop="staffId">
<el-select
v-model="queryParams.staffId"
clearable
placeholder="全部"
>
<el-option v-for="item in staffList" :key="item.id" :label="item.realName" :value="item.id">
<span style="float: left">{{ item.realName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.mobile }}</span>
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="机构:" prop="deptId">-->
<!-- <el-select-->
<!-- v-model="queryParams.deptId"-->
<!-- clearable-->
<!-- placeholder="全部"-->
<!-- >-->
<!-- <el-option v-for="item in deptList" :key="item.id" :label="item.deptName" :value="item.deptId">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
@ -128,7 +126,7 @@
<script>
import {getDayListApi} from "@/api/allOrder";
import {exportExcelDayApi, getDayDatyListApi, getDayListApi, getRunningWaterByTissueApi} from "@/api/allOrder";
export default {
name: "runningWater-day",
@ -137,6 +135,7 @@
radio1:"油号选错",
loading:false,
deptList:[],
//
staffList:[],
//
@ -155,12 +154,11 @@
endTime:"",
},
orderStatistics:{
numberOfStrokes:'0',
theTotalAmountOfTheOrder:'0',
theTotalAmountPaid:'0',
oilDiscounts:'0',
theTotalAmountOfOil:'0',
theTotalAmountOfTheItem:'0',
amount:'0',
strokeCount:'0',
unitPrice:'0',
dailyAmount:'0',
strokesPerDay:'0'
},
total:0,
}
@ -176,6 +174,9 @@
this.endTime = new Date()
this.isSysDate = true
this.getList();
this.getDeptList();
},
methods:{
@ -186,11 +187,17 @@
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
// exportExcelCashierApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
// const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
// this.$download.saveAs(blob,'.xLsx')
// })
exportExcelDayApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
this.$download.saveAs(blob,'日流水分析.xLsx')
})
},
getDeptList() {
getRunningWaterByTissueApi(this.addDateRange(this.queryParams)).then( response => {
this.deptList = response.data.records;
})
},
//
getOrderStatistics() {
@ -199,9 +206,9 @@
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
// orderStatisticsApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
// this.orderStatistics = res.data
// })
getDayDatyListApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
this.orderStatistics = res.data
})
},
//

View File

@ -8,27 +8,27 @@
<div class="box-gang">
<div class="box">
<div class="size-hui">交易金额</div>
<div class="size-bole">{{ orderStatistics.amount }}</div>
<div class="size-bole">{{ orderStatistics.amount?orderStatistics.amount:0 }}</div>
</div>
<div class="box">
<div class="size-hui">交易笔数</div>
<div class="size-bole">{{ orderStatistics.strokeCount }}</div>
<div class="size-bole">{{ orderStatistics.strokeCount?orderStatistics.strokeCount:0 }}</div>
</div>
<div class="box">
<div class="size-hui">笔单价</div>
<div class="size-bole">{{ orderStatistics.unitPrice }}</div>
<div class="size-bole">{{ orderStatistics.unitPrice?orderStatistics.unitPrice:0 }}</div>
</div>
<div class="box">
<div class="size-hui">日均交易金额</div>
<div class="size-bole">{{ orderStatistics.dailyAmount }}</div>
<div class="size-bole">{{ orderStatistics.dailyAmount?orderStatistics.dailyAmount:0 }}</div>
</div>
<div class="box">
<div class="size-hui">日均交易笔数</div>
<div class="size-bole">{{ orderStatistics.strokesPerDay }}</div>
<div class="size-bole">{{ orderStatistics.strokesPerDay?orderStatistics.strokesPerDay:0 }}</div>
</div>
<div class="box">
<div class="size-hui">活跃机构数</div>
<div class="size-bole">{{ orderStatistics.inertiaStore }}</div>
<div class="size-bole">{{ orderStatistics.inertiaStore?orderStatistics.inertiaStore:0 }}</div>
</div>
</div>
</el-card>
@ -130,6 +130,7 @@
<script>
import {
exportExcelTissueApi,
getInstituionListApi,
getRunningWaterByDataApi,
getRunningWaterByTissueApi
@ -196,10 +197,10 @@ import {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
// exportExcelCashierApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
// const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
// this.$download.saveAs(blob,'.xLsx')
// })
exportExcelTissueApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
this.$download.saveAs(blob,'流水订单统计.xLsx')
})
},
//
@ -216,8 +217,12 @@ import {
//
getList(val){
getInstituionListApi(this.addDateRange(this.queryParams)).then( response => {
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
getInstituionListApi(this.addDateRange(this.queryParams,dateRange)).then( response => {
this.orderList = response.data.records;
this.total = response.data.total;
this.isSysDate = false

View File

@ -122,7 +122,7 @@
<script>
import {getInstituionListApi, getRunningWaterByDataApi} from "@/api/allOrder";
import {getInstituionListApi, getRunningWaterByDataApi,exportExcelOilDeptApi} from "@/api/allOrder";
export default {
name: "runningWater-oilDepot",
@ -180,10 +180,10 @@ import {getInstituionListApi, getRunningWaterByDataApi} from "@/api/allOrder";
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
// exportExcelCashierApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
// const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
// this.$download.saveAs(blob,'.xLsx')
// })
exportExcelOilDeptApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
this.$download.saveAs(blob,'油站流水订单统计.xLsx')
})
},
//
@ -200,8 +200,12 @@ import {getInstituionListApi, getRunningWaterByDataApi} from "@/api/allOrder";
//
getList(val){
getInstituionListApi(this.addDateRange(this.queryParams)).then( response => {
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
getInstituionListApi(this.addDateRange(this.queryParams,dateRange)).then( response => {
this.orderList = response.data.records;
this.total = response.data.total;
this.isSysDate = false

View File

@ -57,3 +57,19 @@ export function tagCodeRecord(data) {
data:data
})
}
export function getListByParentIdApi(data) {
return request({
url: '/system/dept/getListByParentId',
method: 'get',
params:data
})
}
export function exportOilTagApi(data) {
return request({
url: '/business/tag/oilTag/export',
method: 'post',
responseType: 'blob', // 表明响应类型为二进制流
data:data
})
}

View File

@ -1,4 +1,4 @@
<template>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="二维码ID" prop="tagCodeSn">
@ -63,8 +63,9 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:tag:export']"
>导出</el-button>
<!-- v-hasPermi="['system:tag:export']"-->
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -148,24 +149,35 @@
</el-dialog>
<el-dialog title="一键绑定" :visible.sync="openShow" width="800px" append-to-body>
<!-- <div style="margin-bottom: 10px;font-weight: bold"> 油站名称 </div>-->
<div style="display: flex;">
<el-input v-model="filterText" placeholder="请输入油站名称" @input="getfilterText()"></el-input>
<div style="width: 10px ; height: 10px;"></div>
<el-button type="primary" @click="getfilterText()">查询</el-button>
</div>
<div class="wrap-box">
<div class="gang-box" :class="{'oilid' :oilid == item.id }" v-for="(item,index) in arrList" :key="index">
<div>
{{item.name}}
</div>
<div style="color: #00afff;cursor: pointer;margin-right: 15px" v-if="oilid != item.id" @click="getoil(item.id)">
选择
</div>
<div style="color: #adadad;cursor: pointer;margin-right: 15px" v-if="oilid == item.id">
已选择
</div>
</div>
</div>
<!-- <div style="display: flex;">-->
<!-- <el-input v-model="filterText" placeholder="请输入油站名称" @input="getfilterText()"></el-input>-->
<!-- <div style="width: 10px ; height: 10px;"></div>-->
<!-- <el-button type="primary" @click="getfilterText()">查询</el-button>-->
<!-- </div>-->
<!-- <div class="wrap-box">-->
<!-- <div class="gang-box" :class="{'oilid' :oilid == item.id }" v-for="(item,index) in arrList" :key="index">-->
<!-- <div>-->
<!-- {{item.name}}-->
<!-- </div>-->
<!-- <div style="color: #00afff;cursor: pointer;margin-right: 15px" v-if="oilid != item.id" @click="getoil(item.id)">-->
<!-- 选择-->
<!-- </div>-->
<!-- <div style="color: #adadad;cursor: pointer;margin-right: 15px" v-if="oilid == item.id">-->
<!-- 已选择-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <el-form-item label="机构:" prop="deptId">-->
<el-select
v-model="deptId"
clearable
placeholder="全部"
>
<el-option v-for="item in deptList" :key="item.id" :label="item.deptName" :value="item.deptId">
</el-option>
</el-select>
<!-- </el-form-item>-->
<div slot="footer" class="dialog-footer">
@ -177,8 +189,19 @@
</template>
<script>
import {listTag, getTag, delTag, addTag, updateTag, storeName, tagCodeRecord} from "./api/tag";
import {
listTag,
getTag,
delTag,
addTag,
updateTag,
storeName,
tagCodeRecord,
getListByParentIdApi,
exportOilTagApi
} from "./api/tag";
import {deptTreeSelect} from "@/api/system/Site/site";
import {exportExcelTissueApi} from "@/api/allOrder";
export default {
name: "Tag",
@ -187,6 +210,8 @@ export default {
return {
oilTagList:[],
oilid:null,
deptIds:'',
deptId:'',
arrList:[],
filterText:"",
defaultProps: {
@ -225,6 +250,7 @@ export default {
status: null,
mtStatus: null,
},
deptList:[],
//
form: {},
//
@ -243,14 +269,21 @@ export default {
},
created() {
this.getList();
this.getDeptList();
},
methods: {
getDeptList() {
getListByParentIdApi().then(res=>{
this.deptList = res.data
})
},
yesyesyes(){
let data = {
oilTagList :this.oilTagList,
storeId:this.oilid,
status:1
status:1,
deptId:this.deptId
}
tagCodeRecord(data).then(res=>{
if(res.code == 200){
@ -387,9 +420,10 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
this.download('system/tag/export', {
...this.queryParams
}, `tag_${new Date().getTime()}.xlsx`)
exportOilTagApi(this.queryParams).then(res=>{
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
this.$download.saveAs(blob,'流水订单统计.xLsx')
})
}
}
};

View File

@ -27,6 +27,15 @@ export function addCode(data) {
})
}
export function exportZipApi(data) {
return request({
url: '/business/tag/tagCode/exportZip',
method: 'post',
responseType: 'blob', // 表明返回服务器返回的数据类型
data: data
})
}
// 修改码牌二维码
export function updateCode(data) {
return request({

View File

@ -53,7 +53,6 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:code:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@ -99,7 +98,7 @@
</template>
<script>
import { listCode, getCode, delCode, addCode, updateCode } from "./api/code";
import {listCode, getCode, delCode, addCode, updateCode, exportZipApi} from "./api/code";
export default {
name: "Code",
@ -248,10 +247,24 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
this.download('system/code/export', {
...this.queryParams
}, `code_${new Date().getTime()}.xlsx`)
}
exportZipApi(this.form).then(response => {
const blob = new Blob([response], { type: 'application/zip' });
const url = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
//
link.setAttribute('download', '1');
//
link.click();
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
})
},
}
};
</script>

View File

@ -43,7 +43,8 @@ images.root=d:/ruoyi/uploadPath
images.path=/static/uploadImages/
# \u4E0A\u4F20\u56FE\u7247\u670D\u52A1\u5668\u57DF\u540D
images.upload.url=http://localhost:8008
#images.upload.url=http://localhost:8008
images.upload.url=http://localhost:8080
# \u4E0A\u4F20\u56FE\u7247\u5141\u8BB8\u7684\u5927\u5C0F\uFF08\u5355\u4F4D\uFF1AMB\uFF09
images.upload.maxSize=5
@ -75,7 +76,7 @@ aliyun.sms.accessKeySecret=whimt0bhMMJ0amVZPsvJ2euz8nCiOp
aliyun.sms.regionId=cn-hangzhou
aliyun.sms.templateCode=SMS_154950909
# \u963F\u91CC\u4E91\u77ED\u4FE1\u7B7E\u540D
aliyun.sms.signName=阿里云短信测试
aliyun.sms.signName=\u963F\u91CC\u4E91\u77ED\u4FE1\u6D4B\u8BD5
################## \u963F\u91CC\u4E91OSS\u5B58\u50A8\u914D\u7F6E######################

View File

@ -49,7 +49,8 @@ public class Const {
public static String NOTIFY_PUBLIC_KEYS="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCbBAl3xSB7YeUnze4yYZmnTeT7OtXZr0sP10TsDVRH2SY/VEjgS9KPmHMmVeKZT3+6xKsUvulgVyie46GGtZPrnoh+glF1gzsYAXJ7dvR/R5nYO5VvfwK/ChPFTiKhbTtO4OKtchgBZuqCbsemG+gFIiVJo37dY0Kg0zISmFHdOQIDAQAB";
//小程序异步通知(回调地址)
public static String notify_url = "https://www.tuofeng.cc/oilAdmin/api/fyPay/notify";
// public static String notify_url = "https://www.tuofeng.cc/oilAdmin/api/fyPay/notify";
public static String notify_url = "http://k40180f897.goho.co/api/fyPay/notify";
// public static String notify_url = "https://8q4f124343.yicp.fun/api/fyPay/notify";
//主扫异步通知(回调地址)

View File

@ -48,7 +48,7 @@ public class CardValueRecord extends Model<CardValueRecord> {
private Double rechargeBalance;
//储值卡赠送金额
private Double giftBalance;
private Double lockupPrice;
// private Double lockupPrice;
//积分
private Integer points;
//成长值

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.order.dto.AllOrderInfoDto;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.order.entity.CardBalanceChange;
import com.fuint.business.order.entity.CashierOrder;
import com.fuint.business.order.service.AllOrderInfoService;
import com.fuint.business.order.vo.AllOrderInfoVo;
import com.fuint.business.order.vo.CardBalanceChangeVo;
@ -14,6 +15,7 @@ import com.fuint.system.dept.vo.SysDeptVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
@ -94,6 +96,16 @@ public class AllOrderInfoController extends BaseController {
return getSuccessResult(list);
}
/**
* 导出订单
* @param response
*/
@PostMapping("tradingExportExcel")
public void tradingExportExcel(HttpServletResponse response, @RequestBody AllOrderInfoDto allOrderInfo) {
this.allOrderInfoService.tradingExportExcel(response, allOrderInfo);
}
@GetMapping("getTradingData")
public ResponseObject getTradingData(AllOrderInfoDto allOrderInfo,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@ -115,6 +127,15 @@ public class AllOrderInfoController extends BaseController {
return getSuccessResult(list);
}
@PostMapping("runningWaterByTissueExportExcel")
public void runningWaterByTissueExportExcel(HttpServletResponse response, @RequestBody AllOrderInfoDto allOrderInfo) {
this.allOrderInfoService.runningWaterByTissueExportExcel(response, allOrderInfo);
}
@PostMapping("runningWaterByOilDeptExportExcel")
public void runningWaterByOilDeptExportExcel(HttpServletResponse response, @RequestBody AllOrderInfoDto allOrderInfo) {
this.allOrderInfoService.runningWaterByOilDeptExportExcel(response, allOrderInfo);
}
/**
* 机构流水分析
*/
@ -135,6 +156,20 @@ public class AllOrderInfoController extends BaseController {
IPage<AllOrderInfoVo> list = allOrderInfoService.runningWaterByDay(page, allOrderInfoDto);
return getSuccessResult(list);
}
@GetMapping("getRunningWaterByDayData")
public ResponseObject getRunningWaterByDayData(AllOrderInfoDto allOrderInfoDto,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
AllOrderInfoVo list = allOrderInfoService.getRunningWaterByDayData(allOrderInfoDto);
return getSuccessResult(list);
}
@PostMapping("runningWaterByDayExportExcel")
public void runningWaterByDayExportExcel(HttpServletResponse response, @RequestBody AllOrderInfoDto allOrderInfo) {
this.allOrderInfoService.runningWaterByDayExportExcel(response, allOrderInfo);
}
@GetMapping("runningWaterByData")
public ResponseObject runningWaterByData(AllOrderInfoDto allOrderInfoDto,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,

View File

@ -32,6 +32,7 @@ public interface AllOrderInfoMapper extends BaseMapper<AllOrderInfo> {
AllOrderInfoVo getStoreNDynamic(@Param("allOrderInfo") AllOrderInfoDto allOrderInfo);
IPage<AllOrderInfoVo> getRunningWaterByDay(@Param("page") Page page, @Param("allOrderInfo") AllOrderInfoDto allOrderInfo);
AllOrderInfoVo getRunningWaterByDayData( @Param("allOrderInfo") AllOrderInfoDto allOrderInfo);
AllOrderInfoVo getRunningWaterByData(@Param("allOrderInfo") AllOrderInfoDto allOrderInfo);

View File

@ -252,6 +252,22 @@
amount > 0
Order by aoi.pay_time
</select>
<select id="getRunningWaterByDayData" resultType="com.fuint.business.order.vo.AllOrderInfoVo">
SELECT DATE(pay_time) AS pay_time,
COUNT(DISTINCT aoi.store_id) storeCount,
COALESCE(SUM(pay_money), 0) AS amount,
COALESCE(COUNT(*), 0) AS strokeCount,
ROUND(
CASE
WHEN COUNT(*) = 0 THEN 0
ELSE SUM(pay_money) / COUNT(*)
END,
2
) AS unitPrice
from all_order_info aoi
WHERE date_format(aoi.pay_time,'%y%m%d') BETWEEN date_format(#{allOrderInfo.params.beginTime},'%y%m%d') AND date_format(#{allOrderInfo.params.endTime},'%y%m%d')
</select>
<select id="getRunningWaterByData" resultType="com.fuint.business.order.vo.AllOrderInfoVo">
select
COUNT(DISTINCT aoi.store_id) storeCount,

View File

@ -4,12 +4,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.order.dto.AllOrderInfoDto;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.order.entity.CashierOrder;
import com.fuint.business.order.vo.AllOrderInfoVo;
import com.fuint.business.order.vo.CardBalanceChangeVo;
import com.fuint.framework.exception.BusinessCheckException;
import com.fuint.system.dept.vo.SysDeptVo;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
@Transactional
public interface AllOrderInfoService {
@ -68,9 +70,19 @@ public interface AllOrderInfoService {
AllOrderInfoVo getTradingData(AllOrderInfoDto allOrderInfo);
IPage<AllOrderInfoVo> getTradingPage(Page page, AllOrderInfoDto allOrderInfo);
IPage<SysDeptVo> runningWaterByInstituion(Page page, AllOrderInfoDto allOrderInfo);
void tradingExportExcel(HttpServletResponse response, AllOrderInfoDto order);
void runningWaterByTissueExportExcel(HttpServletResponse response, AllOrderInfoDto order);
void runningWaterByOilDeptExportExcel(HttpServletResponse response, AllOrderInfoDto order);
IPage<SysDeptVo> runningWaterByNone(Page page, AllOrderInfoDto allOrderInfo);
IPage<AllOrderInfoVo> runningWaterByDay(Page page, AllOrderInfoDto allOrderInfo);
AllOrderInfoVo getRunningWaterByDayData(AllOrderInfoDto allOrderInfo);
void runningWaterByDayExportExcel(HttpServletResponse response, AllOrderInfoDto order);
AllOrderInfoVo runningWaterByData(Page page, AllOrderInfoDto allOrderInfo);
IPage<SysDeptVo> runningWaterByTissue(Page page, AllOrderInfoDto allOrderInfo);

View File

@ -1,20 +1,16 @@
package com.fuint.business.order.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.api.fuyou.entity.Const;
import com.fuint.api.fuyou.entity.MerchantConfig;
import com.fuint.api.fuyou.service.FyPayService;
import com.fuint.api.fuyou.service.MerchantConfigService;
import com.fuint.business.commission.service.CommissionRecordService;
import com.fuint.business.convenienceSore.dto.LJGoodsDto;
import com.fuint.business.convenienceSore.entity.StockStatistic;
import com.fuint.business.convenienceSore.entity.StockTrack;
import com.fuint.business.convenienceSore.service.LJGoodsService;
import com.fuint.business.convenienceSore.service.StockTrackService;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
@ -26,6 +22,10 @@ import com.fuint.business.order.entity.OilOrder;
import com.fuint.business.order.mapper.AllOrderInfoMapper;
import com.fuint.business.order.service.*;
import com.fuint.business.order.vo.AllOrderInfoVo;
import com.fuint.business.order.vo.Excel.DayExcel;
import com.fuint.business.order.vo.Excel.InstituionExcel;
import com.fuint.business.order.vo.Excel.OilDepotExcel;
import com.fuint.business.order.vo.Excel.TradingExcel;
import com.fuint.business.order.vo.OrderGoodsVo;
import com.fuint.business.petrolStationManagement.entity.OilGun;
import com.fuint.business.petrolStationManagement.entity.OilTracking;
@ -39,10 +39,7 @@ import com.fuint.common.dto.AccountInfo;
import com.fuint.common.service.MemberService;
import com.fuint.common.service.StaffService;
import com.fuint.common.util.TokenUtil;
import com.fuint.framework.exception.BusinessCheckException;
import com.fuint.repository.mapper.MtOpenGiftMapper;
import com.fuint.repository.mapper.MtUserMapper;
import com.fuint.repository.model.MtOrderGoods;
import com.fuint.repository.model.MtStaff;
import com.fuint.repository.model.MtUser;
import com.fuint.system.dept.entity.SysDept;
@ -50,12 +47,13 @@ import com.fuint.system.dept.mapper.SysDeptMapper;
import com.fuint.system.dept.service.ISysDeptService;
import com.fuint.system.dept.vo.SysDeptVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
@ -377,9 +375,6 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
ljOrder.setStatus("refund");
ljOrderService.updateById(ljOrder);
// 获取订单的商品数据
List<OrderGoodsVo> orderGoodsVos = orderGoodsService.selectOrderGoods(ljOrder.getId());
// 处理库存
for (OrderGoodsVo orderGoodsVo : orderGoodsVos) {
@ -463,7 +458,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
}
}
MtUser byId = mtUserMapper.queryMemberById(allOrderInfo.getUserId());
MtUser byId = mtUserMapper.queryMemberById(record.getUserId());
if(ObjectUtil.isNotEmpty(byId)) {
record.setUserName(byId.getName());
}else {
@ -475,6 +470,60 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
}
public void tradingExportExcel(HttpServletResponse response, AllOrderInfoDto order) {
IPage<AllOrderInfoVo> tradingPage = getTradingPage(new Page(1, 100000), order);
List<TradingExcel> tradingExcel = new ArrayList<>();
for (AllOrderInfoVo record : tradingPage.getRecords()) {
TradingExcel excel = new TradingExcel();
BeanUtils.copyProperties(record, excel);
if (ObjectUtil.isNotEmpty(record.getType())) {
switch (record.getType()) {
case "1":
excel.setType("油品");
break;
case "2":
excel.setType("商品");
break;
case "3":
excel.setType("储值卡");
break;
case "4":
excel.setType("积分");
break;
case "5":
excel.setType("囤油卡");
break;
case "6":
excel.setType("油品加商品(收银台订单)");
break;
case "7":
excel.setType("挂账订单");
break;
default:
excel.setType("其他");
break;
}
} else {
excel.setType("其他");
}
tradingExcel.add(excel);
}
// 设置响应头信息
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-disposition", "attachment;filename=demo.xlsx");
try{
// 写入文件数据
EasyExcel.write(response.getOutputStream(), TradingExcel.class).sheet("download").doWrite(tradingExcel);
}catch(Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
@Resource
ISysDeptService iSysDeptService;
@Resource
@ -534,6 +583,50 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
return sysDepts;
}
public void runningWaterByTissueExportExcel(HttpServletResponse response, AllOrderInfoDto order) {
IPage<SysDeptVo> tradingPage = runningWaterByInstituion(new Page(1, 100000), order);
List<InstituionExcel> tradingExcel = new ArrayList<>();
for (SysDeptVo record : tradingPage.getRecords()) {
InstituionExcel excel = new InstituionExcel();
BeanUtils.copyProperties(record, excel);
tradingExcel.add(excel);
}
// 设置响应头信息
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-disposition", "attachment;filename=demo.xlsx");
try{
// 写入文件数据
EasyExcel.write(response.getOutputStream(), InstituionExcel.class).sheet("download").doWrite(tradingExcel);
}catch(Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
public void runningWaterByOilDeptExportExcel(HttpServletResponse response, AllOrderInfoDto order) {
IPage<SysDeptVo> tradingPage = runningWaterByInstituion(new Page(1, 100000), order);
List<OilDepotExcel> tradingExcel = new ArrayList<>();
for (SysDeptVo record : tradingPage.getRecords()) {
OilDepotExcel excel = new OilDepotExcel();
BeanUtils.copyProperties(record, excel);
tradingExcel.add(excel);
}
// 设置响应头信息
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-disposition", "attachment;filename=demo.xlsx");
try{
// 写入文件数据
EasyExcel.write(response.getOutputStream(), OilDepotExcel.class).sheet("download").doWrite(tradingExcel);
}catch(Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
@Override
public IPage<SysDeptVo> runningWaterByNone(Page page, AllOrderInfoDto allOrderInfo) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
@ -612,6 +705,46 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
return runningWaterByDay;
}
public AllOrderInfoVo getRunningWaterByDayData(AllOrderInfoDto allOrderInfo) {
//计算天数
if (!ObjectUtil.isNotEmpty(allOrderInfo.getParams().get("beginTime")) && ObjectUtil.isNotEmpty(allOrderInfo.getParams().get("endTime"))) {
throw new RuntimeException("");
}
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
allOrderInfo.setDeptType("3");
List<SysDeptVo> sysDepts = sysDeptMapper.selectChildrenDeptByIdStore(nowAccountInfo.getDeptId());
allOrderInfo.setStoreIds(sysDepts.stream().map(SysDeptVo::getStoreId).collect(Collectors.toList()));
// 数据查询
AllOrderInfoVo runningWaterByDay = allOrderInfoMapper.getRunningWaterByDayData(allOrderInfo);
return runningWaterByDay;
}
public void runningWaterByDayExportExcel(HttpServletResponse response, AllOrderInfoDto order) {
IPage<AllOrderInfoVo> tradingPage = runningWaterByDay(new Page(1, 100000), order);
List<DayExcel> tradingExcel = new ArrayList<>();
for (AllOrderInfoVo record : tradingPage.getRecords()) {
DayExcel excel = new DayExcel();
BeanUtils.copyProperties(record, excel);
tradingExcel.add(excel);
}
// 设置响应头信息
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-disposition", "attachment;filename=demo.xlsx");
try{
// 写入文件数据
EasyExcel.write(response.getOutputStream(), DayExcel.class).sheet("download").doWrite(tradingExcel);
}catch(Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
@Override
public AllOrderInfoVo runningWaterByData(Page page, AllOrderInfoDto allOrderInfo){
@ -717,7 +850,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
}
private void calculatedMean(SysDeptVo sysDept,long day) {
// 创建 DecimalFormat 对象指定保留两位小数的格式
DecimalFormat df = new DecimalFormat("#.00");
DecimalFormat df = new DecimalFormat("0.00");
// 将字符串转换成数值类型进行计算
double amount = Double.parseDouble(sysDept.getAmount());

View File

@ -49,6 +49,7 @@ import com.fuint.business.order.vo.OilOrderVo;
import com.fuint.business.petrolStationManagement.entity.*;
import com.fuint.business.petrolStationManagement.mapper.OilNumberMapper;
import com.fuint.business.petrolStationManagement.service.*;
import com.fuint.business.printer.service.PrinterService;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.tag.entity.OilTag;
@ -1351,6 +1352,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
private TagUtils tagUtils;
@Resource
private OilTagService oilTagService;
@Resource
private PrinterService printerService;
@Override
public int updateOrderStatus(String orderNo, String status) throws Exception {
@ -1392,6 +1395,16 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
log.info("码牌播报内容111"+content);
hashMap.put("content",content);
tagUtils.voiceBroadcast(hashMap);
// 打印
try{
Map<String, Object> objectObjectHashMap = new HashMap<>();
objectObjectHashMap.put("gunName",oilGun.getGunName());
objectObjectHashMap.put("oilNum",oilName11+oilName.getOilType()+oilOrder.getOilNum()+"");
objectObjectHashMap.put("payAmount",oilOrder.getPayAmount()+"");
printerService.printTagReport(objectObjectHashMap,oilOrder.getStoreId());
}catch (Exception e) {
e.printStackTrace();
}
//tagUtils
if (ObjectUtil.isNotEmpty(oilOrder.getUserId())) integralSettingsService.refuelPoints(oilOrder);
oilOrder.setPayTime(new Date());

View File

@ -0,0 +1,24 @@
package com.fuint.business.order.vo.Excel;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class DayExcel {
@ExcelProperty("日期")
private Date payTime;
@ExcelProperty("活跃门店数量")
private String storeCount;
@ExcelProperty("交易金额")
private String amount;
@ExcelProperty("交易笔数")
private String strokeCount;
@ExcelProperty("笔单价")
private String unitPrice;
@ExcelProperty("日均交易金额")
private String dailyAmount;
@ExcelProperty("日均交易笔数")
private String strokesPerDay;
}

View File

@ -0,0 +1,27 @@
package com.fuint.business.order.vo.Excel;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
@Data
public class InstituionExcel {
@ExcelProperty("机构编号")
private Long deptId ;
@ExcelProperty("机构名称")
private String deptName ;
@ExcelProperty("活跃门店数量")
private String inertiaStore ;
@ExcelProperty("交易金额")
private String amount ;
@ExcelProperty("交易笔数")
private String strokeCount ;
@ExcelProperty("笔单价")
private String unitPrice ;
@ExcelProperty("日均交易金额")
private String dailyAmount ;
@ExcelProperty("日均交易笔数")
private String strokesPerDay;
}

View File

@ -0,0 +1,30 @@
package com.fuint.business.order.vo.Excel;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
@Data
public class OilDepotExcel {
@ExcelProperty("门店编号")
private Long deptId;
@ExcelProperty("门店名称")
private String deptName;
@ExcelProperty("门店省市")
private String addr;
@ExcelProperty("交易金额")
private String amount;
@ExcelProperty("交易笔数")
private String strokeCount;
@ExcelProperty("笔单价")
private String unitPrice;
@ExcelProperty("日均交易金额")
private String dailyAmount;
@ExcelProperty("日均交易笔数")
private String strokesPerDay;
@ExcelProperty("机构编号")
private Long parentStoreId;
@ExcelProperty("机构名称")
private String parentStoreName;
@ExcelProperty("站长")
private String leaderName;
}

View File

@ -0,0 +1,41 @@
package com.fuint.business.order.vo.Excel;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class TradingExcel {
@ExcelProperty("支付时间")
private Date payTime; // 支付时间
@ExcelProperty("订单号")
private String orderNo; // 订单号
@ExcelProperty("门店")
private String storeName; // 门店
@ExcelProperty("收银员")
private String createBy; // 收银员
@ExcelProperty("支付渠道")
private String payChannel; // 支付渠道
@ExcelProperty("商户号")
private String mchntCd; // 商户号
@ExcelProperty("费率")
private String amount; // 费率
@ExcelProperty("订单来源")
private String type; // 订单来源
@ExcelProperty("支付方式")
private String payType; // 支付方式
@ExcelProperty("支付状态")
private String status; // 支付状态
@ExcelProperty("订单金额")
private Double goodsMoney; // 订单金额
@ExcelProperty("优惠后应付金额")
private Double payMoney; // 优惠后应付金额
@ExcelProperty("退款金额")
private Double refMoney; // 退款金额
@ExcelProperty("付款用户")
private String userName; // 付款用户
@ExcelProperty("备注")
private String content; //
}

View File

@ -24,6 +24,8 @@ public interface PrinterService {
void getHandover(Map<String, Object> handover,Integer storeId);
void oilOrderReport(Map<String, Object> handover,Integer storeId);
void reOilOrderReport(Map<String, Object> oilOrder, Integer storeId);
void printTagReport(Map<String, Object> integral,Integer storeId);
void printCardValueReport(Map<String, Object> printCardValue,Integer storeId);
void printFuelDieselReport(Map<String, Object> printCardValue,Integer storeId);

View File

@ -310,6 +310,39 @@ public class PrinterServiceImpl implements PrinterService {
String url=m.print(infoByStoreId.getMachineCode(), PrintIntegralReport.printIntegral(), "Z"+System.currentTimeMillis()+random6.toString());
}
public void printTagReport(Map<String, Object> integral,Integer storeId) {
PrintDeviceInfo infoByStoreId = printDeviceInfoMapper.getInfoByStoreId(storeId);
log.info("handover:{}",integral.toString());
Methods m=Methods.getInstance();
Object accessToken = RedisUtil.get("scancodemodel+" + storeId);
if (ObjectUtil.isNotEmpty(accessToken)) {
m.init(accessToken.toString());
} else {
String token = getToken(storeId);
if ("error".equals(token)) {
throw new RuntimeException("获取参数失败,无法打印");
}else {
m.init(token);
}
}
m.init(infoByStoreId.getAppKey(), infoByStoreId.getAppSecret());
// PrintIntegralReport.setHandover(integral);
StringBuilder sb=new StringBuilder();
sb.append("<center>收款码打印\r\n</center>");
sb.append("------------------------------------\r\n");
sb.append("油枪:¥"+integral.get("gunName")+"\r\n");
sb.append("升数:¥"+integral.get("oilNum")+"\r\n");
sb.append("价格:¥"+integral.get("payAmount")+"\r\n");
sb.append("------------------------------------\r\n");
sb.append("<center>谢谢惠顾,欢迎下次光临!</center>");
Integer random6 = (int) ((Math.random() * 9 + 1) * 100000);
String url=m.print(infoByStoreId.getMachineCode(), sb.toString(), "Z"+System.currentTimeMillis()+random6.toString());
}
public void verifySign(String ciphertext, String signature) {
// 交易报文中ciphertext与signature

View File

@ -62,7 +62,7 @@ public class PrintOilOrderReport {
}
if (ObjectUtil.isNotEmpty(handover.get("consumeRefuelMoney"))) {
sb.append("囤油卡付款:"+handover.get("consumeRefuelMoney")+"\r\n");
sb.append("囤油卡付款:"+handover.get("consumeRefuelMoney")+"L\r\n");
sb.append("------------------------------------\r\n");
}

View File

@ -39,7 +39,7 @@ public class RePrintOilOrderReport {
}
sb.append("支付方式:"+handover.get("payType")+"\r\n");
sb.append("支付方式:"+handover.get("payType")+"\r\n");
if (ObjectUtil.isNotEmpty(handover.get("amount"))) {
@ -63,6 +63,23 @@ public class RePrintOilOrderReport {
}
if (ObjectUtil.isNotEmpty(handover.get("type")) && "2".equals(handover.get("type"))) {
if (ObjectUtil.isNotEmpty(handover.get("balanceAmount"))) {
sb.append("储值卡:¥"+handover.get("balanceAmount")+"\r\n");
sb.append("--------------------------------\r\n");
}
if (ObjectUtil.isNotEmpty(handover.get("oilCardAmount"))) {
sb.append("屯油卡:"+handover.get("oilCardAmount")+"L\r\n");
sb.append("--------------------------------\r\n");
}
if (ObjectUtil.isNotEmpty(handover.get("calculateRefundsV"))) {
sb.append("退款:¥"+handover.get("calculateRefundsV")+"\r\n");
sb.append("--------------------------------\r\n");
}
}
sb.append("<center>谢谢惠顾,欢迎下次光临!</center>");
return sb.toString();

View File

@ -108,6 +108,11 @@ public class LJStoreController extends BaseController {
public ResponseObject isRecharge(){
return getSuccessResult(true);
}
@GetMapping("/ifRefPass")
public ResponseObject ifRefPass(String refPass){
boolean b = storeService.ifRefPass(refPass);
return getSuccessResult(b);
}
// /**
// * 修改等级规则信息
@ -118,4 +123,7 @@ public class LJStoreController extends BaseController {
// public ResponseObject updateRule(@Validated @RequestBody Map<String,String> map){
// return getSuccessResult(storeService.updateStoreRule(map));
// }
/**
* 判断密码
*/
}

View File

@ -87,6 +87,7 @@ public class LJStore extends BaseEntity implements Serializable {
@ApiModelProperty("是否删除")
private String ifDelete;
private String refPass;
@TableField(exist = false)
private List<String> welfareList;

View File

@ -79,4 +79,6 @@ public interface ILJStoreService extends IService<LJStore> {
// 假删除店铺
boolean ifDeleteByDeptId(Long deptId);
boolean ifRefPass(String refPass);
}

View File

@ -286,4 +286,17 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
int affectedRows = baseMapper.update(null, updateWrapper);
return affectedRows>0;
}
public boolean ifRefPass(String refPass) {
LJStore ljStore = selectStoreById();
if (ObjectUtil.isNotEmpty(ljStore)) {
if (ObjectUtil.isEmpty(refPass) && ObjectUtil.isEmpty(ljStore.getRefPass())) {
return true;
}
if (ObjectUtil.isEmpty(ljStore.getRefPass())) return false;
if (ObjectUtil.isEmpty(refPass)) return false;
if (refPass.equals(ljStore.getRefPass())) return true;
}
return false;
}
}

View File

@ -2,16 +2,21 @@ package com.fuint.business.tag.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.order.vo.AllOrderInfoVo;
import com.fuint.business.order.vo.Excel.DayExcel;
import com.fuint.business.tag.entity.OilTag;
import com.fuint.business.tag.entity.TagCodeRecord;
import com.fuint.business.tag.service.OilTagService;
import com.fuint.business.tag.service.TagCodeRecordService;
import com.fuint.business.tag.util.TagUtils;
import com.fuint.business.tag.vo.OilTagVO;
import com.fuint.business.tag.vo.OilTagVoExcel;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.framework.web.BaseController;
@ -21,6 +26,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
@ -60,7 +66,10 @@ public class OilTagController extends BaseController {
if (ObjectUtils.isNotEmpty(oilTag.getTagCodeSn())){
queryWrapper.eq(OilTag::getTagCodeSn,oilTag.getTagCodeSn());
}
queryWrapper.eq(OilTag::getDeptId,nowAccountInfo.getDeptId());
// queryWrapper.eq(OilTag::getDeptId,nowAccountInfo.getDeptId());
// FIND_IN_SET
queryWrapper.apply("FIND_IN_SET('" + nowAccountInfo.getDeptId() + "', dept_ids)");
if (ObjectUtils.isNotEmpty(oilTag.getSnCode())){
queryWrapper.eq(OilTag::getSnCode,oilTag.getSnCode());
}
@ -120,6 +129,31 @@ public class OilTagController extends BaseController {
return getSuccessResult(this.oilTagService.updateById(oilTag));
}
@PostMapping("export")
public void export(HttpServletResponse response,@RequestBody OilTag oilTag) {
ResponseObject responseObject = selectAll(1, 100000, oilTag);
IPage<OilTagVO> data = (IPage<OilTagVO>) responseObject.getData();
List<OilTagVoExcel> tradingExcel = new ArrayList<>();
for (OilTagVO record : data.getRecords()) {
OilTagVoExcel excel = new OilTagVoExcel();
BeanUtils.copyProperties(record, excel);
tradingExcel.add(excel);
}
// 设置响应头信息
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-disposition", "attachment;filename=demo.xlsx");
try{
// 写入文件数据
EasyExcel.write(response.getOutputStream(), OilTagVoExcel.class).sheet("download").doWrite(tradingExcel);
}catch(Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
/**
* 删除数据
*
@ -157,5 +191,6 @@ public class OilTagController extends BaseController {
TagCodeRecord one1 = tagCodeRecordService.getOne(queryWrapper1);
return getSuccessResult(one1);
}
}

View File

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.tag.dto.TagCodeDTO;
import com.fuint.business.tag.entity.OilTag;
import com.fuint.business.tag.entity.TagCode;
import com.fuint.business.tag.service.TagCodeService;
import com.fuint.common.dto.AccountInfo;
@ -92,13 +93,19 @@ public class TagCodeController extends BaseController {
public ResponseEntity<InputStreamResource> insert(@RequestBody TagCodeDTO tagCodeDTO ,HttpServletRequest request, HttpServletResponse response) throws Exception {
return this.tagCodeService.add(tagCodeDTO,request,response);
}
@PostMapping("exportZip")
public ResponseEntity<InputStreamResource> exportZip(@RequestBody TagCodeDTO tagCodeDTO ,HttpServletRequest request, HttpServletResponse response) throws Exception {
return this.tagCodeService.exportZip(tagCodeDTO,request,response);
}
/**
* 修改数据
*
* @param tagCode 实体对象
* @return 修改结果
*/
/**
* 修改数据
*
* @param tagCode 实体对象
* @return 修改结果
*/
@PutMapping
public ResponseObject update(@RequestBody TagCode tagCode) {
return getSuccessResult(this.tagCodeService.updateById(tagCode));

View File

@ -10,4 +10,5 @@ import java.util.List;
public class TagCodeRecordDTO extends TagCodeRecord implements Serializable {
private List<Integer> oilTagList;
private String status;
private Long deptId;
}

View File

@ -25,6 +25,7 @@ public class OilTag extends Model<OilTag> {
//二维码id
private Integer tagCodeId;
private Integer deptId;
private String deptIds;
//二维码SN号
private String tagCodeSn;
//厂家名字

View File

@ -19,5 +19,6 @@ import java.io.FileNotFoundException;
public interface TagCodeService extends IService<TagCode> {
ResponseEntity<InputStreamResource> add(TagCodeDTO tagCodeDTO, HttpServletRequest request, HttpServletResponse response) throws Exception;
ResponseEntity<InputStreamResource> exportZip(TagCodeDTO tagCodeDTO, HttpServletRequest request, HttpServletResponse response) throws Exception;
}

View File

@ -51,6 +51,7 @@ public class OilTagServiceImpl extends ServiceImpl<OilTagMapper, OilTag> impleme
LambdaQueryWrapper<OilTag> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(OilTag::getTagCodeSn, oilTag.getTagCodeSn());
queryWrapper1.eq(OilTag::getTagCodeId, oilTag.getTagCodeId());
OilTag one = getOne(queryWrapper1);
if (ObjectUtils.isNotEmpty(one)){
throw new Exception("该二维码已绑定过码牌");

View File

@ -24,6 +24,8 @@ import com.fuint.common.service.StaffService;
import com.fuint.common.util.TokenUtil;
import com.fuint.framework.exception.BusinessCheckException;
import com.fuint.repository.model.MtStaff;
import com.fuint.system.dept.entity.SysDept;
import com.fuint.system.dept.service.ISysDeptService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -55,13 +57,30 @@ public class TagCodeRecordServiceImpl extends ServiceImpl<TagCodeRecordMapper, T
@Resource
private TagCodeService tagCodeService;
@Resource
ISysDeptService iSysDeptService;
@Override
@Transactional
public boolean add(TagCodeRecordDTO tagCodeRecordDTO) throws Exception {
boolean flag = false;
//绑定之前 先去查询
TagCodeRecord tagCodeRecord = new TagCodeRecord();
if (ObjectUtils.isNotEmpty(tagCodeRecordDTO) && CollectionUtils.isNotEmpty(tagCodeRecordDTO.getOilTagList())){
if (ObjectUtils.isEmpty(tagCodeRecordDTO.getDeptId())) throw new Exception("请选择组织!");
// 判断是不是油站
SysDept sysDepts = iSysDeptService.getById(tagCodeRecordDTO.getDeptId());
// 非油站不添加
if (!"3".equals(sysDepts.getDeptType())) {
OilTag byId = oilTagService.getById(tagCodeRecordDTO.getOilTagList().get(0));
byId.setDeptIds(byId.getDeptIds()+","+tagCodeRecordDTO.getDeptId());
oilTagService.updateById(byId);
return true;
}
for (Integer integer : tagCodeRecordDTO.getOilTagList()) {
//码牌配置

View File

@ -1,5 +1,6 @@
package com.fuint.business.tag.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.member.utils.QrCodeUtils;
@ -11,7 +12,9 @@ import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.DateUtil;
import com.fuint.common.util.TokenUtil;
import com.fuint.module.backendApi.controller.BackendFileController;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.core.io.InputStreamResource;
import org.springframework.http.ResponseEntity;
import org.springframework.mock.web.MockMultipartFile;
@ -139,6 +142,125 @@ public class TagCodeServiceImpl extends ServiceImpl<TagCodeMapper, TagCode> impl
//return flag;
}
@Autowired
private Environment env;
@Override
@Transactional
public ResponseEntity<InputStreamResource> exportZip(TagCodeDTO tagCodeDTO, HttpServletRequest request, HttpServletResponse response) throws Exception {
String mode = env.getProperty("images.root");
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LambdaQueryWrapper<TagCode> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TagCode::getDeptId,nowAccountInfo.getDeptId());
List<TagCode> tagCodes = this.baseMapper.selectList(queryWrapper);
Random random1 = new Random();
int i2 = random1.nextInt(1000);
String urls = "/temp/tagCode/"+ DateUtil.formatDate(new Date(), "yyyyMMdd") + "-"+i2;
File file1 = new File(urls);
// 判断目录是否存在
if (!file1.exists()) {
file1.mkdirs();
}
// 遍历原文件的目录转移到新的文件夹
for (TagCode tagCode : tagCodes) {
// 假设每个 TagCode 对象中有一个 filePath 字段指示文件路径
File originalFile = new File(mode+tagCode.getImageUrl());
File newFile = new File(file1, tagCode.getTagCodeSn()+".jpg");
try {
if (originalFile.exists()) {
FileUtils.copyFile(originalFile, newFile);
}
} catch (IOException e) {
e.printStackTrace();
return ResponseEntity.status(500).body(null);
}
}
// 将新文件夹压缩下载
List<File> imageFiles = getImageFiles(urls);
InputStream zipInputStream = createZipInputStream(imageFiles);
response.setHeader("Content-Disposition", "attachment; filename=\"images.zip\"");
return ResponseEntity.ok()
.body(new InputStreamResource(zipInputStream));
// boolean flag = false;
// if (ObjectUtils.isNotEmpty(tagCodeDTO) && ObjectUtils.isNotEmpty(tagCodeDTO.getTotal())){
// int total = tagCodeDTO.getTotal();
// Random random1 = new Random();
// int i2 = random1.nextInt(1000);
// for (int i = 0; i < total; i++) {
// Random random = new Random();
// int i1 = random.nextInt(90000000);
// //String url = "https://oil.youkerr.com/";
// String url = "https://www.tuofeng.cc/oilRefuel?sn=byx"+i1;
// // String finalPath="/temp/qrCode/" + oilTag.getSnCode() + ".jpg";
// //String finalPath="D:\\office\\document\\photos\\tagCode\\"+"str"+i+".jpg";
// //String finalPath="/temp/tagCode/" + "byx"+i1 + ".jpg";
// //String finalPath="/temp/tagCode/"+ DateUtil.formatDate(new Date(), "yyyyMMdd") + "/"+i2 + "byx"+i1 + ".jpg";
//
// TagCode tagCode = new TagCode();
//
// tagCode.setCollection(url);
// tagCode.setTagCodeSn("byx"+i1);
// tagCode.setDeptId(Integer.parseInt(nowAccountInfo.getDeptId().toString()));
//
// //在图片上生成二维码
// String backgroundImage = "static/qrCodeImg/huanyingguanglin.jpg";
// InputStream backgroundStream = this.getClass().getClassLoader().getResourceAsStream(backgroundImage);
// String urls = "";
// urls = "/temp/tagCode/"+ DateUtil.formatDate(new Date(), "yyyyMMdd") + "-"+i2;
// File file1 = new File(urls);
// // String finalPath="/temp/tagCode/" + "byx"+i1 + ".jpg";
// String finalPath=urls+"/" + "byx"+i1 + ".jpg";
// qrCodeUtils.createLogoCodePictures(null, url, finalPath, null,null,urls);
//
//
// // 判断目录是否存在
// if (!file1.exists()) {
// file1.mkdirs();
// }
//
// File file =new File(finalPath);
// FileInputStream fileInputStream =new FileInputStream(file);
// // FileInputStream fileInputStream =new FileInputStream(file1);
// MultipartFile resFile = new MockMultipartFile("file", file.getName(), null, fileInputStream);
//// 返回图片路径
// String saveFile = backendFileController.saveFile(resFile);
// //return saveFile;
// tagCode.setImageUrl(saveFile);
// flag = save(tagCode);
// }
//
// //导出码牌
// //String IMAGE_DIRECTORY = "D:\\temp\\tagCode\\"+DateUtil.formatDate(new Date(), "yyyyMMdd")+"-"+i2;
// String IMAGE_DIRECTORY = "/temp/tagCode/"+DateUtil.formatDate(new Date(), "yyyyMMdd")+"-"+i2;
//
// List<File> imageFiles = getImageFiles(IMAGE_DIRECTORY);
// InputStream zipInputStream = createZipInputStream(imageFiles);
//
// response.setHeader("Content-Disposition", "attachment; filename=\"images.zip\"");
//
// return ResponseEntity.ok()
// .body(new InputStreamResource(zipInputStream));
// }else {
// InputStream inputStream = new InputStream() {
// @Override
// public int read() throws IOException {
// return 0;
// }
// };
// return ResponseEntity.ok()
// .body(new InputStreamResource(inputStream));
// }
//String IMAGE_DIRECTORY = "D:\\temp\\qrCode\\DateUtil.formatDate(new Date(), \"yyyyMMdd\") +";
}
private List<File> getImageFiles(String directory) {
ArrayList<File> objects = new ArrayList<>();
File imageDir = new File(directory);

View File

@ -0,0 +1,51 @@
package com.fuint.business.tag.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@Data
public class OilTagVoExcel {
//店铺名字
@ExcelProperty("店铺名字")
private String storeName;
//主键id
// private Integer id;
//二维码id
// private Integer tagCodeId;
//二维码SN号
@ExcelProperty("二维码SN号")
private String tagCodeSn;
//厂家名字
@ExcelProperty("厂家名字")
private String companyName;
//码牌SN号
@ExcelProperty("码牌SN号")
private String snCode;
//终端号
@ExcelProperty("终端号")
private String terminalNumber;
// //是否已绑定油站 0未绑定 1已绑定
// @ExcelProperty("店铺名字")
// private String status;
// //是否已绑定员工 0未绑定 1已绑定
// @ExcelProperty("店铺名字")
// private String mtStatus;
//创建者
// private String createBy;
//创建时间
@ExcelProperty("创建时间")
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date createTime;
//更新者
// @ExcelProperty("店铺名字")
// private String updateBy;
//更新时间
@ExcelProperty("更新时间")
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date updateTime;
}

View File

@ -185,4 +185,13 @@ public class SysDeptController extends BaseController
return getSuccessResult(deptService.isTopLevelNodes(deptId));
}
@GetMapping("/getListByParentId")
public ResponseObject getListByParentId() {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
// SysDept sysDept = deptService.selectDeptById(nowAccountInfo.getDeptId());
return getSuccessResult(deptService.selectDeptLists(nowAccountInfo.getDeptId()));
}
}

View File

@ -51,6 +51,7 @@ public interface SysDeptMapper extends BaseMapper<SysDept>
IPage<SysDeptVo> selectChildrenDeptById2(@Param("page") Page page, @Param("ancestors") Long ancestors, @Param("deptId") Long deptId, @Param("deptType") String deptType);
List<SysDeptVo> selectChildrenDeptByIdStore(@Param("deptId") Long deptId);
// SysDeptVo selectDeptByIdStoreByData(@Param("deptId") Long deptId);
SysDeptVo getStoreByDept(@Param("deptId") Long deptId);
/**

View File

@ -141,5 +141,7 @@ public interface ISysDeptService extends IService<SysDept>
boolean isTopLevelNodes(Integer deptId);
// boolean getListByParentId(Integer deptId);
int getMaxNumber(SysDept dept);
}

View File

@ -24,3 +24,12 @@ export function updateStore(data) {
data: data
})
}
// 修改店铺信息
export function ifRefPassApi(query) {
return request({
url: '/business/storeInformation/store/ifRefPass',
method: 'get',
params: query
})
}

View File

@ -178,7 +178,7 @@
type="primary" plain round>补打</el-button>
<el-button style="width: 60px" size="mini"
v-if = "scope.row.status === 'paid'"
@click="handleRefund(scope.row.id)"
@click="refHandleRefund(scope.row.id)"
type="danger" plain round>退款</el-button>
</template>
</el-table-column>
@ -330,6 +330,25 @@
</div>
</el-dialog>
<!-- 订单退款-->
<el-dialog
:close-on-click-modal="false"
title="订单退款"
width="25%"
:visible.sync="refDialogRefund">
<div style="margin: 10px 0">
退款密码<br/>
</div>
<div>
<el-input placeholder="请输入退款密码" v-model="refPass" show-password></el-input>
<br/>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="refDialogRefund = false"> </el-button>
<el-button type="primary" @click="refHandleRefundByif()"> </el-button>
</span>
</el-dialog>
<el-dialog
:close-on-click-modal="false"
title="订单退款"
@ -524,6 +543,7 @@ import {getOilNumberGun} from "@/api/cashier/oilGuns";
import {formatDate} from "@/utils";
import ScanPayCodeDialog from "@/views/cashier/components/scanPayCodeDialog.vue";
import {rePrintOilOrderReport} from "@/api/print";
import {ifRefPassApi} from "@/api/staff/store";
export default {
name: "order_Cashier",
@ -533,6 +553,7 @@ import {rePrintOilOrderReport} from "@/api/print";
calculateRefundsV:0,
// 退
refundRemark:"",
refPass:"",
radio1:"油号选错",
//
oilNameList:[],
@ -546,6 +567,7 @@ import {rePrintOilOrderReport} from "@/api/print";
loading:false,
dialogVisible:false,
dialogRefund:false,
refDialogRefund:false,
//
staffList:[],
//
@ -578,6 +600,7 @@ import {rePrintOilOrderReport} from "@/api/print";
},
total:0,
seekZeroAmount:0,
getId:""
}
},
created() {
@ -772,8 +795,7 @@ import {rePrintOilOrderReport} from "@/api/print";
'oilCard': '囤油卡',
'balance': '储值卡'
};
let payTypeText = payTypeMap[this.payType] || '小程序码';
console.log("111111111111111111111111113")
let payTypeText = payTypeMap[this.cashierOrder.payType] || '小程序码';
let f ={
oilOrder:oilOrderR,
@ -781,13 +803,72 @@ import {rePrintOilOrderReport} from "@/api/print";
payType:payTypeText,
amount:this.cashierOrder.amount,
payAmount:this.cashierOrder.amount,
seekZero:this.cashierOrder.payAmount
seekZero:this.cashierOrder.seekZero
}
rePrintOilOrderReport(f).then(res=>{
})
},
//
reoilOrderReport () {
let oilOrderR = []
this.oilInfo.forEach(order=>{
let o = {
oilName : this.getName(this.oilNameList, order.oils) + "-" + this.getName1(this.oilGunList, order.oilGunNum),
amount : order.orderAmount.toString(),
oilNum : order.oilNum.toString()
}
oilOrderR.push(o)
})
console.log("111111111111111111111111111")
let goodsOrderR = []
if (this.goodsInfo) {
this.goodsInfo.forEach(order=>{
console.log("111111111111111111111111111")
let o = {
oilName : order.name,
unit : order.num+""+order.unit,
amount : order.memberPrice.toString()
}
goodsOrderR.push(o)
})
}
//
const payTypeMap = {
'CASH': '现金',
'WECHAT': '微信',
'ALIPAY': '支付宝',
'UNIONPAY': '银联二维码',
'credit': '挂账',
'oilCard': '囤油卡',
'balance': '储值卡'
};
let payTypeText = payTypeMap[this.cashierOrder.payType] || '小程序码';
let f ={
oilOrder:oilOrderR,
goodsOrder:goodsOrderR,
payType:payTypeText,
amount:this.cashierOrder.amount,
payAmount:this.cashierOrder.amount,
seekZero:this.cashierOrder.payAmount,
balanceAmount:this.oilInfo[0].balanceAmount,//
oilCardAmount:this.oilInfo[0].oilCardAmount,//
calculateRefundsV:this.calculateRefundsV,
type : "2",
}
rePrintOilOrderReport(f).then(res=>{
})
},
//
patchwork(data){
const orderNo = data.orderNo
@ -804,7 +885,29 @@ import {rePrintOilOrderReport} from "@/api/print";
this.oilOrderReport()
}).catch(() => {});
},
// 退
async refHandleRefundByif(id){
this.refDialogRefund = true;
await ifRefPassApi({refPass:this.refPass}).then(res=>{
if (res.data) {
this.handleRefund(this.getId)
this.refDialogRefund = false;
} else {
this.$message({
type: 'info',
message: '密码错误'
});
}
})
},
async refHandleRefund(id){
this.getId = id,
this.refPass = ""
this.refDialogRefund = true;
},
// 退
async handleRefund(id){
this.dialogRefund = true;
await cashierOrder(id).then( response => {
@ -906,7 +1009,8 @@ import {rePrintOilOrderReport} from "@/api/print";
message: '退款成功'
});
// this.printLocally()
this.oilOrderReport()
this.reoilOrderReport()
}
})
@ -916,6 +1020,7 @@ import {rePrintOilOrderReport} from "@/api/print";
this.getList();
// this.getOrderStatistics();
this.getStaffList();
// this.oilOrderReport()
},
//

View File

@ -186,7 +186,7 @@
type="primary" plain round>补打</el-button>
<el-button style="width: 60px" size="mini"
v-if = "scope.row.status === 'paid'"
@click="handleRefund(scope.row.id)"
@click="refHandleRefund(scope.row.id)"
type="danger" plain round>退款</el-button>
</template>
</el-table-column>
@ -204,7 +204,25 @@
@current-change="getList">
</el-pagination>
</div>
<!-- 订单退款-->
<el-dialog
:close-on-click-modal="false"
title="订单退款"
width="25%"
:visible.sync="refDialogRefund">
<div style="margin: 10px 0">
退款密码<br/>
</div>
<div>
<el-input placeholder="请输入退款密码" v-model="refPass" show-password></el-input>
<br/>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="refDialogRefund = false"> </el-button>
<el-button type="primary" @click="refHandleRefundByif()"> </el-button>
</span>
</el-dialog>
<!-- 订单退款-->
<el-dialog
:close-on-click-modal="false"
@ -313,6 +331,7 @@ import {cashierOrder} from "@/api/cashier/cashierorder";
import {refundApi, getOrderInfoApi} from "@/api/cashier/refund";
import {connectFlag, getLodop} from "@/api/LodopFuncs";
import {rePrintOilOrderReport} from "@/api/print";
import {ifRefPassApi} from "@/api/staff/store";
export default {
name: "order_Cashier",
@ -353,6 +372,7 @@ export default {
//
payList:[],
dialogRefund: false,
refDialogRefund: false,
radio1:"油号选错",
goods:{},
refundRemark:"",
@ -368,6 +388,9 @@ export default {
},
//
isSysDate:false,
refPass:"",
getId:"",
}
},
created() {
@ -518,7 +541,8 @@ export default {
'UNIONPAY': '银联二维码',
'credit': '挂账',
'oilCard': '囤油卡',
'balance': '储值卡'
'balance': '储值卡',
'0': '兑换卷核销'
};
let payTypeText = payTypeMap[this.goods.payType] || '小程序码';
@ -534,7 +558,7 @@ export default {
})
},
//
//
patchwork(data){
const orderNo = data.orderNo
this.$modal.confirm('确定您要补打当前订单吗?当前订单号[' + orderNo + '],请确保云打印机正在运行中').then(function() {
@ -552,6 +576,27 @@ export default {
}).catch(() => {});
},
async refHandleRefundByif(id){
this.refDialogRefund = true;
await ifRefPassApi({refPass:this.refPass}).then(res=>{
if (res.data) {
this.handleRefund(this.getId)
this.refDialogRefund = false;
} else {
this.$message({
type: 'info',
message: '密码错误'
});
}
})
},
async refHandleRefund(id){
this.getId = id,
this.refPass = ""
this.refDialogRefund = true;
},
// 退
async handleRefund(id){

View File

@ -536,7 +536,7 @@
'oilCard': '囤油卡',
'balance': '储值卡'
};
let payTypeText = payTypeMap[this.payType] || '小程序码';
let payTypeText = payTypeMap[this.oilOrder.payType] || '小程序码';
let f ={
oilOrder:oilOrderR,