Browse Source

fix: [试验管理] 锁定试验时,仅判断了实际填报表单状态,未同时判断试验信息列表中的表单状态是否满足条件

master
memorylkf 1 month ago
parent
commit
766929da41
3 changed files with 17 additions and 5 deletions
  1. +1
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyMapper.java
  2. +3
    -3
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyServiceImpl.java
  3. +13
    -1
      hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyMapper.xml

+ 1
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyMapper.java View File

@ -36,7 +36,7 @@ public interface StudyMapper extends BaseMapper
* @param studyId
* @return
*/
String queryNotFinishFormName(@Param("studyId") Long studyId);
List<String> queryNotFinishFormName(@Param("studyId") Long studyId);
/**
* 获取首页统计的表单数量

+ 3
- 3
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyServiceImpl.java View File

@ -347,9 +347,9 @@ public class StudyServiceImpl extends ServiceImpl implements
throw new ServiceException("该试验已锁定");
}
checkPermit(study);
String name = baseMapper.queryNotFinishFormName(study.getId());
if(StringUtils.isNoneBlank(name)){
throw new ServiceException("该试验下"+name+"还未结束,请先完成该表单后再进行锁定试验");
List<String> nameList = baseMapper.queryNotFinishFormName(study.getId());
if(nameList!=null && nameList.size()>0){
throw new ServiceException("该试验下"+String.join("、",nameList)+"还未结束,请先完成该表单后再进行锁定试验");
}
}

+ 13
- 1
hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyMapper.xml View File

@ -24,7 +24,19 @@
</select>
<select id="queryNotFinishFormName" resultType="java.lang.String">
SELECT GROUP_CONCAT(bdmc ORDER BY id SEPARATOR '、') FROM `t_study_form_fill` WHERE
SELECT bdmc FROM `t_study_form_fill` WHERE
del_flag='0' AND study_id=#{studyId}
AND bdzt NOT IN (5,7,11)
UNION ALL
SELECT bdmc FROM `t_study_form_apply` WHERE
del_flag='0' AND study_id=#{studyId}
AND bdzt NOT IN (5,7,11)
UNION ALL
SELECT bdmc FROM `t_study_form_plan` WHERE
del_flag='0' AND study_id=#{studyId}
AND bdzt NOT IN (5,7,11)
</select>

Loading…
Cancel
Save