pbv5msopc 3 months ago
parent 8914400117
commit 398476f394

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/src.iml" filepath="$PROJECT_DIR$/.idea/src.iml" />
</modules>
</component>
</project>

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

@ -0,0 +1,55 @@
@echo off
chcp 65001 >nul
echo ========================================
echo 文件上传功能检查和修复脚本
echo ========================================
echo.
echo [1/5] 检查Java环境...
java -version
if %errorlevel% neq 0 (
echo ❌ Java未安装或未配置环境变量
pause
exit /b 1
)
echo ✓ Java环境正常
echo.
echo [2/5] 检查项目根目录...
cd /d %~dp0
echo 当前目录: %cd%
echo.
echo [3/5] 创建files目录...
if not exist "files" mkdir files
if not exist "files\signatures" mkdir files\signatures
if not exist "files\videos" mkdir files\videos
echo ✓ files目录已创建
echo.
echo [4/5] 设置目录权限...
icacls files /grant Everyone:(OI)(CI)F /T >nul 2>&1
echo ✓ 权限已设置
echo.
echo [5/5] 检查端口7070...
netstat -ano | findstr :7070 >nul
if %errorlevel% equ 0 (
echo ⚠ 端口7070已被占用
echo 请检查是否有其他程序使用此端口
) else (
echo ✓ 端口7070可用
)
echo.
echo ========================================
echo 检查完成!
echo ========================================
echo.
echo 下一步:
echo 1. 重启后端服务
echo 2. 清空浏览器缓存
echo 3. 重新测试上传功能
echo 4. 查看后端控制台的详细错误信息
echo.
pause

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

@ -3,9 +3,11 @@ package com.example;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
@MapperScan("com.example.mapper")
@EnableScheduling
public class SpringbootApplication {
public static void main(String[] args) {
SpringApplication.run(SpringbootApplication.class, args);

@ -71,6 +71,13 @@ public class JwtInterceptor implements HandlerInterceptor {
*/
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
// 第零步:检查是否是文件访问请求,如果是则直接放行
String requestURI = request.getRequestURI();
if (requestURI.startsWith("/files/")) {
System.out.println("文件访问请求,直接放行: " + requestURI);
return true;
}
// 第一步从HTTP请求头中获取token
String token = request.getHeader(Constants.TOKEN);
if (ObjectUtil.isEmpty(token)) {

@ -20,6 +20,7 @@ public class WebConfig implements WebMvcConfigurer {
.excludePathPatterns("/login")
.excludePathPatterns("/register")
.excludePathPatterns("/files/**")
.excludePathPatterns("/files/public/**") // 公开文件访问不需要token
.excludePathPatterns("/record/template") // 添加模板下载路径到白名单
.excludePathPatterns("/record/import"); // 添加文件导入路径到白名单
}

@ -115,6 +115,22 @@ public class CarrierController {
return Result.success();
}
/**
* IN_USE -> IN_STOCK
*/
@PostMapping("/markReturned/{id}")
public Result markReturned(@PathVariable Integer id) {
Account current = TokenUtils.getCurrentUser();
if (isUser(current)) {
return Result.error("403", "无权限");
}
Carrier c = new Carrier();
c.setId(id);
c.setStatus("IN_STOCK");
carrierService.updateById(c);
return Result.success();
}
private boolean isUser(Account account) {
if (account == null || account.getRole() == null) return true;
return "USER".equalsIgnoreCase(account.getRole());

@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.net.URLEncoder;
@ -42,58 +43,149 @@ public class FileController {
* @return 访URL
*/
@PostMapping("/upload")
public Result upload(@RequestParam(value = "file") MultipartFile file,
public Result upload(@RequestParam(value = "file", required = false) MultipartFile file,
@RequestParam(value = "dir", required = false, defaultValue = "") String dir) {
String flag;
String fileName = "";
// 保证文件名唯一性,使用当前时间戳
synchronized (FileController.class) {
flag = System.currentTimeMillis() + "";
ThreadUtil.sleep(1L); // 避免高并发下时间戳重复
}
String fileName = file.getOriginalFilename();
System.out.println("=== 文件上传开始 ===");
try {
// 检查文件对象是否为null
if (file == null) {
System.err.println("文件对象为null请检查请求参数");
return Result.error("400", "未接收到文件,请检查请求参数");
}
fileName = file.getOriginalFilename();
System.out.println("文件名: " + fileName);
System.out.println("文件大小: " + file.getSize() + " 字节");
System.out.println("目录: " + dir);
System.out.println("Content-Type: " + file.getContentType());
// 检查文件是否为空
if (file.isEmpty()) {
System.err.println("文件为空,上传失败");
return Result.error("400", "文件为空");
}
// 如果文件夹不存在则创建
String subDir = StrUtil.blankToDefault(dir, "").trim();
String basePath = filePath + (StrUtil.isBlank(subDir) ? "" : (subDir + "/"));
if (!FileUtil.isDirectory(basePath)) {
FileUtil.mkdir(basePath);
System.out.println("创建目录: " + basePath);
}
// 文件存储形式:时间戳-文件名,防止重名覆盖
FileUtil.writeBytes(file.getBytes(), basePath + flag + "-" + fileName);
System.out.println(fileName + "--上传成功");
String fullPath = basePath + flag + "-" + fileName;
FileUtil.writeBytes(file.getBytes(), fullPath);
System.out.println("文件保存成功: " + fullPath);
} catch (Exception e) {
System.err.println(fileName + "--文件上传失败");
System.err.println("文件上传失败: " + e.getMessage());
e.printStackTrace();
return Result.error("500", "文件上传失败: " + e.getMessage());
}
// 拼接文件的访问URL
String http = "http://" + ip + ":" + port + "/files/";
String url = http + (StrUtil.isBlank(dir) ? "" : (dir + "/")) + flag + "-" + fileName;
System.out.println("文件URL: " + url);
System.out.println("=== 文件上传完成 ===");
return Result.success(url);
}
/**
*
*
* @param flag
* @param response HTTP
*/
/**
* 访token
*
* /files/public/signatures/xxx.png
*/
@GetMapping("/public/**")
public void publicFile(HttpServletRequest request, HttpServletResponse response) {
// 从请求URI中提取文件路径
String requestURI = request.getRequestURI();
// 移除 /files/public/ 前缀,得到实际文件路径
String flag = requestURI.replace("/files/public/", "");
System.out.println("=== 公开文件访问 ===");
System.out.println("请求URI: " + requestURI);
System.out.println("文件路径: " + flag);
serveFile(flag, response);
}
@GetMapping("/{flag:.+}") // 支持子目录,如 signatures/1697-xx.png
public void avatarPath(@PathVariable String flag, HttpServletResponse response) {
serveFile(flag, response);
}
/**
*
*/
private void serveFile(String flag, HttpServletResponse response) {
System.out.println("=== 文件访问请求 ===");
System.out.println("请求路径参数 flag: " + flag);
OutputStream os;
try {
if (StrUtil.isNotEmpty(flag)) {
// 设置响应头,指定下载文件名
response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(flag, "UTF-8"));
response.setContentType("application/octet-stream");
String fullPath = filePath + flag;
System.out.println("完整文件路径: " + fullPath);
// 检查文件是否存在
java.io.File file = new java.io.File(fullPath);
if (!file.exists()) {
System.err.println("文件不存在: " + fullPath);
response.sendError(404, "文件不存在");
return;
}
System.out.println("文件存在,大小: " + file.length() + " 字节");
// 读取文件内容
byte[] bytes = FileUtil.readBytes(filePath + flag);
byte[] bytes = FileUtil.readBytes(fullPath);
// 根据文件扩展名设置 Content-Type
String fileName = flag.toLowerCase();
if (fileName.endsWith(".png")) {
response.setContentType("image/png");
} else if (fileName.endsWith(".jpg") || fileName.endsWith(".jpeg")) {
response.setContentType("image/jpeg");
} else if (fileName.endsWith(".gif")) {
response.setContentType("image/gif");
} else if (fileName.endsWith(".webm")) {
response.setContentType("video/webm");
} else if (fileName.endsWith(".mp4")) {
response.setContentType("video/mp4");
} else if (fileName.endsWith(".pdf")) {
response.setContentType("application/pdf");
} else {
// 其他文件类型设置为下载
response.setContentType("application/octet-stream");
response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(flag, "UTF-8"));
}
// 输出文件内容
os = response.getOutputStream();
os.write(bytes);
os.flush();
os.close();
}
} catch (Exception e) {
System.out.println("文件下载失败");
System.err.println("文件访问失败: " + flag);
e.printStackTrace();
}
}

@ -0,0 +1,106 @@
package com.example.controller;
import com.example.common.Result;
import com.example.entity.Account;
import com.example.entity.Reminder;
import com.example.service.ReminderService;
import com.example.task.OverdueCheckTask;
import com.example.utils.TokenUtils;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping("/reminder")
public class ReminderController {
@Resource
private ReminderService reminderService;
@Resource
private OverdueCheckTask overdueCheckTask;
/**
*
*/
@GetMapping("/my")
public Result getMyReminders(@RequestParam(defaultValue = "1") Integer pageNum,
@RequestParam(defaultValue = "10") Integer pageSize) {
Account user = TokenUtils.getCurrentUser();
Reminder query = new Reminder();
query.setReceiverId(user.getId());
PageInfo<Reminder> page = reminderService.selectPage(query, pageNum, pageSize);
return Result.success(page);
}
/**
*
*/
@GetMapping("/unreadCount")
public Result getUnreadCount() {
Account user = TokenUtils.getCurrentUser();
int count = reminderService.countUnreadByReceiver(user.getId());
return Result.success(count);
}
/**
*
*/
@PostMapping("/markRead/{id}")
public Result markAsRead(@PathVariable Integer id) {
reminderService.markAsRead(id);
return Result.success();
}
/**
*
*/
@PostMapping("/markAllRead")
public Result markAllAsRead() {
Account user = TokenUtils.getCurrentUser();
reminderService.markAllAsRead(user.getId());
return Result.success();
}
/**
*
*/
@DeleteMapping("/delete/{id}")
public Result delete(@PathVariable Integer id) {
reminderService.deleteById(id);
return Result.success();
}
/**
*
*/
@DeleteMapping("/delete/batch")
public Result deleteBatch(@RequestBody List<Integer> ids) {
for (Integer id : ids) {
reminderService.deleteById(id);
}
return Result.success();
}
/**
*
*
*/
@PostMapping("/testOverdueCheck")
public Result testOverdueCheck() {
Account user = TokenUtils.getCurrentUser();
// 只有管理员可以触发测试
if (user == null || !"ADMIN".equalsIgnoreCase(user.getRole())) {
return Result.error("403", "无权限,仅管理员可执行此操作");
}
try {
overdueCheckTask.doCheckOverdueCarriers();
return Result.success("逾期检查已执行完成,请查看控制台日志和提醒列表");
} catch (Exception e) {
return Result.error("500", "执行失败:" + e.getMessage());
}
}
}

@ -0,0 +1,55 @@
package com.example.entity;
import java.io.Serializable;
/**
*
*/
public class Reminder implements Serializable {
private static final long serialVersionUID = 1L;
private Integer id;
/** 提醒类型OVERDUE逾期未归还 */
private String type;
/** 关联载体ID */
private Integer carrierId;
/** 载体名称(冗余) */
private String carrierName;
/** 关联申请ID */
private Integer applicationId;
/** 接收人ID用户或工作人员 */
private Integer receiverId;
/** 接收人姓名 */
private String receiverName;
/** 提醒内容 */
private String content;
/** 是否已读0未读1已读 */
private Integer isRead;
/** 创建时间 yyyy-MM-dd HH:mm:ss */
private String createTime;
/** 归还截止日期 */
private String dueDate;
public Integer getId() { return id; }
public void setId(Integer id) { this.id = id; }
public String getType() { return type; }
public void setType(String type) { this.type = type; }
public Integer getCarrierId() { return carrierId; }
public void setCarrierId(Integer carrierId) { this.carrierId = carrierId; }
public String getCarrierName() { return carrierName; }
public void setCarrierName(String carrierName) { this.carrierName = carrierName; }
public Integer getApplicationId() { return applicationId; }
public void setApplicationId(Integer applicationId) { this.applicationId = applicationId; }
public Integer getReceiverId() { return receiverId; }
public void setReceiverId(Integer receiverId) { this.receiverId = receiverId; }
public String getReceiverName() { return receiverName; }
public void setReceiverName(String receiverName) { this.receiverName = receiverName; }
public String getContent() { return content; }
public void setContent(String content) { this.content = content; }
public Integer getIsRead() { return isRead; }
public void setIsRead(Integer isRead) { this.isRead = isRead; }
public String getCreateTime() { return createTime; }
public void setCreateTime(String createTime) { this.createTime = createTime; }
public String getDueDate() { return dueDate; }
public void setDueDate(String dueDate) { this.dueDate = dueDate; }
}

@ -19,8 +19,14 @@ public class GlobalExceptionHandler {
@ExceptionHandler(Exception.class)
@ResponseBody//返回json串
public Result error(HttpServletRequest request, Exception e){
System.err.println("=== 捕获到异常 ===");
System.err.println("请求URL: " + request.getRequestURI());
System.err.println("异常类型: " + e.getClass().getName());
System.err.println("异常信息: " + e.getMessage());
e.printStackTrace();
System.err.println("===================");
log.error("异常信息:",e);
return Result.error();
return Result.error("500", "系统异常: " + e.getMessage());
}
@ExceptionHandler(CustomException.class)

@ -0,0 +1,13 @@
package com.example.mapper;
import com.example.entity.Reminder;
import java.util.List;
public interface ReminderMapper {
int insert(Reminder reminder);
int deleteById(Integer id);
int updateById(Reminder reminder);
Reminder selectById(Integer id);
List<Reminder> selectAll(Reminder reminder);
int countUnreadByReceiver(Integer receiverId);
}

@ -0,0 +1,77 @@
package com.example.service;
import cn.hutool.core.date.DateUtil;
import com.example.entity.Reminder;
import com.example.mapper.ReminderMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class ReminderService {
@Resource
private ReminderMapper reminderMapper;
public void add(Reminder reminder) {
if (reminder.getCreateTime() == null) {
reminder.setCreateTime(DateUtil.now());
}
if (reminder.getIsRead() == null) {
reminder.setIsRead(0); // 默认未读
}
reminderMapper.insert(reminder);
}
public void deleteById(Integer id) {
reminderMapper.deleteById(id);
}
public void updateById(Reminder reminder) {
reminderMapper.updateById(reminder);
}
public Reminder selectById(Integer id) {
return reminderMapper.selectById(id);
}
public List<Reminder> selectAll(Reminder reminder) {
return reminderMapper.selectAll(reminder);
}
public PageInfo<Reminder> selectPage(Reminder reminder, Integer pageNum, Integer pageSize) {
PageHelper.startPage(pageNum, pageSize);
List<Reminder> list = reminderMapper.selectAll(reminder);
return PageInfo.of(list);
}
public int countUnreadByReceiver(Integer receiverId) {
return reminderMapper.countUnreadByReceiver(receiverId);
}
/**
*
*/
public void markAsRead(Integer id) {
Reminder r = new Reminder();
r.setId(id);
r.setIsRead(1);
reminderMapper.updateById(r);
}
/**
*
*/
public void markAllAsRead(Integer receiverId) {
Reminder query = new Reminder();
query.setReceiverId(receiverId);
query.setIsRead(0);
List<Reminder> list = reminderMapper.selectAll(query);
for (Reminder r : list) {
markAsRead(r.getId());
}
}
}

@ -0,0 +1,147 @@
package com.example.task;
import cn.hutool.core.date.DateUtil;
import com.example.entity.Account;
import com.example.entity.Admin;
import com.example.entity.Application;
import com.example.entity.Carrier;
import com.example.entity.Doctor;
import com.example.entity.Reminder;
import com.example.mapper.AdminMapper;
import com.example.mapper.ApplicationMapper;
import com.example.mapper.CarrierMapper;
import com.example.mapper.DoctorMapper;
import com.example.service.ReminderService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
*
*/
@Component
public class OverdueCheckTask {
@Resource
private ApplicationMapper applicationMapper;
@Resource
private CarrierMapper carrierMapper;
@Resource
private ReminderService reminderService;
@Resource
private AdminMapper adminMapper;
@Resource
private DoctorMapper doctorMapper;
/**
* 5
*/
@Scheduled(cron = "0 */5 * * * ?")
public void checkOverdueCarriers() {
doCheckOverdueCarriers();
}
/**
*
*/
public void doCheckOverdueCarriers() {
System.out.println("开始检查逾期未归还载体:" + DateUtil.now());
// 查询所有已通过的使用申请
Application query = new Application();
query.setType("USE");
query.setStatus("APPROVED");
List<Application> applications = applicationMapper.selectAll(query);
Date now = new Date();
for (Application app : applications) {
// 检查载体是否仍在使用中
Carrier carrier = carrierMapper.selectById(app.getCarrierId());
if (carrier == null || !"IN_USE".equals(carrier.getStatus())) {
continue; // 已归还或不存在,跳过
}
// 检查是否逾期(精确到分钟)
String dueDate = app.getDueDate();
if (dueDate != null) {
try {
Date dueDateObj = DateUtil.parse(dueDate, "yyyy-MM-dd HH:mm:ss");
if (dueDateObj.before(now)) {
// 已逾期,检查是否已经发送过提醒
Reminder existingReminder = new Reminder();
existingReminder.setApplicationId(app.getId());
existingReminder.setType("OVERDUE");
List<Reminder> existing = reminderService.selectAll(existingReminder);
if (existing == null || existing.isEmpty()) {
// 发送提醒给申请人
createReminderForUser(app, carrier);
// 发送提醒给保密室工作人员(所有管理员和医生)
createReminderForStaff(app, carrier);
System.out.println("已为载体【" + carrier.getName() + "】创建逾期提醒");
}
}
} catch (Exception e) {
System.err.println("解析归还日期失败:" + dueDate + ",错误:" + e.getMessage());
}
}
}
System.out.println("逾期检查完成:" + DateUtil.now());
}
/**
*
*/
private void createReminderForUser(Application app, Carrier carrier) {
Reminder reminder = new Reminder();
reminder.setType("OVERDUE");
reminder.setCarrierId(carrier.getId());
reminder.setCarrierName(carrier.getName());
reminder.setApplicationId(app.getId());
reminder.setReceiverId(app.getApplicantId());
reminder.setReceiverName(app.getApplicantName());
reminder.setDueDate(app.getDueDate());
reminder.setContent("您借用的载体【" + carrier.getName() + "】已逾期未归还,归还截止日期为:" + app.getDueDate() + ",请尽快归还!");
reminderService.add(reminder);
}
/**
*
*/
private void createReminderForStaff(Application app, Carrier carrier) {
// 获取所有管理员
List<Admin> admins = adminMapper.selectAll(new Admin());
for (Admin admin : admins) {
Reminder reminder = new Reminder();
reminder.setType("OVERDUE");
reminder.setCarrierId(carrier.getId());
reminder.setCarrierName(carrier.getName());
reminder.setApplicationId(app.getId());
reminder.setReceiverId(admin.getId());
reminder.setReceiverName(admin.getName());
reminder.setDueDate(app.getDueDate());
reminder.setContent("载体【" + carrier.getName() + "】已逾期未归还,借用人:" + app.getApplicantName() + ",归还截止日期:" + app.getDueDate());
reminderService.add(reminder);
}
// 获取所有医生(保密室工作人员)
List<Doctor> doctors = doctorMapper.selectAll(new Doctor());
for (Doctor doctor : doctors) {
Reminder reminder = new Reminder();
reminder.setType("OVERDUE");
reminder.setCarrierId(carrier.getId());
reminder.setCarrierName(carrier.getName());
reminder.setApplicationId(app.getId());
reminder.setReceiverId(doctor.getId());
reminder.setReceiverName(doctor.getName());
reminder.setDueDate(app.getDueDate());
reminder.setContent("载体【" + carrier.getName() + "】已逾期未归还,借用人:" + app.getApplicantName() + ",归还截止日期:" + app.getDueDate());
reminderService.add(reminder);
}
}
}

@ -0,0 +1,91 @@
<?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.example.mapper.ReminderMapper">
<sql id="Base_Column_List">
id,type,carrier_id as carrierId,carrier_name as carrierName,application_id as applicationId,
receiver_id as receiverId,receiver_name as receiverName,content,is_read as isRead,
create_time as createTime,due_date as dueDate
</sql>
<select id="selectAll" resultType="com.example.entity.Reminder">
select
<include refid="Base_Column_List"/>
from reminder
<where>
<if test="id != null"> and id = #{id}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="carrierId != null"> and carrier_id = #{carrierId}</if>
<if test="applicationId != null"> and application_id = #{applicationId}</if>
<if test="receiverId != null"> and receiver_id = #{receiverId}</if>
<if test="isRead != null"> and is_read = #{isRead}</if>
</where>
order by id desc
</select>
<select id="selectById" resultType="com.example.entity.Reminder">
select
<include refid="Base_Column_List"/>
from reminder
where id = #{id}
</select>
<insert id="insert" parameterType="com.example.entity.Reminder" useGeneratedKeys="true" keyProperty="id">
insert into reminder
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="type != null">type,</if>
<if test="carrierId != null">carrier_id,</if>
<if test="carrierName != null">carrier_name,</if>
<if test="applicationId != null">application_id,</if>
<if test="receiverId != null">receiver_id,</if>
<if test="receiverName != null">receiver_name,</if>
<if test="content != null">content,</if>
<if test="isRead != null">is_read,</if>
<if test="createTime != null">create_time,</if>
<if test="dueDate != null">due_date,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="type != null">#{type},</if>
<if test="carrierId != null">#{carrierId},</if>
<if test="carrierName != null">#{carrierName},</if>
<if test="applicationId != null">#{applicationId},</if>
<if test="receiverId != null">#{receiverId},</if>
<if test="receiverName != null">#{receiverName},</if>
<if test="content != null">#{content},</if>
<if test="isRead != null">#{isRead},</if>
<if test="createTime != null">#{createTime},</if>
<if test="dueDate != null">#{dueDate},</if>
</trim>
</insert>
<update id="updateById" parameterType="com.example.entity.Reminder">
update reminder
<set>
<if test="type != null"> type = #{type},</if>
<if test="carrierId != null"> carrier_id = #{carrierId},</if>
<if test="carrierName != null"> carrier_name = #{carrierName},</if>
<if test="applicationId != null"> application_id = #{applicationId},</if>
<if test="receiverId != null"> receiver_id = #{receiverId},</if>
<if test="receiverName != null"> receiver_name = #{receiverName},</if>
<if test="content != null"> content = #{content},</if>
<if test="isRead != null"> is_read = #{isRead},</if>
<if test="createTime != null"> create_time = #{createTime},</if>
<if test="dueDate != null"> due_date = #{dueDate},</if>
</set>
where id = #{id}
</update>
<delete id="deleteById">
delete from reminder where id = #{id}
</delete>
<select id="countUnreadByReceiver" resultType="java.lang.Integer">
select count(1) from reminder
where receiver_id = #{receiverId} and is_read = 0
</select>
</mapper>

@ -0,0 +1,91 @@
<?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.example.mapper.ReminderMapper">
<sql id="Base_Column_List">
id,type,carrier_id as carrierId,carrier_name as carrierName,application_id as applicationId,
receiver_id as receiverId,receiver_name as receiverName,content,is_read as isRead,
create_time as createTime,due_date as dueDate
</sql>
<select id="selectAll" resultType="com.example.entity.Reminder">
select
<include refid="Base_Column_List"/>
from reminder
<where>
<if test="id != null"> and id = #{id}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="carrierId != null"> and carrier_id = #{carrierId}</if>
<if test="applicationId != null"> and application_id = #{applicationId}</if>
<if test="receiverId != null"> and receiver_id = #{receiverId}</if>
<if test="isRead != null"> and is_read = #{isRead}</if>
</where>
order by id desc
</select>
<select id="selectById" resultType="com.example.entity.Reminder">
select
<include refid="Base_Column_List"/>
from reminder
where id = #{id}
</select>
<insert id="insert" parameterType="com.example.entity.Reminder" useGeneratedKeys="true" keyProperty="id">
insert into reminder
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="type != null">type,</if>
<if test="carrierId != null">carrier_id,</if>
<if test="carrierName != null">carrier_name,</if>
<if test="applicationId != null">application_id,</if>
<if test="receiverId != null">receiver_id,</if>
<if test="receiverName != null">receiver_name,</if>
<if test="content != null">content,</if>
<if test="isRead != null">is_read,</if>
<if test="createTime != null">create_time,</if>
<if test="dueDate != null">due_date,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="type != null">#{type},</if>
<if test="carrierId != null">#{carrierId},</if>
<if test="carrierName != null">#{carrierName},</if>
<if test="applicationId != null">#{applicationId},</if>
<if test="receiverId != null">#{receiverId},</if>
<if test="receiverName != null">#{receiverName},</if>
<if test="content != null">#{content},</if>
<if test="isRead != null">#{isRead},</if>
<if test="createTime != null">#{createTime},</if>
<if test="dueDate != null">#{dueDate},</if>
</trim>
</insert>
<update id="updateById" parameterType="com.example.entity.Reminder">
update reminder
<set>
<if test="type != null"> type = #{type},</if>
<if test="carrierId != null"> carrier_id = #{carrierId},</if>
<if test="carrierName != null"> carrier_name = #{carrierName},</if>
<if test="applicationId != null"> application_id = #{applicationId},</if>
<if test="receiverId != null"> receiver_id = #{receiverId},</if>
<if test="receiverName != null"> receiver_name = #{receiverName},</if>
<if test="content != null"> content = #{content},</if>
<if test="isRead != null"> is_read = #{isRead},</if>
<if test="createTime != null"> create_time = #{createTime},</if>
<if test="dueDate != null"> due_date = #{dueDate},</if>
</set>
where id = #{id}
</update>
<delete id="deleteById">
delete from reminder where id = #{id}
</delete>
<select id="countUnreadByReceiver" resultType="java.lang.Integer">
select count(1) from reminder
where receiver_id = #{receiverId} and is_read = 0
</select>
</mapper>

@ -0,0 +1,70 @@
com\example\common\config\JwtInterceptor.class
com\example\entity\User.class
com\example\listener\RecordExcelListener.class
com\example\entity\Doctor.class
com\example\dto\RecordExcelDTO.class
com\example\service\StatisticsService.class
com\example\common\enums\CallEnum.class
com\example\mapper\RecordMapper.class
com\example\service\DepartmentService.class
com\example\exception\CustomException.class
com\example\mapper\NoticeMapper.class
com\example\service\ReserveService.class
com\example\entity\Admin.class
com\example\utils\TokenUtils.class
com\example\controller\WebController.class
com\example\common\config\WebConfig.class
com\example\common\enums\StatusEnum.class
com\example\controller\DoctorController.class
com\example\task\OverdueCheckTask.class
com\example\mapper\DepartmentMapper.class
com\example\service\ReminderService.class
com\example\entity\Application.class
com\example\entity\Registration.class
com\example\controller\PlanController.class
com\example\controller\StatisticsController.class
com\example\exception\GlobalExceptionHandler.class
com\example\entity\Department.class
com\example\controller\CarrierController.class
com\example\service\UserService.class
com\example\service\RecordService.class
com\example\entity\Notice.class
com\example\controller\ApplicationController.class
com\example\controller\NoticeController.class
com\example\common\config\CorsConfig.class
com\example\mapper\DoctorMapper.class
com\example\controller\RegistrationController.class
com\example\entity\Plan.class
com\example\entity\Carrier.class
com\example\mapper\ReminderMapper.class
com\example\controller\UserController.class
com\example\SpringbootApplication.class
com\example\mapper\ApplicationMapper.class
com\example\common\enums\ResultCodeEnum.class
com\example\controller\AdminController.class
com\example\entity\Record.class
com\example\mapper\UserMapper.class
com\example\service\DoctorService.class
com\example\mapper\PlanMapper.class
com\example\mapper\RegistrationMapper.class
com\example\controller\RecordController.class
com\example\common\Result.class
com\example\exception\BusinessException.class
com\example\service\CarrierService.class
com\example\service\PlanService.class
com\example\entity\Account.class
com\example\service\AdminService.class
com\example\common\enums\RoleEnum.class
com\example\controller\ReserveController.class
com\example\mapper\ReserveMapper.class
com\example\common\Constants.class
com\example\controller\ReminderController.class
com\example\entity\Reminder.class
com\example\controller\FileController.class
com\example\service\RegistrationService.class
com\example\service\ApplicationService.class
com\example\mapper\CarrierMapper.class
com\example\controller\DepartmentController.class
com\example\entity\Reserve.class
com\example\mapper\AdminMapper.class
com\example\service\NoticeService.class

@ -0,0 +1,70 @@
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\mapper\UserMapper.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\service\StatisticsService.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\controller\RecordController.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\controller\UserController.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\service\PlanService.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\entity\Doctor.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\service\ApplicationService.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\common\config\WebConfig.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\service\CarrierService.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\task\OverdueCheckTask.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\listener\RecordExcelListener.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\service\AdminService.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\mapper\ReminderMapper.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\mapper\CarrierMapper.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\service\RecordService.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\entity\Registration.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\service\ReserveService.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\mapper\DepartmentMapper.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\mapper\ReserveMapper.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\controller\CarrierController.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\controller\PlanController.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\mapper\NoticeMapper.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\entity\Reminder.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\controller\FileController.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\utils\TokenUtils.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\common\config\CorsConfig.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\service\RegistrationService.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\entity\Record.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\mapper\ApplicationMapper.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\controller\DoctorController.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\common\Constants.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\entity\Account.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\service\NoticeService.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\controller\ReserveController.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\exception\BusinessException.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\common\enums\RoleEnum.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\entity\Admin.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\controller\WebController.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\exception\CustomException.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\service\UserService.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\mapper\AdminMapper.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\controller\NoticeController.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\controller\ApplicationController.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\SpringbootApplication.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\mapper\RecordMapper.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\service\DoctorService.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\exception\GlobalExceptionHandler.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\service\ReminderService.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\entity\Notice.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\controller\AdminController.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\dto\RecordExcelDTO.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\entity\Carrier.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\entity\Department.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\common\config\JwtInterceptor.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\controller\DepartmentController.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\controller\ReminderController.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\entity\Application.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\entity\Plan.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\mapper\PlanMapper.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\common\enums\ResultCodeEnum.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\common\Result.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\common\enums\CallEnum.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\controller\RegistrationController.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\entity\User.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\mapper\RegistrationMapper.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\common\enums\StatusEnum.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\controller\StatisticsController.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\mapper\DoctorMapper.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\entity\Reserve.java
D:\asoftware\SRMS\src\springboot\src\main\java\com\example\service\DepartmentService.java

@ -0,0 +1,42 @@
-- 为carrier表添加签名和录像字段
-- 执行时间2025-11-18
USE hospital;
-- 步骤1检查字段是否已存在
SELECT
COLUMN_NAME,
DATA_TYPE,
COLUMN_TYPE,
IS_NULLABLE,
COLUMN_COMMENT
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
TABLE_SCHEMA = 'hospital'
AND TABLE_NAME = 'carrier'
AND COLUMN_NAME IN ('signature_url', 'video_url');
-- 步骤2添加字段如果不存在
-- 如果上面的查询返回空结果,说明字段不存在,需要添加
ALTER TABLE `carrier`
ADD COLUMN `signature_url` VARCHAR(500) NULL COMMENT '入库手写签名文件URL' AFTER `status`,
ADD COLUMN `video_url` VARCHAR(500) NULL COMMENT '入库录像文件URL' AFTER `signature_url`;
-- 步骤3验证字段是否添加成功
SELECT
COLUMN_NAME,
DATA_TYPE,
COLUMN_TYPE,
IS_NULLABLE,
COLUMN_COMMENT
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
TABLE_SCHEMA = 'hospital'
AND TABLE_NAME = 'carrier'
ORDER BY ORDINAL_POSITION;
-- 步骤4查看现有数据可选
SELECT id, name, signature_url, video_url FROM carrier LIMIT 10;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
{"ast":null,"code":"/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport { addCommas, toCamelCase, normalizeCssArray, encodeHTML, formatTpl, getTooltipMarker, formatTime, capitalFirst, truncateText, getTextRect } from '../../util/format.js';","map":{"version":3,"names":["addCommas","toCamelCase","normalizeCssArray","encodeHTML","formatTpl","getTooltipMarker","formatTime","capitalFirst","truncateText","getTextRect"],"sources":["D:/asoftware/SRMS/src/vue/node_modules/echarts/lib/export/api/format.js"],"sourcesContent":["\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport { addCommas, toCamelCase, normalizeCssArray, encodeHTML, formatTpl, getTooltipMarker, formatTime, capitalFirst, truncateText, getTextRect } from '../../util/format.js';"],"mappings":"AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,EAAEC,iBAAiB,EAAEC,UAAU,EAAEC,SAAS,EAAEC,gBAAgB,EAAEC,UAAU,EAAEC,YAAY,EAAEC,YAAY,EAAEC,WAAW,QAAQ,sBAAsB","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save