Przeglądaj źródła

质控核查bug修改

songxinlu 4 lat temu
rodzic
commit
d615c3ffed

+ 8 - 2
src/main/java/com/diagbot/facade/MedCheckWorkFacade.java

@@ -95,10 +95,16 @@ public class MedCheckWorkFacade {
                 throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL, "存在未生成核查任务!");
             }
 
+            //创建用户集合
             Set<Long> creaters = list.stream().map(MedCheckInfo::getJobCreator).collect(Collectors.toSet());
-            if(creaters!=null&&!creaters.contains(principleId)||creaters!=null&&creaters.size()>1)
+            if(creaters!=null)
             {
-                throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL, "只能取消本人生成任务!");
+                //移除当前用户如果还有其他用户
+                creaters.remove(principleId);
+                if(creaters.size()>0)
+                {
+                    throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL, "无法取消他人生成任务!");
+                }
             }
             int i = medCheckInfoFacade.getBaseMapper().deleteBatchCodes(medCheckWorkVO.getBehospitalCodeList());
             if (i != 0) {