Merge remote-tracking branch 'origin/master'

# Conflicts:
#	fuintAdmin_zt/src/views/Site/index.vue
This commit is contained in:
齐天大圣 2024-03-22 09:34:15 +08:00
commit 443e3888f7
65 changed files with 1390 additions and 180 deletions

View File

@ -0,0 +1,35 @@
import request from '@/utils/request'
// 分页查询角色信息
export function dutyList(query) {
return request({
url: '/business/member/duty',
method: 'get',
params: query
})
}
// 分页查询角色信息
export function dutyLists(query) {
return request({
url: '/business/member/duty/dutys',
method: 'get',
params: query
})
}
// 根据id删除角色信息
export function dutyDelete(id) {
return request({
url: '/business/member/duty/'+id,
method: 'delete',
})
}
// 根据id删除角色信息
export function dutyEdit(data) {
return request({
url: '/business/member/duty',
method: 'put',
data: data
})
}

View File

@ -18,10 +18,11 @@ export function getMenu(menuId) {
}
// 查询菜单下拉树结构
export function treeselect() {
export function treeselect(params) {
return request({
url: 'backendApi/source/treeselect',
method: 'get'
method: 'get',
params: params
})
}

View File

@ -0,0 +1,361 @@
<template>
<div class="app-container">
<el-card>
<el-form :model="queryParams1" ref="queryForm" size="small" :inline="true" label-width="100px">
<el-form-item label="角色名称" prop="dutyName">
<el-input
v-model="queryParams1.dutyName"
placeholder="请输入角色名称"
clearable
@keyup.enter.native="handleQuery1"
/>
</el-form-item>
<el-form-item label="角色状态" prop="status">
<el-select
v-model="queryParams1.status"
placeholder="全部"
clearable
>
<el-option label="启用" value="A"></el-option>
<el-option label="禁用" value="D"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery1">查询</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="handleAdd1"
>新增
</el-button>
</el-col>
</el-row>
<el-table ref="tables"
v-loading="loading"
:data="dutyList">
<el-table-column label="序号" align="center" type="index" width="50"></el-table-column>
<el-table-column label="角色名称" align="center" prop="dutyName" />
<!-- <el-table-column label="角色类型" align="center" prop="dutyType" >-->
<!-- <template slot-scope="scope">-->
<!-- <span v-if="scope.row.dutyType=='1'">超级管理员</span>-->
<!-- <span v-if="scope.row.dutyType=='2'">普通管理员</span>-->
<!-- <span v-if="scope.row.dutyType=='3'">用户角色</span>-->
<!-- <span v-if="scope.row.dutyType=='3'">员工角色</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="所属机构" align="center" prop="deptName" />
<el-table-column label="角色状态" align="center" prop="status" >
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
active-value="A"
inactive-value="N"
@change="handleStatusChangeDuty(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="角色描述" align="center" prop="description" >
<template slot-scope="scope">
{{scope.row.description || "--"}}
</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="handleUpdate1(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete1(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total1>0"
:total="total1"
:page.sync="queryParams1.page"
:limit.sync="queryParams1.pageSize"
@pagination="getDutyList"
/>
</el-card>
<!-- 添加或修改角色配置对话框 -->
<el-dialog :title="title" :visible.sync="openDuty" width="700px" append-to-body>
<el-form ref="form1" :model="form1" :rules="rules1" label-width="100px">
<el-form-item label="角色名称" prop="roleName">
<el-input v-model="form1.roleName" @input="$forceUpdate()" style="width: 300px" placeholder="请输入角色名称" />
</el-form-item>
<!-- <el-form-item label="角色类型" prop="roleType">-->
<!-- <el-select-->
<!-- v-model="form1.roleType"-->
<!-- placeholder="角色类型"-->
<!-- @change="changeMenu"-->
<!-- style="width: 300px"-->
<!-- >-->
<!-- <el-option key="1" label="超级管理员" value="1"/>-->
<!-- <el-option key="2" label="普通管理员" value="2"/>-->
<!-- <el-option key="3" label="用户角色" value="3"/>-->
<!-- <el-option key="3" label="员工角色" value="3"/>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="状态">
<el-radio-group v-model="form1.status">
<el-radio key="A" label="A" value="A">启用</el-radio>
<el-radio key="N" label="N" value="N">禁用</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="菜单权限">
<el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>
<el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox>
<el-checkbox v-model="form1.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox>
<el-tree
class="tree-border"
:data="menuOptions"
show-checkbox
ref="menu"
node-key="id"
:check-strictly="!form1.menuCheckStrictly"
empty-text="加载中,请稍候"
:props="defaultProps1"
></el-tree>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form1.description" type="textarea" placeholder="请输入备注信息"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm1"> </el-button>
<el-button @click="cancel1"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {dutyDelete, dutyEdit, dutyList} from "@/api/duty/duty";
import {addRole, getRole, updateRole} from "@/api/system/role";
import {treeselect} from "@/api/system/menu";
export default {
data(){
return {
queryParams1:{
page:1,
pageSize:10,
// id使
storeId:"",
},
title:"",
total1:0,
dutyList:[],
//
loading: true,
openDuty:false,
menuExpand: false,
menuNodeAll: false,
//
menuOptions: [],
defaultProps1: {
children: "childrens",
label: "label"
},
form1: { id: '', status: 'A', roleType: '4', description: '' },
rules1: {
roleName: [
{ required: true, message: "角色名称不能为空", trigger: "blur" }
],
// roleType: [
// { required: true, message: "", trigger: "blur" }
// ]
},
}
},
created() {
this.getDutyList()
},
methods:{
//
changeMenu(){
console.log(this.form1.roleType)
if (this.form1.roleType == '4'){
this.getMenuTreeselect(2);
}
if (this.form1.roleType == '3'){
this.getMenuTreeselect(1);
}
},
//
reset1() {
if (this.$refs.menu != undefined) {
this.$refs.menu.setCheckedKeys([]);
}
this.menuExpand = false,
this.menuNodeAll = false,
this.form1 = {
id: undefined,
roleName: '',
roleType: '3',
status: "A",
menuIds: [],
menuCheckStrictly: true,
description: ''
};
this.resetForm("form1");
},
//
cancel1() {
this.openDuty = false;
this.reset1();
},
submitForm1: function() {
this.$refs["form1"].validate(valid => {
if (valid) {
if (this.form1.dutyId) {
this.form1.menuIds = this.getMenuAllCheckedKeys();
updateRole(this.form1).then(response => {
this.$modal.msgSuccess("修改成功");
this.openDuty = false;
this.getDutyList();
});
} else {
this.form1.storeId = '-1';
this.form1.menuIds = this.getMenuAllCheckedKeys();
addRole(this.form1).then(response => {
this.$modal.msgSuccess("新增成功");
this.openDuty = false;
this.getDutyList();
});
}
}
});
},
//
getMenuAllCheckedKeys() {
//
let checkedKeys = this.$refs.menu.getCheckedKeys();
//
let halfCheckedKeys = this.$refs.menu.getHalfCheckedKeys();
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
return checkedKeys;
},
// /
handleCheckedTreeExpand(value, type) {
if (type == 'menu') {
let treeList = this.menuOptions;
for (let i = 0; i < treeList.length; i++) {
this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value;
}
}
},
// /
handleCheckedTreeNodeAll(value, type) {
if (type == 'menu') {
this.$refs.menu.setCheckedNodes(value ? this.menuOptions: []);
}
},
//
handleCheckedTreeConnect(value, type) {
if (type == 'menu') {
this.form1.menuCheckStrictly = value ? true: false;
}
},
handleAdd1(){
this.reset1();
this.getMenuTreeselect(1);
this.openDuty = true;
this.title = "添加角色";
},
//
getMenuTreeselect(merchantId) {
return treeselect({merchantId:merchantId}).then(response => {
this.menuOptions = response.data;
return response
});
},
handleDelete1(row){
const roleIds = row.dutyName;
this.$modal.confirm('是否确认删除角色名为"' + roleIds + '"的信息?').then(function() {
return dutyDelete(row.dutyId);
}).then(() => {
this.getDutyList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
handleUpdate1(data){
this.reset1();
let val = null;
if (data.dutyType == '3') val = 1;
if (data.dutyType == '4') val = 2;
const roleMenu = this.getMenuTreeselect(val);
const roleId = data.dutyId
getRole(roleId).then(response => {
this.form1.roleName = response.data.roleInfo.name;
this.form1.roleType = response.data.roleInfo.type;
this.form1.status = response.data.roleInfo.status;
this.form1.dutyId = response.data.roleInfo.id;
this.form1.description = response.data.roleInfo.description;
this.openDuty = true;
this.title = "修改角色";
let checkedKeys = response.data.checkedKeys
this.$nextTick(() => {
roleMenu.then(res => {
checkedKeys.forEach((v) => {
this.$nextTick(()=>{
this.$refs.menu.setChecked(v, true ,false);
})
})
});
});
});
},
handleStatusChangeDuty(data){
console.log(data)
dutyEdit(data).then(res => {
this.$message.success("修改成功")
this.getDutyList();
})
},
//
handleQuery1(){
this.queryParams1.page = 1;
this.getDutyList();
},
getDutyList(){
this.loading = true;
dutyList(this.queryParams1).then(res => {
this.dutyList = res.data.records;
this.total1 = res.data.total;
this.loading = false;
})
},
}
}
</script>
<style lang="scss" scoped>
.app-container{
width: 100%;
height: 100%;
background: #f6f8f9;
}
</style>

View File

@ -60,11 +60,9 @@
<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="roleId" >
<el-table-column label="员工角色" align="center" prop="dutyName" >
<template slot-scope="scope">
<span v-if="scope.row.roleId=='12'">油站站长</span>
<span v-if="scope.row.roleId=='15'">加油员</span>
<span v-if="scope.row.roleId=='16'">收银员</span>
<span>{{scope.row.dutyName || "--"}}</span>
</template>
</el-table-column>
<el-table-column label="手机号" align="center" prop="mobile" width="110"/>
@ -156,11 +154,6 @@
:label="item.dutyName"
:value="item.dutyId+''"
></el-option>
<el-option
v-if="form.roleId == 12"
label="油站站长"
:value="12+''"
></el-option>
</el-select>
</el-form-item>
@ -333,6 +326,7 @@ import {addStaff, createStaffQrCode, delStaff, getStaff, listStaff, queryStaff,
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: "StaffList",
@ -488,7 +482,7 @@ export default {
},
created() {
this.getList();
this.getDuty();
// this.getDuty();
// this.getStoreList();
},
methods: {
@ -649,9 +643,21 @@ export default {
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 = '';
@ -757,6 +763,7 @@ export default {
if (this.appletPrem != null && this.appletPrem != ""){
this.appletPrem = JSON.parse(this.form.appletPrem);
}
this.getRoleList1();
});
},
//

View File

@ -82,7 +82,7 @@
</el-table-column>
<el-table-column label="囤油卡充值" prop="oilStorageRecharge" align="center">
<template slot-scope="scope">
<span>{{ scope.row.oilCardRecharge || 0 }}</span>
<span>{{ scope.row.oilStorageRecharge || 0 }}</span>
</template>
</el-table-column>
<el-table-column label="车主加油" prop="oilSale" align="center">
@ -239,15 +239,12 @@
multiple
placeholder="请选择所属角色"
@change="getCheckbox">
<!-- <el-option-->
<!-- v-for="(item,index) in roleList"-->
<!-- :key="index"-->
<!-- :label="item.dutyName"-->
<!-- :value="item.dutyId"-->
<!-- ></el-option>-->
<el-option label="加油员" :value="15+''" ></el-option>
<el-option label="收银员" :value="16+''" ></el-option>
<!-- :value="item.dutyId"-->
<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>
@ -315,7 +312,7 @@
<el-drawer
title="库存跟踪"
title="提成记录"
:visible.sync="drawer"
direction="rtl"
size="60%"
@ -332,9 +329,9 @@
<el-option label="油品订单提成" :value="1"></el-option>
<el-option label="商品订单提成" :value="2"></el-option>
<el-option label="储值卡充值提成" :value="3"></el-option>
<el-option label="油品退款" :value="4"></el-option>
<el-option label="商品退款" :value="5"></el-option>
<el-option label="囤油卡充值提成" :value="6"></el-option>
<el-option label="囤油卡充值提成" :value="4"></el-option>
<!-- <el-option label="商品退款" :value="5"></el-option>-->
<!-- <el-option label="囤油卡充值提成" :value="6"></el-option>-->
</el-select>
</el-form-item>
<el-form-item label="订单号">
@ -384,9 +381,9 @@
<span v-if="scope.row.type==1">油品订单提成</span>
<span v-if="scope.row.type==2">商品订单提成</span>
<span v-if="scope.row.type==3">储值卡充值提成</span>
<span v-if="scope.row.type==4">油品退款</span>
<span v-if="scope.row.type==5">商品退款</span>
<span v-if="scope.row.type==6">囤油卡充值提成</span>
<!-- <span v-if="scope.row.type==4">油品退款</span>-->
<!-- <span v-if="scope.row.type==5">商品退款</span>-->
<span v-if="scope.row.type==4">囤油卡充值提成</span>
</template>
</el-table-column>
<el-table-column label="提成金额(元)" prop="amount" align="center">
@ -430,6 +427,7 @@ import {
} from "@/api/staffCommission/staffcommission";
import {listDuty} from "@/api/staff/duty";
import {queryStaffs} from "@/api/order/staff";
import {dutyList} from "@/api/duty/duty";
export default {
dicts: ['source','role','zhzt','comissionType'],
@ -521,9 +519,20 @@ export default {
created() {
this.getList();
this.getStaffList();
this.getDuty();
// this.getDuty();
},
methods:{
//
getRoleList1() {
let data = {
page:1,
pageSize:10000,
dutyType:3
}
dutyList(data).then(res => {
this.roleList = res.data.records
})
},
getStaffCommissionList(){
this.loading = true
this.dateRange = []
@ -657,6 +666,7 @@ export default {
handleAdd() {
this.reset();
this.open = true;
this.getRoleList1()
this.title = "新增提成方案";
},
//
@ -673,6 +683,7 @@ export default {
if (response.data.staffRoleGroup){
this.staffRoleGroup = response.data.staffRoleGroup.split(",");
}
this.getRoleList1()
});
},

View File

@ -98,6 +98,13 @@
<el-radio :label="0">按钮</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="菜单角色" prop="merchantId">
<el-radio-group v-model="form.merchantId">
<el-radio :label="0">暂未设置</el-radio>
<el-radio :label="1">油站端菜单</el-radio>
<el-radio :label="2">中台端菜单</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="菜单图标" prop="icon">

View File

@ -0,0 +1,35 @@
import request from '@/utils/request'
// 分页查询角色信息
export function dutyList(query) {
return request({
url: '/business/member/duty',
method: 'get',
params: query
})
}
// 分页查询角色信息
export function dutyLists(query) {
return request({
url: '/business/member/duty/dutys',
method: 'get',
params: query
})
}
// 根据id删除角色信息
export function dutyDelete(id) {
return request({
url: '/business/member/duty/'+id,
method: 'delete',
})
}
// 根据id删除角色信息
export function dutyEdit(data) {
return request({
url: '/business/member/duty',
method: 'put',
data: data
})
}

View File

@ -18,10 +18,11 @@ export function getMenu(menuId) {
}
// 查询菜单下拉树结构
export function treeselect() {
export function treeselect(params) {
return request({
url: 'backendApi/source/treeselect',
method: 'get'
method: 'get',
params: params
})
}

View File

@ -158,7 +158,7 @@
</el-tab-pane>
<el-tab-pane label="机构信息" name="info">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" class="demo-ruleForm">
<el-form-item label="父级节点" prop="name" v-if="ruleForm.parentId != 0">
<el-cascader :disabled="isTopDept" :options="Thetree" disabled style="width: 300px"
v-model="cascader" :props="defaultProps" @change="handleChanges" :placeholder="parentName" ></el-cascader>
@ -167,7 +167,7 @@
<!-- <el-form-item label="上级部门" prop="parentId">-->
<!-- <treeselect v-model="cascader" :options="Thetree" :normalizer="normalizer" @change="handleChanges" placeholder="啊" />-->
<!-- </el-form-item>-->
<el-form-item label="节点名称" prop="deptName">
<el-form-item label="连锁店/油站名称" prop="deptName">
<el-input :disabled="isTopDept" v-model="ruleForm.deptName"></el-input>
</el-form-item>
<el-form-item label="负责人名称" prop="leaderName">
@ -449,6 +449,102 @@
</el-tab-pane>
<el-tab-pane label="角色信息" name="duty">
<el-form :model="queryParams1" ref="queryForm" size="small" :inline="true" label-width="100px">
<el-form-item label="角色名称" prop="dutyName">
<el-input
v-model="queryParams1.dutyName"
placeholder="请输入角色名称"
clearable
@keyup.enter.native="handleQuery1"
/>
</el-form-item>
<el-form-item label="角色状态" prop="status">
<el-select
v-model="queryParams1.status"
placeholder="全部"
clearable
>
<el-option label="启用" value="A"></el-option>
<el-option label="禁用" value="D"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery1">查询</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd1"
>新增
</el-button>
</el-col>
</el-row>
<el-table ref="tables"
v-loading="loading"
:data="dutyList">
<el-table-column label="序号" align="center" type="index" width="50"></el-table-column>
<el-table-column label="角色名称" align="center" prop="dutyName" />
<el-table-column label="角色类型" align="center" prop="dutyType" >
<template slot-scope="scope">
<span v-if="scope.row.dutyType=='1'">超级管理员</span>
<span v-if="scope.row.dutyType=='2'">普通管理员</span>
<span v-if="scope.row.dutyType=='3'">油站角色</span>
<span v-if="scope.row.dutyType=='4'">公司角色</span>
</template>
</el-table-column>
<el-table-column label="所属机构" align="center" prop="deptName" />
<el-table-column label="角色状态" align="center" prop="status" >
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
active-value="A"
inactive-value="N"
@change="handleStatusChangeDuty(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="角色描述" align="center" prop="description" >
<template slot-scope="scope">
{{scope.row.description || "--"}}
</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="handleUpdate1(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete1(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total1>0"
:total="total1"
:page.sync="queryParams1.page"
:limit.sync="queryParams1.pageSize"
@pagination="getDutyList"
/>
</el-tab-pane>
</el-tabs>
</el-card>
@ -512,7 +608,7 @@
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="分配角色">
<el-form-item label="分配角色" prop="roleIds">
<el-select v-model="form.roleIds" @change="$forceUpdate(),getCodeByRole($event)" placeholder="请选择角色">
<el-option
v-for="item in rolelist"
@ -521,6 +617,7 @@
:value="item.dutyId"
></el-option>
</el-select>
<div v-if="!rolelist || rolelist.length==0" style="color: red;font-size: 12px">请先为当前机构添加角色信息</div>
</el-form-item>
</el-col>
@ -533,6 +630,57 @@
</div>
</el-dialog>
<!-- 添加或修改角色配置对话框 -->
<el-dialog :title="title" :visible.sync="openDuty" width="700px" append-to-body>
<el-form ref="form1" :model="form1" :rules="rules1" label-width="100px">
<el-form-item label="角色名称" prop="roleName">
<el-input v-model="form1.roleName" @input="$forceUpdate()" style="width: 300px" placeholder="请输入角色名称" />
</el-form-item>
<el-form-item label="角色类型" prop="roleType">
<el-select
v-model="form1.roleType"
placeholder="角色类型"
@change="changeMenu"
style="width: 300px"
>
<!-- <el-option key="1" label="超级管理员" value="1"/>-->
<!-- <el-option key="2" label="普通管理员" value="2"/>-->
<el-option key="3" label="油站角色" value="3"/>
<el-option key="4" label="公司角色" value="4"/>
</el-select>
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="form1.status">
<el-radio key="A" label="A" value="A">启用</el-radio>
<el-radio key="N" label="N" value="N">禁用</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="菜单权限">
<el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>
<el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox>
<el-checkbox v-model="form1.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox>
<el-tree
class="tree-border"
:data="menuOptions"
show-checkbox
ref="menu"
node-key="id"
:check-strictly="!form1.menuCheckStrictly"
empty-text="加载中,请稍候"
:props="defaultProps1"
></el-tree>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form1.description" type="textarea" placeholder="请输入备注信息"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm1"> </el-button>
<el-button @click="cancel1"> </el-button>
</div>
</el-dialog>
<!-- 用户导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body :close-on-click-modal="false">
<el-upload
@ -589,7 +737,10 @@ import {
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import BigNumber from 'bignumber.js';
import node from "../../../../gasStation-uni/uni_modules/uview-ui/components/u-parse/node/node.vue";
import {dutyDelete, dutyEdit, dutyList, dutyLists} from "@/api/duty/duty";
import {addRole, delRole, getRole, updateRole} from "@/api/system/role";
import {treeselect as menuTreeselect} from "@/api/system/menu";
@ -653,6 +804,18 @@ export default {
multiple: true,
//
showSearch: true,
openDuty:false,
form1: { id: '', status: 'A', roleType: '4', description: '' },
//
roleList: [],
menuExpand: false,
menuNodeAll: false,
//
menuOptions: [],
defaultProps1: {
children: "childrens",
label: "label"
},
//
total: 0,
//
@ -663,7 +826,14 @@ export default {
Thetree:[],
//
deptOptions: undefined,
queryParams1:{
page:1,
pageSize:10,
// id使
storeId:"",
},
total1:0,
dutyList:[],
//
open: false,
@ -731,6 +901,15 @@ export default {
],
rolelist:'',
//
//
rules1: {
roleName: [
{ required: true, message: "角色名称不能为空", trigger: "blur" }
],
roleType: [
{ required: true, message: "角色类型不能为空", trigger: "blur" }
]
},
rules: {
leaderName: [
{ required: true, message: '姓名不能为空', trigger: 'blur' },
@ -746,7 +925,11 @@ export default {
],
deptName: [
{ required: true, message: '请输入节点名称', trigger: 'blur' },
{ required: true, message: '请输入机构名称', trigger: 'blur' },
],
roleIds: [
{ required: true, message: '请选择角色信息', trigger: 'blur' },
],
region: [
@ -826,6 +1009,165 @@ export default {
},
components: { Treeselect },
methods: {
//
async changeMenu() {
console.log(this.form1.roleType)
if (this.form1.roleType == '4') {
this.getMenuTreeselect(2);
}
if (this.form1.roleType == '3') {
await this.getMenuTreeselect(1);
await this.handleCheckedTreeNodeAll(true, 'menu')
}
},
//
reset1() {
if (this.$refs.menu != undefined) {
this.$refs.menu.setCheckedKeys([]);
}
this.menuExpand = false,
this.menuNodeAll = false,
this.form1 = {
id: undefined,
roleName: '',
roleType: '4',
status: "A",
menuIds: [],
menuCheckStrictly: true,
description: ''
};
this.resetForm("form1");
},
//
cancel1() {
this.openDuty = false;
this.reset1();
},
submitForm1: function() {
this.$refs["form1"].validate(valid => {
if (valid) {
if (this.form1.dutyId) {
this.form1.menuIds = this.getMenuAllCheckedKeys();
updateRole(this.form1).then(response => {
this.$modal.msgSuccess("修改成功");
this.openDuty = false;
this.getDutyList();
});
} else {
this.form1.storeId = this.queryParams1.storeId
this.form1.menuIds = this.getMenuAllCheckedKeys();
addRole(this.form1).then(response => {
this.$modal.msgSuccess("新增成功");
this.openDuty = false;
this.getDutyList();
});
}
}
});
},
//
getMenuAllCheckedKeys() {
//
let checkedKeys = this.$refs.menu.getCheckedKeys();
//
let halfCheckedKeys = this.$refs.menu.getHalfCheckedKeys();
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
return checkedKeys;
},
// /
handleCheckedTreeExpand(value, type) {
if (type == 'menu') {
let treeList = this.menuOptions;
for (let i = 0; i < treeList.length; i++) {
this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value;
}
}
},
// /
handleCheckedTreeNodeAll(value, type) {
console.log(this.menuOptions)
if (type == 'menu') {
this.$refs.menu.setCheckedNodes(value ? this.menuOptions: []);
}
},
//
handleCheckedTreeConnect(value, type) {
if (type == 'menu') {
this.form1.menuCheckStrictly = value ? true: false;
}
},
handleAdd1(){
this.reset1();
this.getMenuTreeselect(2);
this.form1.storeId = this.Thetree[0].id
this.openDuty = true;
this.title = "添加角色";
console.log(this.form1)
},
//
getMenuTreeselect(merchantId) {
return menuTreeselect({merchantId:merchantId}).then(response => {
this.menuOptions = response.data;
return response
});
},
handleDelete1(row){
const roleIds = row.dutyName;
this.$modal.confirm('是否确认删除角色名为"' + roleIds + '"的信息?').then(function() {
return dutyDelete(row.dutyId);
}).then(() => {
this.getDutyList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
handleUpdate1(data){
this.reset1();
let val = null;
if (data.dutyType == '3') val = 1;
if (data.dutyType == '4') val = 2;
const roleMenu = this.getMenuTreeselect(val);
const roleId = data.dutyId
getRole(roleId).then(response => {
this.form1.roleName = response.data.roleInfo.name;
this.form1.roleType = response.data.roleInfo.type;
this.form1.status = response.data.roleInfo.status;
this.form1.dutyId = response.data.roleInfo.id;
this.form1.description = response.data.roleInfo.description;
this.openDuty = true;
this.title = "修改角色";
let checkedKeys = response.data.checkedKeys
this.$nextTick(() => {
roleMenu.then(res => {
checkedKeys.forEach((v) => {
this.$nextTick(()=>{
this.$refs.menu.setChecked(v, true ,false);
})
})
});
});
});
},
handleStatusChangeDuty(data){
console.log(data)
dutyEdit(data).then(res => {
this.$message.success("修改成功")
this.getDutyList();
})
},
//
handleQuery1(){
this.queryParams1.page = 1;
this.getDutyList();
},
getDutyList(){
this.loading = true;
dutyList(this.queryParams1).then(res => {
this.dutyList = res.data.records;
this.total1 = res.data.total;
this.loading = false;
})
},
//
async changeTheBillingRule(event) {
//
@ -930,12 +1272,14 @@ export default {
//
this.queryParams.deptId = data.id
this.queryParams1.storeId = data.id
this.deptType = data.deptType
//
this.appedit(data.id,data.label)
//
// this.getList();
this.onlyGetUser()
this.getDutyList()
},
//
@ -1036,7 +1380,13 @@ export default {
// // this.$refs[formName].resetFields();
// },
handleClick(tab, event) {
console.log(this.activeName)
if (this.activeName=="list"){
this.onlyGetUser()
}
if (this.activeName=="duty"){
this.getDutyList()
}
},
//
//
@ -1235,6 +1585,7 @@ export default {
if(this.Thetree.length>0 && !this.queryParams.deptId) {
this.queryParams.deptId = this.Thetree[0].id
this.form.deptType = this.Thetree[0].deptType
this.queryParams1.storeId = this.Thetree[0].id
console.log("this.Thetree",this.Thetree[0])
}
@ -1408,6 +1759,12 @@ export default {
this.rolelist = res.data
})
},
//
getRoleList1(storeId) {
dutyLists({storeId:storeId}).then(res => {
this.rolelist = res.data
})
},
/** 新增按钮操作 */
handleAdd() {
@ -1420,7 +1777,8 @@ export default {
}else {
permissionType = 'system'
}
this.getRoleList(permissionType);
// this.getRoleList(permissionType);
this.getRoleList1(this.queryParams1.storeId);
},
@ -1452,7 +1810,8 @@ export default {
}else {
permissionType = 'system'
}
this.getRoleList(permissionType);
// this.getRoleList(permissionType);
this.getRoleList1(row.deptId);
},

View File

@ -59,11 +59,9 @@
<el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
<el-table-column label="ID" align="center" prop="id" width="80" />
<el-table-column label="姓名" align="center" prop="realName" />
<el-table-column label="员工角色" align="center" prop="roleId" >
<el-table-column label="员工角色" align="center" prop="dutyName" >
<template slot-scope="scope">
<span v-if="scope.row.roleId=='12'">油站站长</span>
<span v-if="scope.row.roleId=='15'">加油员</span>
<span v-if="scope.row.roleId=='16'">收银员</span>
<span>{{scope.row.dutyName || "--"}}</span>
</template>
</el-table-column>
<el-table-column label="手机号" align="center" prop="mobile" />
@ -143,9 +141,12 @@
<el-col :span="8">
<el-form-item label="角色组" prop="roleId">
<el-select v-model="form.roleId" placeholder="请选择角色" style="width: 270px">
<el-option label="油站站长" :value="12+''" ></el-option>
<el-option label="加油员" :value="15+''" ></el-option>
<el-option label="收银员" :value="16+''" ></el-option>
<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>
@ -240,6 +241,7 @@
<script>
import {getName} from "../../../utils/fuint";
import {addStaff, delStaff, getStaff, listStaff, updateStaff} from "../../../api/staff/staff";
import {dutyList} from "@/api/duty/duty";
// import {getDuty, listDuty} from "@/api/staff/duty";
export default {
@ -295,6 +297,8 @@
dateRange: [],
//
defaultSort: {prop: 'createTime', order: 'descending'},
//
roleList:[],
//
form: {
id:'', category:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:this.id, auditedStatus:'',
@ -465,6 +469,18 @@
this.reset();
this.open = true;
this.title = "新增员工";
this.getRoleList1()
},
//
getRoleList1() {
let data = {
page:1,
pageSize:10000,
dutyType:3
}
dutyList(data).then(res => {
this.roleList = res.data.records
})
},
//
reset() {
@ -521,6 +537,7 @@
this.specialPrem = this.form.specialPrem.split(",");
this.posPrem = JSON.parse(this.form.posPrem);
this.appletPrem = JSON.parse(this.form.appletPrem);
this.getRoleList1()
});
},
//

View File

@ -98,6 +98,13 @@
<el-radio :label="0">按钮</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="菜单角色" prop="merchantId">
<el-radio-group v-model="form.merchantId">
<el-radio :label="0">暂未设置</el-radio>
<el-radio :label="1">油站端菜单</el-radio>
<el-radio :label="2">中台端菜单</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="菜单图标" prop="icon">

View File

@ -70,7 +70,11 @@
<el-table-column label="角色类型" prop="type" :show-overflow-tooltip="true" width="200" />
<el-table-column label="状态" align="center" width="200">
<template slot-scope="scope">
<span v-if="roleList.length==3">
{{scope.row.status=='A'?'启用':'禁用'}}
</span>
<el-switch
v-else
v-model="scope.row.status"
active-value="A"
inactive-value="N"
@ -110,22 +114,23 @@
<el-dialog :title="title" :visible.sync="open" width="700px" class="common-dialog" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="角色名称" prop="roleName">
<el-input v-model="form.roleName" style="width: 300px" placeholder="请输入角色名称" />
<el-input :disabled="roleList.length==3" v-model="form.roleName" style="width: 300px" placeholder="请输入角色名称" />
</el-form-item>
<el-form-item label="角色类型" prop="roleType">
<el-select
:disabled="roleList.length==3"
v-model="form.roleType"
placeholder="角色类型"
style="width: 300px"
>
<el-option key="1" label="超级管理员" value="1"/>
<el-option key="2" label="普通管理员" value="2"/>
<!-- <el-option key="3" label="用户角色" value="3"/> -->
<el-option key="3" label="员工角色" value="3"/>
<el-option key="3" label="用户角色" value="3"/>
<el-option key="4" label="员工角色" value="4"/>
</el-select>
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio-group v-model="form.status" :disabled="roleList.length==3">
<el-radio key="A" label="A" value="A">启用</el-radio>
<el-radio key="N" label="N" value="N">禁用</el-radio>
</el-radio-group>

View File

@ -57,7 +57,7 @@ public class FyPayController {
// 接收支付平台异步通知的接口
@PostMapping("/notify")
public String notifyUrl(HttpServletRequest request,HttpServletResponse response) throws UnsupportedEncodingException, JsonProcessingException {
public String notifyUrl(HttpServletRequest request,HttpServletResponse response) throws Exception {
System.out.println("----------------收到支付回调--------"+request.getParameter("req"));
String notifyData = request.getParameter("req");
String decode = URLDecoder.decode(notifyData, Const.charset);
@ -96,7 +96,7 @@ public class FyPayController {
return "0";
}
}
public void updateOrderStatus(String orderNo,String type) throws JsonProcessingException {
public void updateOrderStatus(String orderNo,String type) throws Exception {
if ("1".equals(type)) {
orderService.updateOrderStatus(orderNo,"paid");
}else if ("4".equals(type)) {
@ -109,4 +109,4 @@ public class FyPayController {
cardFuelRecordService.fuleRechargeFinallDeal(orderNo);
}
}
}
}

View File

@ -38,15 +38,17 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
@Override
public MerchantConfig selectMeChByIdIsUse(int storeId) {
List<MerchantConfig> list = this.selectMeChByIsOpen(storeId);
if (list.size()>0){
oilConfigService.oilRule(storeId);
}
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_use","1");
queryWrapper.eq("store_id",storeId);
MerchantConfig merchantConfig = baseMapper.selectOne(queryWrapper);
return merchantConfig;
if (ObjectUtil.isNotEmpty(merchantConfig) && merchantConfig.getIsOpenRule().equals("1")){
List<MerchantConfig> list = this.selectMeChByIsOpen(storeId);
if (list.size()>0){
oilConfigService.oilRule(storeId);
}
}
return baseMapper.selectOne(queryWrapper);
}
@Override

View File

@ -89,7 +89,7 @@ public class CommissionRecordServiceImpl implements CommissionRecordService {
staffPercentageVo.setGoodsCommission(commissionRecordMapper.selectAllCommissIon(commissionRecord));
commissionRecord.setType("3");
staffPercentageVo.setOilCardRecharge(commissionRecordMapper.selectAllCommissIon(commissionRecord));
commissionRecord.setType("6");
commissionRecord.setType("4");
staffPercentageVo.setOilStorageRecharge(commissionRecordMapper.selectAllCommissIon(commissionRecord));
list.add(staffPercentageVo);
}

View File

@ -41,7 +41,7 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
commission.setStoreId(storeId);
IPage<StaffCommissionVo> staffCommissionIPage = baseMapper.selectCommissionList(page, commission);
for (StaffCommissionVo record : staffCommissionIPage.getRecords()) {
List<TDuty> tDuties = dutyService.selectDutyList();
List<TDuty> tDuties = dutyService.selectDutyPage(new Page<>(1,10000),new TDuty()).getRecords();
String[] staffRoleGroup = record.getStaffRoleGroup().split(",");
String str = "";
for (String staffRole : staffRoleGroup) {

View File

@ -152,13 +152,13 @@ public class IntegralOrdersController extends BaseController {
* @return
*/
@GetMapping("checkTheStatusOfYourPaymentByIntegral")
public ResponseObject checkTheStatusOfYourPaymentByIntegral(@Param("orderNumber") String orderNumber) {
public ResponseObject checkTheStatusOfYourPaymentByIntegral(@Param("orderNumber") String orderNumber) throws Exception {
return getSuccessResult(this.integralOrdersService.checkTheStatusOfYourPaymentByIntegral(orderNumber));
}
@PostMapping("integralOrdersProcessingUni")
public ResponseObject integralOrdersProcessingUni(@RequestBody IntegralOrdersRequest integralOrdersList) {
public ResponseObject integralOrdersProcessingUni(@RequestBody IntegralOrdersRequest integralOrdersList) throws Exception {
return getSuccessResult(this.integralOrdersService.integralOrdersProcessingUni(integralOrdersList));
}

View File

@ -70,12 +70,12 @@ public interface IntegralOrdersService {
IntegralOrders integralOrdersProcessing(IntegralOrdersRequest integralOrdersList);
IntegralOrders checkTheStatusOfYourPaymentByIntegral(String orderNO);
IntegralOrders checkTheStatusOfYourPaymentByIntegral(String orderNO) throws Exception;
int editPayStatus(String orderNumber, String payStates,Integer storeId);
Map<String, Object> integralOrdersProcessingUni(IntegralOrdersRequest integralOrdersList);
Map<String, Object> integralOrdersProcessingUni(IntegralOrdersRequest integralOrdersList) throws Exception;
/**
* 查询是否领取到同一件商品领取了几件

View File

@ -308,7 +308,7 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
private RedisLock redisLock;
@Override
@Transactional
public IntegralOrders checkTheStatusOfYourPaymentByIntegral(String orderNo) {
public IntegralOrders checkTheStatusOfYourPaymentByIntegral(String orderNo) throws Exception {
// AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
// 查询订单信息
@ -439,7 +439,7 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
@Override
public Map<String, Object> integralOrdersProcessingUni(IntegralOrdersRequest integralOrdersList) {
public Map<String, Object> integralOrdersProcessingUni(IntegralOrdersRequest integralOrdersList) throws Exception {
double epsilon = 1e-10; // 阈值
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();

View File

@ -61,5 +61,5 @@ public interface ActiveExchangeService {
* 消费有礼后续处理
* @param paymentActiveDTO
*/
void activeConsumption(PaymentActiveDTO paymentActiveDTO);
void activeConsumption(PaymentActiveDTO paymentActiveDTO) throws Exception;
}

View File

@ -983,7 +983,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
}
@Override
public void activeConsumption (PaymentActiveDTO paymentActiveDTO){
public void activeConsumption (PaymentActiveDTO paymentActiveDTO) throws Exception {
//消费有礼
ArrayList<ActiveConsumptionVO> activeConsumptionVOS1 = new ArrayList<>();
List<ActiveConsumptionVO> activeConsumptionVOS = oilOrderMapper.selectActiveConsumption(paymentActiveDTO.getStoreId(), paymentActiveDTO.getAmount());

View File

@ -71,7 +71,7 @@ public class ActiveRecommendRecordsController extends BaseController {
* @return 新增结果
*/
@PostMapping
public ResponseObject insert(@RequestBody ActiveRecommendRecordsDTO activeRecommendRecordsDTO) {
public ResponseObject insert(@RequestBody ActiveRecommendRecordsDTO activeRecommendRecordsDTO) throws Exception {
return getSuccessResult(this.activeRecommendRecordsService.add(activeRecommendRecordsDTO));
}

View File

@ -33,6 +33,6 @@ public interface ActiveRecommendRecordsService extends IService<ActiveRecommendR
* @param activeRecommendRecordsDTO
* @return
*/
boolean add(ActiveRecommendRecordsDTO activeRecommendRecordsDTO);
boolean add(ActiveRecommendRecordsDTO activeRecommendRecordsDTO) throws Exception;
}

View File

@ -156,7 +156,7 @@ public class ActiveRecommendRecordsServiceImpl extends ServiceImpl<ActiveRecomme
*/
@Override
@Transactional
public boolean add(ActiveRecommendRecordsDTO activeRecommendRecordsDTO) {
public boolean add(ActiveRecommendRecordsDTO activeRecommendRecordsDTO) throws Exception {
log.info("邀请有礼");
if (ObjectUtils.isNotEmpty(activeRecommendRecordsDTO) && activeRecommendRecordsDTO.getType().equals("yaoqingyouli")){
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();

View File

@ -104,7 +104,7 @@ public class CardFavorableRecordController extends BaseController {
* @return 新增结果
*/
@PostMapping("issueCardFavorable")
public ResponseObject issueCardFavorable(@RequestBody CardFavorableAdnUserDTO cardFavorableAdnUserDTO) {
public ResponseObject issueCardFavorable(@RequestBody CardFavorableAdnUserDTO cardFavorableAdnUserDTO) throws Exception {
return getSuccessResult(this.cardFavorableRecordService.issueCardFavorable(cardFavorableAdnUserDTO));
}
@ -160,7 +160,7 @@ public class CardFavorableRecordController extends BaseController {
* @return 修改结果
*/
@PostMapping("updateCardAndActiveById")
public ResponseObject updateCardAndActiveById(@RequestBody PaymentActiveVO paymentActiveVO) {
public ResponseObject updateCardAndActiveById(@RequestBody PaymentActiveVO paymentActiveVO) throws Exception {
return getSuccessResult(this.cardFavorableRecordService.updateCardAndActiveById(paymentActiveVO));
}

View File

@ -58,5 +58,9 @@ public class CardFavorableRecord extends Model<CardFavorableRecord> {
//更新时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date updateTime;
//优惠金额
private Double discountAmount;
//满足金额
private Double satisfiedAmount;
}

View File

@ -59,21 +59,21 @@ public interface CardFavorableRecordService extends IService<CardFavorableRecord
* @param cardFavorableRecord
* @return
*/
boolean addCardFavorableRecord(CardFavorableRecord cardFavorableRecord);
boolean addCardFavorableRecord(CardFavorableRecord cardFavorableRecord) throws Exception;
/**
* 核销
* @param paymentActiveVO
* @return
*/
boolean updateCardAndActiveById(PaymentActiveVO paymentActiveVO);
boolean updateCardAndActiveById(PaymentActiveVO paymentActiveVO) throws Exception;
/**
* pc端一键发券接口
* @param cardFavorableAdnUserDTO
* @return
*/
boolean issueCardFavorable(CardFavorableAdnUserDTO cardFavorableAdnUserDTO);
boolean issueCardFavorable(CardFavorableAdnUserDTO cardFavorableAdnUserDTO) throws Exception;
CardFavorableAdnUserDTO getInfoById(Integer id);

View File

@ -245,11 +245,13 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
queryWrapper.eq(CardFavorableRecord::getMtUserId,nowAccountInfo.getId());
queryWrapper.eq(CardFavorableRecord::getStoreId,cardFavorableRecord.getStoreId());
//如果领过券 就不让领了
List<CardFavorableRecord> list = list(queryWrapper);
List<CardFavorableRecord> list = cardFavorableRecordMapper.selectList(queryWrapper);
// List<CardFavorableRecord> list = list(queryWrapper);
if (CollectionUtils.isEmpty(list) && CollectionUtils.isNotEmpty(list1) && list.size() <list1.size()){
isDrawDown = true;
}
return isDrawDown;
//return true;
}
/**
@ -258,9 +260,14 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
* @return
*/
@Override
public boolean addCardFavorableRecord(CardFavorableRecord cardFavorableRecord) {
public boolean addCardFavorableRecord(CardFavorableRecord cardFavorableRecord) throws Exception {
CardFavorable cardFavorable = cardFavorableService.getById(cardFavorableRecord.getCardFavorableId());
if (ObjectUtils.isNotEmpty(cardFavorable)){
//优惠券的数量
Integer count = cardFavorable.getCount();
if (count < 1){
throw new Exception("优惠券已领完");
}
//优惠券开始结束时间
if (ObjectUtils.isNotEmpty(cardFavorable) && ObjectUtils.isNotEmpty(cardFavorable.getTimeType())) {
if (cardFavorable.getTimeType().equals("0")) {
@ -283,9 +290,13 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
Date froms = Date.from(localDates.atStartOfDay(ZoneId.systemDefault()).toInstant());
cardFavorableRecord.setStartTime(froms);
cardFavorableRecord.setEndTime(from);
cardFavorable.setCount(count-1);
}
}
}
cardFavorableService.updateById(cardFavorable);
cardFavorableRecord.setSatisfiedAmount(cardFavorable.getSatisfiedAmount());
cardFavorableRecord.setDiscountAmount(cardFavorable.getDiscountAmount());
return save(cardFavorableRecord);
}
@ -296,7 +307,7 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
*/
@Override
@Transactional
public boolean updateCardAndActiveById(PaymentActiveVO paymentActiveVO) {
public boolean updateCardAndActiveById(PaymentActiveVO paymentActiveVO) throws Exception {
//优惠券
boolean flag = false;
Integer userId = null;
@ -342,7 +353,7 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
* @return
*/
@Override
public boolean issueCardFavorable(CardFavorableAdnUserDTO cardFavorableAdnUserDTO) {
public boolean issueCardFavorable(CardFavorableAdnUserDTO cardFavorableAdnUserDTO) throws Exception {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer activeId = cardFavorableAdnUserDTO.getActiveId();
LambdaQueryWrapper<ActiveOneCoupon> queryWrapper = new LambdaQueryWrapper<>();

View File

@ -27,6 +27,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -124,23 +125,75 @@ public class CardFavorableServiceImpl extends ServiceImpl<CardFavorableMapper, C
queryWrapper1.eq(CardFavorableRecord::getMtUserId,TokenUtil.getNowAccountInfo().getId());
queryWrapper1.eq(CardFavorableRecord::getStoreId,storeId);
List<CardFavorableRecord> list = cardFavorableRecordService.list(queryWrapper1);
if (CollectionUtils.isNotEmpty(list)){
//只查询当天的数据
queryWrapper1.ge(CardFavorableRecord::getCreateTime, LocalDateTime.now().minusDays(1));
List<CardFavorableRecord> list1= cardFavorableRecordService.list(queryWrapper1);
//所有领取列表的券ids
ArrayList<Integer> carFavorbleRecordIds = new ArrayList<>();
//领取列表的券ids限领一张
ArrayList<Integer> carFavorbleIds = new ArrayList<>();
ArrayList<Integer> carFavorbleIds2 = new ArrayList<>();
//领取列表的券ids
ArrayList<Integer> carFavorbleIds1 = new ArrayList<>();
for (CardFavorableRecord cardFavorableRecord : list) {
Integer cardFavorableId = cardFavorableRecord.getCardFavorableId();
carFavorbleRecordIds.add(cardFavorableId);
}
for (CardFavorable record : records) {
if (record.getClaimRule().equals("0")){
Integer id = record.getId();
carFavorbleIds.add(id);
}
}
//领取列表的券ids 减去 限领一张的
carFavorbleIds.removeAll(carFavorbleRecordIds);
for (Integer carFavorbleId : carFavorbleIds) {
CardFavorable one = getById(carFavorbleId);
cardFavorableArrayList.add(one);
}
for (CardFavorable record : records) {
if (record.getClaimRule().equals("1")){
Integer id = record.getId();
carFavorbleIds2.add(id);
}
}
//领取列表的券ids 减去 当前查询的券ids
carFavorbleIds2.removeAll(carFavorbleIds1);
for (Integer carFavorbleId : carFavorbleIds) {
CardFavorable one = getById(carFavorbleId);
cardFavorableArrayList.add(one);
}
//
//每人限领一张
/* if (CollectionUtils.isNotEmpty(list)){
for (CardFavorableRecord cardFavorableRecord : list) {
for (CardFavorable record : records) {
if(record.getClaimRule().equals("0") && !cardFavorableRecord.getCardFavorableId().equals(record.getId())){
CardFavorable one = getById(record.getId());
cardFavorableArrayList.add(one);
}
if (record.getClaimRule().equals("1")){
//查询当天有没有领取这张券
}
}
}
}
//每人每日限领一张
if (CollectionUtils.isNotEmpty(list1)){
for (CardFavorableRecord cardFavorableRecord : list1) {
//
for (CardFavorable record : records) {
if(record.getClaimRule().equals("1") && !cardFavorableRecord.getCardFavorableId().equals(record.getId())){
CardFavorable one = getById(record.getId());
cardFavorableArrayList.add(one);
}
}
}
}*/
if (cardFavorableArrayList.size()>3){
List<CardFavorable> cardFavorables = cardFavorableArrayList.subList(0, 3);
page1.setRecords(cardFavorables);
}else {
page1.setRecords(cardFavorableArrayList);
}
return page1;
}

View File

@ -18,10 +18,6 @@ public class CardFavorableRecordVO extends CardFavorableRecord {
* 满减金额
*/
private double fullDeduction;
/**
* 优惠金额
*/
private double discountAmount;
/**
* 优惠折扣
*/
@ -43,8 +39,6 @@ public class CardFavorableRecordVO extends CardFavorableRecord {
private String oilName;
//优惠类型 0满减券 1折扣券
private String discountType;
//满足金额
private double satisfiedAmount;
//优惠券描述信息
}

View File

@ -659,6 +659,20 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
oilBalanceChangeService.save(oilBalanceChange);
//员工提成
staffCommissionService.countStaffCommission(cardFuleOrders.getStaffId(),cardFuleOrders.getStoreId(),cardFuleOrders.getAmount(),cardFuleOrders.getPayAmount(),"4",cardFuleOrders.getOrderNo());
//积分表变动
if (ObjectUtils.isNotEmpty(userBalance) && ObjectUtils.isNotEmpty(userBalance.getPoints()) && ObjectUtils.isNotEmpty(cardFuleOrders.getPoints())) {
IntegralDetail integralDetail = new IntegralDetail();
integralDetail.setStoreId(cardFuleOrders.getStoreId());
integralDetail.setChainStoreId(cardFuleOrders.getChainStoreId());
integralDetail.setPointsChange(Double.valueOf(cardFuleOrders.getPoints()));
integralDetail.setCurrentPoints(userBalance.getPoints() + cardFuleOrders.getPoints());
integralDetail.setChangeType("1");
integralDetail.setChangeReason("囤油卡充值");
integralDetail.setUserId(cardFuleOrders.getMtUserId());
IntegralDetail integralDetail1 = integralDetailService.insert2(integralDetail);
}
//生成充值记录
cardFuelRecord.setMtUserId(cardFuleOrders.getMtUserId());
cardFuelRecord.setName(cardFuleOrders.getName());

View File

@ -141,7 +141,7 @@ public class CardValueRecordController extends BaseController {
* @return
*/
@GetMapping("checkTheStatusOfYourPayment")
public ResponseObject checkTheStatusOfYourPayment(Integer id) {
public ResponseObject checkTheStatusOfYourPayment(Integer id) throws Exception {
return getSuccessResult(this.cardValueRecordService.checkTheStatusOfYourPayment(id));
}
@ -196,7 +196,7 @@ public class CardValueRecordController extends BaseController {
* @return
*/
@GetMapping("/testCharge/{orderNo}")
public void testCharge(@PathVariable String orderNo) {
public void testCharge(@PathVariable String orderNo) throws Exception {
this.cardValueRecordService.rechargeFinallDeal(orderNo);
}

View File

@ -49,7 +49,7 @@ public interface CardValueRecordService extends IService<CardValueRecord> {
CardValueRecordDTO prepaidCardTopUp(CardValueRecordDTO cardValueRecordDTO);
CardValueRecord checkTheStatusOfYourPayment(Integer id);
CardValueRecord checkTheStatusOfYourPayment(Integer id) throws Exception;
boolean editPayStatus(@Param("id") Integer id,@Param("payStates") String payStates);
@ -60,7 +60,7 @@ public interface CardValueRecordService extends IService<CardValueRecord> {
IPage<CardValueRecordDTO> selectAllRecord(@Param("page") Page page, CardValueRecordDTO cardValueRecord);
void export(HttpServletResponse response, CardValueRecord cardValueRecord);
void rechargeFinallDeal(String orderNo);
void rechargeFinallDeal(String orderNo) throws Exception;
/**
* 修改订单状态信息
@ -73,7 +73,7 @@ public interface CardValueRecordService extends IService<CardValueRecord> {
* 会员等级优惠送券
* @param userId
*/
void giveCoupon(Integer userId, Integer storeId, LJUserVo ljUserVos, LJStaff ljStaff);
void giveCoupon(Integer userId, Integer storeId, LJUserVo ljUserVos, LJStaff ljStaff) throws Exception;
/**
* 根据用户id查询当前的储值卡信息

View File

@ -494,7 +494,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
*/
@Override
@Transactional
public CardValueRecord checkTheStatusOfYourPayment(Integer id) {
public CardValueRecord checkTheStatusOfYourPayment(Integer id) throws Exception {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
CardValueRecord cardValueRecord = baseMapper.selectById(id);
@ -823,7 +823,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
* @param orderNo
*/
@Transactional
public void rechargeFinallDeal(String orderNo){
public void rechargeFinallDeal(String orderNo) throws Exception {
UserBalance userBalance1 = new UserBalance();
CardValueRecord cardValueRecord = new CardValueRecord();
CardBalanceChange cardBalanceChange = new CardBalanceChange();
@ -947,6 +947,8 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
cardFavorableRecord.setEndTime(from);
}
}
cardFavorableRecord.setSatisfiedAmount(cardValueVoucher.getSatisfiedAmount());
cardFavorableRecord.setDiscountAmount(cardValueVoucher.getDiscountAmount());
cardFavorableRecordService.save(cardFavorableRecord);
}
/*
@ -1054,7 +1056,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
}
@Override
public void giveCoupon(Integer userId,Integer storeId,LJUserVo ljUserVos,LJStaff ljStaff) {
public void giveCoupon(Integer userId,Integer storeId,LJUserVo ljUserVos,LJStaff ljStaff) throws Exception {
List<MtUserGradeChild> mtUserGradeChildren = userGradeChildService.selectListByUserId(userId,storeId);
if (CollectionUtils.isNotEmpty(mtUserGradeChildren)) {
for (MtUserGradeChild mtUserGradeChild : mtUserGradeChildren) {

View File

@ -1,14 +1,12 @@
package com.fuint.business.member.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.member.service.ILJDutyService;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import com.fuint.system.role.entity.TDuty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -31,6 +29,15 @@ public class LjDutyController extends BaseController {
return getSuccessResult(list);
}
/**
* 查询角色信息
* @return
*/
@GetMapping("/dutys")
public ResponseObject dutys(TDuty duty){
return getSuccessResult(dutyService.selectDutys(duty));
}
/**
* 根据id查询角色信息
* @param id
@ -41,4 +48,22 @@ public class LjDutyController extends BaseController {
TDuty duty = dutyService.selectDutyById(id);
return getSuccessResult(duty);
}
@GetMapping()
public ResponseObject listPage(TDuty duty,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
return getSuccessResult(dutyService.selectDutyPage(page,duty));
}
@DeleteMapping("/{dutyId}")
public ResponseObject delete(@PathVariable Integer dutyId){
return getSuccessResult(dutyService.deleteDuty(dutyId));
}
@PutMapping()
public ResponseObject edit(@RequestBody TDuty duty){
return getSuccessResult(dutyService.updateDuty(duty));
}
}

View File

@ -123,4 +123,9 @@ public class LJStaff extends BaseEntity implements Serializable {
private String staffCode;
private String ifDelete;
/**
* 角色名称
*/
@TableField(exist = false)
private String dutyName;
}

View File

@ -1,7 +1,16 @@
package com.fuint.business.member.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.system.role.entity.TDuty;
import org.apache.ibatis.annotations.Param;
public interface LJDutyMapper extends BaseMapper<TDuty> {
/**
* 分页查询角色信息
* @param page
* @param duty
* @return
*/
Page<TDuty> selectDutyPage(Page page, @Param("duty") TDuty duty);
}

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.business.member.mapper.LJDutyMapper">
<select id="selectDutyPage" resultType="com.fuint.system.role.entity.TDuty">
SELECT td.*,sd.dept_name FROM t_duty td
left join sys_dept sd on sd.dept_id = td.store_id
<where>
<if test="duty.dutyName != null and duty.dutyName != ''">
and td.duty_name like concat('%', #{duty.dutyName}, '%')
</if>
<if test="duty.status != null and duty.status != ''">
and td.status = #{duty.status}
</if>
<if test="duty.dutyType != null and duty.dutyType != ''">
and td.duty_type = #{duty.dutyType}
</if>
<if test="duty.storeId != null">
and (td.store_id = #{duty.storeId} or FIND_IN_SET(#{duty.storeId}, sd.ancestors))
</if>
</where>
</select>
</mapper>

View File

@ -6,20 +6,21 @@
</sql>
<!--根据条件分页查询用户信息-->
<select id="selectLJStaffList" resultType="com.fuint.business.member.entity.LJStaff">
<include refid="selectMtStaff"></include>
SELECT ms.*,td.duty_name FROM mt_staff ms
left join t_duty td on ms.role_id = td.duty_id
<where>
store_id = #{staff.storeId} and if_delete = 0
ms.store_id = #{staff.storeId} and ms.if_delete = 0
<if test="staff.realName != null and staff.realName != ''">
and real_name like concat('%', #{staff.realName}, '%')
and ms.real_name like concat('%', #{staff.realName}, '%')
</if>
<if test="staff.mobile != null and staff.mobile != ''">
and mobile like concat('%', #{staff.mobile}, '%')
and ms.mobile like concat('%', #{staff.mobile}, '%')
</if>
<if test="staff.status != null and staff.status != ''">
and status = #{staff.status}
and ms.status = #{staff.status}
</if>
<if test="staff.id != null and staff.id != ''">
and id = #{staff.id}
and ms.id = #{staff.id}
</if>
</where>
</select>

View File

@ -1,5 +1,6 @@
package com.fuint.business.member.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.system.role.entity.TDuty;
@ -15,10 +16,32 @@ public interface ILJDutyService extends IService<TDuty> {
*/
public List<TDuty> selectDutyList();
/**
* 根据机构信息查询角色信息
* @return
*/
public List<TDuty> selectDutys(TDuty duty);
/**
* 根据id查询角色信息
* @param id
* @return
*/
public TDuty selectDutyById(int id);
/**
* 分页查询角色信息
* @param page
* @param duty
* @return
*/
Page<TDuty> selectDutyPage(Page page,TDuty duty);
/**
* 根据id删除角色信息
* @param id
*/
int deleteDuty(Integer id);
int updateDuty(TDuty duty);
}

View File

@ -1,16 +1,26 @@
package com.fuint.business.member.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.member.mapper.LJDutyMapper;
import com.fuint.business.member.service.ILJDutyService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.system.dept.entity.SysDept;
import com.fuint.system.dept.service.ISysDeptService;
import com.fuint.system.role.entity.TDuty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class LJDutyServiceImpl extends ServiceImpl<LJDutyMapper, TDuty> implements ILJDutyService {
@Autowired
private ISysDeptService sysDeptService;
/**
* 查询角色信息
* @return
@ -22,6 +32,25 @@ public class LJDutyServiceImpl extends ServiceImpl<LJDutyMapper, TDuty> implemen
return baseMapper.selectList(queryWrapper);
}
/**
* 根据机构id查询角色信息
* @param duty
* @return
*/
@Override
public List<TDuty> selectDutys(TDuty duty) {
QueryWrapper<TDuty> queryWrapper = new QueryWrapper<>();
if (ObjectUtil.isNotEmpty(duty.getStoreId())) {
SysDept sysDept = sysDeptService.selectParentId(Long.valueOf(duty.getStoreId()));
queryWrapper.eq("store_id", sysDept.getDeptId());
}else {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
SysDept sysDept = sysDeptService.selectParentId(nowAccountInfo.getDeptId());
queryWrapper.eq("store_id", sysDept.getDeptId());
}
return baseMapper.selectList(queryWrapper);
}
/**
* 根据id查询角色信息
* @param id
@ -31,4 +60,27 @@ public class LJDutyServiceImpl extends ServiceImpl<LJDutyMapper, TDuty> implemen
public TDuty selectDutyById(int id) {
return baseMapper.selectById(id);
}
@Override
public Page<TDuty> selectDutyPage(Page page, TDuty duty) {
if (ObjectUtil.isNotEmpty(duty.getStoreId())){
SysDept sysDept = sysDeptService.selectParentId(Long.valueOf(duty.getStoreId()));
duty.setStoreId(Math.toIntExact(sysDept.getDeptId()));
}else {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
SysDept sysDept = sysDeptService.selectParentId(nowAccountInfo.getDeptId());
duty.setStoreId(Math.toIntExact(sysDept.getDeptId()));
}
return baseMapper.selectDutyPage(page,duty);
}
@Override
public int deleteDuty(Integer id) {
return baseMapper.deleteById(id);
}
@Override
public int updateDuty(TDuty duty) {
return baseMapper.updateById(duty);
}
}

View File

@ -50,7 +50,7 @@ public class AllOrderInfoController extends BaseController {
* @return
*/
@PostMapping("/orderStatus")
public ResponseObject editStatus(@RequestBody Map<String,String> map){
public ResponseObject editStatus(@RequestBody Map<String,String> map) throws Exception {
String orderNo = map.get("orderNo");
String status = map.get("status");
return getSuccessResult(allOrderInfoService.updateAllOrderInfoByOrderNo(orderNo,status));

View File

@ -98,7 +98,7 @@ public class OilOrderController extends BaseController {
* @return
*/
@PostMapping
public ResponseObject add(@Validated @RequestBody Map<String,String> map){
public ResponseObject add(@Validated @RequestBody Map<String,String> map) throws Exception {
Map<String, Object> order = orderService.insertOilOrder(map);
return getSuccessResult(order);
}
@ -120,7 +120,7 @@ public class OilOrderController extends BaseController {
* @return
*/
@PostMapping("/appletPay")
public ResponseObject appletPay(@Validated @RequestBody Map<String,String> map){
public ResponseObject appletPay(@Validated @RequestBody Map<String,String> map) throws Exception {
return getSuccessResult(orderService.appletPay(map));
}
@ -179,7 +179,7 @@ public class OilOrderController extends BaseController {
* @return
*/
@PostMapping("/orderStatus")
public ResponseObject editStatus(@RequestBody Map<String,String> map){
public ResponseObject editStatus(@RequestBody Map<String,String> map) throws Exception {
String orderNo = map.get("orderNo");
String status = map.get("status");
return getSuccessResult(orderService.updateOrderStatus(orderNo,status));

View File

@ -52,7 +52,7 @@ public interface AllOrderInfoService {
* @param orderNo
* @return
*/
public int updateAllOrderInfoByOrderNo(String orderNo,String status);
public int updateAllOrderInfoByOrderNo(String orderNo,String status) throws Exception;
public int refund(Map<String,String> map);

View File

@ -81,7 +81,7 @@ public interface OilOrderService extends IService<OilOrder> {
* @param map
* @return
*/
public Map<String,Object> insertOilOrder(Map<String ,String> map);
public Map<String,Object> insertOilOrder(Map<String ,String> map) throws Exception;
/**
* 消费有礼调用接口
@ -93,7 +93,7 @@ public interface OilOrderService extends IService<OilOrder> {
* @param orderAmount 订单金额
* @param oilId 油品id
*/
void updateCardAndActiveById(Integer storeId,Integer userId,Integer activeId,Integer cardFavorableId,String type,Double orderAmount,Double payAmount,Integer oilId);
void updateCardAndActiveById(Integer storeId,Integer userId,Integer activeId,Integer cardFavorableId,String type,Double orderAmount,Double payAmount,Integer oilId) throws Exception;
/**
* 扫描小程序中二维码所处理的逻辑
@ -112,7 +112,7 @@ public interface OilOrderService extends IService<OilOrder> {
* 小程序订单支付
* @param map
*/
public Map<String, Object> appletPay(Map<String,String> map);
public Map<String, Object> appletPay(Map<String,String> map) throws Exception;
/**
* 根据订单号修改订单支付状态
@ -120,7 +120,7 @@ public interface OilOrderService extends IService<OilOrder> {
* @param status
* @return
*/
public int updateOrderStatus(String orderNo,String status);
public int updateOrderStatus(String orderNo,String status) throws Exception;
/**
* 添加油品跟踪信息

View File

@ -104,7 +104,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
@Override
public int updateAllOrderInfoByOrderNo(String orderNo, String status) {
public int updateAllOrderInfoByOrderNo(String orderNo, String status) throws Exception {
int row = 0;
AllOrderInfo allOrderInfo = this.selectAllOrderInfoByOrderNo(orderNo);
if (ObjectUtil.isNotEmpty(allOrderInfo)){

View File

@ -243,7 +243,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
}
@Override
public Map<String,Object> insertOilOrder(Map<String ,String> map) {
public Map<String,Object> insertOilOrder(Map<String ,String> map) throws Exception {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
// 油品订单信息
@ -557,7 +557,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
}
// 调用消费有礼接口
public void updateCardAndActiveById(Integer storeId,Integer userId,Integer activeId,Integer cardFavorableId,String type,Double orderAmount,Double payAmount,Integer oilId){
public void updateCardAndActiveById(Integer storeId,Integer userId,Integer activeId,Integer cardFavorableId,String type,Double orderAmount,Double payAmount,Integer oilId) throws Exception {
if (ObjectUtil.isNotEmpty(userId)){
LJUserVo userVo = userService.queryUserById(userId, storeId);
PaymentActiveVO paymentActiveVO = new PaymentActiveVO();
@ -1094,7 +1094,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
}
@Override
public Map<String, Object> appletPay(Map<String, String> map) {
public Map<String, Object> appletPay(Map<String, String> map) throws Exception {
String orderNo = map.get("orderNo");
// 支付金额
Double payAmount = Double.valueOf(map.get("payAmount"));
@ -1307,7 +1307,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
private CardValudChildrensService cardValudChildrensService;
@Override
public int updateOrderStatus(String orderNo, String status) {
public int updateOrderStatus(String orderNo, String status) throws Exception {
int row = 0;
OilOrder oilOrder = this.selectOilOrderByOrderNo(orderNo);
Integer userId = oilOrder.getUserId();

View File

@ -9,7 +9,8 @@ package com.fuint.common.enums;
public enum AdminRoleEnum {
ADMIN("1", "超级管理员","admin"),
COMMON("2", "普通管理员","common"),
USER("3", "用户角色","user");
USER("3", "用户角色","user"),
STAFF("4", "员工角色","staff");
private String key;
private String name;

View File

@ -23,6 +23,13 @@ public interface SourceService extends IService<TSource> {
*/
List<TSource> getAvailableSources(Integer merchantId);
/**
* 获取有效的菜单集合
*
* @return
*/
List<TSource> getAvailableSources1(Integer merchantId);
/**
* 获取菜单的属性结构
*

View File

@ -234,9 +234,7 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
String staffId = param.get("staffId") == null ? "0" : param.get("staffId").toString();
String deptId = param.get("deptId") == null ? "0" : param.get("deptId").toString();
ChainStoreInfo chainStoreInfo = chainStoreInfoService.selectChainStoreByDeptId(Long.valueOf(deptId));
if (ObjectUtil.isNotEmpty(chainStoreInfo) && ObjectUtil.isNotEmpty(chainStoreInfo.getId()))
merchantId = String.valueOf(chainStoreInfo.getId());
// 获取角色code
String code = param.get("code") == null ? "0" : param.get("code").toString();
@ -255,7 +253,13 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
LambdaQueryWrapper<MtStore> lambdaQueryWrapper = Wrappers.lambdaQuery();
lambdaQueryWrapper.eq(MtStore::getContractDeptId,deptId);
mtStore = mtStoreMapper.selectOne(lambdaQueryWrapper);
if (ObjectUtil.isNotEmpty(mtStore)) merchantId = String.valueOf(mtStore.getChainStoreId());
}
if ("2".equals(deptType)) {
// 查出storeId
ChainStoreInfo chainStoreInfo = chainStoreInfoService.selectChainStoreByDeptId(Long.valueOf(deptId));
if (ObjectUtil.isNotEmpty(chainStoreInfo) && ObjectUtil.isNotEmpty(chainStoreInfo.getId()))
merchantId = String.valueOf(chainStoreInfo.getId());
}
AccountInfo accountInfo = getAccountByName(accountName);
@ -359,6 +363,7 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
TAccount tAccount = getAccountInfoById(id.intValue());
tAccount.setAcctId(id.intValue());
tAccount.setRealName(realName);
tAccount.setRoleIds(roleId);
if (StringUtil.isNotEmpty(accountName)) {
tAccount.setAccountName(accountName);
@ -373,9 +378,15 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
tAccount.setStaffId(Integer.parseInt(staffId));
}
ChainStoreInfo chainStoreInfo = chainStoreInfoService.selectChainStoreByDeptId(tAccount.getDeptId());
if (ObjectUtil.isNotEmpty(chainStoreInfo) && ObjectUtil.isNotEmpty(chainStoreInfo.getId()))
merchantId = String.valueOf(chainStoreInfo.getId());
if (param.get("deptType").equals("3")) {
MtStore store = mtStoreMapper.selectById(Integer.valueOf(param.get("storeId").toString()));
if (ObjectUtil.isNotEmpty(store)) merchantId = String.valueOf(store.getChainStoreId());
}
if (param.get("deptType").equals("2")){
ChainStoreInfo chainStoreInfo = chainStoreInfoService.selectChainStoreByDeptId(tAccount.getDeptId());
if (ObjectUtil.isNotEmpty(chainStoreInfo) && ObjectUtil.isNotEmpty(chainStoreInfo.getId()))
merchantId = String.valueOf(chainStoreInfo.getId());
}
if (StringUtil.isNotEmpty(merchantId)) {
tAccount.setMerchantId(Integer.parseInt(merchantId));
@ -421,38 +432,40 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
if(ObjectUtil.isNotEmpty(staffId)) {
LJStaff ljStaff = ljStaffMapper.selectById(staffId);
// 修改对应的员工账号
ljStaff.setRealName(realName);
ljStaff.setStoreId(Integer.parseInt(storeId));
if (ObjectUtil.isNotEmpty(ljStaff)){
// 修改对应的员工账号
ljStaff.setRealName(realName);
ljStaff.setStoreId(Integer.parseInt(storeId));
ljStaff.setRoleId(roleId);
ljStaff.setRoleId(roleId);
boolean flag = false;
if (ObjectUtil.isNotEmpty(param.get("mobile"))) {
if (param.get("mobile").toString().equals(ljStaff.getMobile())) {
flag = true;
} else {
ljStaff.setMobile(param.get("mobile").toString());
boolean flag = false;
if (ObjectUtil.isNotEmpty(param.get("mobile"))) {
if (param.get("mobile").toString().equals(ljStaff.getMobile())) {
flag = true;
} else {
ljStaff.setMobile(param.get("mobile").toString());
}
}else {
throw new RuntimeException("请输入手机号!");
}
LambdaQueryWrapper<LJStaff> lambdaQueryWrapper = Wrappers.lambdaQuery();
if (!flag) {
// 查询手机号是否存在
lambdaQueryWrapper.eq(LJStaff::getMobile,param.get("mobile").toString());
lambdaQueryWrapper.eq(LJStaff::getIfDelete,0);
List list = ljStaffMapper.selectList(lambdaQueryWrapper);
if (list.size()>0) {
throw new RuntimeException("手机号重复!");
}
}
}else {
throw new RuntimeException("请输入手机号!");
ljStaffMapper.updateById(ljStaff);
}
LambdaQueryWrapper<LJStaff> lambdaQueryWrapper = Wrappers.lambdaQuery();
if (!flag) {
// 查询手机号是否存在
lambdaQueryWrapper.eq(LJStaff::getMobile,param.get("mobile").toString());
lambdaQueryWrapper.eq(LJStaff::getIfDelete,0);
List list = ljStaffMapper.selectList(lambdaQueryWrapper);
if (list.size()>0) {
throw new RuntimeException("手机号重复!");
}
}
ljStaffMapper.updateById(ljStaff);
}
} catch (BusinessCheckException e) {

View File

@ -2,8 +2,10 @@ package com.fuint.common.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.common.domain.TreeSelect;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.enums.StatusEnum;
import com.fuint.common.service.SourceService;
import com.fuint.common.util.TokenUtil;
import com.fuint.common.vo.MetaVo;
import com.fuint.common.vo.RouterVo;
import com.fuint.framework.annoation.OperationServiceLog;
@ -42,6 +44,11 @@ public class SourceServiceImpl extends ServiceImpl<TSourceMapper, TSource> imple
return tSourceMapper.findByStatus(merchantId, StatusEnum.ENABLED.getKey());
}
@Override
public List<TSource> getAvailableSources1(Integer merchantId) {
return tSourceMapper.findByStatus1(merchantId, StatusEnum.ENABLED.getKey());
}
/**
* 获取菜单的属性结构
*
@ -49,7 +56,10 @@ public class SourceServiceImpl extends ServiceImpl<TSourceMapper, TSource> imple
*/
@Override
public List<TreeNode> getSourceTree(Integer merchantId) {
List<TSource> tSources = getAvailableSources(merchantId);
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
// List<TSource> tSources = getAvailableSources(merchantId);
// if (nowAccountInfo.getRoleIds().equals("14")) tSources = getAvailableSources1(1);
List<TSource> tSources = getAvailableSources1(merchantId);
List<TreeNode> trees = new ArrayList<>();
if (tSources != null && tSources.size() > 0) {
TreeNode sourceTreeNode = null;

View File

@ -1,10 +1,13 @@
package com.fuint.module.backendApi.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.api.R;
import com.fuint.business.member.entity.LJStaff;
import com.fuint.business.member.service.ILJStaffService;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.userManager.entity.LJUser;
import com.fuint.business.userManager.service.LJUserService;
import com.fuint.common.dto.AccountInfo;
@ -20,6 +23,7 @@ import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import com.fuint.module.backendApi.response.LoginResponse;
import com.fuint.repository.model.TAccount;
import com.fuint.repository.model.TDutySource;
import com.fuint.system.role.entity.TDuty;
import com.fuint.repository.model.TSource;
import com.fuint.system.role.service.DutyService;
@ -77,6 +81,8 @@ public class BackendLoginController extends BaseController {
private CaptchaService captchaService;
@Autowired
private LJUserService userService;
@Autowired
private ILJStoreService storeService;
@Autowired
public RedisTemplate redisTemplate;
@ -273,8 +279,23 @@ public class BackendLoginController extends BaseController {
return getFailureResult(401, "登录信息已失效,请重新登录");
}
List<TSource> sources = sourceService.getMenuListByUserId(accountInfo.getMerchantId(), accountInfo.getId());
TDuty roleById = dutyService.getRoleById(Long.valueOf(accountInfo.getRoleIds()));
Integer merchantId = null;
if (ObjectUtil.isNotEmpty(roleById) && roleById.getDutyType().equals("3")) merchantId = 1;
if (ObjectUtil.isNotEmpty(roleById) && roleById.getDutyType().equals("4")) merchantId = 2;
List<TSource> sources = sourceService.getMenuListByUserId(merchantId, accountInfo.getId());
// List<TSource> sources = new ArrayList<>();
// if (!accountInfo.getRoleIds().equals("12") && !accountInfo.getRoleIds().equals("15") && !accountInfo.getRoleIds().equals("16")) {
// sources = sources1;
// }else {
// List<TDutySource> tDutySources = dutySourceService.selectListByChainStoreId(Integer.valueOf(accountInfo.getRoleIds()),chainStoreId);
// for (TDutySource tDutySource : tDutySources) {
// for (TSource tSource : sources1) {
// if (tDutySource.getSourceId().equals(tSource.getSourceId())) sources.add(tSource);
// }
// }
// }
List<TreeNode> trees = new ArrayList<>();
TreeNode treeNode;
for (TSource tSource : sources) {

View File

@ -1,5 +1,6 @@
package com.fuint.module.backendApi.controller;
import cn.hutool.core.util.ObjectUtil;
import com.fuint.common.domain.TreeNode;
import com.fuint.common.domain.TreeSelect;
import com.fuint.common.dto.AccountInfo;
@ -11,6 +12,7 @@ import com.fuint.common.util.TokenUtil;
import com.fuint.framework.exception.BusinessCheckException;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import com.fuint.repository.model.TAccount;
import com.fuint.repository.model.TSource;
import com.fuint.utils.StringUtil;
import io.swagger.annotations.Api;
@ -251,14 +253,13 @@ public class BackendSourceController extends BaseController {
* */
@ApiOperation(value = "获取菜单下拉树列表")
@RequestMapping(value = "/treeselect", method = RequestMethod.GET)
public ResponseObject treeselect(HttpServletRequest request) {
public ResponseObject treeselect(HttpServletRequest request, TAccount account) {
String token = request.getHeader("Access-Token");
AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);
if (accountInfo == null) {
return getFailureResult(1001, "请先登录");
}
List<TreeNode> sources = sSourceService.getSourceTree(accountInfo.getMerchantId());
List<TreeNode> sources = sSourceService.getSourceTree(ObjectUtil.isNotEmpty(account.getMerchantId()) ? account.getMerchantId() : null);
List<TreeSelect> data = sourceService.buildMenuTreeSelect(sources);
return getSuccessResult(data);

View File

@ -29,7 +29,7 @@ import java.util.List;
/**
* 部门信息
*
*
* @author ruoyi
*/
@RestController

View File

@ -48,6 +48,13 @@ public interface ISysDeptService extends IService<SysDept>
*/
public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts);
/**
* 查询除蓝鲸总部的父级信息
* @param deptId
* @return
*/
SysDept selectParentId(Long deptId);
/**
* 根据部门ID查询信息

View File

@ -135,7 +135,19 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper,SysDept> imple
List<SysDept> deptTrees = buildDeptTree(depts);
return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
}
@Override
public SysDept selectParentId(Long deptId) {
// SysDept sysDept = this.selectDeptById(deptId);
SysDept dept = this.selectDeptById(deptId);
Long parentId = dept.getParentId();
while (parentId > 100){
dept = this.selectDeptById(parentId);
parentId = dept.getParentId();
}
return dept;
}
/**
* 根据部门ID查询信息

View File

@ -1,10 +1,13 @@
package com.fuint.system.role.controller;
import cn.hutool.core.util.ObjectUtil;
import com.fuint.common.service.AccountService;
import com.fuint.common.util.Constants;
import com.fuint.common.dto.AccountDto;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.dto.RoleDto;
import com.fuint.common.enums.AdminRoleEnum;
import com.fuint.repository.model.TAccount;
import com.fuint.system.role.service.DutyService;
import com.fuint.common.service.SourceService;
import com.fuint.common.util.TokenUtil;
@ -49,6 +52,9 @@ public class BackendDutyController extends BaseController {
@Autowired
private SourceService tSourceService;
@Autowired
private AccountService accountService;
/**
* 角色列表
*
@ -86,6 +92,7 @@ public class BackendDutyController extends BaseController {
}
paginationRequest.setSearchParams(searchParams);
paginationRequest.setRoleIds(accountInfo.getRoleIds());
PaginationResponse<TDuty> paginationResponse = tDutyService.findDutiesByPagination(paginationRequest);
List<RoleDto> content = new ArrayList<>();
if (paginationResponse.getContent().size() > 0) {
@ -136,8 +143,15 @@ public class BackendDutyController extends BaseController {
String type = param.get("roleType").toString();
String status = param.get("status").toString();
String description = param.get("description").toString();
if (ObjectUtil.isEmpty(param.get("storeId"))){
return getFailureResult(1001, "请先选择机构");
}
Integer storeId = Integer.valueOf(param.get("storeId").toString());
AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);
if (ObjectUtil.isNotEmpty(accountInfo) && param.get("storeId").equals("-1")){
storeId = Math.toIntExact(accountInfo.getDeptId());
}
if (accountInfo == null) {
return getFailureResult(1001, "请先登录");
}
@ -159,6 +173,7 @@ public class BackendDutyController extends BaseController {
tDuty.setDutyType(type);
tDuty.setStatus(status);
tDuty.setDescription(description);
tDuty.setStoreId(storeId);
// 添加角色信息
try {
@ -198,6 +213,7 @@ public class BackendDutyController extends BaseController {
roleInfo.setDescription(htDuty.getDescription());
result.put("roleInfo", roleInfo);
List<Long> checkedKeys = tDutyService.getSourceIdsByDutyId(roleId.intValue());
if (checkedKeys != null && checkedKeys.size() > 0) {
result.put("checkedKeys", checkedKeys);
@ -218,7 +234,7 @@ public class BackendDutyController extends BaseController {
public ResponseObject updateHandler(HttpServletRequest request, @RequestBody Map<String, Object> param) {
String token = request.getHeader("Access-Token");
List<Integer> menuIds = (List) param.get("menuIds");
String id = param.get("id").toString();
String id = param.get("dutyId").toString();
String name = param.get("roleName").toString();
String type = param.get("roleType").toString();
String status = param.get("status").toString();
@ -234,7 +250,8 @@ public class BackendDutyController extends BaseController {
}
TDuty duty = tDutyService.getRoleById(Long.parseLong(id));
if (!duty.getStoreId().equals(accountInfo.getMerchantId()) && accountInfo.getMerchantId() > 0) {
if (!accountInfo.getDeptId().equals(Long.valueOf(duty.getStoreId())) && accountInfo.getStoreId()>0
&& !accountInfo.getRoleIds().equals("14")) {
return getFailureResult(201, "抱歉,您没有修改权限");
}

View File

@ -1,6 +1,7 @@
package com.fuint.system.role.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
@ -48,6 +49,10 @@ public class TDuty extends BaseEntity implements Serializable {
@ApiModelProperty("角色编码")
private String code;
private String permissionType;
/**
* 机构名称
*/
@TableField(exist = false)
private String deptName;
}

View File

@ -14,7 +14,7 @@
select * from t_duty u
where u.DUTY_NAME = #{name}
<if test="merchantId != null and merchantId > 0">
and u.MERCHANT_ID = #{merchantId}
and u.store_id = #{merchantId}
</if>
</select>

View File

@ -4,7 +4,11 @@ import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.enums.StatusEnum;
import com.fuint.common.service.AccountService;
import com.fuint.common.util.TokenUtil;
import com.fuint.repository.model.TAccount;
import com.fuint.system.role.service.DutyService;
import com.fuint.framework.annoation.OperationServiceLog;
import com.fuint.framework.exception.BusinessCheckException;
@ -23,6 +27,7 @@ import com.fuint.utils.StringUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
@ -47,6 +52,10 @@ public class DutyServiceImpl extends ServiceImpl<TDutyMapper, TDuty> implements
@Resource
private TDutySourceMapper tDutySourceMapper;
@Resource
@Lazy
private AccountService accountService;
@Override
public List<TDuty> getAvailableRoles(Integer merchantId) {
List<TDuty> result = tDutyMapper.findByStatus(merchantId, StatusEnum.ENABLED.getKey());
@ -88,8 +97,8 @@ public class DutyServiceImpl extends ServiceImpl<TDutyMapper, TDuty> implements
throw new BusinessRuntimeException("抱歉,您没有删除的权限");
}
try {
tDutySourceMapper.deleteSourcesByDutyId((int) dutyId);
tDutyMapper.deleteById(dutyId);
tDutySourceMapper.deleteSourcesByDutyId((int) dutyId);
tDutyMapper.deleteById(dutyId);
} catch (Exception e) {
throw new BusinessRuntimeException("该角色已存在关联用户,无法删除");
}
@ -153,6 +162,8 @@ public class DutyServiceImpl extends ServiceImpl<TDutyMapper, TDuty> implements
dutySource.setSourceId(tSource.getSourceId());
tDutySourceMapper.insert(dutySource);
}
}else {
tDutySourceMapper.deleteSourcesByDutyId(tduty.getDutyId());
}
tDutyMapper.updateById(existsDuty);
@ -195,11 +206,16 @@ public class DutyServiceImpl extends ServiceImpl<TDutyMapper, TDuty> implements
throw new BusinessCheckException("角色名称已经存在.");
}
this.tDutyMapper.insert(duty);
// AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
// TAccount byId = accountService.getById(nowAccountInfo.getId());
// Integer chainStoreId = null;
// if (ObjectUtil.isNotEmpty(byId)) chainStoreId = byId.getMerchantId();
if (sources != null && sources.size() > 0) {
for (TSource tSource : sources) {
TDutySource dutySource = new TDutySource();
dutySource.setDutyId(duty.getDutyId());
dutySource.setSourceId(tSource.getSourceId());
// dutySource.setChainStoreId(chainStoreId);
tDutySourceMapper.insert(dutySource);
}
}
@ -232,7 +248,17 @@ public class DutyServiceImpl extends ServiceImpl<TDutyMapper, TDuty> implements
}
lambdaQueryWrapper.orderByDesc(TDuty::getDutyId);
List<TDuty> dataList = tDutyMapper.selectList(lambdaQueryWrapper);
List<TDuty> dataList1 = tDutyMapper.selectList(lambdaQueryWrapper);
List<TDuty> dataList = new ArrayList<>();
if (paginationRequest.getRoleIds().equals("14")){
for (TDuty tDuty : dataList1) {
if (tDuty.getDutyId()==12) dataList.add(tDuty);
if (tDuty.getDutyId()==15) dataList.add(tDuty);
if (tDuty.getDutyId()==16) dataList.add(tDuty);
}
}else {
dataList = dataList1;
}
PageRequest pageRequest = PageRequest.of(paginationRequest.getCurrentPage(), paginationRequest.getPageSize());
PageImpl pageImpl = new PageImpl(dataList, pageRequest, pageHelper.getTotal());

View File

@ -1,5 +1,7 @@
package com.fuint.framework.pagination;
import lombok.Data;
import java.io.Serializable;
import java.util.Map;
@ -9,6 +11,7 @@ import java.util.Map;
* Created by FSQ
* CopyRight https://www.fuint.cn
*/
@Data
public class PaginationRequest implements Serializable {
/** */
@ -33,6 +36,10 @@ public class PaginationRequest implements Serializable {
* 分页查询参数
*/
private Map<String, Object> searchParams;
/**
* 角色id
*/
private String roleIds;
public int getCurrentPage() {
return currentPage;

View File

@ -19,4 +19,6 @@ public interface TSourceMapper extends BaseMapper<TSource> {
List<TSource> findByStatus(@Param("merchantId") Integer merchantId, @Param("status") String status);
List<TSource> findByStatus1(@Param("merchantId") Integer merchantId, @Param("status") String status);
}

View File

@ -35,10 +35,6 @@ public class TDutySource implements Serializable {
* 菜单id
*/
private Integer sourceId;
/**
* 连锁店id
*/
private Integer chainStoreId;
}

View File

@ -34,8 +34,14 @@
left join t_duty td ON ta.role_ids = td.duty_id
where account_status != -1
<if test="accountInfo.accountName != null and accountInfo.accountName != ''">
AND ta.account_name like concat('%',#{accountInfo.accountName},'%')
</if>
<if test="accountInfo.accountStatus != null">
AND ta.account_status = #{accountInfo.accountStatus}
</if>
<if test="accountInfo.realName != null and accountInfo.realName != ''">
AND ta.real_name = like concat('%',#{accountInfo.realName},'%')
AND ta.real_name like concat('%',#{accountInfo.realName},'%')
</if>
<if test="accountInfo.deptId != null">
AND (ta.dept_id = #{accountInfo.deptId} or FIND_IN_SET(#{accountInfo.deptId}, sd.ancestors))

View File

@ -2,7 +2,15 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.repository.mapper.TSourceMapper">
<select id="findSourcesByAccountId" resultType="com.fuint.repository.model.TSource">
SELECT s.* FROM `t_source` s WHERE s.status='A' AND (s.merchant_id = 0 OR s.merchant_id = #{merchantId}) AND source_id IN(SELECT source_id FROM `t_duty_source` WHERE duty_id IN(SELECT duty_id FROM `t_account_duty` WHERE acct_id = #{accountId})) ORDER BY s.source_style ASC
SELECT s.* FROM `t_source` s
WHERE s.status='A'
<if test="merchantId != null and merchantId > 0">
AND (s.merchant_id = 0 OR s.merchant_id = #{merchantId})
</if>
AND source_id IN(SELECT source_id FROM `t_duty_source`
WHERE duty_id IN(SELECT duty_id FROM `t_account_duty`
WHERE acct_id = #{accountId}))
ORDER BY s.source_style ASC
</select>
<select id="findByIdIn" resultType="com.fuint.repository.model.TSource">
@ -21,4 +29,12 @@
</if>
order by source_style asc
</select>
<select id="findByStatus1" resultType="com.fuint.repository.model.TSource">
select * from t_source s
where s.status = #{status}
<if test="merchantId != null and merchantId > 0">
and s.merchant_id = #{merchantId}
</if>
order by source_style asc
</select>
</mapper>