Fix Bug #571: 检验申请撤回操作时触发错误提示
根因:SQL查询计算computed_status时,只要ANY ServiceRequest为ACTIVE(status_enum=2) 就显示"已签发",但后端withdrawRequestForm方法要求ALL ServiceRequest都为ACTIVE才允许撤回。 当处方下存在混合状态的ServiceRequest(如一个DRAFT+一个ACTIVE)时,前端显示撤回按钮, 但后端拒绝操作返回错误。 修复:将allMatch改为anyMatch,允许至少有一条ACTIVE记录即可撤回, 且只更新ACTIVE状态的ServiceRequest为DRAFT,跳过非ACTIVE的记录。
This commit is contained in:
@@ -3,6 +3,9 @@ package com.openhis.lab.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.lab.domain.Specimen;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Mapper接口
|
||||
@@ -13,4 +16,9 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface SpecimenMapper extends BaseMapper<Specimen> {
|
||||
|
||||
/**
|
||||
* 统计已采集/已接收的标本数量(绕过 @TableLogic,因 lab_specimen 表无 delete_flag 列)
|
||||
*/
|
||||
long countCollectedByServiceIds(@Param("serviceIds") List<Long> serviceIds,
|
||||
@Param("minStatus") Integer minStatus);
|
||||
}
|
||||
@@ -4,4 +4,13 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.openhis.lab.mapper.SpecimenMapper">
|
||||
|
||||
<select id="countCollectedByServiceIds" resultType="long">
|
||||
SELECT COUNT(*) FROM lab_specimen
|
||||
WHERE service_id IN
|
||||
<foreach collection="serviceIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
AND collection_status_enum >= #{minStatus}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user