Jelajahi Sumber

请假,补卡修改

LIVE_YE 1 Minggu lalu
induk
melakukan
66fcf5413d
16 mengubah file dengan 601 tambahan dan 14 penghapusan
  1. 4 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/kaoqin/CardReplacementRecordController.java
  2. 2 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/kaoqin/ProcessConfigurationController.java
  3. 19 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/qinjia/RecordLeaveController.java
  4. 104 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/qinjia/RecordLeaveFjController.java
  5. 3 3
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/sms/SendSmsController.java
  6. 26 2
      ruoyi-system/src/main/java/com/ruoyi/system/domain/RecordLeave.java
  7. 80 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/RecordLeaveFj.java
  8. 61 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/RecordLeaveFjMapper.java
  9. 61 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/IRecordLeaveFjService.java
  10. 4 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/IRecordLeaveService.java
  11. 18 6
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CardReplacementRecordServiceImpl.java
  12. 93 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RecordLeaveFjServiceImpl.java
  13. 48 1
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RecordLeaveServiceImpl.java
  14. 1 0
      ruoyi-system/src/main/resources/mapper/system/CardReplacementRecordMapper.xml
  15. 70 0
      ruoyi-system/src/main/resources/mapper/system/RecordLeaveFjMapper.xml
  16. 7 0
      ruoyi-system/src/main/resources/mapper/system/RecordLeaveMapper.xml

+ 4 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/kaoqin/CardReplacementRecordController.java

@@ -72,6 +72,7 @@ public class CardReplacementRecordController extends BaseController
     /**
      * 新增补卡记录
      */
+    @PreAuthorize("@ss.hasPermi('system:record:add')")
     @Log(title = "补卡记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody CardReplacementRecord cardReplacementRecord)
@@ -82,8 +83,9 @@ public class CardReplacementRecordController extends BaseController
     /**
      * 修改补卡记录
      */
+    @PreAuthorize("@ss.hasPermi('system:record:edit')")
     @Log(title = "补卡记录", businessType = BusinessType.UPDATE)
-    @PostMapping("put")
+    @PostMapping("/put")
     public AjaxResult edit(@RequestBody CardReplacementRecord cardReplacementRecord)
     {
         return toAjax(cardReplacementRecordService.updateCardReplacementRecord(cardReplacementRecord));
@@ -115,6 +117,7 @@ public class CardReplacementRecordController extends BaseController
     /**
      * 获取当前账号下的补卡列表
      */
+    @PreAuthorize("@ss.hasPermi('system:record:presentList')")
     @GetMapping("/presentList")
     public TableDataInfo presentList(CardReplacementRecord cardReplacementRecord)
     {

+ 2 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/kaoqin/ProcessConfigurationController.java

@@ -72,6 +72,7 @@ public class ProcessConfigurationController extends BaseController
     /**
      * 新增补卡、请假流程配置
      */
+    @PreAuthorize("@ss.hasPermi('system:configuration:add')")
     @Log(title = "补卡、请假流程配置", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody ProcessConfiguration processConfiguration)
@@ -82,6 +83,7 @@ public class ProcessConfigurationController extends BaseController
     /**
      * 修改补卡、请假流程配置
      */
+    @PreAuthorize("@ss.hasPermi('system:configuration:edit')")
     @Log(title = "补卡、请假流程配置", businessType = BusinessType.UPDATE)
     @PostMapping("put")
     public AjaxResult edit(@RequestBody ProcessConfiguration processConfiguration)

+ 19 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/qinjia/RecordLeaveController.java

@@ -2,6 +2,8 @@ package com.ruoyi.web.controller.qinjia;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.system.domain.CardReplacementRecord;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -38,6 +40,7 @@ public class RecordLeaveController extends BaseController
      * 查询请假记录信息列表
      */
     @GetMapping("/list")
+    @PreAuthorize("@ss.hasPermi('system:leave:list')")
     public TableDataInfo list(RecordLeave recordLeave)
     {
         startPage();
@@ -61,6 +64,7 @@ public class RecordLeaveController extends BaseController
      * 获取请假记录信息详细信息
      */
     @GetMapping(value = "/{id}")
+    @PreAuthorize("@ss.hasPermi('system:leave:query')")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
         return AjaxResult.success(recordLeaveService.selectRecordLeaveById(id));
@@ -69,6 +73,7 @@ public class RecordLeaveController extends BaseController
     /**
      * 新增请假记录信息
      */
+    @PreAuthorize("@ss.hasPermi('system:leave:add')")
     @Log(title = "请假记录信息", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody RecordLeave recordLeave)
@@ -81,7 +86,7 @@ public class RecordLeaveController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:leave:edit')")
     @Log(title = "请假记录信息", businessType = BusinessType.UPDATE)
-    @PostMapping("put")
+    @PostMapping("/put")
     public AjaxResult edit(@RequestBody RecordLeave recordLeave)
     {
         return toAjax(recordLeaveService.updateRecordLeave(recordLeave));
@@ -104,9 +109,22 @@ public class RecordLeaveController extends BaseController
      * @param isPass 是否通过 1:不通过,2:通过
      * @return
      */
+    @PreAuthorize("@ss.hasPermi('system:leave:audit')")
     @GetMapping(value = "/audit")
     public AjaxResult audit(Long id, String isPass)
     {
         return toAjax(recordLeaveService.audit(id,isPass));
     }
+
+    /**
+     * 获取当前账号下的请假审核列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:leave:presentList')")
+    @GetMapping("/presentList")
+    public TableDataInfo presentList(RecordLeave recordLeave)
+    {
+        startPage();
+        List<RecordLeave> list = recordLeaveService.presentList(recordLeave);
+        return getDataTable(list);
+    }
 }

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/qinjia/RecordLeaveFjController.java

@@ -0,0 +1,104 @@
+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.RecordLeaveFj;
+import com.ruoyi.system.service.IRecordLeaveFjService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 请假_附件Controller
+ * 
+ * @author ruoyi
+ * @date 2025-06-19
+ */
+@RestController
+@RequestMapping("/system/fj")
+public class RecordLeaveFjController extends BaseController
+{
+    @Autowired
+    private IRecordLeaveFjService recordLeaveFjService;
+
+    /**
+     * 查询请假_附件列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:fj:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(RecordLeaveFj recordLeaveFj)
+    {
+        startPage();
+        List<RecordLeaveFj> list = recordLeaveFjService.selectRecordLeaveFjList(recordLeaveFj);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出请假_附件列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:fj:export')")
+    @Log(title = "请假_附件", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, RecordLeaveFj recordLeaveFj)
+    {
+        List<RecordLeaveFj> list = recordLeaveFjService.selectRecordLeaveFjList(recordLeaveFj);
+        ExcelUtil<RecordLeaveFj> util = new ExcelUtil<RecordLeaveFj>(RecordLeaveFj.class);
+        util.exportExcel(response, list, "请假_附件数据");
+    }
+
+    /**
+     * 获取请假_附件详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:fj:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(recordLeaveFjService.selectRecordLeaveFjById(id));
+    }
+
+    /**
+     * 新增请假_附件
+     */
+    @PreAuthorize("@ss.hasPermi('system:fj:add')")
+    @Log(title = "请假_附件", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody RecordLeaveFj recordLeaveFj)
+    {
+        return toAjax(recordLeaveFjService.insertRecordLeaveFj(recordLeaveFj));
+    }
+
+    /**
+     * 修改请假_附件
+     */
+    @PreAuthorize("@ss.hasPermi('system:fj:edit')")
+    @Log(title = "请假_附件", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody RecordLeaveFj recordLeaveFj)
+    {
+        return toAjax(recordLeaveFjService.updateRecordLeaveFj(recordLeaveFj));
+    }
+
+    /**
+     * 删除请假_附件
+     */
+    @PreAuthorize("@ss.hasPermi('system:fj:remove')")
+    @Log(title = "请假_附件", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(recordLeaveFjService.deleteRecordLeaveFjByIds(ids));
+    }
+}

+ 3 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/sms/SendSmsController.java

@@ -138,15 +138,15 @@ public class SendSmsController extends BaseController
                     //手机号码
                     .setPhoneNumbers(phone)
                     //短信签名名称。潜山市数据资源局
-                    .setSignName("中新云")
+                    .setSignName("安徽博曼网络科技有限公司")
                     //短信模板CODE
                     .setTemplateCode("SMS_232893584")
                     //短信模板变量对应的实际值{"name": code}
                     .setTemplateParam(smsCode);
             try {
-                sendSms.setContent("【中新云】您的验证码"+smsCode+",该验证码10分钟内有效,请勿泄漏于他人!");
+                sendSms.setContent("【安徽博曼网络科技有限公司】您的验证码"+smsCode+",该验证码10分钟内有效,请勿泄漏于他人!");
                 // 复制代码运行请自行打印 API 的返回值
-                System.out.println("发送短信"+"【中新云】您的验证码"+smsCode+",该验证码10分钟内有效,请勿泄漏于他人!");
+                System.out.println("发送短信"+"【安徽博曼网络科技有限公司】您的验证码"+smsCode+",该验证码10分钟内有效,请勿泄漏于他人!");
                 SendSmsResponse sendSmsResponse = client.sendSmsWithOptions(sendSmsRequest, new RuntimeOptions());
                 String code = sendSmsResponse.getBody().code;
                 System.out.println(code);

+ 26 - 2
ruoyi-system/src/main/java/com/ruoyi/system/domain/RecordLeave.java

@@ -1,6 +1,8 @@
 package com.ruoyi.system.domain;
 
 import java.util.Date;
+import java.util.List;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -25,12 +27,12 @@ public class RecordLeave extends BaseEntity
     private String type;
 
     /** 请假开始时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "请假开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date startTime;
 
     /** 请假结束时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "请假结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date endTime;
 
@@ -72,6 +74,12 @@ public class RecordLeave extends BaseEntity
     @Excel(name = "提交时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date submitTime;
 
+    /** 当前所属部门id合集 */
+    private List<RecordLeaveFj> recordLeaveFjList;
+
+    /** 当前所属部门id合集 */
+    private List<Long> deptIds;
+
     public void setId(Long id) 
     {
         this.id = id;
@@ -199,6 +207,22 @@ public class RecordLeave extends BaseEntity
         return submitTime;
     }
 
+    public List<Long> getDeptIds() {
+        return deptIds;
+    }
+
+    public void setDeptIds(List<Long> deptIds) {
+        this.deptIds = deptIds;
+    }
+
+    public List<RecordLeaveFj> getRecordLeaveFjList() {
+        return recordLeaveFjList;
+    }
+
+    public void setRecordLeaveFjList(List<RecordLeaveFj> recordLeaveFjList) {
+        this.recordLeaveFjList = recordLeaveFjList;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 80 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/RecordLeaveFj.java

@@ -0,0 +1,80 @@
+package com.ruoyi.system.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;
+
+/**
+ * 请假_附件对象 record_leave_fj
+ * 
+ * @author ruoyi
+ * @date 2025-06-19
+ */
+public class RecordLeaveFj extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 附件ID */
+    private Long id;
+
+    /** 请假id */
+    @Excel(name = "请假id")
+    private String recordId;
+
+    /** 附件名称 */
+    @Excel(name = "附件名称")
+    private String name;
+
+    /** 附件地址 */
+    @Excel(name = "附件地址")
+    private String url;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setRecordId(String recordId) 
+    {
+        this.recordId = recordId;
+    }
+
+    public String getRecordId() 
+    {
+        return recordId;
+    }
+    public void setName(String name) 
+    {
+        this.name = name;
+    }
+
+    public String getName() 
+    {
+        return name;
+    }
+    public void setUrl(String url) 
+    {
+        this.url = url;
+    }
+
+    public String getUrl() 
+    {
+        return url;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("recordId", getRecordId())
+            .append("name", getName())
+            .append("url", getUrl())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/RecordLeaveFjMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.RecordLeaveFj;
+
+/**
+ * 请假_附件Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2025-06-19
+ */
+public interface RecordLeaveFjMapper 
+{
+    /**
+     * 查询请假_附件
+     * 
+     * @param id 请假_附件主键
+     * @return 请假_附件
+     */
+    public RecordLeaveFj selectRecordLeaveFjById(Long id);
+
+    /**
+     * 查询请假_附件列表
+     * 
+     * @param recordLeaveFj 请假_附件
+     * @return 请假_附件集合
+     */
+    public List<RecordLeaveFj> selectRecordLeaveFjList(RecordLeaveFj recordLeaveFj);
+
+    /**
+     * 新增请假_附件
+     * 
+     * @param recordLeaveFj 请假_附件
+     * @return 结果
+     */
+    public int insertRecordLeaveFj(RecordLeaveFj recordLeaveFj);
+
+    /**
+     * 修改请假_附件
+     * 
+     * @param recordLeaveFj 请假_附件
+     * @return 结果
+     */
+    public int updateRecordLeaveFj(RecordLeaveFj recordLeaveFj);
+
+    /**
+     * 删除请假_附件
+     * 
+     * @param id 请假_附件主键
+     * @return 结果
+     */
+    public int deleteRecordLeaveFjById(Long id);
+
+    /**
+     * 批量删除请假_附件
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteRecordLeaveFjByIds(Long[] ids);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IRecordLeaveFjService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.ruoyi.system.domain.RecordLeaveFj;
+
+/**
+ * 请假_附件Service接口
+ * 
+ * @author ruoyi
+ * @date 2025-06-19
+ */
+public interface IRecordLeaveFjService 
+{
+    /**
+     * 查询请假_附件
+     * 
+     * @param id 请假_附件主键
+     * @return 请假_附件
+     */
+    public RecordLeaveFj selectRecordLeaveFjById(Long id);
+
+    /**
+     * 查询请假_附件列表
+     * 
+     * @param recordLeaveFj 请假_附件
+     * @return 请假_附件集合
+     */
+    public List<RecordLeaveFj> selectRecordLeaveFjList(RecordLeaveFj recordLeaveFj);
+
+    /**
+     * 新增请假_附件
+     * 
+     * @param recordLeaveFj 请假_附件
+     * @return 结果
+     */
+    public int insertRecordLeaveFj(RecordLeaveFj recordLeaveFj);
+
+    /**
+     * 修改请假_附件
+     * 
+     * @param recordLeaveFj 请假_附件
+     * @return 结果
+     */
+    public int updateRecordLeaveFj(RecordLeaveFj recordLeaveFj);
+
+    /**
+     * 批量删除请假_附件
+     * 
+     * @param ids 需要删除的请假_附件主键集合
+     * @return 结果
+     */
+    public int deleteRecordLeaveFjByIds(Long[] ids);
+
+    /**
+     * 删除请假_附件信息
+     * 
+     * @param id 请假_附件主键
+     * @return 结果
+     */
+    public int deleteRecordLeaveFjById(Long id);
+}

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

@@ -1,6 +1,8 @@
 package com.ruoyi.system.service;
 
 import java.util.List;
+
+import com.ruoyi.system.domain.CardReplacementRecord;
 import com.ruoyi.system.domain.RecordLeave;
 
 /**
@@ -60,4 +62,6 @@ public interface IRecordLeaveService
     public int deleteRecordLeaveById(Long id);
 
     int audit(Long id, String isPass);
+
+    List<RecordLeave> presentList(RecordLeave recordLeave);
 }

+ 18 - 6
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CardReplacementRecordServiceImpl.java

@@ -3,8 +3,12 @@ package com.ruoyi.system.service.impl;
 import java.util.List;
 import java.util.stream.Collectors;
 
+import com.ruoyi.common.constant.HttpStatus;
+import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.system.domain.ProcessConfiguration;
 import com.ruoyi.system.mapper.ProcessConfigurationMapper;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -49,6 +53,8 @@ public class CardReplacementRecordServiceImpl implements ICardReplacementRecordS
     @Override
     public List<CardReplacementRecord> selectCardReplacementRecordList(CardReplacementRecord cardReplacementRecord)
     {
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        cardReplacementRecord.setUserId(user.getUserId());
         return cardReplacementRecordMapper.selectCardReplacementRecordList(cardReplacementRecord);
     }
 
@@ -79,6 +85,10 @@ public class CardReplacementRecordServiceImpl implements ICardReplacementRecordS
     @Override
     public int updateCardReplacementRecord(CardReplacementRecord cardReplacementRecord)
     {
+        CardReplacementRecord cardReplacementRecord1 = cardReplacementRecordMapper.selectCardReplacementRecordById(cardReplacementRecord.getId());
+        if("0".equals(cardReplacementRecord1.getIsPass())){
+            throw new ServiceException("当前补卡已处理,无法修改");
+        }
         return cardReplacementRecordMapper.updateCardReplacementRecord(cardReplacementRecord);
     }
 
@@ -119,12 +129,14 @@ public class CardReplacementRecordServiceImpl implements ICardReplacementRecordS
     public List<CardReplacementRecord> presentList(CardReplacementRecord cardReplacementRecord) {
         //获取当前人员信息
         SysUser user = SecurityUtils.getLoginUser().getUser();
-        //获取当前人员补卡配置所在的部门id
-        ProcessConfiguration processConfiguration = new ProcessConfiguration();
-        processConfiguration.setUserId(user.getUserId());
-        List<ProcessConfiguration> list = processConfigurationMapper.selectProcessConfigurationList(processConfiguration);
-        List<Long> deptIds = list.stream().map(ProcessConfiguration::getDeptId).collect(Collectors.toList());
-        cardReplacementRecord.setDeptIds(deptIds);
+        if (!"admin".equals(user.getUserName())){
+            //获取当前人员补卡配置所在的部门id
+            ProcessConfiguration processConfiguration = new ProcessConfiguration();
+            processConfiguration.setUserId(user.getUserId());
+            List<ProcessConfiguration> list = processConfigurationMapper.selectProcessConfigurationList(processConfiguration);
+            List<Long> deptIds = list.stream().map(ProcessConfiguration::getDeptId).collect(Collectors.toList());
+            cardReplacementRecord.setDeptIds(deptIds);
+        }
         return cardReplacementRecordMapper.selectCardReplacementRecordList(cardReplacementRecord);
     }
 }

+ 93 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RecordLeaveFjServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.RecordLeaveFjMapper;
+import com.ruoyi.system.domain.RecordLeaveFj;
+import com.ruoyi.system.service.IRecordLeaveFjService;
+
+/**
+ * 请假_附件Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2025-06-19
+ */
+@Service
+public class RecordLeaveFjServiceImpl implements IRecordLeaveFjService 
+{
+    @Autowired
+    private RecordLeaveFjMapper recordLeaveFjMapper;
+
+    /**
+     * 查询请假_附件
+     * 
+     * @param id 请假_附件主键
+     * @return 请假_附件
+     */
+    @Override
+    public RecordLeaveFj selectRecordLeaveFjById(Long id)
+    {
+        return recordLeaveFjMapper.selectRecordLeaveFjById(id);
+    }
+
+    /**
+     * 查询请假_附件列表
+     * 
+     * @param recordLeaveFj 请假_附件
+     * @return 请假_附件
+     */
+    @Override
+    public List<RecordLeaveFj> selectRecordLeaveFjList(RecordLeaveFj recordLeaveFj)
+    {
+        return recordLeaveFjMapper.selectRecordLeaveFjList(recordLeaveFj);
+    }
+
+    /**
+     * 新增请假_附件
+     * 
+     * @param recordLeaveFj 请假_附件
+     * @return 结果
+     */
+    @Override
+    public int insertRecordLeaveFj(RecordLeaveFj recordLeaveFj)
+    {
+        return recordLeaveFjMapper.insertRecordLeaveFj(recordLeaveFj);
+    }
+
+    /**
+     * 修改请假_附件
+     * 
+     * @param recordLeaveFj 请假_附件
+     * @return 结果
+     */
+    @Override
+    public int updateRecordLeaveFj(RecordLeaveFj recordLeaveFj)
+    {
+        return recordLeaveFjMapper.updateRecordLeaveFj(recordLeaveFj);
+    }
+
+    /**
+     * 批量删除请假_附件
+     * 
+     * @param ids 需要删除的请假_附件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteRecordLeaveFjByIds(Long[] ids)
+    {
+        return recordLeaveFjMapper.deleteRecordLeaveFjByIds(ids);
+    }
+
+    /**
+     * 删除请假_附件信息
+     * 
+     * @param id 请假_附件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteRecordLeaveFjById(Long id)
+    {
+        return recordLeaveFjMapper.deleteRecordLeaveFjById(id);
+    }
+}

+ 48 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RecordLeaveServiceImpl.java

@@ -1,9 +1,18 @@
 package com.ruoyi.system.service.impl;
 
+import java.util.Collections;
 import java.util.List;
+import java.util.stream.Collectors;
 
 import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.exception.ServiceException;
+import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.system.domain.CardReplacementRecord;
+import com.ruoyi.system.domain.ProcessConfiguration;
+import com.ruoyi.system.domain.RecordLeaveFj;
+import com.ruoyi.system.mapper.ProcessConfigurationMapper;
+import com.ruoyi.system.mapper.RecordLeaveFjMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.system.mapper.RecordLeaveMapper;
@@ -22,6 +31,12 @@ public class RecordLeaveServiceImpl implements IRecordLeaveService
     @Autowired
     private RecordLeaveMapper recordLeaveMapper;
 
+    @Autowired
+    private ProcessConfigurationMapper processConfigurationMapper;
+
+    @Autowired
+    private RecordLeaveFjMapper recordLeaveFjMapper;
+
     /**
      * 查询请假记录信息
      * 
@@ -43,6 +58,8 @@ public class RecordLeaveServiceImpl implements IRecordLeaveService
     @Override
     public List<RecordLeave> selectRecordLeaveList(RecordLeave recordLeave)
     {
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        recordLeave.setAbsenteeId(String.valueOf(user.getUserId()));
         return recordLeaveMapper.selectRecordLeaveList(recordLeave);
     }
 
@@ -59,7 +76,17 @@ public class RecordLeaveServiceImpl implements IRecordLeaveService
         SysUser user = SecurityUtils.getLoginUser().getUser();
         recordLeave.setAbsenteeId(String.valueOf(user.getUserId()));
         recordLeave.setAbsenteeName(user.getNickName());
-        return recordLeaveMapper.insertRecordLeave(recordLeave);
+        recordLeave.setDeptId(user.getDeptId());
+        recordLeave.setDeptName(user.getDept().getDeptName());
+        recordLeave.setSubmitTime(DateUtils.getNowDate());
+        int i = recordLeaveMapper.insertRecordLeave(recordLeave);
+        List<RecordLeaveFj> recordLeaveFjList = recordLeave.getRecordLeaveFjList();
+        for (RecordLeaveFj recordLeaveFj : recordLeaveFjList) {
+            recordLeaveFj.setRecordId(String.valueOf(recordLeave.getId()));
+            recordLeaveFjMapper.insertRecordLeaveFj(recordLeaveFj);
+        }
+
+        return i;
     }
 
     /**
@@ -71,6 +98,11 @@ public class RecordLeaveServiceImpl implements IRecordLeaveService
     @Override
     public int updateRecordLeave(RecordLeave recordLeave)
     {
+        RecordLeave recordLeave1 = recordLeaveMapper.selectRecordLeaveById(recordLeave.getId());
+        if("0".equals(recordLeave1.getIsPass())){
+            throw new ServiceException("当前补卡已处理,无法修改");
+        }
+        recordLeave.setSubmitTime(DateUtils.getNowDate());
         return recordLeaveMapper.updateRecordLeave(recordLeave);
     }
 
@@ -110,4 +142,19 @@ public class RecordLeaveServiceImpl implements IRecordLeaveService
         recordLeave.setIsPass(isPass);
         return recordLeaveMapper.updateRecordLeave(recordLeave);
     }
+
+    @Override
+    public List<RecordLeave> presentList(RecordLeave recordLeave) {
+        //获取当前人员信息
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        if (!"admin".equals(user.getUserName())){
+            //获取当前人员补卡配置所在的部门id
+            ProcessConfiguration processConfiguration = new ProcessConfiguration();
+            processConfiguration.setUserId(user.getUserId());
+            List<ProcessConfiguration> list = processConfigurationMapper.selectProcessConfigurationList(processConfiguration);
+            List<Long> deptIds = list.stream().map(ProcessConfiguration::getDeptId).collect(Collectors.toList());
+            recordLeave.setDeptIds(deptIds);
+        }
+        return recordLeaveMapper.selectRecordLeaveList(recordLeave);
+    }
 }

+ 1 - 0
ruoyi-system/src/main/resources/mapper/system/CardReplacementRecordMapper.xml

@@ -39,6 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 </foreach>
             </if>
         </where>
+        order by is_pass, application_time desc
     </select>
     
     <select id="selectCardReplacementRecordById" parameterType="Long" resultMap="CardReplacementRecordResult">

+ 70 - 0
ruoyi-system/src/main/resources/mapper/system/RecordLeaveFjMapper.xml

@@ -0,0 +1,70 @@
+<?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.RecordLeaveFjMapper">
+    
+    <resultMap type="RecordLeaveFj" id="RecordLeaveFjResult">
+        <result property="id"    column="id"    />
+        <result property="recordId"    column="record_id"    />
+        <result property="name"    column="name"    />
+        <result property="url"    column="url"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectRecordLeaveFjVo">
+        select id, record_id, name, url, remark from record_leave_fj
+    </sql>
+
+    <select id="selectRecordLeaveFjList" parameterType="RecordLeaveFj" resultMap="RecordLeaveFjResult">
+        <include refid="selectRecordLeaveFjVo"/>
+        <where>  
+            <if test="recordId != null  and recordId != ''"> and record_id = #{recordId}</if>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="url != null  and url != ''"> and url = #{url}</if>
+        </where>
+    </select>
+    
+    <select id="selectRecordLeaveFjById" parameterType="Long" resultMap="RecordLeaveFjResult">
+        <include refid="selectRecordLeaveFjVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertRecordLeaveFj" parameterType="RecordLeaveFj" useGeneratedKeys="true" keyProperty="id">
+        insert into record_leave_fj
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="recordId != null">record_id,</if>
+            <if test="name != null and name != ''">name,</if>
+            <if test="url != null">url,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="recordId != null">#{recordId},</if>
+            <if test="name != null and name != ''">#{name},</if>
+            <if test="url != null">#{url},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateRecordLeaveFj" parameterType="RecordLeaveFj">
+        update record_leave_fj
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="recordId != null">record_id = #{recordId},</if>
+            <if test="name != null and name != ''">name = #{name},</if>
+            <if test="url != null">url = #{url},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteRecordLeaveFjById" parameterType="Long">
+        delete from record_leave_fj where id = #{id}
+    </delete>
+
+    <delete id="deleteRecordLeaveFjByIds" parameterType="String">
+        delete from record_leave_fj where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

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

@@ -35,7 +35,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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>
+            <if test="deptIds!=null and deptIds.size() >0">
+                and dept_id in
+                <foreach item="deptId" collection="deptIds" open="(" separator="," close=")">
+                    #{deptId}
+                </foreach>
+            </if>
         </where>
+        order by isPass,submitTime desc
     </select>
     
     <select id="selectRecordLeaveById" parameterType="Long" resultMap="RecordLeaveResult">