员工管理护工管理数据分离

This commit is contained in:
ryoeiken 2020-11-24 23:17:51 +08:00
parent 64bd494733
commit 7cdb38b7c9
10 changed files with 46 additions and 258 deletions

View File

@ -1,107 +0,0 @@
package com.ruoyi.system.fantang.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtCareStaffInfoDao;
import com.ruoyi.system.fantang.service.IFtCareStaffInfoDaoService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
/**
* 护工信息Controller
*
* @author ft
* @date 2020-11-19
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/careStaffInfo")
public class FtCareStaffInfoDaoController extends BaseController {
private final IFtCareStaffInfoDaoService iFtCareStaffInfoDaoService;
/**
* 查询护工信息列表
*/
@PreAuthorize("@ss.hasPermi('fantang:careStaffInfo:list')")
@GetMapping("/list")
public TableDataInfo list(FtCareStaffInfoDao ftCareStaffInfoDao) {
startPage();
LambdaQueryWrapper<FtCareStaffInfoDao> lqw = Wrappers.lambdaQuery(ftCareStaffInfoDao);
if (StringUtils.isNotBlank(ftCareStaffInfoDao.getName())) {
lqw.like(FtCareStaffInfoDao::getName, ftCareStaffInfoDao.getName());
}
if (StringUtils.isNotBlank(ftCareStaffInfoDao.getCorpName())) {
lqw.like(FtCareStaffInfoDao::getCorpName, ftCareStaffInfoDao.getCorpName());
}
if (StringUtils.isNotBlank(ftCareStaffInfoDao.getDepartList())) {
lqw.eq(FtCareStaffInfoDao::getDepartList, ftCareStaffInfoDao.getDepartList());
}
List<FtCareStaffInfoDao> list = iFtCareStaffInfoDaoService.list(lqw);
return getDataTable(list);
}
/**
* 导出护工信息列表
*/
@PreAuthorize("@ss.hasPermi('fantang:careStaffInfo:export')")
@Log(title = "护工信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtCareStaffInfoDao ftCareStaffInfoDao) {
LambdaQueryWrapper<FtCareStaffInfoDao> lqw = new LambdaQueryWrapper<FtCareStaffInfoDao>(ftCareStaffInfoDao);
List<FtCareStaffInfoDao> list = iFtCareStaffInfoDaoService.list(lqw);
ExcelUtil<FtCareStaffInfoDao> util = new ExcelUtil<FtCareStaffInfoDao>(FtCareStaffInfoDao.class);
return util.exportExcel(list, "careStaffInfo");
}
/**
* 获取护工信息详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:careStaffInfo:query')")
@GetMapping(value = "/{careStaffId}")
public AjaxResult getInfo(@PathVariable("careStaffId") Long careStaffId) {
return AjaxResult.success(iFtCareStaffInfoDaoService.getById(careStaffId));
}
/**
* 新增护工信息
*/
@PreAuthorize("@ss.hasPermi('fantang:careStaffInfo:add')")
@Log(title = "护工信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtCareStaffInfoDao ftCareStaffInfoDao) {
return toAjax(iFtCareStaffInfoDaoService.save(ftCareStaffInfoDao) ? 1 : 0);
}
/**
* 修改护工信息
*/
@PreAuthorize("@ss.hasPermi('fantang:careStaffInfo:edit')")
@Log(title = "护工信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtCareStaffInfoDao ftCareStaffInfoDao) {
return toAjax(iFtCareStaffInfoDaoService.updateById(ftCareStaffInfoDao) ? 1 : 0);
}
/**
* 删除护工信息
*/
@PreAuthorize("@ss.hasPermi('fantang:careStaffInfo:remove')")
@Log(title = "护工信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{careStaffIds}")
public AjaxResult remove(@PathVariable Long[] careStaffIds) {
return toAjax(iFtCareStaffInfoDaoService.removeByIds(Arrays.asList(careStaffIds)) ? 1 : 0);
}
}

View File

@ -40,19 +40,17 @@ public class FtStaffInfoDaoController extends BaseController {
* 查询员工管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:staffInfo:list')")
@GetMapping("/list")
public TableDataInfo list(FtStaffInfoDao ftStaffInfoDao) {
@GetMapping("/staffList")
public TableDataInfo staffList(FtStaffInfoDao ftStaffInfoDao) {
startPage();
LambdaQueryWrapper<FtStaffInfoDao> lqw = Wrappers.lambdaQuery(ftStaffInfoDao);
lqw.eq(FtStaffInfoDao::getStaffType, 1);
if (StringUtils.isNotBlank(ftStaffInfoDao.getName())) {
lqw.like(FtStaffInfoDao::getName, ftStaffInfoDao.getName());
}
if (StringUtils.isNotBlank(ftStaffInfoDao.getPost())) {
lqw.eq(FtStaffInfoDao::getPost, ftStaffInfoDao.getPost());
}
if (StringUtils.isNotBlank(ftStaffInfoDao.getRole())) {
lqw.eq(FtStaffInfoDao::getRole, ftStaffInfoDao.getRole());
}
if (ftStaffInfoDao.getFlag() != null) {
lqw.eq(FtStaffInfoDao::getFlag, ftStaffInfoDao.getFlag());
}
@ -60,6 +58,25 @@ public class FtStaffInfoDaoController extends BaseController {
return getDataTable(list);
}
/**
* 查询护工管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:staffInfo:list')")
@GetMapping("/careStaffList")
public TableDataInfo careStaffList(FtStaffInfoDao ftStaffInfoDao) {
startPage();
LambdaQueryWrapper<FtStaffInfoDao> lqw = Wrappers.lambdaQuery(ftStaffInfoDao);
lqw.eq(FtStaffInfoDao::getStaffType, 2);
if (StringUtils.isNotBlank(ftStaffInfoDao.getName())) {
lqw.like(FtStaffInfoDao::getName, ftStaffInfoDao.getName());
}
if (StringUtils.isNotBlank(ftStaffInfoDao.getPost())) {
lqw.eq(FtStaffInfoDao::getPost, ftStaffInfoDao.getPost());
}
List<FtStaffInfoDao> list = iFtStaffInfoDaoService.list(lqw);
return getDataTable(list);
}
/**
* 导出员工管理列表
*/
@ -92,7 +109,7 @@ public class FtStaffInfoDaoController extends BaseController {
List<FtStaffInfoDao> list = iFtStaffInfoDaoService.list(null);
for (FtStaffInfoDao staffInfoDao : list) {
if (ftStaffInfoDao.getTel().equals(staffInfoDao.getTel())) {
if (ftStaffInfoDao.getTel() != null && ftStaffInfoDao.getTel().equals(staffInfoDao.getTel())) {
return AjaxResult.error("该电话号码已存在");
}
}
@ -110,8 +127,9 @@ public class FtStaffInfoDaoController extends BaseController {
}
ftStaffInfoDao.setCreateAt(new Date());
ftStaffInfoDao.setDepartId(Long.parseLong(ftStaffInfoDao.getDeptList()));
boolean save = iFtStaffInfoDaoService.save(ftStaffInfoDao);
iFtStaffInfoDaoService.save(ftStaffInfoDao);
return AjaxResult.success("添加成功");
}

View File

@ -1,71 +0,0 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* 护工信息对象 ft_care_staff_info
*
* @author ft
* @date 2020-11-19
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_care_staff_info")
public class FtCareStaffInfoDao implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 护工 id
*/
@TableId(value = "care_staff_id")
private Long careStaffId;
/**
* 姓名
*/
@Excel(name = "姓名")
private String name;
/**
* 所属公司名称
*/
@Excel(name = "所属公司名称")
private String corpName;
/**
* 所属科室清单
*/
@Excel(name = "所属科室清单")
private String departList;
/**
* 启用标志
*/
private Integer flag;
/**
* 照片
*/
@Excel(name = "照片")
private String photo;
/**
* 二维码
*/
@Excel(name = "二维码")
private String qrCode;
}

View File

@ -1,14 +0,0 @@
package com.ruoyi.system.fantang.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.fantang.domain.FtCareStaffInfoDao;
/**
* 护工信息Mapper接口
*
* @author ft
* @date 2020-11-19
*/
public interface FtCareStaffInfoDaoMapper extends BaseMapper<FtCareStaffInfoDao> {
}

View File

@ -1,14 +0,0 @@
package com.ruoyi.system.fantang.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.system.fantang.domain.FtCareStaffInfoDao;
/**
* 护工信息Service接口
*
* @author ft
* @date 2020-11-19
*/
public interface IFtCareStaffInfoDaoService extends IService<FtCareStaffInfoDao> {
}

View File

@ -1,18 +0,0 @@
package com.ruoyi.system.fantang.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.fantang.domain.FtCareStaffInfoDao;
import com.ruoyi.system.fantang.mapper.FtCareStaffInfoDaoMapper;
import com.ruoyi.system.fantang.service.IFtCareStaffInfoDaoService;
import org.springframework.stereotype.Service;
/**
* 护工信息Service业务层处理
*
* @author ft
* @date 2020-11-19
*/
@Service
public class FtCareStaffInfoDaoServiceImpl extends ServiceImpl<FtCareStaffInfoDaoMapper, FtCareStaffInfoDao> implements IFtCareStaffInfoDaoService {
}

View File

@ -1,18 +0,0 @@
<?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.ruoyi.system.fantang.mapper.FtCareStaffInfoDaoMapper">
<resultMap type="FtCareStaffInfoDao" id="FtCareStaffInfoDaoResult">
<result property="careStaffId" column="care_staff_id" />
<result property="name" column="name" />
<result property="corpName" column="corp_name" />
<result property="departList" column="depart_list" />
<result property="flag" column="flag" />
<result property="photo" column="photo" />
<result property="qrCode" column="qr_code" />
</resultMap>
</mapper>

View File

@ -3,7 +3,16 @@ import request from '@/utils/request'
// 查询员工管理列表
export function listStaffInfo(query) {
return request({
url: '/fantang/staffInfo/list',
url: '/fantang/staffInfo/staffList',
method: 'get',
params: query
})
}
// 查询护工管理列表
export function careStaffList(query) {
return request({
url: '/fantang/staffInfo/careStaffList',
method: 'get',
params: query
})
@ -50,4 +59,4 @@ export function exportStaffInfo(query) {
method: 'get',
params: query
})
}
}

View File

@ -91,7 +91,7 @@
<el-table-column label="员工 id" align="center" prop="staffId" v-if="false"/>
<el-table-column label="姓名" align="center" prop="name"/>
<el-table-column label="所属公司" align="center" prop="corpName"/>
<!-- <el-table-column label="员工类别" align="center" prop="staffType"/>-->
<!-- <el-table-column label="员工类别" align="center" prop="staffType"/>-->
<el-table-column label="报餐科室" align="center" prop="deptList"/>
<el-table-column label="补贴余额" align="center" prop="balance"/>
<el-table-column label="创建日期" align="center" prop="createAt" width="180">
@ -154,8 +154,8 @@
<el-form-item label="所属公司" prop="corpName">
<el-input v-model="form.corpName" placeholder="请输入所属公司"/>
</el-form-item>
<el-form-item label="照片" prop="pictureUrl">
<el-input v-model="form.pictureUrl" placeholder="请输入照片"/>
<el-form-item label="照片">
<uploadImage v-model="form.pictureUrl"/>
</el-form-item>
<el-form-item label="报餐科室" prop="deptList">
<el-select v-model="form.deptList" placeholder="请选择报餐科室">
@ -179,17 +179,20 @@
<script>
import {
addStaffInfo,
careStaffList,
delStaffInfo,
exportStaffInfo,
getStaffInfo,
listStaffInfo,
updateStaffInfo
} from "@/api/fantang/staffInfo";
import {listDepart} from "@/api/fantang/depart";
import UploadImage from '@/components/UploadImage';
export default {
name: "StaffInfo",
components: {},
components: {
UploadImage,
},
data() {
return {
sexOptions: [],
@ -250,7 +253,7 @@ export default {
/** 查询员工管理列表 */
getList() {
this.loading = true;
listStaffInfo(this.queryParams).then(response => {
careStaffList(this.queryParams).then(response => {
this.staffInfoList = response.rows;
this.total = response.total;
this.loading = false;

View File

@ -167,7 +167,7 @@
v-for="item in deptListOptions"
:key="item.departName"
:label="item.departName"
:value="item.departName">
:value="item.departId">
</el-option>
</el-select>
</el-form-item>