员工管理

This commit is contained in:
cun-nan 2023-10-10 18:58:08 +08:00
parent 0c376945aa
commit 29f78ae021
13 changed files with 951 additions and 128 deletions

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询员工列表
export function listStaff(query) {
return request({
url: '/business/member/staff/list',
method: 'get',
params: query
})
}
// 查询字典类型详细
export function getStaff(id) {
return request({
url: '/business/member/staff' + id,
method: 'get'
})
}
// 新增字典类型
export function addStaff(data) {
return request({
url: '/business/member/staff',
method: 'post',
data: data
})
}
// 修改字典类型
export function updateStaff(data) {
return request({
url: '/business/member/staff',
method: 'put',
data: data
})
}
// 删除字典类型
export function delStaff(id) {
return request({
url: '/business/member/staff' + id,
method: 'delete'
})
}

View File

@ -1,131 +1,135 @@
<template>
<div class="app-container">
<el-form :model="queryParams" class="main-search" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="员工类别" prop="category">
<el-select v-model="queryParams.category" clearable placeholder="请选择员工类别">
<el-option
v-for="item in categoryOptions"
:key="item.key"
:label="item.name"
:value="item.key"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="姓名" 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.auditedStatus"
placeholder="状态"
clearable
style="width: 240px"
>
<el-option key="A" label="启用" value="A"/>
<el-option key="N" label="禁用" value="N"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['staff:list']"
>新增员工</el-button>
</el-form-item>
</el-form>
<el-card >
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="员工类别" prop="category">
<el-select v-model="queryParams.category" clearable placeholder="请选择员工类别">
<el-option
v-for="item in categoryOptions"
:key="item.key"
:label="item.name"
:value="item.key"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="姓名" 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.auditedStatus"
placeholder="状态"
clearable
style="width: 240px"
>
<el-option key="A" label="启用" value="A"/>
<el-option key="N" label="禁用" value="N"/>
</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-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</el-form-item>
</el-form>
</el-card>
<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="category">
<template slot-scope="scope">
<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 label="ID" align="center" prop="id" width="80" />
<el-table-column label="类别" align="center" prop="category">
<template slot-scope="scope">
<span v-if="scope.row.category">
<span>{{ getName(categoryOptions, scope.row.category) }}</span>
</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="姓名" align="center" prop="realName" />
<el-table-column label="手机号" align="center" prop="mobile" />
<el-table-column label="关联会员ID" align="center" prop="userId" />
<el-table-column label="所属店铺" align="center" prop="storeName">
<template slot-scope="scope">
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="姓名" align="center" prop="realName" />
<el-table-column label="手机号" align="center" prop="mobile" />
<el-table-column label="关联会员ID" align="center" prop="userId" />
<el-table-column label="所属店铺" align="center" prop="storeName">
<template slot-scope="scope">
<span v-if="scope.row.storeId">
<span>{{ getName(storeOptions, scope.row.storeId) }}</span>
</span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="storeName">
<template slot-scope="scope">
<el-switch
v-model="scope.row.auditedStatus"
active-value="A"
inactive-value="N"
@change="handleStatusChange(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="更新时间" align="center" prop="updateTime">
<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"
v-hasPermi="['staff:list']"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
v-hasPermi="['staff:list']"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="storeName">
<template slot-scope="scope">
<el-switch
v-model="scope.row.auditedStatus"
active-value="A"
inactive-value="N"
@change="handleStatusChange(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="更新时间" align="center" prop="updateTime">
<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"
v-hasPermi="['staff:list']"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
v-hasPermi="['staff:list']"
@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"
/>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-card>
<!-- 添加或修改对话框 -->
<el-dialog :title="title" :visible.sync="open" class="common-dialog" width="700px" append-to-body>
@ -204,6 +208,8 @@
<script>
import { getStaffList, getStaffInfo, updateStaffStatus, deleteStaff, saveStaff } from "@/api/staff";
import { searchStore } from "@/api/store";
import {getName} from "../../utils/fuint";
import {listStaff} from "@/api/staff/staff";
export default {
name: "StaffList",
@ -212,7 +218,7 @@ export default {
//
title: "",
//
loading: true,
loading: false,
//
ids: [],
//
@ -259,26 +265,36 @@ export default {
},
created() {
this.getList();
this.getStoreList();
// this.getStoreList();
},
methods: {
getName,
//
getList() {
this.loading = true;
getStaffList(this.addDateRange(this.queryParams, this.dateRange)).then( response => {
this.list = response.data.paginationResponse.content;
this.total = response.data.paginationResponse.totalElements;
this.categoryOptions = response.data.categoryList;
this.loading = false;
// this.loading = true;
listStaff().then(response => {
this.list = response.data.records;
this.total = response.data.total;
}
);
// getStaffList(this.addDateRange(this.queryParams, this.dateRange)).then( response => {
// this.list = response.data.paginationResponse.content;
// this.total = response.data.paginationResponse.totalElements;
// this.categoryOptions = response.data.categoryList;
// this.loading = false;
// }
// );
},
//
getStoreList() {
searchStore().then( response => {
this.storeOptions = response.data.storeList;
listStaff().then(response => {
this.storeOptions = response.data.records;
}
);
// searchStore().then(response => {
// this.storeOptions = response.data.storeList;
// }
// );
},
//
handleQuery() {

View File

@ -0,0 +1,75 @@
package com.fuint.business.member.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.member.entity.LJStaff;
import com.fuint.business.member.service.ILJStaffService;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/business/member/staff")
public class LJStaffController extends BaseController {
@Autowired
private ILJStaffService mtStaffService;
/**
* 根据条件分页查询员工信息
* @param staff
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/list")
public ResponseObject list(LJStaff staff,
@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<LJStaff> list = mtStaffService.selectStaffList(page,staff);
return getSuccessResult(list);
}
/**
* 根据id查询员工信息
* @param id
* @return
*/
@GetMapping("/{id}")
public ResponseObject staffInfo(@PathVariable Integer id){
LJStaff staff = mtStaffService.selectStaffById(id);
return getSuccessResult(staff);
}
/**
* 批量删除员工信息
* @return
*/
@DeleteMapping("/id")
public ResponseObject remove(@PathVariable Integer id){
mtStaffService.removeById(id);
return getSuccessResult("操作成功");
}
/**
* 添加员工信息
* @param staff
* @return
*/
@PostMapping
public ResponseObject add(@Validated @RequestBody LJStaff staff){
return getSuccessResult(mtStaffService.insertStaff(staff));
}
/**
* 修改员工信息
* @param staff
* @return
*/
@PutMapping
public ResponseObject edit(@Validated @RequestBody LJStaff staff){
return getSuccessResult(mtStaffService.updateStaff(staff));
}
}

View File

@ -0,0 +1,58 @@
package com.fuint.business.member.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.util.Date;
/**
* 角色表
*
* Created by FSQ
* CopyRight https://www.fuint.cn
*/
@Getter
@Setter
@TableName("t_duty")
@ApiModel(value = "TDuty对象", description = "角色表")
public class LJDuty implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("角色ID")
@TableId(value = "duty_id", type = IdType.AUTO)
private Integer dutyId;
@ApiModelProperty("商户ID")
private Integer merchantId;
@ApiModelProperty("角色名称")
private String dutyName;
@ApiModelProperty("状态(A: 可用 D: 禁用)")
private String status;
@ApiModelProperty("描述")
private String description;
@ApiModelProperty("角色类型")
private String dutyType;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("修改时间")
private Date updateTime;
@ApiModelProperty("创建用户")
private Date createUser;
@ApiModelProperty("修改用户")
private Date updateUser;
}

View File

@ -0,0 +1,115 @@
package com.fuint.business.member.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fuint.framework.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.util.Date;
/**
* 店铺员工表
*
* Created by FSQ
* CopyRight https://www.fuint.cn
*/
@Getter
@Setter
@TableName("mt_staff")
@ApiModel(value = "MtStaff对象", description = "店铺员工表")
public class LJStaff extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("自增ID")
@TableId(value = "ID", type = IdType.AUTO)
private Integer id;
@ApiModelProperty("员工类别")
private Integer category;
@ApiModelProperty("用户ID")
private Integer userId;
@ApiModelProperty("手机号码")
private String mobile;
@ApiModelProperty("真实姓名")
private String realName;
@ApiModelProperty("微信号")
private String wechat;
@ApiModelProperty("商户ID")
private Integer merchantId;
@ApiModelProperty("店铺ID")
private Integer storeId;
@ApiModelProperty("审核状态A审核通过U未审核D无效; ")
private String auditedStatus;
@ApiModelProperty("审核时间")
private Date auditedTime;
@ApiModelProperty("备注")
private String description;
@ApiModelProperty("一键加油: 显示、隐藏")
private String isRefuel;
@ApiModelProperty("交班模式:当前门店统一交班;当前账户交班;指定商户号交班")
private String handoverMode;
@ApiModelProperty("交班权限,有权限;没有权限")
private String handoverPrem;
@ApiModelProperty("交班退出:交班退出;交班不退出")
private String out;
@ApiModelProperty("交班记录,全部记录;名下记录;禁用权限")
private String record;
@ApiModelProperty("交班商户号,启用;禁用")
private String merchantStatus;
@ApiModelProperty("员工筛选,启用;禁用")
private String screen;
@ApiModelProperty("POS权限")
private String posPrem;
@ApiModelProperty("小程序权限")
private String appletPrem;
@ApiModelProperty("收款通知(模板通知),禁用;全部交易;名下交易;指定邮箱")
private String notice;
@ApiModelProperty("模板油枪号,对应油枪号信息,当收款通知选择指定邮箱时才可选择")
private String oilGunId;
@ApiModelProperty("时间范围1不限2当天33天内47天内530天内6当月7当前班次")
private String timeFrame;
@ApiModelProperty("退款权限,有权限;无权限")
private String refund;
@ApiModelProperty("交易统计1全部交易2名下交易")
private String transaction;
@ApiModelProperty("核销权限1洗车卡券2兑换券")
private String writeOff;
@ApiModelProperty("特殊权限1PC后台管理2POS收银系统3PC收银权限4小程序端报表")
private String specialPrem;
@ApiModelProperty("公众号1未关注2已关注")
private String official;
}

View File

@ -0,0 +1,61 @@
package com.fuint.business.member.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.member.entity.LJStaff;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
/**
* 店铺员工表 Mapper 接口
*
* Created by FSQ
* CopyRight https://www.fuint.cn
*/
@Mapper
public interface LJStaffMapper extends BaseMapper<LJStaff> {
/**
* 根据条件分页查询员工信息
* @param page
* @param staff
* @return
*/
public IPage<LJStaff> selectLJStaffList(Page page, @Param("staff") LJStaff staff);
/**
* 根据id查询员工信息
* @param id
* @return
*/
public LJStaff selectLJStaffById(@Param("id") int id);
/**
* 根据id删除员工信息
* @param id
* @return
*/
public int deleteStaffById(@Param("id") int id);
/**
* 添加员工信息
* @param staff
* @return
*/
public int insertStaff(LJStaff staff);
/**
* 修改员工信息
* @param staff
* @return
*/
public int updateStaff(LJStaff staff);
int updateStatus(@Param("id") Integer id, @Param("status") String status, @Param("updateTime") Date updateTime);
LJStaff queryStaffByMobile(@Param("mobile") String mobile);
LJStaff queryStaffByUserId(@Param("userId") Integer userId);
}

View File

@ -0,0 +1,149 @@
<?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.LJStaffMapper">
<resultMap type="com.fuint.business.member.entity.LJStaff" id="LJStaffResult">
<id property="id" column="id" />
<result property="merchantId" column="merchant_id" />
<result property="storeId" column="store_id" />
<result property="userId" column="user_id" />
<result property="category" column="category" />
<result property="mobile" column="mobile" />
<result property="realName" column="real_name" />
<result property="wechat" column="wechat" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="auditedStatus" column="audited_status" />
<result property="auditedTime" column="audited_time" />
<result property="description" column="description" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="isRefuel" column="is_refuel" />
<result property="handoverMode" column="handover_mode" />
<result property="handoverPrem" column="handover_prem" />
<result property="handoverPrem" column="handover_prem" />
<result property="out" column="out" />
<result property="record" column="record" />
<result property="merchantStatus" column="merchant_status" />
<result property="screen" column="screen" />
<result property="posPrem" column="pos_prem" />
<result property="appletPrem" column="applet_prem" />
<result property="notice" column="notice" />
<result property="oilGunId" column="oil_gun_id" />
<result property="timeFrame" column="time_frame" />
<result property="refund" column="refund" />
<result property="transaction" column="transaction" />
<result property="writeOff" column="write_off" />
<result property="specialPrem" column="special_prem" />
<result property="official" column="official" />
</resultMap>
<sql id="selectMtStaff">
select id, merchant_id, store_id, user_id, category, mobile, real_name, wechat, create_time, update_time,
audited_status, audited_time, description, create_by, update_by, is_refuel, handover_mode, handover_prem,
`out`, record, merchant_status, screen, pos_prem, applet_prem, notice, oil_gun_id, time_frame, refund, transaction,
write_off, special_prem, official from mt_staff
</sql>
<!--根据条件分页查询用户信息-->
<select id="selectLJStaffList" resultMap="LJStaffResult">
<include refid="selectMtStaff"></include>
<where>
<if test="staff.realName != null and staff.realName != ''">
and real_name like concat('%', #{staff.realName}, '%')
</if>
<if test="staff.mobile != null and staff.mobile != ''">
and mobile like concat('%', #{staff.mobile}, '%')
</if>
</where>
</select>
<!--根据id查询员工信息-->
<select id="selectLJStaffById" resultMap="LJStaffResult">
<include refid="selectMtStaff"></include>
where id = #{id}
</select>
<!--根据id查询员工信息-->
<select id="deleteStaffById">
delete from mt_staff where id = #{id}
</select>
<!--增加员工信息-->
<insert id="insertStaff">
insert into mt_staff(
<if test="merchantId != null">merchant_id,</if>
<if test="storeId != null">store_id,</if>
<if test="userId != null">user_id,</if>
<if test="category != null">category,</if>
<if test="mobile != null and mobile != ''">mobile,</if>
<if test="realName != null and realName != ''">real_name,</if>
<if test="wechat != null and wechat != ''">wechat,</if>
<if test="updateTime != null and updateTime != ''">update_time,</if>
<if test="auditedStatus != null and auditedStatus != ''">audited_status,</if>
<if test="auditedTime != null and auditedTime != ''">audited_time,</if>
<if test="description != null and description != ''">description,</if>
<if test="createUser != null and createUser != ''">create_user,</if>
<if test="updateUser != null and updateUser != ''">update_user,</if>
<if test="isRefuel != null and isRefuel != ''">is_refuel,</if>
<if test="handoverMode != null and handoverMode != ''">handover_mode,</if>
<if test="handoverPrem != null and handoverPrem != ''">handover_prem,</if>
<if test="out != null and out != ''">out,</if>
<if test="record != null and record != ''">record,</if>
<if test="merchantStatus != null and merchantStatus != ''">merchant_status,</if>
<if test="screen != null and screen != ''">screen,</if>
<if test="posPrem != null and posPrem != ''">pos_prem,</if>
<if test="appletPrem != null and appletPrem != ''">applet_prem,</if>
<if test="notice != null and notice != ''">notice,</if>
<if test="oilGunId != null and oilGunId != ''">oil_gun_id,</if>
<if test="timeFrame != null and timeFrame != ''">time_frame,</if>
<if test="refund != null and refund != ''">refund,</if>
<if test="transaction != null and transaction != ''">transaction,</if>
<if test="writeOff != null and writeOff != ''">write_off,</if>
<if test="specialPrem != null and specialPrem != ''">special_prem,</if>
<if test="official != null and official != ''">official,</if>
create_time
)values (
<if test="merchantId != null">#{merchantId},</if>
<if test="storeId != null">#{storeId},</if>
<if test="userId != null">#{userId},</if>
<if test="category != null">#{category},</if>
<if test="mobile != null and mobile != ''">#{mobile},</if>
<if test="realName != null and realName != ''">#{realName},</if>
<if test="wechat != null and wechat != ''">#{wechat},</if>
<if test="updateTime != null and updateTime != ''">#{updateTime},</if>
<if test="auditedStatus != null and auditedStatus != ''">#{auditedStatus},</if>
<if test="auditedTime != null and auditedTime != ''">#{auditedTime},</if>
<if test="description != null and description != ''">#{description},</if>
<if test="createUser != null and createUser != ''">#{createUser},</if>
<if test="updateUser != null and updateUser != ''">#{updateUser},</if>
<if test="isRefuel != null and isRefuel != ''">#{isRefuel},</if>
<if test="handoverMode != null and handoverMode != ''">#{handoverMode},</if>
<if test="handoverPrem != null and handoverPrem != ''">#{handoverPrem},</if>
<if test="out != null and out != ''">#{out},</if>
<if test="record != null and record != ''">#{record},</if>
<if test="merchantStatus != null and merchantStatus != ''">#{merchantStatus},</if>
<if test="screen != null and screen != ''">#{screen},</if>
<if test="posPrem != null and posPrem != ''">#{posPrem},</if>
<if test="appletPrem != null and appletPrem != ''">#{appletPrem},</if>
<if test="notice != null and notice != ''">#{notice},</if>
<if test="oilGunId != null and oilGunId != ''">#{oilGunId},</if>
<if test="timeFrame != null and timeFrame != ''">#{time_frame},</if>
<if test="refund != null and refund != ''">#{refund},</if>
<if test="transaction != null and transaction != ''">#{transaction},</if>
<if test="writeOff != null and writeOff != ''">#{write_off},</if>
<if test="specialPrem != null and specialPrem != ''">#{special_prem},</if>
<if test="official != null and official != ''">#{official},</if>
sysdate()
)
</insert>
<!-- 修改员工信息-->
<update id="updateStaff"></update>
<update id="updateStatus">
update mt_staff p set p.AUDITED_STATUS = #{status}, p.UPDATE_TIME = #{updateTime} where p.ID = #{id}
</update>
<select id="queryStaffByMobile" resultType="com.fuint.repository.model.MtStaff">
select * from mt_staff t where t.MOBILE = #{mobile} and t.AUDITED_STATUS != 'D'
</select>
<select id="queryStaffByUserId" resultType="com.fuint.repository.model.MtStaff">
select * from mt_staff t where t.USER_ID = #{userId} and t.AUDITED_STATUS != 'D'
</select>
</mapper>

View File

@ -0,0 +1,40 @@
package com.fuint.business.member.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.member.entity.LJStaff;
/**
* 员工管理 业务层
*/
public interface ILJStaffService extends IService<LJStaff> {
/**
* 根据条件分页查询员工信息
* @param page
* @return
*/
public IPage<LJStaff> selectStaffList(Page page, LJStaff LJStaff);
/**
* 根据id查询员工信息
* @param id
* @return
*/
public LJStaff selectStaffById(int id);
/**
* 批量删除员工信息
* @param ids
*/
public void deleteStaffByIds(Integer[] ids);
/**
* 增加员工信息
* @param staff
* @return
*/
public int insertStaff(LJStaff staff);
public int updateStaff(LJStaff staff);
}

View File

@ -0,0 +1,72 @@
package com.fuint.business.member.service.impl;
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.business.member.entity.LJStaff;
import com.fuint.business.member.mapper.LJStaffMapper;
import com.fuint.business.member.service.ILJStaffService;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* 员工管理 业务层
*/
@Service
public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> implements ILJStaffService {
/**
* 根据条件分页查询员工信息
* @param page
* @param staff
* @return
*/
@Override
public IPage<LJStaff> selectStaffList(Page page, LJStaff staff) {
return baseMapper.selectLJStaffList(page,staff);
}
/**
* 根据id查询员工信息
* @param id
* @return
*/
@Override
public LJStaff selectStaffById(int id) {
return baseMapper.selectById(id);
}
/**
* 根据id批量删除员工信息
* @param ids
*/
@Override
public void deleteStaffByIds(Integer[] ids) {
for (int id : ids){
baseMapper.deleteById(id);
}
}
/**
* 添加用户信息
* @param staff
* @return
*/
@Override
public int insertStaff(LJStaff staff) {
staff.setCreateTime(new Date());
int row = baseMapper.insert(staff);
return row;
}
/**
* 修改用户信息
* @param staff
* @return
*/
@Override
public int updateStaff(LJStaff staff) {
int row = baseMapper.updateById(staff);
return row;
}
}

View File

@ -64,4 +64,60 @@ public class MtStaff implements Serializable {
@ApiModelProperty("备注")
private String description;
@ApiModelProperty("创建用户")
private String createUser;
@ApiModelProperty("修改用户")
private String updateUser;
@ApiModelProperty("一键加油: 显示、隐藏")
private String isRefuel;
@ApiModelProperty("交班模式:当前门店统一交班;当前账户交班;指定商户号交班")
private String handoverMode;
@ApiModelProperty("交班权限,有权限;没有权限")
private String handoverPrem;
@ApiModelProperty("交班退出:交班退出;交班不退出")
private String out;
@ApiModelProperty("交班记录,全部记录;名下记录;禁用权限")
private String record;
@ApiModelProperty("交班商户号,启用;禁用")
private String merchantStatus;
@ApiModelProperty("员工筛选,启用;禁用")
private String screen;
@ApiModelProperty("POS权限")
private String posPrem;
@ApiModelProperty("小程序权限")
private String appletPrem;
@ApiModelProperty("收款通知(模板通知),禁用;全部交易;名下交易;指定邮箱")
private String notice;
@ApiModelProperty("模板油枪号,对应油枪号信息,当收款通知选择指定邮箱时才可选择")
private String oilGunId;
@ApiModelProperty("时间范围1不限2当天33天内47天内530天内6当月7当前班次")
private String timeFrame;
@ApiModelProperty("退款权限,有权限;无权限")
private String refund;
@ApiModelProperty("交易统计1全部交易2名下交易")
private String transaction;
@ApiModelProperty("核销权限1洗车卡券2兑换券")
private String writeOff;
@ApiModelProperty("特殊权限1PC后台管理2POS收银系统3PC收银权限4小程序端报表")
private String specialPrem;
@ApiModelProperty("公众号1未关注2已关注")
private String official;
}

View File

@ -69,4 +69,13 @@ public class TAccount implements Serializable {
@ApiModelProperty("员工ID")
private Integer staffId;
@ApiModelProperty("账户头像地址")
private String avatar;
@ApiModelProperty("创建用户")
private String createUser;
@ApiModelProperty("修改用户")
private String updateUser;
}

View File

@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import com.fuint.repository.model.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
@ -19,7 +22,7 @@ import lombok.Setter;
@Setter
@TableName("t_duty")
@ApiModel(value = "TDuty对象", description = "角色表")
public class TDuty implements Serializable {
public class TDuty extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ -41,4 +44,6 @@ public class TDuty implements Serializable {
@ApiModelProperty("角色类型")
private String dutyType;
}

View File

@ -0,0 +1,123 @@
package com.fuint.repository.model.base;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* Entity基类
*
* @author ruoyi
*/
public class BaseEntity implements Serializable
{
private static final long serialVersionUID = 1L;
/** 搜索值 */
@JsonIgnore
@TableField(exist = false)
private String searchValue;
/** 创建者 */
private String createBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/** 更新者 */
private String updateBy;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/** 备注 */
@TableField(exist = false)
private String remark;
/** 请求参数 */
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@TableField(exist = false)
private Map<String, Object> params;
public String getSearchValue()
{
return searchValue;
}
public void setSearchValue(String searchValue)
{
this.searchValue = searchValue;
}
public String getCreateBy()
{
return createBy;
}
public void setCreateBy(String createBy)
{
this.createBy = createBy;
}
public Date getCreateTime()
{
return createTime;
}
public void setCreateTime(Date createTime)
{
this.createTime = createTime;
}
public String getUpdateBy()
{
return updateBy;
}
public void setUpdateBy(String updateBy)
{
this.updateBy = updateBy;
}
public Date getUpdateTime()
{
return updateTime;
}
public void setUpdateTime(Date updateTime)
{
this.updateTime = updateTime;
}
public String getRemark()
{
return remark;
}
public void setRemark(String remark)
{
this.remark = remark;
}
public Map<String, Object> getParams()
{
if (params == null)
{
params = new HashMap<>();
}
return params;
}
public void setParams(Map<String, Object> params)
{
this.params = params;
}
}