员工管理护工管理数据分离
This commit is contained in:
parent
64bd494733
commit
7cdb38b7c9
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
@ -40,19 +40,17 @@ public class FtStaffInfoDaoController extends BaseController {
|
|||||||
* 查询员工管理列表
|
* 查询员工管理列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('fantang:staffInfo:list')")
|
@PreAuthorize("@ss.hasPermi('fantang:staffInfo:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/staffList")
|
||||||
public TableDataInfo list(FtStaffInfoDao ftStaffInfoDao) {
|
public TableDataInfo staffList(FtStaffInfoDao ftStaffInfoDao) {
|
||||||
startPage();
|
startPage();
|
||||||
LambdaQueryWrapper<FtStaffInfoDao> lqw = Wrappers.lambdaQuery(ftStaffInfoDao);
|
LambdaQueryWrapper<FtStaffInfoDao> lqw = Wrappers.lambdaQuery(ftStaffInfoDao);
|
||||||
|
lqw.eq(FtStaffInfoDao::getStaffType, 1);
|
||||||
if (StringUtils.isNotBlank(ftStaffInfoDao.getName())) {
|
if (StringUtils.isNotBlank(ftStaffInfoDao.getName())) {
|
||||||
lqw.like(FtStaffInfoDao::getName, ftStaffInfoDao.getName());
|
lqw.like(FtStaffInfoDao::getName, ftStaffInfoDao.getName());
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(ftStaffInfoDao.getPost())) {
|
if (StringUtils.isNotBlank(ftStaffInfoDao.getPost())) {
|
||||||
lqw.eq(FtStaffInfoDao::getPost, ftStaffInfoDao.getPost());
|
lqw.eq(FtStaffInfoDao::getPost, ftStaffInfoDao.getPost());
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(ftStaffInfoDao.getRole())) {
|
|
||||||
lqw.eq(FtStaffInfoDao::getRole, ftStaffInfoDao.getRole());
|
|
||||||
}
|
|
||||||
if (ftStaffInfoDao.getFlag() != null) {
|
if (ftStaffInfoDao.getFlag() != null) {
|
||||||
lqw.eq(FtStaffInfoDao::getFlag, ftStaffInfoDao.getFlag());
|
lqw.eq(FtStaffInfoDao::getFlag, ftStaffInfoDao.getFlag());
|
||||||
}
|
}
|
||||||
@ -60,6 +58,25 @@ public class FtStaffInfoDaoController extends BaseController {
|
|||||||
return getDataTable(list);
|
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);
|
List<FtStaffInfoDao> list = iFtStaffInfoDaoService.list(null);
|
||||||
for (FtStaffInfoDao staffInfoDao : list) {
|
for (FtStaffInfoDao staffInfoDao : list) {
|
||||||
if (ftStaffInfoDao.getTel().equals(staffInfoDao.getTel())) {
|
if (ftStaffInfoDao.getTel() != null && ftStaffInfoDao.getTel().equals(staffInfoDao.getTel())) {
|
||||||
return AjaxResult.error("该电话号码已存在");
|
return AjaxResult.error("该电话号码已存在");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -110,8 +127,9 @@ public class FtStaffInfoDaoController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ftStaffInfoDao.setCreateAt(new Date());
|
ftStaffInfoDao.setCreateAt(new Date());
|
||||||
|
ftStaffInfoDao.setDepartId(Long.parseLong(ftStaffInfoDao.getDeptList()));
|
||||||
|
|
||||||
boolean save = iFtStaffInfoDaoService.save(ftStaffInfoDao);
|
iFtStaffInfoDaoService.save(ftStaffInfoDao);
|
||||||
|
|
||||||
return AjaxResult.success("添加成功");
|
return AjaxResult.success("添加成功");
|
||||||
}
|
}
|
||||||
|
@ -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;
|
|
||||||
}
|
|
@ -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> {
|
|
||||||
|
|
||||||
}
|
|
@ -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> {
|
|
||||||
|
|
||||||
}
|
|
@ -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 {
|
|
||||||
|
|
||||||
}
|
|
@ -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>
|
|
@ -3,7 +3,16 @@ import request from '@/utils/request'
|
|||||||
// 查询员工管理列表
|
// 查询员工管理列表
|
||||||
export function listStaffInfo(query) {
|
export function listStaffInfo(query) {
|
||||||
return request({
|
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',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
|
@ -154,8 +154,8 @@
|
|||||||
<el-form-item label="所属公司" prop="corpName">
|
<el-form-item label="所属公司" prop="corpName">
|
||||||
<el-input v-model="form.corpName" placeholder="请输入所属公司"/>
|
<el-input v-model="form.corpName" placeholder="请输入所属公司"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="照片" prop="pictureUrl">
|
<el-form-item label="照片">
|
||||||
<el-input v-model="form.pictureUrl" placeholder="请输入照片"/>
|
<uploadImage v-model="form.pictureUrl"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="报餐科室" prop="deptList">
|
<el-form-item label="报餐科室" prop="deptList">
|
||||||
<el-select v-model="form.deptList" placeholder="请选择报餐科室">
|
<el-select v-model="form.deptList" placeholder="请选择报餐科室">
|
||||||
@ -179,17 +179,20 @@
|
|||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
addStaffInfo,
|
addStaffInfo,
|
||||||
|
careStaffList,
|
||||||
delStaffInfo,
|
delStaffInfo,
|
||||||
exportStaffInfo,
|
exportStaffInfo,
|
||||||
getStaffInfo,
|
getStaffInfo,
|
||||||
listStaffInfo,
|
|
||||||
updateStaffInfo
|
updateStaffInfo
|
||||||
} from "@/api/fantang/staffInfo";
|
} from "@/api/fantang/staffInfo";
|
||||||
import {listDepart} from "@/api/fantang/depart";
|
import {listDepart} from "@/api/fantang/depart";
|
||||||
|
import UploadImage from '@/components/UploadImage';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "StaffInfo",
|
name: "StaffInfo",
|
||||||
components: {},
|
components: {
|
||||||
|
UploadImage,
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
sexOptions: [],
|
sexOptions: [],
|
||||||
@ -250,7 +253,7 @@ export default {
|
|||||||
/** 查询员工管理列表 */
|
/** 查询员工管理列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listStaffInfo(this.queryParams).then(response => {
|
careStaffList(this.queryParams).then(response => {
|
||||||
this.staffInfoList = response.rows;
|
this.staffInfoList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
@ -167,7 +167,7 @@
|
|||||||
v-for="item in deptListOptions"
|
v-for="item in deptListOptions"
|
||||||
:key="item.departName"
|
:key="item.departName"
|
||||||
:label="item.departName"
|
:label="item.departName"
|
||||||
:value="item.departName">
|
:value="item.departId">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user