Преглед изворни кода

增加当前队列分页获取全部问卷

wangzl пре 2 месеци
родитељ
комит
130649683f

+ 11 - 4
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/controller/BizReasearchQueueClinicController.java

@@ -2,10 +2,9 @@ package cn.tr.module.smart.common.controller;
 
 import cn.tr.module.smart.common.controller.vo.BizReasearchQueueClinicAndPatientVO;
 import cn.tr.module.smart.common.controller.vo.BizReasearchQueueClinicVO;
+import cn.tr.module.smart.common.controller.vo.BizReasearchQueueQuestionAnswerAllVO;
 import cn.tr.module.smart.common.controller.vo.BizReasearchQueueQuestionAnswerVO;
-import cn.tr.module.smart.common.dto.BizClinicRoomAndPatientQueryDTO;
-import cn.tr.module.smart.common.dto.BizReasearchQueueAddClinicDTO;
-import cn.tr.module.smart.common.dto.BizReasearchQueueClinicQuestionAnswerRecordQueryDTO;
+import cn.tr.module.smart.common.dto.*;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import cn.tr.core.validation.Insert;
 import cn.tr.core.pojo.CommonResult;
@@ -17,7 +16,7 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
 import cn.tr.module.smart.common.service.IBizReasearchQueueClinicService;
-import cn.tr.module.smart.common.dto.BizReasearchQueueClinicQueryDTO;
+
 import java.util.*;
 import cn.tr.plugin.mybatis.base.BaseController;
 import org.springframework.web.bind.annotation.*;
@@ -72,4 +71,12 @@ public class BizReasearchQueueClinicController extends BaseController{
         startPage();
         return getDataTable(bizReasearchQueueClinicService.addClinicList(source));
     }
+
+    @ApiOperationSupport(author = "wangzl",order = 7)
+    @ApiOperation(value="当前队列下全部问卷填写记录",notes = "权限: 无")
+    @PostMapping("/questionAnswerListAll")
+    public TableDataInfo<BizReasearchQueueQuestionAnswerAllVO> questionAnswerListAll(@RequestBody BizReasearchQueueClinicQuestionAnswerAllQueryDTO source) {
+        startPage();
+        return getDataTable(bizReasearchQueueClinicService.stdSelectQuestionAnswerListAll(source));
+    }
 }

+ 45 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/controller/vo/BizReasearchQueueQuestionAnswerAllVO.java

@@ -0,0 +1,45 @@
+package cn.tr.module.smart.common.controller.vo;
+
+import cn.tr.module.smart.app.config.ContentListType;
+import cn.tr.module.smart.common.entity.BizQuestionEntity;
+import cn.tr.module.smart.common.entity.BizWxAppletQuestionAnswerEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * TODO
+ *
+ * @author wangzl
+ * @date 2025/10/21 11:19
+ */
+@Data
+@ApiModel("问卷填写记录实体")
+public class BizReasearchQueueQuestionAnswerAllVO {
+
+    private static final long serialVersionUID = 1L;
+    /**   */
+    @ApiModelProperty(value = "记录id", position = 1)
+    private String id;
+
+    @ApiModelProperty("问卷的填写人名称")
+    private String answerUserName;
+
+    /** 回答的内容 */
+    @ApiModelProperty(value = "回答的内容", position = 2)
+    @TableField(typeHandler = ContentListType.class)
+    private List<BizWxAppletQuestionAnswerEntity> content;
+
+    /** 问卷问题 */
+    @ApiModelProperty(value = "问卷问题", position = 3)
+    @TableField(typeHandler = ContentListType.class)
+    private List<BizQuestionEntity> question;
+
+    /** 问卷回答时间 */
+    @ApiModelProperty(value = "问卷回答时间", position = 7)
+    private Date answerTime;
+}

+ 22 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/BizReasearchQueueClinicQuestionAnswerAllQueryDTO.java

@@ -0,0 +1,22 @@
+package cn.tr.module.smart.common.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * TODO
+ *
+ * @author wangzl
+ * @date 2025/10/21 11:22
+ */
+@Data
+@ApiModel("查询队列全部问卷信息参数")
+public class BizReasearchQueueClinicQuestionAnswerAllQueryDTO {
+
+    @ApiModelProperty(value = "队列id",required = true)
+    @NotBlank(message = "队列id不能为空")
+    private String queueId;
+}

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

@@ -3,8 +3,10 @@ package cn.tr.module.smart.common.repository;
 import cn.tr.module.smart.common.controller.vo.BizReasearchQueueClinicAndPatientVO;
 import cn.tr.module.smart.common.controller.vo.BizReasearchQueueClinicVO;
 import cn.tr.module.smart.common.controller.vo.BizReasearchQueuePushVO;
+import cn.tr.module.smart.common.controller.vo.BizReasearchQueueQuestionAnswerAllVO;
 import cn.tr.module.smart.common.dto.BizClinicRoomAndPatientQueryDTO;
 import cn.tr.module.smart.common.dto.BizReasearchQueueClinicQueryDTO;
+import cn.tr.module.smart.common.dto.BizReasearchQueueClinicQuestionAnswerAllQueryDTO;
 import cn.tr.module.smart.wx.dto.BizMpPublishInfoDTO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
@@ -30,4 +32,7 @@ public interface BizReasearchQueueClinicRepository extends BaseMapper<BizReasear
     BizReasearchQueuePushVO stdSelectBizReasearchQueueClinicById(@Param("id") String id);
 
     List<BizReasearchQueueClinicAndPatientVO>  stdSelectClinicAndPatientList(@Param("query") BizClinicRoomAndPatientQueryDTO query);
+
+
+    List<BizReasearchQueueQuestionAnswerAllVO> stdSelectQuestionAnswerListAll(@Param("query") BizReasearchQueueClinicQuestionAnswerAllQueryDTO query);
 }

+ 9 - 4
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/IBizReasearchQueueClinicService.java

@@ -2,11 +2,9 @@ package cn.tr.module.smart.common.service;
 
 import cn.tr.module.smart.common.controller.vo.BizReasearchQueueClinicAndPatientVO;
 import cn.tr.module.smart.common.controller.vo.BizReasearchQueueClinicVO;
+import cn.tr.module.smart.common.controller.vo.BizReasearchQueueQuestionAnswerAllVO;
 import cn.tr.module.smart.common.controller.vo.BizReasearchQueueQuestionAnswerVO;
-import cn.tr.module.smart.common.dto.BizClinicRoomAndPatientQueryDTO;
-import cn.tr.module.smart.common.dto.BizReasearchQueueAddClinicDTO;
-import cn.tr.module.smart.common.dto.BizReasearchQueueClinicQueryDTO;
-import cn.tr.module.smart.common.dto.BizReasearchQueueClinicQuestionAnswerRecordQueryDTO;
+import cn.tr.module.smart.common.dto.*;
 import cn.tr.module.smart.common.po.BizReasearchQueueClinicPO;
 
 import java.util.*;
@@ -56,4 +54,11 @@ public interface IBizReasearchQueueClinicService{
      * @date 2025/10/20
      */
     List<BizReasearchQueueClinicAndPatientVO> addClinicList(BizClinicRoomAndPatientQueryDTO source);
+
+    /**
+     * @description: 查询当前队列所有的问卷填写记录
+     * @author wangzl
+     * @date 2025/10/21
+     */
+    List<BizReasearchQueueQuestionAnswerAllVO> stdSelectQuestionAnswerListAll(BizReasearchQueueClinicQuestionAnswerAllQueryDTO source);
 }

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

@@ -5,10 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.tr.core.annotation.TenantIgnore;
 import cn.tr.core.exception.TRExcCode;
-import cn.tr.module.smart.common.controller.vo.BizReasearchQueueClinicAndPatientVO;
-import cn.tr.module.smart.common.controller.vo.BizReasearchQueueClinicVO;
-import cn.tr.module.smart.common.controller.vo.BizReasearchQueuePushVO;
-import cn.tr.module.smart.common.controller.vo.BizReasearchQueueQuestionAnswerVO;
+import cn.tr.module.smart.common.controller.vo.*;
 import cn.tr.module.smart.common.dto.*;
 import cn.tr.module.smart.common.enums.ClinicUndoType;
 import cn.tr.module.smart.common.enums.MpPublishTaskTypeEnums;
@@ -251,6 +248,17 @@ public class BizReasearchQueueClinicServiceImpl extends ServiceImpl<BizReasearch
         return baseMapper.stdSelectClinicAndPatientList(source);
     }
 
+    /**
+     * @param source
+     * @description: 查询当前队列所有的问卷填写记录
+     * @author wangzl
+     * @date 2025/10/21
+     */
+    @Override
+    public List<BizReasearchQueueQuestionAnswerAllVO> stdSelectQuestionAnswerListAll(BizReasearchQueueClinicQuestionAnswerAllQueryDTO source) {
+        return baseMapper.stdSelectQuestionAnswerListAll(source);
+    }
+
 
     //执行推送逻辑
     private void sendMessage(BizReasearchQueuePushVO source,long nextPushInterval){

+ 25 - 0
tr-modules/tr-module-smartFollowUp/src/main/resources/mapper/smart/BizReasearchQueueClinicMapper.xml

@@ -149,4 +149,29 @@
             </if>
         </where>
     </select>
+    <resultMap id="QuestionAnswerListAll" type="cn.tr.module.smart.common.controller.vo.BizReasearchQueueQuestionAnswerAllVO">
+        <result property="id" column="id" />
+        <result property="answerUserName" column="answer_user_name" />
+        <result property="content" column="content" typeHandler="cn.tr.module.smart.app.config.ContentListType"/>
+        <result property="question" column="question" typeHandler="cn.tr.module.smart.app.config.QuestionListType"/>
+        <result property="answerTime" column="answer_time" />
+    </resultMap>
+    <select id="stdSelectQuestionAnswerListAll" resultMap="QuestionAnswerListAll">
+        SELECT
+            bqa.id,
+            bcr.patient_name AS answer_user_name,
+            bqa.content,
+            bqa.question,
+            bqa.answer_time
+        FROM
+            biz_question_answer bqa
+                JOIN biz_clinic_room bcr ON bqa.clinic_id = bcr.ID  and bcr.deleted =0
+        <where>
+            and  bqa.deleted = 0
+            <if test="query.queueId != null and query.queueId != ''">
+                and bqa.reasearch_queue_id = #{query.queueId}
+            </if>
+        </where>
+        order by bqa.answer_time desc
+    </select>
 </mapper>

+ 2 - 2
tr-test/src/main/resources/application.yml

@@ -8,8 +8,8 @@ server:
 mybatis-plus:
   mapper-locations: classpath*:com/gitee/sunchenbin/mybatis/actable/mapping/*/*.xml,classpath*:mapper/*/*.xml
   configuration:
-#    log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+    log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
+#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
   global-config:
     db-config:
       logic-delete-value: 1