增加oa模块

This commit is contained in:
oepraxxx 2022-03-17 21:26:41 +08:00
parent 857054179c
commit ee56129472
9 changed files with 470 additions and 1 deletions

29
oa-system/pom.xml Normal file
View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.8.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.oa.system</groupId>
<artifactId>oa-system</artifactId>
<description>
oa 系统模块
</description>
<dependencies>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,107 @@
package com.oa.system.employee.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 员工信息对象 oa_employee_info
*
* @author ruoyi
* @date 2022-03-17
*/
public class EmployeeInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 用户id */
private Long userId;
/** 部门id */
@Excel(name = "部门id")
private Long deptId;
/** 职位id */
@Excel(name = "职位id")
private Long postId;
/** 电话 */
@Excel(name = "电话")
private String phone;
/** 身份证 */
@Excel(name = "身份证")
private String idCard;
/** 银行卡 */
@Excel(name = "银行卡")
private String bankCard;
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
}
public Long getDeptId()
{
return deptId;
}
public void setPostId(Long postId)
{
this.postId = postId;
}
public Long getPostId()
{
return postId;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setIdCard(String idCard)
{
this.idCard = idCard;
}
public String getIdCard()
{
return idCard;
}
public void setBankCard(String bankCard)
{
this.bankCard = bankCard;
}
public String getBankCard()
{
return bankCard;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("userId", getUserId())
.append("deptId", getDeptId())
.append("postId", getPostId())
.append("phone", getPhone())
.append("idCard", getIdCard())
.append("bankCard", getBankCard())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.oa.system.employee.mapper;
import com.oa.system.employee.domain.EmployeeInfo;
import java.util.List;
/**
* 员工信息Mapper接口
*
* @author ruoyi
* @date 2022-03-17
*/
public interface EmployeeInfoMapper
{
/**
* 查询员工信息
*
* @param userId 员工信息主键
* @return 员工信息
*/
EmployeeInfo selectEmployeeInfoByUserId(Long userId);
/**
* 查询员工信息列表
*
* @param employeeInfo 员工信息
* @return 员工信息集合
*/
List<EmployeeInfo> selectEmployeeInfoList(EmployeeInfo employeeInfo);
/**
* 新增员工信息
*
* @param employeeInfo 员工信息
* @return 结果
*/
int insertEmployeeInfo(EmployeeInfo employeeInfo);
/**
* 修改员工信息
*
* @param employeeInfo 员工信息
* @return 结果
*/
int updateEmployeeInfo(EmployeeInfo employeeInfo);
/**
* 删除员工信息
*
* @param userId 员工信息主键
* @return 结果
*/
int deleteEmployeeInfoByUserId(Long userId);
/**
* 批量删除员工信息
*
* @param userIds 需要删除的数据主键集合
* @return 结果
*/
int deleteEmployeeInfoByUserIds(Long[] userIds);
}

View File

@ -0,0 +1,61 @@
package com.oa.system.employee.service;
import com.oa.system.employee.domain.EmployeeInfo;
import java.util.List;
/**
* 员工信息Service接口
*
* @author ruoyi
* @date 2022-03-17
*/
public interface IEmployeeInfoService
{
/**
* 查询员工信息
*
* @param userId 员工信息主键
* @return 员工信息
*/
EmployeeInfo selectEmployeeInfoByUserId(Long userId);
/**
* 查询员工信息列表
*
* @param employeeInfo 员工信息
* @return 员工信息集合
*/
List<EmployeeInfo> selectEmployeeInfoList(EmployeeInfo employeeInfo);
/**
* 新增员工信息
*
* @param employeeInfo 员工信息
* @return 结果
*/
int insertEmployeeInfo(EmployeeInfo employeeInfo);
/**
* 修改员工信息
*
* @param employeeInfo 员工信息
* @return 结果
*/
int updateEmployeeInfo(EmployeeInfo employeeInfo);
/**
* 批量删除员工信息
*
* @param userIds 需要删除的员工信息主键集合
* @return 结果
*/
int deleteEmployeeInfoByUserIds(Long[] userIds);
/**
* 删除员工信息信息
*
* @param userId 员工信息主键
* @return 结果
*/
int deleteEmployeeInfoByUserId(Long userId);
}

View File

@ -0,0 +1,97 @@
package com.oa.system.employee.service.impl;
import com.oa.system.employee.domain.EmployeeInfo;
import com.oa.system.employee.mapper.EmployeeInfoMapper;
import com.oa.system.employee.service.IEmployeeInfoService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 员工信息Service业务层处理
*
* @author ruoyi
* @date 2022-03-17
*/
@Service
public class EmployeeInfoServiceImpl implements IEmployeeInfoService
{
private final EmployeeInfoMapper employeeInfoMapper;
@Autowired
public EmployeeInfoServiceImpl(EmployeeInfoMapper employeeInfoMapper) {
this.employeeInfoMapper = employeeInfoMapper;
}
/**
* 查询员工信息
*
* @param userId 员工信息主键
* @return 员工信息
*/
@Override
public EmployeeInfo selectEmployeeInfoByUserId(Long userId)
{
return employeeInfoMapper.selectEmployeeInfoByUserId(userId);
}
/**
* 查询员工信息列表
*
* @param employeeInfo 员工信息
* @return 员工信息
*/
@Override
public List<EmployeeInfo> selectEmployeeInfoList(EmployeeInfo employeeInfo)
{
return employeeInfoMapper.selectEmployeeInfoList(employeeInfo);
}
/**
* 新增员工信息
*
* @param employeeInfo 员工信息
* @return 结果
*/
@Override
public int insertEmployeeInfo(EmployeeInfo employeeInfo)
{
return employeeInfoMapper.insertEmployeeInfo(employeeInfo);
}
/**
* 修改员工信息
*
* @param employeeInfo 员工信息
* @return 结果
*/
@Override
public int updateEmployeeInfo(EmployeeInfo employeeInfo)
{
return employeeInfoMapper.updateEmployeeInfo(employeeInfo);
}
/**
* 批量删除员工信息
*
* @param userIds 需要删除的员工信息主键
* @return 结果
*/
@Override
public int deleteEmployeeInfoByUserIds(Long[] userIds)
{
return employeeInfoMapper.deleteEmployeeInfoByUserIds(userIds);
}
/**
* 删除员工信息信息
*
* @param userId 员工信息主键
* @return 结果
*/
@Override
public int deleteEmployeeInfoByUserId(Long userId)
{
return employeeInfoMapper.deleteEmployeeInfoByUserId(userId);
}
}

View File

@ -209,6 +209,7 @@
<module>ruoyi-quartz</module>
<module>ruoyi-generator</module>
<module>ruoyi-common</module>
<module>oa-system</module>
</modules>
<packaging>pom</packaging>

View File

@ -60,6 +60,12 @@
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId>
</dependency>
<dependency>
<groupId>com.oa.system</groupId>
<artifactId>oa-system</artifactId>
<version>3.8.1</version>
<scope>compile</scope>
</dependency>
</dependencies>

View File

@ -0,0 +1,107 @@
package com.oa.controller.employee;
import com.oa.system.employee.domain.EmployeeInfo;
import com.oa.system.employee.service.IEmployeeInfoService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 员工信息Controller
*
* @author ruoyi
* @date 2022-03-17
*/
@RestController
@RequestMapping("/oa/employee")
public class EmployeeInfoController extends BaseController
{
private final IEmployeeInfoService employeeInfoService;
@Autowired
public EmployeeInfoController(IEmployeeInfoService employeeInfoService) {
this.employeeInfoService = employeeInfoService;
}
/**
* 查询员工信息列表
*/
@PreAuthorize("@ss.hasPermi('oa:employee:list')")
@GetMapping("/list")
public TableDataInfo list(EmployeeInfo employeeInfo)
{
startPage();
List<EmployeeInfo> list = employeeInfoService.selectEmployeeInfoList(employeeInfo);
return getDataTable(list);
}
/**
* 导出员工信息列表
*/
@PreAuthorize("@ss.hasPermi('oa:employee:export')")
@Log(title = "员工信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EmployeeInfo employeeInfo)
{
List<EmployeeInfo> list = employeeInfoService.selectEmployeeInfoList(employeeInfo);
ExcelUtil<EmployeeInfo> util = new ExcelUtil<>(EmployeeInfo.class);
util.exportExcel(response, list, "员工信息数据");
}
/**
* 获取员工信息详细信息
*/
@GetMapping(value = "/{userId}")
public AjaxResult getInfo(@PathVariable("userId") Long userId)
{
return AjaxResult.success(employeeInfoService.selectEmployeeInfoByUserId(userId));
}
/**
* 新增员工信息
*/
@PreAuthorize("@ss.hasPermi('oa:employee:add')")
@Log(title = "员工信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EmployeeInfo employeeInfo)
{
return toAjax(employeeInfoService.insertEmployeeInfo(employeeInfo));
}
/**
* 修改员工信息
*/
@PreAuthorize("@ss.hasPermi('oa:employee:edit')")
@Log(title = "员工信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EmployeeInfo employeeInfo)
{
return toAjax(employeeInfoService.updateEmployeeInfo(employeeInfo));
}
/**
* 删除员工信息
*/
@PreAuthorize("@ss.hasPermi('oa:employee:remove')")
@Log(title = "员工信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{userIds}")
public AjaxResult remove(@PathVariable Long[] userIds)
{
return toAjax(employeeInfoService.deleteEmployeeInfoByUserIds(userIds));
}
}

View File

@ -8,7 +8,7 @@ spring:
master:
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: password
password: rootmysql
# 从库数据源
slave:
# 从数据源开关/默认关闭