From 6fd10ed6dbaae3c91f334311aa66ee312254b981 Mon Sep 17 00:00:00 2001 From: "15881625488@163.com" <15881625488@163.com> Date: Thu, 22 Jan 2026 11:37:53 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A[=E8=AF=95=E9=AA=8C=E7=AE=A1?= =?UTF-8?q?=E7=90=86]=E6=96=B9=E6=B3=95=E6=9C=AA=E9=98=85=E8=AF=BB?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hxhq/business/controller/StudyMethodController.java | 3 +-- .../java/com/hxhq/business/service/IStudyMethodService.java | 3 ++- .../hxhq/business/service/impl/StudyMethodServiceImpl.java | 11 ++++++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyMethodController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyMethodController.java index 7648aea..386f082 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyMethodController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyMethodController.java @@ -106,8 +106,7 @@ public class StudyMethodController extends BaseController { */ @GetMapping(value = "/getReadAllMethodStatus") public AjaxResult getReadAllMethodStatus(Long userId, Long studyId, Long studySubjectId) { - studyMethodService.checkAllMethodReadStatus(userId, studyId, studySubjectId); - return AjaxResult.success("成功"); + return AjaxResult.success(studyMethodService.checkAllMethodReadStatus(userId, studyId, studySubjectId)); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodService.java index ebc3641..7189c17 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyMethodService.java @@ -1,5 +1,6 @@ package com.hxhq.business.service; +import java.util.HashMap; import java.util.List; import com.hxhq.business.domain.StudyMethod; import com.baomidou.mybatisplus.extension.service.IService; @@ -39,5 +40,5 @@ public interface IStudyMethodService extends IService * @param studySubjectId 试验科学id * @return */ - void checkAllMethodReadStatus(Long userId, Long studyId, Long studySubjectId); + HashMap checkAllMethodReadStatus(Long userId, Long studyId, Long studySubjectId); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java index 5edf8ac..a68b247 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java @@ -1,8 +1,10 @@ package com.hxhq.business.service.impl; +import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; +import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.hxhq.business.domain.Study; @@ -146,7 +148,8 @@ public class StudyMethodServiceImpl extends ServiceImpl checkAllMethodReadStatus(Long userId, Long studyId, Long studySubjectId) { + HashMap result=new HashMap<>(); Study study = studyService.getById(studyId); if(study==null){ throw new ServiceException("信息不存在"); @@ -171,10 +174,12 @@ public class StudyMethodServiceImpl extends ServiceImpl list = this.list(studyMethodLambdaQueryWrapper); if(readCount != list.size()) { - String ffmc = list.stream().map(StudyMethod::getFfmc).collect(Collectors.joining(",")); - throw new ServiceException("[" + ffmc + "方案还未阅读,请先阅读后再进行试验操作]"); + String toUrl=study.getType().equals(StudyTypeEnum.sy.getValue())?("/study/enter/"+study.getId()+"/syff"):study.getType().equals(StudyTypeEnum.fsy.getValue())?("/nonTrial/enter/"+study.getId()+"/syff"):study.getType().equals(StudyTypeEnum.mjy.getValue())?("/drug/enter/"+study.getId()+"/syff"):""; + result.put("toUrl",toUrl); + result.put("ffmc","【" + list.stream().map(StudyMethod::getFfmc).collect(Collectors.joining(",")) + "】方法还未阅读,请先阅读后再进行操作]"); } } + return result; } }