考勤修改
This commit is contained in:
parent
9fcefb3573
commit
eedb654f32
|
|
@ -238,6 +238,17 @@ public class AttDataDetailsBean {
|
||||||
private String attendType;
|
private String attendType;
|
||||||
private String attStatusToday;
|
private String attStatusToday;
|
||||||
|
|
||||||
|
/**上班附件/下班附件*/
|
||||||
|
private List<FilesVo> filesVoList;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class FilesVo{
|
||||||
|
/**文件名称*/
|
||||||
|
private String fileName;
|
||||||
|
private String filePath;
|
||||||
|
private String attType;
|
||||||
|
}
|
||||||
|
|
||||||
public AttDataDetailsBean() {
|
public AttDataDetailsBean() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import com.bonus.system.att.tasks.WechatTasks;
|
||||||
import com.bonus.system.basic.domain.SysNotice;
|
import com.bonus.system.basic.domain.SysNotice;
|
||||||
import com.bonus.system.basic.service.SysNoticeService;
|
import com.bonus.system.basic.service.SysNoticeService;
|
||||||
import com.bonus.system.dept.dao.ProDeptRoleDao;
|
import com.bonus.system.dept.dao.ProDeptRoleDao;
|
||||||
|
import com.bonus.system.file.service.FileUploadService;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -48,9 +49,13 @@ public class AttendanceDetailsServiceImpl implements AttendanceDetailsService {
|
||||||
@Resource
|
@Resource
|
||||||
private SysNoticeService noticeService;
|
private SysNoticeService noticeService;
|
||||||
|
|
||||||
|
@Resource(name = "FileUploadService")
|
||||||
|
private FileUploadService fileUploadService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AttDataDetailsBean> selectAttDetailsList(AttDataDetailsBean bean) {
|
public List<AttDataDetailsBean> selectAttDetailsList(AttDataDetailsBean bean) {
|
||||||
return attendanceDetailsDao.selectAttDetailsList(bean);
|
List<AttDataDetailsBean> list = attendanceDetailsDao.selectAttDetailsList(bean);
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -72,7 +77,7 @@ public class AttendanceDetailsServiceImpl implements AttendanceDetailsService {
|
||||||
@Override
|
@Override
|
||||||
public int updateAttDetailsData(List<AttDataDetailsBean> list) {
|
public int updateAttDetailsData(List<AttDataDetailsBean> list) {
|
||||||
int i = attendanceDetailsDao.updateAttDetailsData(list);
|
int i = attendanceDetailsDao.updateAttDetailsData(list);
|
||||||
|
fileUploadService.saveAttUpdateFileSource(list);
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
Long userId = SecurityUtils.getLoginUser().getSysUser().getUserId();
|
Long userId = SecurityUtils.getLoginUser().getSysUser().getUserId();
|
||||||
List<Long> orgList = new ArrayList<>();
|
List<Long> orgList = new ArrayList<>();
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.bonus.system.file.dao;
|
||||||
|
|
||||||
|
import com.bonus.system.file.entity.FileSourceVo;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @className:FileUploadDao
|
||||||
|
* @author:cwchen
|
||||||
|
* @date:2025-02-19-14:48
|
||||||
|
* @version:1.0
|
||||||
|
* @description:文件上传
|
||||||
|
*/
|
||||||
|
@Repository(value = "FileUploadDao")
|
||||||
|
public interface FileUploadDao {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增资源文件
|
||||||
|
* @param list
|
||||||
|
* @return void
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2025/2/19 15:15
|
||||||
|
*/
|
||||||
|
void addFileResource(List<FileSourceVo> list);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除资源文件
|
||||||
|
* @param list
|
||||||
|
* @return void
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2025/2/19 15:16
|
||||||
|
*/
|
||||||
|
void delFileResource(@Param("list") List<String> list,@Param("sourceType") int sourceType);
|
||||||
|
}
|
||||||
|
|
@ -31,7 +31,7 @@ public class FileSourceVo {
|
||||||
/**
|
/**
|
||||||
* 文件类型 1图片 2文件
|
* 文件类型 1图片 2文件
|
||||||
*/
|
*/
|
||||||
private String fileType;
|
private int fileType;
|
||||||
/**
|
/**
|
||||||
* 资源id
|
* 资源id
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.bonus.system.file.util;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @className:FileUtils
|
||||||
|
* @author:cwchen
|
||||||
|
* @date:2025-02-19-15:27
|
||||||
|
* @version:1.0
|
||||||
|
* @description:文件工具类
|
||||||
|
*/
|
||||||
|
public class FileUtils {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取文件后缀
|
||||||
|
* @param fileName
|
||||||
|
* @return String
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2025/2/19 15:27
|
||||||
|
*/
|
||||||
|
public static String getFileExtension(String fileName) {
|
||||||
|
if (fileName == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
int lastDotIndex = fileName.lastIndexOf('.');
|
||||||
|
if (lastDotIndex == -1) {
|
||||||
|
// 没有后缀
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return fileName.substring(lastDotIndex + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getFileType(String fileName) {
|
||||||
|
if (fileName == null) {
|
||||||
|
return 2; // 默认返回文件类型
|
||||||
|
}
|
||||||
|
// 获取文件后缀
|
||||||
|
String fileExtension = getFileExtension(fileName).toLowerCase();
|
||||||
|
// 常见图片后缀
|
||||||
|
String[] imageExtensions = {"jpg", "jpeg", "png", "gif", "bmp", "webp"};
|
||||||
|
// 判断是否是图片
|
||||||
|
for (String ext : imageExtensions) {
|
||||||
|
if (ext.equals(fileExtension)) {
|
||||||
|
return 1; // 图片类型
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 2; // 其他文件类型
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?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.bonus.system.file.dao.FileUploadDao">
|
||||||
|
|
||||||
|
<!--新增资源文件-->
|
||||||
|
<insert id="addFileResource">
|
||||||
|
INSERT INTO sys_file_source(file_name, file_suffix, file_path,
|
||||||
|
file_type, source_id, source_type,
|
||||||
|
create_user, update_user) VALUES
|
||||||
|
<foreach collection="list" item="item" separator=";">
|
||||||
|
(
|
||||||
|
#{item.fileName},
|
||||||
|
#{item.fileSuffix},
|
||||||
|
#{item.filePath},
|
||||||
|
#{item.fileType},
|
||||||
|
#{item.sourceId},
|
||||||
|
#{item.sourceType},
|
||||||
|
#{item.createUser},
|
||||||
|
#{item.updateUser}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
<!--删除资源文件-->
|
||||||
|
<update id="delFileResource">
|
||||||
|
UPDATE sys_file_source SET del_flag = 0 WHERE source_id IN (
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
) AND source_type = #{sourceType}
|
||||||
|
</update>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue