lifang 3 kuukautta sitten
vanhempi
commit
37f62e02e7

+ 6 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/ALiYunController.java

@@ -31,4 +31,10 @@ public class ALiYunController {
     public CommonResult<List<WxDoctorClinicRoomThumbnailVO>> recognizeImage(@RequestParam MultipartFile file) throws Exception {
         return CommonResult.success(aliYunService.recognizeImage(file));
     }
+
+//    @PostMapping("/recognize")
+//    @ApiOperation(value = "识别患者图片信息",notes = "权限: 无")
+//    public CommonResult<List<WxDoctorClinicRoomThumbnailVO>> recognizeImage(@RequestParam MultipartFile file) throws Exception {
+//        return CommonResult.success(aliYunService.recognizeImage(file));
+//    }
 }

+ 2 - 2
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/enums/QuestionGroupTypeEnums.java

@@ -5,10 +5,10 @@ public interface QuestionGroupTypeEnums {
     /**
      * 术前问卷
      */
-    String PRE="pre_question";
+    String PRE="BEFORE";
 
     /**
      * 术后问卷
      */
-    String AFTER="after_question";
+    String AFTER="AFTER";
 }

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

@@ -3,6 +3,8 @@ package cn.tr.module.smart.common.repository;
 import cn.tr.module.smart.common.po.BizQuestionDeptPO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
 import org.springframework.stereotype.Repository;
 /**
  * 问卷科室关联表Mapper接口
@@ -13,4 +15,11 @@ import org.springframework.stereotype.Repository;
 @Repository
 @Mapper
 public interface BizQuestionDeptRepository extends BaseMapper<BizQuestionDeptPO> {
+    @Select("SELECT bqg.id \n" +
+            "FROM biz_question_dept AS bqd\n" +
+            "JOIN biz_question_group AS bqg ON bqg.id = bqd.question_group_id\n" +
+            "WHERE bqd.dept_id = #{clinicId} AND type = #{type}\n" +
+            "ORDER BY RANDOM()\n" +
+            "LIMIT 1;")
+    String selectOneDeptQuestionGroupRandom(@Param("clinicId") String clinicId,@Param("type") String type);
 }

+ 7 - 5
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/impl/BizClinicRoomServiceImpl.java

@@ -19,8 +19,8 @@ import cn.tr.module.smart.common.dto.BizClinicRoomQueryDTO;
 import cn.tr.module.smart.common.dto.BizDeptDTO;
 import cn.tr.module.smart.common.entity.BizWxAppletQuestionAnswerEntity;
 import cn.tr.module.smart.common.enums.ClinicPhaseEnums;
-import cn.tr.module.smart.common.enums.ClinicUndoType;
 import cn.tr.module.smart.common.enums.InfusionBindType;
+import cn.tr.module.smart.common.enums.QuestionGroupTypeEnums;
 import cn.tr.module.smart.common.enums.UserTypeEnums;
 import cn.tr.module.smart.common.mapper.BizClinicRoomMapper;
 import cn.tr.module.smart.common.mapper.BizInfusionHistoryMapper;
@@ -114,6 +114,9 @@ public class BizClinicRoomServiceImpl implements IBizClinicRoomService {
 
     @Autowired
     private IBizMpPublishTaskService mpPublishTaskService;
+
+    @Autowired
+    private BizQuestionDeptRepository questionDeptRepository;
     @Override
     public List<BizWxAppletClinicDetailVO> stdSelectWxAppletClinicList(BizWxAppletClinicQueryDTO query) {
         return baseRepository.stdSelectWxAppletClinicList(query);
@@ -293,11 +296,10 @@ public class BizClinicRoomServiceImpl implements IBizClinicRoomService {
         if (StrUtil.isBlank(deptId)) {
             throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001, "手术未关联科室");
         }
-        BizDeptDTO bizDeptDTO = bizDeptService.selectBizDeptById(deptId);
-        if (ObjectUtil.isNull(bizDeptDTO)) {
-            throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001, "科室信息不存在");
+        String groupId=questionDeptRepository.selectOneDeptQuestionGroupRandom(clinicId, QuestionGroupTypeEnums.PRE);
+        if(StrUtil.isEmpty(groupId)){
+            return null;
         }
-        String groupId = bizDeptDTO.getGroupId();
         //通过获取到的groupId查询问卷调查问题表
         return bizQuestionService.selectBizQuestionByGroupId(groupId);
     }

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

@@ -115,10 +115,10 @@
             <if test="query.userId != null and query.userId != ''">
                 and bcrmu.user_id = #{query.userId,jdbcType=VARCHAR}
             </if>
-            <if test="query.bindDevice != null and query.bindDevcie == true">
+            <if test="query.bindDevice != null and query.bindDevice == true">
                 and bp.current_clinic_id is not null and bic.device_id is not null
             </if>
-            <if test="query.bindDevice != null and query.bindDevcie == false">
+            <if test="query.bindDevice != null and query.bindDevice == false">
 
             </if>
         </where>