Files
FrameTour-BE/src/main/java/com/ycwl/basic/mapper/PrinterMapper.java
Jerry Yan d590286b13 feat(printer): 实现打印机任务WebSocket实时推送功能
- 新增PrinterTaskPushService接口及实现,负责任务推送逻辑
- 在PrinterServiceImpl中集成WebSocket推送,在任务创建和审核通过时主动推送
- 新增WebSocket配置类和处理器,支持打印机通过WebSocket连接接收任务
- 实现连接管理器,维护打印机在线状态并支持心跳保活
- 添加相关模型类如WsMessage、WsMessageType等,规范通信协议
- 在PrinterMapper中增加查询待处理任务列表的方法
- 完善异常处理和日志记录,确保推送可靠性
2025-12-01 09:59:27 +08:00

64 lines
2.3 KiB
Java

package com.ycwl.basic.mapper;
import com.ycwl.basic.model.pc.printer.entity.MemberPrintEntity;
import com.ycwl.basic.model.pc.printer.entity.PrintTaskEntity;
import com.ycwl.basic.model.pc.printer.entity.PrinterEntity;
import com.ycwl.basic.model.pc.printer.resp.MemberPrintResp;
import com.ycwl.basic.model.pc.printer.resp.PrinterResp;
import com.ycwl.basic.model.printer.resp.PrintTaskResp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface PrinterMapper {
List<PrinterEntity> list(@Param("condition") PrinterEntity condition);
PrinterEntity getById(@Param("id") Integer id);
int add(PrinterEntity entity);
int update(PrinterEntity entity);
int deleteById(@Param("id") Integer id);
PrinterEntity findByAccessKey(String accessKey);
PrintTaskResp findTaskByPrinterId(Integer printerId);
List<PrintTaskResp> listPendingTasksByPrinterId(Integer printerId);
int updateTaskStatus(@Param("id") Integer id, @Param("status") Integer status);
int compareAndSetTaskStatus(@Param("id") Integer id,
@Param("expectStatus") Integer expectStatus,
@Param("newStatus") Integer newStatus);
PrintTaskEntity getTaskById(Integer id);
List<PrinterResp> listByScenicId(@Param("scenicId") Long scenicId);
int countFacePhoto(Long scenicId, Long faceId, Long sourceId);
List<MemberPrintResp> listRelation(@Param("memberId") Long memberId, @Param("scenicId") Long scenicId);
List<MemberPrintResp> listRelationByFaceId(Long memberId, Long scenicId, Long faceId);
int deleteUserPhoto(Long memberId, Long scenicId, Long relationId);
int addUserPhoto(MemberPrintEntity entity);
MemberPrintResp getUserPhoto(Long memberId, Long scenicId, Long id);
int setPhotoCropped(Long memberId, Long scenicId, Long id, String url, String crop);
int setPhotoQuantity(Long memberId, Long scenicId, Long id, Integer quantity);
List<MemberPrintResp> getUserPhotoByIds(List<Long> ids);
int setUserIsBuyItem(Long memberId, Long id, Long orderId);
void updateUserPhotoListToPrinter(Long memberId, Long scenicId, Integer printerId);
List<MemberPrintResp> listRelationByOrderId(Long orderId);
PrintTaskResp queryTaskByMpId(Integer id);
}