zhaowenxuan
5 天以前 a1808ba0ff1ccc2efacb69c1033054dbaab8687f
2025-07-10
4个文件已修改
417 ■■■■ 已修改文件
ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisPDFUtil.java 367 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysNoticeController.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/websocket/WebSockerManager.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/domain/SysNoticeUser.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisPDFUtil.java
@@ -1003,6 +1003,37 @@
           List<TjOrderDetail> orderDetails = tjOrderDetailMapper.getzongjianyishengchakanyichangxiangmu4(tjOrder.getTjNumber());
//        List<Map<String, Object>> jiancha = new ArrayList<>();
           Font zongJianFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE);
           Font zongJianTitleFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE);
           zongJianTitleFont.setStyle(Font.BOLD);
           PdfPCell cell;
           String zjjyandqmgzIstop = sysConfigService.selectConfigByKey("pdf_zjjyandqmgz_istop");
           boolean zjjyandqmgzIstopFlag = false;
           if (StrUtil.isNotBlank(zjjyandqmgzIstop) && zjjyandqmgzIstop.equalsIgnoreCase("y")){
               zjjyandqmgzIstopFlag = true;
               paragraph = PdfUtils.setParagraph(defaultTitleFont, "总检医生建议:");
               document2.add(paragraph);
               if (tjOrder.getCheckAdvice() == null) {
                   paragraph = PdfUtils.setParagraph(defaultFont, "无");
                   document2.add(paragraph);
               } else {
                   Paragraph paragraphs = new Paragraph(tjOrder.getCheckAdvice(), defaultFont);
                   //设置文字居中
                   paragraphs.setAlignment(Element.ALIGN_LEFT);
                   //行间距
//            paragraphs.setLeading(5f);
                   //设置段落上空白
                   paragraphs.setSpacingBefore(10f);
                   //设置段落下空白
                   paragraphs.setSpacingAfter(10f);
//            paragraph = PdfUtils.setParagraph(defaultFont, tjOrder.getCheckAdvice());
                   document2.add(paragraphs);
               }
               makeZjjyAndQmgzTab(tjOrder, zongJianYiShiQianMing, zongJianFont, zongJianTitleFont, value, document2, defaultFont);
           }
           int xmXh = 1;
@@ -1135,10 +1166,15 @@
                           List<Map<String, Object>> collect1 = maps.stream().distinct().collect(Collectors.toList());
                           for (Map<String, Object> objectMap : collect1) {
                               String content = str + objectMap.get("bt").toString() + objectMap.get("nr").toString();
                               if (StrUtil.isBlank(content)) content = "     ";
//                               if (StrUtil.isBlank(content)) content = "     ";
//                               paragraph = new Paragraph(content, defaultFont);
//                               paragraph.setAlignment(Element.ALIGN_LEFT);
//                               document2.add(paragraph);
                               if (StrUtil.isNotBlank(content) && StrUtil.isNotBlank(content.trim())){
                               paragraph = new Paragraph(content, defaultFont);
                               paragraph.setAlignment(Element.ALIGN_LEFT);
                               document2.add(paragraph);
                               }
                           }
                           index++;
                           paragraph = PdfUtils.setParagraph(defaultFont, "");
@@ -1157,6 +1193,7 @@
               paragraph = PdfUtils.setParagraph(defaultFont, "");
               document2.add(paragraph);
           }
           if (!zjjyandqmgzIstopFlag){
           paragraph = PdfUtils.setParagraph(defaultTitleFont, "总检医生建议:");
           document2.add(paragraph);
           if (tjOrder.getCheckAdvice() == null) {
@@ -1175,6 +1212,8 @@
//            paragraph = PdfUtils.setParagraph(defaultFont, tjOrder.getCheckAdvice());
               document2.add(paragraphs);
           }
           }
           Paragraph paragraphNone = new Paragraph("", defaultFont);
@@ -1193,124 +1232,16 @@
           document2.add(paragraphNone);
           PdfPTable tableQz = new PdfPTable(new float[]{100f, 100f, 50f});
           tableQz.setTotalWidth(PageSize.A4.getWidth() - 100);
           tableQz.setLockedWidth(true);
           tableQz.setHorizontalAlignment(Element.ALIGN_LEFT);
           tableQz.getDefaultCell().setBorder(0);
           tableQz.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
           Font zongJianFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE);
           Font zongJianTitleFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE);
           zongJianTitleFont.setStyle(Font.BOLD);
           for (int i = 0; i < 3; i++) {
               PdfPCell cell = new PdfPCell();
               cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
               cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
               cell.setPhrase(new Phrase("", defaultFont));
               cell.setBorder(Rectangle.NO_BORDER);
               tableQz.addCell(cell);
           if (!zjjyandqmgzIstopFlag){
               makeZjjyAndQmgzTab(tjOrder, zongJianYiShiQianMing, zongJianFont, zongJianTitleFont, value, document2, defaultFont);
           }
           PdfPCell cell = new PdfPCell();
           cell.setBorder(Rectangle.NO_BORDER);
           cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
           cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
           cell.setPhrase(new Phrase("", defaultFont));
           cell.setRowspan(3);
           tableQz.addCell(cell);
           cell = new PdfPCell();
           cell.setBorder(Rectangle.NO_BORDER);
           cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
           cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
           cell.setPaddingTop(10);
           cell.setPaddingBottom(10);
           cell.setPaddingRight(4);
           cell.setPhrase(new Phrase("体检单位盖章:", zongJianTitleFont));
           tableQz.addCell(cell);
           File file = new File(value + File.separator + "yinzhang.png");
           cell = new PdfPCell();
           cell.setBorder(Rectangle.NO_BORDER);
           cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
           cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
           cell.setPaddingTop(10);
           cell.setPaddingBottom(10);
           cell.setPaddingRight(4);
           if (!file.exists()) {
               cell.setPhrase(new Phrase("", zongJianFont));
           }else {
               FileInputStream fileInputStream = new FileInputStream(file);
               byte[] fileBytes = new byte[(int) file.length()];
               fileInputStream.read(fileBytes);
               fileInputStream.close();
               Image image = Image.getInstance(Base64.getDecoder().decode(Base64.getEncoder().encodeToString(fileBytes)));
               image.scaleToFit(90, 90);
               cell.addElement(image);
           }
           tableQz.addCell(cell);
           cell = new PdfPCell();
           cell.setBorder(Rectangle.NO_BORDER);
           cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
           cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
           cell.setPaddingTop(10);
           cell.setPaddingBottom(10);
           cell.setPaddingRight(4);
           cell.setPhrase(new Phrase("总检医师:", zongJianTitleFont));
           tableQz.addCell(cell);
           cell = new PdfPCell();
           cell.setBorder(Rectangle.NO_BORDER);
           cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
           cell.setHorizontalAlignment(Element.ALIGN_CENTER);
           cell.setPaddingTop(10);
           cell.setPaddingBottom(10);
           cell.setPaddingRight(4);
           String zongjianysname = sysConfigService.selectConfigByKey("pdf_report_zongjianysname");
           if (zongJianYiShiQianMing == null && StrUtil.isNotBlank(zongjianysname) && !zongjianysname.equals("无")) {
               cell.setPhrase(new Phrase(zongjianysname, zongJianFont));
               tableQz.addCell(cell);
           } else if (zongJianYiShiQianMing == null && zongjianysname.equals("无")) {
               String nickName = SecurityUtils.getLoginUser().getUser().getNickName();
               cell.setPhrase(new Phrase(nickName, zongJianFont));
               tableQz.addCell(cell);
           } else {
               byte[] bytes = Base64.getDecoder().decode(zongJianYiShiQianMing.getTemplate());
               Image image = Image.getInstance(bytes);
               image.scaleToFit(100, 100);
               cell.addElement(image);
               tableQz.addCell(cell);
           }
           cell = new PdfPCell();
           cell.setBorder(Rectangle.NO_BORDER);
           cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
           cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
           cell.setPaddingTop(10);
           cell.setPaddingBottom(10);
           cell.setPaddingRight(4);
           cell.setPhrase(new Phrase("总检日期:", zongJianTitleFont));
           tableQz.addCell(cell);
           cell = new PdfPCell();
           cell.setBorder(Rectangle.NO_BORDER);
           cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
           cell.setHorizontalAlignment(Element.ALIGN_CENTER);
           cell.setPaddingTop(10);
           cell.setPaddingBottom(10);
           cell.setPaddingRight(4);
           cell.setPhrase(new Phrase(new SimpleDateFormat("yyyy-MM-dd").format(tjOrder.getCheckTime()), zongJianFont));
           tableQz.addCell(cell);
           document2.add(tableQz);
           document2.close();
           zongJianFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE);
           zongJianTitleFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE);
           zongJianTitleFont.setStyle(Font.BOLD);
           ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
@@ -1511,6 +1442,210 @@
        }
    }
    private void makeZjjyAndQmgzTab(TjOrder tjOrder, TjReportTemplate zongJianYiShiQianMing, Font zongJianFont, Font zongJianTitleFont, String value, Document document2, Font defaultFont) throws IOException, DocumentException {
        PdfPCell cell;
        String pdfQzgzpailie = sysConfigService.selectConfigByKey("pdf_qzgzpailie");
        if (StrUtil.isNotBlank(pdfQzgzpailie) && pdfQzgzpailie.equalsIgnoreCase("h")){
            zongJianFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE - 2);
            zongJianTitleFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE - 2);
            zongJianTitleFont.setStyle(Font.BOLD);
            PdfPTable tableQz = new PdfPTable(new float[]{90f, 90f, 60f, 60f, 60f, 60f});
            tableQz.setTotalWidth(PageSize.A4.getWidth() - 100);
            tableQz.setLockedWidth(true);
            tableQz.setHorizontalAlignment(Element.ALIGN_LEFT);
            tableQz.getDefaultCell().setBorder(1);
            tableQz.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
            cell = new PdfPCell(new Phrase("体检单位盖章:", zongJianTitleFont));
            cell.setBorder(Rectangle.NO_BORDER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
            cell.setPadding(10);
            tableQz.addCell(cell);
            File file = new File(value + File.separator + "yinzhang.png");
            cell = new PdfPCell();
            cell.setBorder(Rectangle.NO_BORDER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setPadding(10);
            if (!file.exists()) {
                cell.setPhrase(new Phrase("", zongJianFont));
            } else {
                FileInputStream fileInputStream = new FileInputStream(file);
                byte[] fileBytes = new byte[(int) file.length()];
                fileInputStream.read(fileBytes);
                fileInputStream.close();
                Image image = Image.getInstance(Base64.getDecoder().decode(Base64.getEncoder().encodeToString(fileBytes)));
                image.scaleToFit(60, 60);
                cell.addElement(image);
            }
            tableQz.addCell(cell);
            cell = new PdfPCell(new Phrase("总检医师:", zongJianTitleFont));
            cell.setBorder(Rectangle.NO_BORDER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
            cell.setPadding(10);
            tableQz.addCell(cell);
            cell = new PdfPCell();
            cell.setBorder(Rectangle.NO_BORDER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setPadding(10);
            String zongjianysname = sysConfigService.selectConfigByKey("pdf_report_zongjianysname");
            if (zongJianYiShiQianMing == null && StrUtil.isNotBlank(zongjianysname) && !zongjianysname.equals("无")) {
                cell.setPhrase(new Phrase(zongjianysname, zongJianFont));
            } else if (zongJianYiShiQianMing == null && zongjianysname.equals("无")) {
                String nickName = SecurityUtils.getLoginUser().getUser().getNickName();
                cell.setPhrase(new Phrase(nickName, zongJianFont));
            } else {
                byte[] bytes = Base64.getDecoder().decode(zongJianYiShiQianMing.getTemplate());
                Image image = Image.getInstance(bytes);
                image.scaleToFit(60, 60);
//                cell.addElement(image);
//                cell.setPaddingTop(5);
//                cell.setPaddingBottom(15);
                String pdfSfsgqz = sysConfigService.selectConfigByKey("pdf_sfsgqz");
                if (StrUtil.isNotBlank(pdfSfsgqz) && pdfSfsgqz.equalsIgnoreCase("Y")) {
                    cell.setVerticalAlignment(Element.ALIGN_TOP);
                }
                cell.setImage(image);
            }
            tableQz.addCell(cell);
            cell = new PdfPCell(new Phrase("总检日期:", zongJianTitleFont));
            cell.setBorder(Rectangle.NO_BORDER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
            cell.setPadding(10);
            tableQz.addCell(cell);
            cell = new PdfPCell(new Phrase(new SimpleDateFormat("yyyy-MM-dd").format(tjOrder.getCheckTime()), zongJianFont));
            cell.setBorder(Rectangle.NO_BORDER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setPadding(10);
            tableQz.addCell(cell);
            document2.add(tableQz);
        } else {
            PdfPTable tableQz = new PdfPTable(new float[]{90f, 90f, 70f});
            tableQz.setTotalWidth(PageSize.A4.getWidth() - 100);
            tableQz.setLockedWidth(true);
            tableQz.setHorizontalAlignment(Element.ALIGN_LEFT);
//            tableQz.getDefaultCell().setBorder(1);
            tableQz.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
            for (int i = 0; i < 3; i++) {
                cell = new PdfPCell();
                cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
                cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
                cell.setPhrase(new Phrase("", defaultFont));
                cell.setBorder(Rectangle.NO_BORDER);
                tableQz.addCell(cell);
            }
            cell = new PdfPCell();
            cell.setBorder(Rectangle.NO_BORDER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
            cell.setPhrase(new Phrase("", defaultFont));
            cell.setRowspan(3);
            tableQz.addCell(cell);
            cell = new PdfPCell();
            cell.setBorder(Rectangle.NO_BORDER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
            cell.setPaddingTop(10);
            cell.setPaddingBottom(10);
//            cell.setPaddingRight(50);
            cell.setPhrase(new Phrase("体检单位盖章:", zongJianTitleFont));
            tableQz.addCell(cell);
            File file = new File(value + File.separator + "yinzhang.png");
            cell = new PdfPCell();
            cell.setBorder(Rectangle.NO_BORDER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setHorizontalAlignment(Element.ALIGN_LEFT);
            cell.setPaddingTop(10);
            cell.setPaddingBottom(10);
//            cell.setPaddingRight(50);
            if (!file.exists()) {
                cell.setPhrase(new Phrase("", zongJianFont));
            }else {
                FileInputStream fileInputStream = new FileInputStream(file);
                byte[] fileBytes = new byte[(int) file.length()];
                fileInputStream.read(fileBytes);
                fileInputStream.close();
                Image image = Image.getInstance(Base64.getDecoder().decode(Base64.getEncoder().encodeToString(fileBytes)));
                image.scaleToFit(90, 90);
                cell.addElement(image);
            }
            tableQz.addCell(cell);
            cell = new PdfPCell();
            cell.setBorder(Rectangle.NO_BORDER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
            cell.setPaddingTop(10);
            cell.setPaddingBottom(10);
//            cell.setPaddingRight(50);
            cell.setPhrase(new Phrase("总检医师:", zongJianTitleFont));
            tableQz.addCell(cell);
            cell = new PdfPCell();
            cell.setBorder(Rectangle.NO_BORDER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setHorizontalAlignment(Element.ALIGN_LEFT);
            cell.setPaddingTop(10);
            cell.setPaddingBottom(10);
//            cell.setPaddingRight(50);
            String zongjianysname = sysConfigService.selectConfigByKey("pdf_report_zongjianysname");
            if (zongJianYiShiQianMing == null && StrUtil.isNotBlank(zongjianysname) && !zongjianysname.equals("无")) {
                cell.setPhrase(new Phrase(zongjianysname, zongJianFont));
                tableQz.addCell(cell);
            } else if (zongJianYiShiQianMing == null && zongjianysname.equals("无")) {
                String nickName = SecurityUtils.getLoginUser().getUser().getNickName();
                cell.setPhrase(new Phrase(nickName, zongJianFont));
                tableQz.addCell(cell);
            } else {
                byte[] bytes = Base64.getDecoder().decode(zongJianYiShiQianMing.getTemplate());
                Image image = Image.getInstance(bytes);
                image.scaleToFit(100, 100);
                cell.addElement(image);
                tableQz.addCell(cell);
            }
            cell = new PdfPCell();
            cell.setBorder(Rectangle.NO_BORDER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
            cell.setPaddingTop(10);
            cell.setPaddingBottom(10);
//            cell.setPaddingRight(50);
            cell.setPhrase(new Phrase("总检日期:", zongJianTitleFont));
            tableQz.addCell(cell);
            cell = new PdfPCell();
            cell.setBorder(Rectangle.NO_BORDER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setHorizontalAlignment(Element.ALIGN_LEFT);
            cell.setPaddingTop(10);
            cell.setPaddingBottom(10);
//            cell.setPaddingRight(50);
            cell.setPhrase(new Phrase(new SimpleDateFormat("yyyy-MM-dd").format(tjOrder.getCheckTime()), zongJianFont));
            tableQz.addCell(cell);
            document2.add(tableQz);
        }
    }
    /**
     * 生成检查表格
     *
ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysNoticeController.java
@@ -7,8 +7,10 @@
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.ltkj.common.core.domain.entity.SysUser;
import com.ltkj.common.core.domain.model.LoginUser;
import com.ltkj.common.utils.SecurityUtils;
@@ -133,6 +135,21 @@
        return AjaxResult.success();
    }
    @Log(title = "公告已读", businessType = BusinessType.UPDATE)
    @PostMapping("readNotice")
    public AjaxResult read(@RequestBody String json){
        JSONObject entries = JSONUtil.parseObj(json);
        String noticeId = entries.getStr("noticeId");
        LambdaUpdateWrapper<SysNoticeUser> wrapper = new LambdaUpdateWrapper<>();
        wrapper.eq(SysNoticeUser::getNoticeId, noticeId);
        wrapper.eq(SysNoticeUser::getUserId, getUserId());
        wrapper.set(SysNoticeUser::getIsRead, 1);
        boolean update = sysNoticeUserService.update(wrapper);
        if (update) {
            return success();
        }else return error();
    }
    /**
     * 修改通知公告
     */
ltkj-admin/src/main/java/com/ltkj/web/websocket/WebSockerManager.java
@@ -1,8 +1,14 @@
package com.ltkj.web.websocket;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ltkj.common.core.domain.model.LoginUser;
import com.ltkj.hosp.domain.SysNoticeUser;
import com.ltkj.hosp.service.SysNoticeUserService;
import com.ltkj.system.domain.SysNotice;
import com.ltkj.system.service.ISysNoticeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.socket.CloseStatus;
import org.springframework.web.socket.TextMessage;
@@ -11,6 +17,7 @@
import redis.clients.jedis.util.SafeEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
@@ -23,6 +30,11 @@
@Slf4j
@Component
public class WebSockerManager extends TextWebSocketHandler {
    @Autowired
    private SysNoticeUserService noticeUserService;
    @Autowired
    private ISysNoticeService noticeService;
    public final ConcurrentHashMap<String, ClientSessionInfo> userSessions = new ConcurrentHashMap<>();
    private static final ConcurrentHashMap<String, WebSocketClientInfo> sessions = new ConcurrentHashMap<>();
@@ -50,6 +62,16 @@
        userSessions.put(String.valueOf(clientInfo.getUid()), sessionInfo);
        session.sendMessage(new TextMessage("连接成功"));
        log.info("[WebSocket] 在线列表UserIds\n{}",JSONUtil.toJsonStr(new ArrayList<>(userSessions.keySet())));
        LambdaQueryWrapper<SysNoticeUser> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(SysNoticeUser::getUserId,clientInfo.getUid());
        wrapper.eq(SysNoticeUser::getIsRead,0);
        List<SysNoticeUser> list = noticeUserService.list(wrapper);
        if (list != null && !list.isEmpty()){
            List<Long> noticeIds = list.stream().map(SysNoticeUser::getNoticeId).collect(Collectors.toList());
            for (Long noticeId : noticeIds) {
                session.sendMessage(new TextMessage(JSONUtil.toJsonStr(noticeService.getById(noticeId))));
            }
        }
    }
    @Override
ltkj-hosp/src/main/java/com/ltkj/hosp/domain/SysNoticeUser.java
@@ -5,6 +5,9 @@
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
/**
@@ -18,18 +21,26 @@
     * 
     */
    @TableId
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    /**
     * 
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long noticeId;
    /**
     * 
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;
    /**
     * 是否已读
     */
    private Integer isRead;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}