فهرست منبع

Merge remote-tracking branch 'origin/master'

Administrator 2 سال پیش
والد
کامیت
0fef22d2ac

+ 112 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/qinjia/RecordLeaveController.java

@@ -0,0 +1,112 @@
+package com.ruoyi.web.controller.qinjia;
+
+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.system.domain.RecordLeave;
+import com.ruoyi.system.service.IRecordLeaveService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 请假记录信息Controller
+ * 
+ * @author ruoyi
+ * @date 2023-02-13
+ */
+@RestController
+@RequestMapping("/system/leave")
+public class RecordLeaveController extends BaseController
+{
+    @Autowired
+    private IRecordLeaveService recordLeaveService;
+
+    /**
+     * 查询请假记录信息列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(RecordLeave recordLeave)
+    {
+        startPage();
+        List<RecordLeave> list = recordLeaveService.selectRecordLeaveList(recordLeave);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出请假记录信息列表
+     */
+    @Log(title = "请假记录信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, RecordLeave recordLeave)
+    {
+        List<RecordLeave> list = recordLeaveService.selectRecordLeaveList(recordLeave);
+        ExcelUtil<RecordLeave> util = new ExcelUtil<RecordLeave>(RecordLeave.class);
+        util.exportExcel(response, list, "请假记录信息数据");
+    }
+
+    /**
+     * 获取请假记录信息详细信息
+     */
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(recordLeaveService.selectRecordLeaveById(id));
+    }
+
+    /**
+     * 新增请假记录信息
+     */
+    @Log(title = "请假记录信息", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody RecordLeave recordLeave)
+    {
+        return toAjax(recordLeaveService.insertRecordLeave(recordLeave));
+    }
+
+    /**
+     * 修改请假记录信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:leave:edit')")
+    @Log(title = "请假记录信息", businessType = BusinessType.UPDATE)
+    @PostMapping("put")
+    public AjaxResult edit(@RequestBody RecordLeave recordLeave)
+    {
+        return toAjax(recordLeaveService.updateRecordLeave(recordLeave));
+    }
+
+    /**
+     * 删除请假记录信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:leave:remove')")
+    @Log(title = "请假记录信息", businessType = BusinessType.DELETE)
+    @GetMapping(value = "/delete/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(recordLeaveService.deleteRecordLeaveByIds(ids));
+    }
+
+    /***
+     * 请假审核
+     * @param id id
+     * @param isPass 是否通过 1:不通过,2:通过
+     * @return
+     */
+    @GetMapping(value = "/audit")
+    public AjaxResult audit(Long id, String isPass)
+    {
+        return toAjax(recordLeaveService.audit(id,isPass));
+    }
+}

+ 221 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/RecordLeave.java

@@ -0,0 +1,221 @@
+package com.ruoyi.system.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+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;
+
+/**
+ * 请假记录信息对象 record_leave
+ * 
+ * @author ruoyi
+ * @date 2023-02-13
+ */
+public class RecordLeave extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /**  */
+    private Long id;
+
+    /** 类型 1:临时请假 2:事假 */
+    @Excel(name = "类型 1:临时请假 2:事假")
+    private String type;
+
+    /** 请假开始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "请假开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date startTime;
+
+    /** 请假结束时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "请假结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date endTime;
+
+    /** 请假理由 */
+    @Excel(name = "请假理由")
+    private String reason;
+
+    /** 部门id */
+    private Long deptId;
+
+    /** 部门名称 */
+    @Excel(name = "部门名称")
+    private String deptName;
+
+    /** 请假人id */
+    private String absenteeId;
+
+    /** 请假人姓名 */
+    @Excel(name = "请假人姓名")
+    private String absenteeName;
+
+    /** 审批人员id */
+    private Long examinersId;
+
+    /** 审批人员姓名 */
+    @Excel(name = "审批人员姓名")
+    private String examinersName;
+
+    /** 请假类别 1:病假,2:产假,3:陪产假,4:婚假,5:丧假,6:其他 */
+    @Excel(name = "请假类别 1:病假,2:产假,3:陪产假,4:婚假,5:丧假,6:其他")
+    private String category;
+
+    /** 是否通过 0:未处理,1:不通过,2:通过 */
+    @Excel(name = "是否通过 0:未处理,1:不通过,2:通过")
+    private String isPass;
+
+    /** 提交时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "提交时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date submitTime;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setType(String type) 
+    {
+        this.type = type;
+    }
+
+    public String getType() 
+    {
+        return type;
+    }
+    public void setStartTime(Date startTime) 
+    {
+        this.startTime = startTime;
+    }
+
+    public Date getStartTime() 
+    {
+        return startTime;
+    }
+    public void setEndTime(Date endTime) 
+    {
+        this.endTime = endTime;
+    }
+
+    public Date getEndTime() 
+    {
+        return endTime;
+    }
+    public void setReason(String reason) 
+    {
+        this.reason = reason;
+    }
+
+    public String getReason() 
+    {
+        return reason;
+    }
+    public void setDeptId(Long deptId) 
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId() 
+    {
+        return deptId;
+    }
+    public void setDeptName(String deptName) 
+    {
+        this.deptName = deptName;
+    }
+
+    public String getDeptName() 
+    {
+        return deptName;
+    }
+    public void setAbsenteeId(String absenteeId) 
+    {
+        this.absenteeId = absenteeId;
+    }
+
+    public String getAbsenteeId() 
+    {
+        return absenteeId;
+    }
+    public void setAbsenteeName(String absenteeName) 
+    {
+        this.absenteeName = absenteeName;
+    }
+
+    public String getAbsenteeName() 
+    {
+        return absenteeName;
+    }
+    public void setExaminersId(Long examinersId) 
+    {
+        this.examinersId = examinersId;
+    }
+
+    public Long getExaminersId() 
+    {
+        return examinersId;
+    }
+    public void setExaminersName(String examinersName) 
+    {
+        this.examinersName = examinersName;
+    }
+
+    public String getExaminersName() 
+    {
+        return examinersName;
+    }
+    public void setCategory(String category) 
+    {
+        this.category = category;
+    }
+
+    public String getCategory() 
+    {
+        return category;
+    }
+    public void setIsPass(String isPass) 
+    {
+        this.isPass = isPass;
+    }
+
+    public String getIsPass() 
+    {
+        return isPass;
+    }
+    public void setSubmitTime(Date submitTime) 
+    {
+        this.submitTime = submitTime;
+    }
+
+    public Date getSubmitTime() 
+    {
+        return submitTime;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("type", getType())
+            .append("startTime", getStartTime())
+            .append("endTime", getEndTime())
+            .append("reason", getReason())
+            .append("deptId", getDeptId())
+            .append("deptName", getDeptName())
+            .append("absenteeId", getAbsenteeId())
+            .append("absenteeName", getAbsenteeName())
+            .append("examinersId", getExaminersId())
+            .append("examinersName", getExaminersName())
+            .append("category", getCategory())
+            .append("isPass", getIsPass())
+            .append("submitTime", getSubmitTime())
+            .toString();
+    }
+}

+ 63 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/RecordLeaveMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.RecordLeave;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 请假记录信息Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2023-02-13
+ */
+public interface RecordLeaveMapper 
+{
+    /**
+     * 查询请假记录信息
+     * 
+     * @param id 请假记录信息主键
+     * @return 请假记录信息
+     */
+    public RecordLeave selectRecordLeaveById(Long id);
+
+    /**
+     * 查询请假记录信息列表
+     * 
+     * @param recordLeave 请假记录信息
+     * @return 请假记录信息集合
+     */
+    public List<RecordLeave> selectRecordLeaveList(RecordLeave recordLeave);
+
+    /**
+     * 新增请假记录信息
+     * 
+     * @param recordLeave 请假记录信息
+     * @return 结果
+     */
+    public int insertRecordLeave(RecordLeave recordLeave);
+
+    /**
+     * 修改请假记录信息
+     * 
+     * @param recordLeave 请假记录信息
+     * @return 结果
+     */
+    public int updateRecordLeave(RecordLeave recordLeave);
+
+    /**
+     * 删除请假记录信息
+     * 
+     * @param id 请假记录信息主键
+     * @return 结果
+     */
+    public int deleteRecordLeaveById(Long id);
+
+    /**
+     * 批量删除请假记录信息
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteRecordLeaveByIds(Long[] ids);
+
+}

+ 63 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IRecordLeaveService.java

@@ -0,0 +1,63 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.ruoyi.system.domain.RecordLeave;
+
+/**
+ * 请假记录信息Service接口
+ * 
+ * @author ruoyi
+ * @date 2023-02-13
+ */
+public interface IRecordLeaveService 
+{
+    /**
+     * 查询请假记录信息
+     * 
+     * @param id 请假记录信息主键
+     * @return 请假记录信息
+     */
+    public RecordLeave selectRecordLeaveById(Long id);
+
+    /**
+     * 查询请假记录信息列表
+     * 
+     * @param recordLeave 请假记录信息
+     * @return 请假记录信息集合
+     */
+    public List<RecordLeave> selectRecordLeaveList(RecordLeave recordLeave);
+
+    /**
+     * 新增请假记录信息
+     * 
+     * @param recordLeave 请假记录信息
+     * @return 结果
+     */
+    public int insertRecordLeave(RecordLeave recordLeave);
+
+    /**
+     * 修改请假记录信息
+     * 
+     * @param recordLeave 请假记录信息
+     * @return 结果
+     */
+    public int updateRecordLeave(RecordLeave recordLeave);
+
+    /**
+     * 批量删除请假记录信息
+     * 
+     * @param ids 需要删除的请假记录信息主键集合
+     * @return 结果
+     */
+    public int deleteRecordLeaveByIds(Long[] ids);
+
+    /**
+     * 删除请假记录信息信息
+     * 
+     * @param id 请假记录信息主键
+     * @return 结果
+     */
+    public int deleteRecordLeaveById(Long id);
+
+    int audit(Long id, String isPass);
+}

+ 113 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RecordLeaveServiceImpl.java

@@ -0,0 +1,113 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.SecurityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.RecordLeaveMapper;
+import com.ruoyi.system.domain.RecordLeave;
+import com.ruoyi.system.service.IRecordLeaveService;
+
+/**
+ * 请假记录信息Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2023-02-13
+ */
+@Service
+public class RecordLeaveServiceImpl implements IRecordLeaveService 
+{
+    @Autowired
+    private RecordLeaveMapper recordLeaveMapper;
+
+    /**
+     * 查询请假记录信息
+     * 
+     * @param id 请假记录信息主键
+     * @return 请假记录信息
+     */
+    @Override
+    public RecordLeave selectRecordLeaveById(Long id)
+    {
+        return recordLeaveMapper.selectRecordLeaveById(id);
+    }
+
+    /**
+     * 查询请假记录信息列表
+     * 
+     * @param recordLeave 请假记录信息
+     * @return 请假记录信息
+     */
+    @Override
+    public List<RecordLeave> selectRecordLeaveList(RecordLeave recordLeave)
+    {
+        return recordLeaveMapper.selectRecordLeaveList(recordLeave);
+    }
+
+    /**
+     * 新增请假记录信息
+     * 
+     * @param recordLeave 请假记录信息
+     * @return 结果
+     */
+    @Override
+    public int insertRecordLeave(RecordLeave recordLeave)
+    {
+        //获取当前人员信息
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        recordLeave.setAbsenteeId(String.valueOf(user.getUserId()));
+        recordLeave.setAbsenteeName(user.getNickName());
+        return recordLeaveMapper.insertRecordLeave(recordLeave);
+    }
+
+    /**
+     * 修改请假记录信息
+     * 
+     * @param recordLeave 请假记录信息
+     * @return 结果
+     */
+    @Override
+    public int updateRecordLeave(RecordLeave recordLeave)
+    {
+        return recordLeaveMapper.updateRecordLeave(recordLeave);
+    }
+
+    /**
+     * 批量删除请假记录信息
+     * 
+     * @param ids 需要删除的请假记录信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteRecordLeaveByIds(Long[] ids)
+    {
+        return recordLeaveMapper.deleteRecordLeaveByIds(ids);
+    }
+
+    /**
+     * 删除请假记录信息信息
+     * 
+     * @param id 请假记录信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteRecordLeaveById(Long id)
+    {
+        return recordLeaveMapper.deleteRecordLeaveById(id);
+    }
+
+    @Override
+    public int audit(Long id, String isPass) {
+        //获取当前人员信息
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+
+        RecordLeave recordLeave = new RecordLeave();
+        recordLeave.setId(id);
+        recordLeave.setExaminersId(user.getUserId());
+        recordLeave.setExaminersName(user.getNickName());
+        recordLeave.setIsPass(isPass);
+        return recordLeaveMapper.updateRecordLeave(recordLeave);
+    }
+}

+ 2 - 0
ruoyi-system/src/main/resources/mapper/system/RecordInfoMapper.xml

@@ -35,7 +35,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>  
             <if test="title != null  and title != ''"> and title = #{title}</if>
             <if test="content != null  and content != ''"> and content = #{content}</if>
+            <if test="senderId != null  and senderId != ''"> and sender_id = #{senderId}</if>
             <if test="senderName != null  and senderName != ''"> and sender_name like concat('%', #{senderName}, '%')</if>
+            <if test="addresseeId != null  and addresseeId != ''"> and addressee_id = #{addresseeId}</if>
             <if test="addresseeName != null  and addresseeName != ''"> and addressee_name like concat('%', #{addresseeName}, '%')</if>
             <if test="isRead != null  and isRead != ''"> and is_read = #{isRead}</if>
             <if test="infoType != null  and infoType != ''"> and info_type = #{infoType}</if>

+ 109 - 0
ruoyi-system/src/main/resources/mapper/system/RecordLeaveMapper.xml

@@ -0,0 +1,109 @@
+<?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.mapper.RecordLeaveMapper">
+    
+    <resultMap type="RecordLeave" id="RecordLeaveResult">
+        <result property="id"    column="id"    />
+        <result property="type"    column="type"    />
+        <result property="startTime"    column="start_time"    />
+        <result property="endTime"    column="end_time"    />
+        <result property="reason"    column="reason"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="deptName"    column="dept_name"    />
+        <result property="absenteeId"    column="absentee_id"    />
+        <result property="absenteeName"    column="absentee_name"    />
+        <result property="examinersId"    column="examiners_id"    />
+        <result property="examinersName"    column="examiners_name"    />
+        <result property="category"    column="category"    />
+        <result property="isPass"    column="is_pass"    />
+        <result property="submitTime"    column="submit_time"    />
+    </resultMap>
+
+    <sql id="selectRecordLeaveVo">
+        select id, type, start_time, end_time, reason, dept_id, dept_name, absentee_id, absentee_name, examiners_id, examiners_name, category, is_pass, submit_time from record_leave
+    </sql>
+
+    <select id="selectRecordLeaveList" parameterType="RecordLeave" resultMap="RecordLeaveResult">
+        <include refid="selectRecordLeaveVo"/>
+        <where>  
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+            <if test="deptName != null  and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
+            <if test="absenteeName != null  and absenteeName != ''"> and absentee_name like concat('%', #{absenteeName}, '%')</if>
+            <if test="examinersName != null  and examinersName != ''"> and examiners_name like concat('%', #{examinersName}, '%')</if>
+            <if test="category != null  and category != ''"> and category = #{category}</if>
+            <if test="isPass != null  and isPass != ''"> and is_pass = #{isPass}</if>
+            <if test="submitTime != null "> and submit_time = #{submitTime}</if>
+        </where>
+    </select>
+    
+    <select id="selectRecordLeaveById" parameterType="Long" resultMap="RecordLeaveResult">
+        <include refid="selectRecordLeaveVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertRecordLeave" parameterType="RecordLeave" useGeneratedKeys="true" keyProperty="id">
+        insert into record_leave
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="type != null">type,</if>
+            <if test="startTime != null">start_time,</if>
+            <if test="endTime != null">end_time,</if>
+            <if test="reason != null">reason,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="deptName != null">dept_name,</if>
+            <if test="absenteeId != null">absentee_id,</if>
+            <if test="absenteeName != null">absentee_name,</if>
+            <if test="examinersId != null">examiners_id,</if>
+            <if test="examinersName != null">examiners_name,</if>
+            <if test="category != null">category,</if>
+            <if test="isPass != null">is_pass,</if>
+            submit_time
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="type != null">#{type},</if>
+            <if test="startTime != null">#{startTime},</if>
+            <if test="endTime != null">#{endTime},</if>
+            <if test="reason != null">#{reason},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="deptName != null">#{deptName},</if>
+            <if test="absenteeId != null">#{absenteeId},</if>
+            <if test="absenteeName != null">#{absenteeName},</if>
+            <if test="examinersId != null">#{examinersId},</if>
+            <if test="examinersName != null">#{examinersName},</if>
+            <if test="category != null">#{category},</if>
+            <if test="isPass != null">#{isPass},</if>
+            #{submitTime}
+         </trim>
+    </insert>
+
+    <update id="updateRecordLeave" parameterType="RecordLeave">
+        update record_leave
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="type != null">type = #{type},</if>
+            <if test="startTime != null">start_time = #{startTime},</if>
+            <if test="endTime != null">end_time = #{endTime},</if>
+            <if test="reason != null">reason = #{reason},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="deptName != null">dept_name = #{deptName},</if>
+            <if test="absenteeId != null">absentee_id = #{absenteeId},</if>
+            <if test="absenteeName != null">absentee_name = #{absenteeName},</if>
+            <if test="examinersId != null">examiners_id = #{examinersId},</if>
+            <if test="examinersName != null">examiners_name = #{examinersName},</if>
+            <if test="category != null">category = #{category},</if>
+            <if test="isPass != null">is_pass = #{isPass},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteRecordLeaveById" parameterType="Long">
+        delete from record_leave where id = #{id}
+    </delete>
+
+    <delete id="deleteRecordLeaveByIds" parameterType="String">
+        delete from record_leave where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>