diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtCareStaffInfoDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtCareStaffInfoDaoController.java deleted file mode 100644 index 575765246..000000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtCareStaffInfoDaoController.java +++ /dev/null @@ -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 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 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 lqw = new LambdaQueryWrapper(ftCareStaffInfoDao); - List list = iFtCareStaffInfoDaoService.list(lqw); - ExcelUtil util = new ExcelUtil(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); - } -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtStaffInfoDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtStaffInfoDaoController.java index f2bbad616..00f223fb2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtStaffInfoDaoController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtStaffInfoDaoController.java @@ -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 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 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 list = iFtStaffInfoDaoService.list(lqw); + return getDataTable(list); + } + /** * 导出员工管理列表 */ @@ -92,7 +109,7 @@ public class FtStaffInfoDaoController extends BaseController { List 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("添加成功"); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtCareStaffInfoDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtCareStaffInfoDao.java deleted file mode 100644 index 53888ca92..000000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtCareStaffInfoDao.java +++ /dev/null @@ -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; -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtCareStaffInfoDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtCareStaffInfoDaoMapper.java deleted file mode 100644 index dd7b54d3e..000000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtCareStaffInfoDaoMapper.java +++ /dev/null @@ -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 { - -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtCareStaffInfoDaoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtCareStaffInfoDaoService.java deleted file mode 100644 index cc1451091..000000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtCareStaffInfoDaoService.java +++ /dev/null @@ -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 { - -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtCareStaffInfoDaoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtCareStaffInfoDaoServiceImpl.java deleted file mode 100644 index 913c02dfb..000000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtCareStaffInfoDaoServiceImpl.java +++ /dev/null @@ -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 implements IFtCareStaffInfoDaoService { - -} diff --git a/ruoyi-system/src/main/resources/mapper/fantang/FtCareStaffInfoDaoMapper.xml b/ruoyi-system/src/main/resources/mapper/fantang/FtCareStaffInfoDaoMapper.xml deleted file mode 100644 index 016b88833..000000000 --- a/ruoyi-system/src/main/resources/mapper/fantang/FtCareStaffInfoDaoMapper.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ruoyi-ui/src/api/fantang/staffInfo.js b/ruoyi-ui/src/api/fantang/staffInfo.js index 1c4440ee6..d67bccddc 100644 --- a/ruoyi-ui/src/api/fantang/staffInfo.js +++ b/ruoyi-ui/src/api/fantang/staffInfo.js @@ -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 }) -} \ No newline at end of file +} diff --git a/ruoyi-ui/src/views/fantang/careStaffInfo/index.vue b/ruoyi-ui/src/views/fantang/careStaffInfo/index.vue index 0884b5537..0fb54e196 100644 --- a/ruoyi-ui/src/views/fantang/careStaffInfo/index.vue +++ b/ruoyi-ui/src/views/fantang/careStaffInfo/index.vue @@ -91,7 +91,7 @@ - + @@ -154,8 +154,8 @@ - - + + @@ -179,17 +179,20 @@