Pre Merge pull request !455 from operaxxx/master
This commit is contained in:
29
oa-system/pom.xml
Normal file
29
oa-system/pom.xml
Normal 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>
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
4
oa-system/src/main/java/com/oa/system/package-info.java
Normal file
4
oa-system/src/main/java/com/oa/system/package-info.java
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/**
|
||||||
|
* OA 系统
|
||||||
|
*/
|
||||||
|
package com.oa.system;
|
@ -0,0 +1,78 @@
|
|||||||
|
<?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.oa.domain.mapper.EmployeeInfoMapper">
|
||||||
|
|
||||||
|
<resultMap type="EmployeeInfo" id="EmployeeInfoResult">
|
||||||
|
<result property="userId" column="user_id" />
|
||||||
|
<result property="deptId" column="dept_id" />
|
||||||
|
<result property="postId" column="post_id" />
|
||||||
|
<result property="phone" column="phone" />
|
||||||
|
<result property="idCard" column="id_card" />
|
||||||
|
<result property="bankCard" column="bank_card" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectEmployeeInfoVo">
|
||||||
|
select user_id, dept_id, post_id, phone, id_card, bank_card from oa_employee_info
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectEmployeeInfoList" parameterType="EmployeeInfo" resultMap="EmployeeInfoResult">
|
||||||
|
<include refid="selectEmployeeInfoVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||||
|
<if test="postId != null "> and post_id = #{postId}</if>
|
||||||
|
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||||||
|
<if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if>
|
||||||
|
<if test="bankCard != null and bankCard != ''"> and bank_card = #{bankCard}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectEmployeeInfoByUserId" parameterType="Long" resultMap="EmployeeInfoResult">
|
||||||
|
<include refid="selectEmployeeInfoVo"/>
|
||||||
|
where user_id = #{userId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertEmployeeInfo" parameterType="EmployeeInfo">
|
||||||
|
insert into oa_employee_info
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="userId != null">user_id,</if>
|
||||||
|
<if test="deptId != null">dept_id,</if>
|
||||||
|
<if test="postId != null">post_id,</if>
|
||||||
|
<if test="phone != null">phone,</if>
|
||||||
|
<if test="idCard != null">id_card,</if>
|
||||||
|
<if test="bankCard != null">bank_card,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="userId != null">#{userId},</if>
|
||||||
|
<if test="deptId != null">#{deptId},</if>
|
||||||
|
<if test="postId != null">#{postId},</if>
|
||||||
|
<if test="phone != null">#{phone},</if>
|
||||||
|
<if test="idCard != null">#{idCard},</if>
|
||||||
|
<if test="bankCard != null">#{bankCard},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateEmployeeInfo" parameterType="EmployeeInfo">
|
||||||
|
update oa_employee_info
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||||
|
<if test="postId != null">post_id = #{postId},</if>
|
||||||
|
<if test="phone != null">phone = #{phone},</if>
|
||||||
|
<if test="idCard != null">id_card = #{idCard},</if>
|
||||||
|
<if test="bankCard != null">bank_card = #{bankCard},</if>
|
||||||
|
</trim>
|
||||||
|
where user_id = #{userId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteEmployeeInfoByUserId" parameterType="Long">
|
||||||
|
delete from oa_employee_info where user_id = #{userId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteEmployeeInfoByUserIds" parameterType="String">
|
||||||
|
delete from oa_employee_info where user_id in
|
||||||
|
<foreach item="userId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{userId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
1
pom.xml
1
pom.xml
@ -209,6 +209,7 @@
|
|||||||
<module>ruoyi-quartz</module>
|
<module>ruoyi-quartz</module>
|
||||||
<module>ruoyi-generator</module>
|
<module>ruoyi-generator</module>
|
||||||
<module>ruoyi-common</module>
|
<module>ruoyi-common</module>
|
||||||
|
<module>oa-system</module>
|
||||||
</modules>
|
</modules>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
@ -60,6 +60,12 @@
|
|||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-generator</artifactId>
|
<artifactId>ruoyi-generator</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.oa.system</groupId>
|
||||||
|
<artifactId>oa-system</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -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));
|
||||||
|
}
|
||||||
|
}
|
@ -8,7 +8,7 @@ spring:
|
|||||||
master:
|
master:
|
||||||
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username: root
|
username: root
|
||||||
password: password
|
password: rootmysql
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
slave:
|
||||||
# 从数据源开关/默认关闭
|
# 从数据源开关/默认关闭
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<!-- 日志存放路径 -->
|
<!-- 日志存放路径 -->
|
||||||
<property name="log.path" value="/home/ruoyi/logs" />
|
<property name="log.path" value="logs" />
|
||||||
<!-- 日志输出格式 -->
|
<!-- 日志输出格式 -->
|
||||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||||
|
|
||||||
|
44
ruoyi-ui/src/api/oa/employee.js
Normal file
44
ruoyi-ui/src/api/oa/employee.js
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询员工信息列表
|
||||||
|
export function listEmployee(query) {
|
||||||
|
return request({
|
||||||
|
url: '/oa/employee/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询员工信息详细
|
||||||
|
export function getEmployee(userId) {
|
||||||
|
return request({
|
||||||
|
url: '/oa/employee/' + userId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增员工信息
|
||||||
|
export function addEmployee(data) {
|
||||||
|
return request({
|
||||||
|
url: '/oa/employee',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改员工信息
|
||||||
|
export function updateEmployee(data) {
|
||||||
|
return request({
|
||||||
|
url: '/oa/employee',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除员工信息
|
||||||
|
export function delEmployee(userId) {
|
||||||
|
return request({
|
||||||
|
url: '/oa/employee/' + userId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
103
ruoyi-ui/src/views/oa/employee/index.vue
Normal file
103
ruoyi-ui/src/views/oa/employee/index.vue
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
|
||||||
|
<el-descriptions title="个人中心" :v-model="employee">
|
||||||
|
<el-descriptions-item label="部门"></el-descriptions-item>
|
||||||
|
<el-descriptions-item v-model="form.phone" label="手机号"></el-descriptions-item>
|
||||||
|
<el-descriptions-item label="居住地">苏州市</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="备注">
|
||||||
|
<el-tag size="small">学校</el-tag>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="联系地址">江苏省苏州市吴中区吴中大道 1188 号</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
>修改</el-button>
|
||||||
|
|
||||||
|
<!-- 添加或修改员工信息对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="部门id" prop="deptId">
|
||||||
|
<el-input v-model="form.deptId" placeholder="请输入部门id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="职位id" prop="postId">
|
||||||
|
<el-input v-model="form.postId" placeholder="请输入职位id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="电话" prop="phone">
|
||||||
|
<el-input v-model="form.phone" placeholder="请输入电话" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="身份证" prop="idCard">
|
||||||
|
<el-input v-model="form.idCard" placeholder="请输入身份证" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="银行卡" prop="bankCard">
|
||||||
|
<el-input v-model="form.bankCard" placeholder="请输入银行卡" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getEmployee, updateEmployee } from "@/api/oa/employee";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Employee",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 员工信息表格数据
|
||||||
|
employee: {},
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getEmployee();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询员工信息 */
|
||||||
|
getEmployee() {
|
||||||
|
this.loading = true;
|
||||||
|
getEmployee('100001').then(response => {
|
||||||
|
this.employee = response.data;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const userId = row.userId || this.ids
|
||||||
|
getEmployee(userId).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改员工信息";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Reference in New Issue
Block a user