Parcourir la source

微信小程序宣教文档查询接口提交

wangzl il y a 6 mois
Parent
commit
135522bf74
20 fichiers modifiés avec 464 ajouts et 47 suppressions
  1. 14 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/constant/PhaseConstant.java
  2. 2 2
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/BizMissionDocAndSquareCoverDTO.java
  3. 2 2
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/BizMissionDocDTO.java
  4. 2 2
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/BizMissionDocJsonDTO.java
  5. 2 2
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/BizMissionDocSquareDTO.java
  6. 8 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/mapper/BizMissionDocMapper.java
  7. 37 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/po/BizDocDeptPO.java
  8. 14 11
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/po/BizMissionDocPO.java
  9. 2 2
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/po/BizMissionDocSquarePO.java
  10. 16 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/repository/BizDocDeptRepository.java
  11. 8 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/repository/BizMissionDocRepository.java
  12. 41 16
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/IBizMissionDocService.java
  13. 68 4
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/impl/BizMissionDocServiceImpl.java
  14. 58 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/wx/controller/WxMissionController.java
  15. 56 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/wx/controller/vo/BizDeptAndDocVO.java
  16. 27 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/wx/dto/BizWxKnowledgeDocQueryDTO.java
  17. 36 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/wx/dto/BizWxMissionDocQueryDTO.java
  18. 27 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/wx/dto/BizWxQueryPO.java
  19. 42 4
      tr-modules/tr-module-smartFollowUp/src/main/resources/mapper/smart/BizMissionDocMapper.xml
  20. 2 2
      tr-modules/tr-module-smartFollowUp/src/main/resources/mapper/smart/BizMissionDocSquareMapper.xml

+ 14 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/constant/PhaseConstant.java

@@ -0,0 +1,14 @@
+package cn.tr.module.smart.common.constant;
+
+/**
+ * @author wangzl
+ * @description: 手术常量
+ * @date 2025/6/4 9:14
+ */
+public interface PhaseConstant {
+
+    /** 术前 */
+    String BEFORE = "BEFORE";
+    /** 术后 */
+    String AFTER = "AFTER";
+}

+ 2 - 2
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/BizMissionDocAndSquareCoverDTO.java

@@ -38,10 +38,10 @@ public class BizMissionDocAndSquareCoverDTO implements Serializable {
     private String phase;
 
     @ApiModelProperty(value = "间隔时间段(最小值),如术前2-6天,即2", position = 7)
-    private String intervalMinDay;
+    private Integer intervalMinDay;
 
     @ApiModelProperty(value = "间隔时间段(最大值),如术后2-6天,即6", position = 8)
-    private String intervalMaxDay;
+    private Integer intervalMaxDay;
 
     /** version */
     @ApiModelProperty(value = "version", position = 14)

+ 2 - 2
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/BizMissionDocDTO.java

@@ -44,10 +44,10 @@ public class BizMissionDocDTO extends BaseDTO  {
     private String phase;
 
     @ApiModelProperty(value = "间隔时间段(最小值),如术前2-6天,即2", position = 8)
-    private String intervalMinDay;
+    private Integer intervalMinDay;
 
     @ApiModelProperty(value = "间隔时间段(最大值),如术后2-6天,即6", position = 9)
-    private String intervalMaxDay;
+    private Integer intervalMaxDay;
 
     @ApiModelProperty(value = "版本号", position = 15)
     private Integer version;

+ 2 - 2
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/BizMissionDocJsonDTO.java

@@ -41,11 +41,11 @@ public class BizMissionDocJsonDTO {
 
     /** 间隔时间段(最小值),如术前2-6天,即2 */
     @ApiModelProperty(value = "间隔时间段(最小值),如术前2-6天,即2", position = 8)
-    private String intervalMinDay;
+    private Integer intervalMinDay;
 
     /** 间隔时间段(最大值),如术后2-6天,即6 */
     @ApiModelProperty(value = "间隔时间段(最大值),如术后2-6天,即6", position = 9)
-    private String intervalMaxDay;
+    private Integer intervalMaxDay;
 
     /** 医院id(医院上传的自己的文档) */
     @ApiModelProperty(value = "医院id(医院上传的自己的文档)", position = 10)

+ 2 - 2
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/BizMissionDocSquareDTO.java

@@ -44,10 +44,10 @@ public class BizMissionDocSquareDTO extends BaseDTO  {
     private String phase;
 
     @ApiModelProperty(value = "间隔时间段(最小值),如术前2-6天,即2", position = 8)
-    private String intervalMinDay;
+    private Integer intervalMinDay;
 
     @ApiModelProperty(value = "间隔时间段(最大值),如术后2-6天,即6", position = 9)
-    private String intervalMaxDay;
+    private Integer intervalMaxDay;
 
     @ApiModelProperty(value = "引用次数", position = 11)
     private Integer citationCount;

+ 8 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/mapper/BizMissionDocMapper.java

@@ -4,7 +4,10 @@ import cn.tr.module.smart.common.dto.BizMissionDocAndSquareCoverDTO;
 import cn.tr.module.smart.common.dto.BizMissionDocDTO;
 import cn.tr.module.smart.common.dto.BizMissionDocJsonDTO;
 import cn.tr.module.smart.common.po.BizMissionDocPO;
+import cn.tr.module.smart.wx.controller.vo.BizDeptAndDocVO;
 import org.mapstruct.Mapper;
+import org.mapstruct.Mapping;
+import org.mapstruct.Mappings;
 import org.mapstruct.factory.Mappers;
 
 import java.util.List;
@@ -32,4 +35,9 @@ public interface BizMissionDocMapper {
     BizMissionDocPO convertSquarePO(BizMissionDocAndSquareCoverDTO source);
     BizMissionDocAndSquareCoverDTO convertCoverDTO(BizMissionDocPO source);
 
+    @Mappings({
+            @Mapping(source = "id", target = "docId"),
+    })
+    BizDeptAndDocVO convertWxVODetail(BizMissionDocPO source);
+
 }

+ 37 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/po/BizDocDeptPO.java

@@ -0,0 +1,37 @@
+package cn.tr.module.smart.common.po;
+
+
+import cn.tr.plugin.mybatis.pojo.BasePO;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import java.util.*;
+/**
+ * 科室的宣教文档绑定实体
+ *
+ * @author wangzl
+ * @date  2025/06/04 14:26
+ **/
+@Data
+@TableName(value="biz_doc_dept",autoResultMap = true)
+@EqualsAndHashCode(callSuper = true)
+@ToString
+public class BizDocDeptPO extends BasePO {
+
+    /** id */
+    @TableId
+    @ApiModelProperty(value = "id", position = 1)
+    private String id;
+
+    /** doc_id */
+    @ApiModelProperty(value = "doc_id", position = 2)
+    private String docId;
+
+    /** dept_id */
+    @ApiModelProperty(value = "dept_id", position = 3)
+    private String deptId;
+
+}

+ 14 - 11
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/po/BizMissionDocPO.java

@@ -46,40 +46,43 @@ public class BizMissionDocPO extends TenantPO {
     @ApiModelProperty(value = "封面图", position = 5)
     private String image;
 
+    @ApiModelProperty(value = "封面图id", position = 6)
+    private String imageId;
+
     /** 宣教内容 */
-    @ApiModelProperty(value = "宣教内容", position = 6)
+    @ApiModelProperty(value = "宣教内容", position = 7)
     private String content;
 
     /** 宣教阶段 */
-    @ApiModelProperty(value = "宣教阶段", position = 7)
+    @ApiModelProperty(value = "宣教阶段", position = 8)
     private String phase;
 
     /** 间隔时间段(最小值),如术前2-6天,即2 */
-    @ApiModelProperty(value = "间隔时间段(最小值),如术前2-6天,即2", position = 8)
-    private String intervalMinDay;
+    @ApiModelProperty(value = "间隔时间段(最小值),如术前2-6天,即2", position = 9)
+    private Integer intervalMinDay;
 
     /** 间隔时间段(最大值),如术后2-6天,即6 */
-    @ApiModelProperty(value = "间隔时间段(最大值),如术后2-6天,即6", position = 9)
-    private String intervalMaxDay;
+    @ApiModelProperty(value = "间隔时间段(最大值),如术后2-6天,即6", position = 10)
+    private Integer intervalMaxDay;
 
     /** 医院id(医院上传的自己的文档) */
-    @ApiModelProperty(value = "医院id(医院上传的自己的文档)", position = 10)
+    @ApiModelProperty(value = "医院id(医院上传的自己的文档)", position = 11)
     private String tenantId;
 
     /** 版本号 */
-    @ApiModelProperty(value = "版本号", position = 15)
+    @ApiModelProperty(value = "版本号", position = 16)
     private Integer version;
 
     /** md5 签名 */
-    @ApiModelProperty(value = " md5 签名", position = 16)
+    @ApiModelProperty(value = " md5 签名", position = 17)
     private String md5;
 
     /** 宣教内容MD5签名 */
-    @ApiModelProperty(value = "宣教内容MD5签名", position = 17)
+    @ApiModelProperty(value = "宣教内容MD5签名", position = 18)
     private String contentMd5;
 
     /** 宣教光广场ID */
-    @ApiModelProperty(value = "宣教光广场ID", position = 18)
+    @ApiModelProperty(value = "宣教光广场ID", position = 19)
     private String squareDocId;
 
     @Comment("删除标记")

+ 2 - 2
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/po/BizMissionDocSquarePO.java

@@ -56,11 +56,11 @@ public class BizMissionDocSquarePO extends TenantPO {
 
     /** 间隔时间段(最小值),如术前2-6天,即2 */
     @ApiModelProperty(value = "间隔时间段(最小值),如术前2-6天,即2", position = 8)
-    private String intervalMinDay;
+    private Integer intervalMinDay;
 
     /** 间隔时间段(最大值),如术后2-6天,即6 */
     @ApiModelProperty(value = "间隔时间段(最大值),如术后2-6天,即6", position = 9)
-    private String intervalMaxDay;
+    private Integer intervalMaxDay;
 
     /** 医院id(上传医院id) */
     @ApiModelProperty(value = "医院id(上传医院id)", position = 10)

+ 16 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/repository/BizDocDeptRepository.java

@@ -0,0 +1,16 @@
+package cn.tr.module.smart.common.repository;
+
+import cn.tr.module.smart.common.po.BizDocDeptPO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+/**
+ * 科室的宣教文档绑定Mapper接口
+ *
+ * @author wangzl
+ * @date  2025/06/04 14:26
+ **/
+@Repository
+@Mapper
+public interface BizDocDeptRepository extends BaseMapper<BizDocDeptPO> {
+}

+ 8 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/repository/BizMissionDocRepository.java

@@ -1,9 +1,15 @@
 package cn.tr.module.smart.common.repository;
 
 import cn.tr.module.smart.common.po.BizMissionDocPO;
+import cn.tr.module.smart.wx.controller.vo.BizDeptAndDocVO;
+import cn.tr.module.smart.wx.dto.BizWxQueryPO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
 /**
  * 宣教文档Mapper接口
  *
@@ -19,4 +25,6 @@ public interface BizMissionDocRepository extends BaseMapper<BizMissionDocPO> {
     BizMissionDocPO selectOneBySquareId(String squareId);
 
     int updateBizMissionDocById(BizMissionDocPO source);
+
+    List<BizDeptAndDocVO> selectBizDeptAndDocByDeptIdList(@Param("query") BizWxQueryPO query);
 }

+ 41 - 16
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/IBizMissionDocService.java

@@ -2,6 +2,9 @@ package cn.tr.module.smart.common.service;
 
 import cn.tr.module.smart.common.dto.BizMissionDocDTO;
 import cn.tr.module.smart.common.dto.BizMissionDocQueryDTO;
+import cn.tr.module.smart.wx.controller.vo.BizDeptAndDocVO;
+import cn.tr.module.smart.wx.dto.BizWxKnowledgeDocQueryDTO;
+import cn.tr.module.smart.wx.dto.BizWxMissionDocQueryDTO;
 
 import java.util.Collection;
 import java.util.List;
@@ -10,47 +13,52 @@ import java.util.List;
  * 宣教文档Service接口
  *
  * @author lf
- * @date  2025/05/23 16:24
+ * @date 2025/05/23 16:24
  **/
-public interface IBizMissionDocService{
+public interface IBizMissionDocService {
 
     /**
      * 根据条件查询宣教文档
-     * @param    query 查询参数
-     * @author   lf
-     * @date      2025/05/23 16:24
+     *
+     * @param query 查询参数
+     * @author lf
+     * @date 2025/05/23 16:24
      */
     List<BizMissionDocDTO> selectBizMissionDocList(BizMissionDocQueryDTO query);
 
     /**
      * 根据id查询宣教文档
-     * @param    id 主键id
-     * @author   lf
-     * @date      2025/05/23 16:24
+     *
+     * @param id 主键id
+     * @author lf
+     * @date 2025/05/23 16:24
      */
     BizMissionDocDTO selectBizMissionDocById(String id);
 
     /**
      * 编辑宣教文档
-     * @param   source 编辑实体类
-     * @author  lf
-     * @date     2025/05/23 16:24
+     *
+     * @param source 编辑实体类
+     * @author lf
+     * @date 2025/05/23 16:24
      */
     boolean updateBizMissionDocById(BizMissionDocDTO source);
 
     /**
      * 新增宣教文档
-     * @param   source 新增实体类
+     *
+     * @param source 新增实体类
      * @author lf
-     * @date  2025/05/23 16:24
+     * @date 2025/05/23 16:24
      */
     boolean insertBizMissionDoc(BizMissionDocDTO source);
 
     /**
      * 删除宣教文档详情
-     * @param  ids 删除主键集合
+     *
+     * @param ids 删除主键集合
      * @author lf
-     * @date    2025/05/23 16:24
+     * @date 2025/05/23 16:24
      */
     int removeBizMissionDocByIds(Collection<String> ids);
 
@@ -59,11 +67,28 @@ public interface IBizMissionDocService{
      * @author wangzl
      * @date 2025/5/26
      */
-    boolean  checkContent(String content);
+    boolean checkContent(String content);
+
     /**
      * @description: 推送医院宣教文档到宣教文档广场
      * @author wangzl
      * @date 2025/5/27
      */
     boolean pushDoc(String id);
+
+    /**
+     * @description: 查询首页宣教文档列表
+     * @author wangzl
+     * @date 2025/6/3
+     */
+    List<BizDeptAndDocVO> selectWxMissionDocList(BizWxMissionDocQueryDTO query);
+
+    /**
+     * @description: 查询首页知识库列表
+     * @author wangzl
+     * @date 2025/6/3
+     */
+    List<BizDeptAndDocVO> selectWxKnowledgeDocList(BizWxKnowledgeDocQueryDTO query);
+
+    BizDeptAndDocVO selectMissionDocDetail(String docId);
 }

+ 68 - 4
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/impl/BizMissionDocServiceImpl.java

@@ -1,22 +1,28 @@
 package cn.tr.module.smart.common.service.impl;
 
 import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUnit;
+import cn.hutool.core.date.DateUtil;
 import cn.hutool.crypto.digest.DigestUtil;
 import cn.tr.core.exception.ServiceException;
 import cn.tr.core.exception.TRExcCode;
 import cn.tr.core.strategy.LoginUserStrategy;
 import cn.tr.core.utils.JsonUtils;
+import cn.tr.module.smart.common.constant.PhaseConstant;
 import cn.tr.module.smart.common.dto.BizMissionDocAndSquareCoverDTO;
 import cn.tr.module.smart.common.dto.BizMissionDocDTO;
 import cn.tr.module.smart.common.dto.BizMissionDocJsonDTO;
 import cn.tr.module.smart.common.dto.BizMissionDocQueryDTO;
 import cn.tr.module.smart.common.mapper.BizMissionDocMapper;
 import cn.tr.module.smart.common.mapper.BizMissionDocSquareMapper;
-import cn.tr.module.smart.common.po.BizMissionDocPO;
-import cn.tr.module.smart.common.po.BizMissionDocSquarePO;
-import cn.tr.module.smart.common.repository.BizMissionDocRepository;
-import cn.tr.module.smart.common.repository.BizMissionDocSquareRepository;
+import cn.tr.module.smart.common.po.*;
+import cn.tr.module.smart.common.repository.*;
 import cn.tr.module.smart.common.service.IBizMissionDocService;
+import cn.tr.module.smart.wx.controller.vo.BizDeptAndDocVO;
+import cn.tr.module.smart.wx.dto.BizWxKnowledgeDocQueryDTO;
+import cn.tr.module.smart.wx.dto.BizWxMissionDocQueryDTO;
+import cn.tr.module.smart.wx.dto.BizWxQueryPO;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -42,7 +48,13 @@ public class BizMissionDocServiceImpl implements IBizMissionDocService {
 
     @Resource
     private BizMissionDocSquareRepository bizMissionDocSquareRepository;
+    @Resource
+    private BizClinicRepository bizClinicRepository;
+    @Resource
+    private BizDocDeptRepository bizDocDeptRepository;
 
+    @Resource
+    private BizDeptRepository bizDeptRepository;
 
     /**
      * 根据条件查询宣教文档
@@ -184,4 +196,56 @@ public class BizMissionDocServiceImpl implements IBizMissionDocService {
         }
     }
 
+    /**
+     * @param query 查询参数
+     * @description: 查询首页宣教文档列表
+     * @author wangzl
+     * @date 2025/6/3
+     */
+    @Override
+    public List<BizDeptAndDocVO> selectWxMissionDocList(BizWxMissionDocQueryDTO query) {
+        BizClinicPO bizClinicPO = bizClinicRepository.selectById(query.getClinicId());
+        if (Objects.isNull(bizClinicPO)) {
+            throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001, "患者手术信息不存在");
+        }
+        DateTime clinicStartTime = DateUtil.beginOfDay(bizClinicPO.getClinicStartTime());
+        DateTime queryDate = DateUtil.beginOfDay(query.getQueryDate());
+        //计算传入时间跟查无如时间差值
+        long time = DateUtil.between(clinicStartTime, queryDate, DateUnit.DAY);
+        //判断传入时间跟手术开始时间之前  手术当天算术前
+        boolean isBefore = DateUtil.compare(queryDate, clinicStartTime) <= 0;
+        String phase;
+        if (isBefore) {
+            phase = PhaseConstant.BEFORE;
+        } else {
+            phase = PhaseConstant.AFTER;
+        }
+        return baseRepository.selectBizDeptAndDocByDeptIdList(new BizWxQueryPO(bizClinicPO.getDeptId(), time, phase));
+    }
+
+    /**
+     * @param query 查询参数
+     * @description: 查询首页知识库列表
+     * @author wangzl
+     * @date 2025/6/3
+     */
+    @Override
+    public List<BizDeptAndDocVO> selectWxKnowledgeDocList(BizWxKnowledgeDocQueryDTO query) {
+        return baseRepository.selectBizDeptAndDocByDeptIdList(new BizWxQueryPO(query.getDeptId(), query.getTitle()));
+    }
+
+    @Override
+    public BizDeptAndDocVO selectMissionDocDetail(String docId) {
+        BizMissionDocPO bizMissionDocPO = baseRepository.selectById(docId);
+        BizDocDeptPO bizDocDeptPO = bizDocDeptRepository.selectOne(new LambdaQueryWrapper<BizDocDeptPO>()
+                .eq(BizDocDeptPO::getDocId, docId)
+                .orderByDesc(BizDocDeptPO::getCreateTime)
+                .last("limit 1"));
+        BizDeptAndDocVO bizDeptAndDocVO = BizMissionDocMapper.INSTANCE.convertWxVODetail(bizMissionDocPO);
+        bizDeptAndDocVO.setDeptId(bizDocDeptPO.getDeptId());
+        BizDeptPO bizDeptPO = bizDeptRepository.selectById(bizDocDeptPO.getDeptId());
+        bizDeptAndDocVO.setDeptName(bizDeptPO.getName());
+        return bizDeptAndDocVO;
+    }
+
 }

+ 58 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/wx/controller/WxMissionController.java

@@ -0,0 +1,58 @@
+package cn.tr.module.smart.wx.controller;
+
+import cn.tr.core.pojo.TableDataInfo;
+import cn.tr.module.smart.common.service.IBizMissionDocService;
+import cn.tr.module.smart.wx.controller.vo.BizDeptAndDocVO;
+import cn.tr.module.smart.wx.dto.BizWxKnowledgeDocQueryDTO;
+import cn.tr.module.smart.wx.dto.BizWxMissionDocQueryDTO;
+import cn.tr.plugin.mybatis.base.BaseController;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+/**
+ * @author wangzl
+ * @description: 宣教文档查询
+ * @date 2025/6/3 14:55
+ */
+@Api(tags = "宣教文档操作")
+@RestController
+@RequestMapping("/wx/mission")
+@AllArgsConstructor
+//@SaCheckLogin(type = LoginTypeConstant.WX_APPLET)
+public class WxMissionController extends BaseController {
+    @Resource
+    private IBizMissionDocService missionDocService;
+    @ApiOperationSupport(author = "wangzl", order = 1)
+    @ApiOperation(value = "查询对应手术日期的宣教文档的列表", notes = "权限: 无")
+    @PostMapping("/doc/query/page")
+    public TableDataInfo<BizDeptAndDocVO> selectMissionDocList(@RequestBody@Validated BizWxMissionDocQueryDTO queryDTO) {
+        startPage();
+        return getDataTable(missionDocService.selectWxMissionDocList(queryDTO));
+    }
+
+    @ApiOperationSupport(author = "wangzl", order = 1)
+    @ApiOperation(value = "查询对应科室的知识库宣教文档列表", notes = "权限: 无")
+    @PostMapping("/knowledge/query/page")
+    public TableDataInfo<BizDeptAndDocVO> selectKnowLedgeDocList(@RequestBody BizWxKnowledgeDocQueryDTO queryDTO) {
+        startPage();
+        return getDataTable(missionDocService.selectWxKnowledgeDocList(queryDTO));
+    }
+
+    @ApiOperationSupport(author = "wangzl", order = 1)
+    @ApiOperation(value = "根据宣教文档Id获取宣教文档详情", notes = "权限: 无")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(value = "文档ID", required = true, name = "docId")
+    })
+    @GetMapping("/detail/{docId}")
+    public BizDeptAndDocVO selectList(@PathVariable String docId) {
+        return missionDocService.selectMissionDocDetail(docId);
+    }
+}

+ 56 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/wx/controller/vo/BizDeptAndDocVO.java

@@ -0,0 +1,56 @@
+package cn.tr.module.smart.wx.controller.vo;
+
+import cn.tr.core.annotation.Comment;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+
+import java.util.Date;
+
+/**
+ * @author wangzl
+ * @description: 手术信息关联科室宣教文档
+ * @date 2025/6/3 17:33
+ */
+@Data
+@ApiModel(" 科室文档,文档表三表联查实体")
+@ToString
+public class BizDeptAndDocVO {
+
+    @ApiModelProperty(value = "科室id", position = 1)
+    private String deptId;
+
+    @ApiModelProperty(value = "科室名称", position = 2)
+    private String deptName;
+
+    @ApiModelProperty(value = "科室文档id", position = 3)
+    private String docId;
+
+    @ApiModelProperty(value = "宣教类型", position = 4)
+    private String type;
+
+    @ApiModelProperty(value = "宣教名称", position = 5)
+    private String title;
+
+    @ApiModelProperty(value = "宣教来源", position = 6)
+    private String source;
+
+    @ApiModelProperty(value = "封面图", position = 7)
+    private String image;
+
+    @ApiModelProperty(value = "封面图id", position = 8)
+    private String imageId;
+
+    @ApiModelProperty(value = "宣教阶段", position = 9)
+    private String phase;
+
+    @ApiModelProperty(value = "宣教内容" ,position = 10)
+    private String content;
+
+    @ApiModelProperty(value = "文档创建时间", position = 11)
+    private Date createTime;
+
+}

+ 27 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/wx/dto/BizWxKnowledgeDocQueryDTO.java

@@ -0,0 +1,27 @@
+package cn.tr.module.smart.wx.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+
+/**
+ * @author wangzl
+ * @description: TODO
+ * @date 2025/6/3 16:23
+ */
+@Data
+@ApiModel("知识库查询参数")
+@ToString
+@AllArgsConstructor(staticName = "of")
+@NoArgsConstructor
+public class BizWxKnowledgeDocQueryDTO {
+
+    @ApiModelProperty("科室ID")
+    private String deptId;
+
+    @ApiModelProperty("查询标题内容")
+    private String title;
+}

+ 36 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/wx/dto/BizWxMissionDocQueryDTO.java

@@ -0,0 +1,36 @@
+package cn.tr.module.smart.wx.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.util.Date;
+
+/**
+ * @author wangzl
+ * @description: TODO
+ * @date 2025/6/3 16:23
+ */
+@Data
+@ApiModel("宣教文档查询参数")
+@ToString
+@AllArgsConstructor(staticName = "of")
+@NoArgsConstructor
+public class BizWxMissionDocQueryDTO {
+
+    @ApiModelProperty("手术ID")
+    @NotBlank(message = "手术ID 不能为空")
+    private String clinicId;
+
+    @ApiModelProperty("查询日期")
+    @NotNull(message = "查询日期不能为空")
+    @DateTimeFormat(pattern  = "yyyy-MM-dd")
+    private Date queryDate;
+
+}

+ 27 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/wx/dto/BizWxQueryPO.java

@@ -0,0 +1,27 @@
+package cn.tr.module.smart.wx.dto;
+
+import lombok.Data;
+
+/**
+ * @author wangzl
+ * @description: 微信查询数据参数集合
+ * @date 2025/6/4 14:07
+ */
+@Data
+public class BizWxQueryPO {
+    private String deptId;
+    private Long time;
+    private String phase;
+    private String title;
+
+    public BizWxQueryPO(String deptId, Long time, String phase) {
+        this.deptId = deptId;
+        this.time = time;
+        this.phase = phase;
+    }
+
+    public BizWxQueryPO(String deptId, String title) {
+        this.deptId = deptId;
+        this.title = title;
+    }
+}

+ 42 - 4
tr-modules/tr-module-smartFollowUp/src/main/resources/mapper/smart/BizMissionDocMapper.xml

@@ -9,6 +9,7 @@
         <result property="title" column="title"/>
         <result property="source" column="source"/>
         <result property="image" column="image"/>
+        <result property="imageId" column="image_id"/>
         <result property="content" column="content"/>
         <result property="phase" column="phase"/>
         <result property="intervalMinDay" column="interval_min_day"/>
@@ -25,8 +26,7 @@
         <result property="squareDocId" column="square_doc_id"/>
     </resultMap>
     <sql id="baseColumn">
-        id
-        , type, title, source, image, content, phase, interval_min_day, interval_max_day, tenant_id, create_time, create_by, update_time, update_by, version, md5, content_md5, deleted, square_doc_id
+        id, type, title, source, image,image_id, content, phase, interval_min_day, interval_max_day, tenant_id, create_time, create_by, update_time, update_by, version, md5, content_md5, deleted, square_doc_id
     </sql>
 
     <select id="selectBizMissionDocById" resultMap="MissionDoc">
@@ -61,6 +61,9 @@
             <if test="image != null">
                 image = #{image ,jdbcType=VARCHAR},
             </if>
+            <if test="imageId != null">
+                image_id = #{imageId ,jdbcType=VARCHAR},
+            </if>
             <if test="content != null">
                 content = #{content ,jdbcType=VARCHAR},
             </if>
@@ -68,10 +71,10 @@
                 phase = #{phase ,jdbcType=VARCHAR},
             </if>
             <if test="intervalMinDay != null">
-                interval_min_day = #{intervalMinDay ,jdbcType=VARCHAR},
+                interval_min_day = #{intervalMinDay ,jdbcType=BIGINT},
             </if>
             <if test="intervalMaxDay != null">
-                interval_max_day = #{intervalMaxDay ,jdbcType=VARCHAR},
+                interval_max_day = #{intervalMaxDay ,jdbcType=BIGINT},
             </if>
             <if test="tenantId != null">
                 tenant_id = #{tenantId ,jdbcType=VARCHAR},
@@ -100,4 +103,39 @@
         </set>
         where id = #{id ,jdbcType=VARCHAR}
     </update>
+
+    <select id="selectBizDeptAndDocByDeptIdList" resultType="cn.tr.module.smart.wx.controller.vo.BizDeptAndDocVO">
+        select bdd.dept_id as deptId,
+        bd.name as deptName,
+        bmd.id as docId,
+        bmd.type as type,
+        bmd.title as title,
+        bmd.source as source,
+        bmd.image as image,
+        bmd.image_id as imageId,
+        bmd.phase as phase,
+        bmd.interval_min_day as intervalMinDay,
+        bmd.interval_max_day as intervalMaxDay,
+        bmd.create_time as createTime
+        from biz_doc_dept bdd
+        join biz_mission_doc bmd on
+        bdd.doc_id = bmd.id
+        join biz_dept bd on
+        bd.id = bdd.dept_id
+        <where>
+            <if test="query.deptId != null and query.deptId != ''">
+                and bdd.dept_id = #{query.deptId ,jdbcType=VARCHAR}
+            </if>
+            <if test="query.time != null">
+                and #{query.time} BETWEEN bmd.interval_min_day AND bmd.interval_max_day
+            </if>
+            <if test="query.phase != null and query.phase != ''">
+                and bmd.phase = #{query.phase,jdbcType=VARCHAR}
+            </if>
+            <if test="query.title != null and query.title != ''">
+                and bmd.title like concat('%',#{query.title,jdbcType=VARCHAR},'%')
+            </if>
+        </where>
+    </select>
+
 </mapper>

+ 2 - 2
tr-modules/tr-module-smartFollowUp/src/main/resources/mapper/smart/BizMissionDocSquareMapper.xml

@@ -52,10 +52,10 @@
                 phase = #{phase ,jdbcType=VARCHAR},
             </if>
             <if test="intervalMinDay != null">
-                interval_min_day = #{intervalMinDay ,jdbcType=VARCHAR},
+                interval_min_day = #{intervalMinDay ,jdbcType=BIGINT},
             </if>
             <if test="intervalMaxDay != null">
-                interval_max_day = #{intervalMaxDay ,jdbcType=VARCHAR},
+                interval_max_day = #{intervalMaxDay ,jdbcType=BIGINT},
             </if>
             <if test="tenantId != null">
                 tenant_id = #{tenantId ,jdbcType=VARCHAR},