瀏覽代碼

皮试保存优化

lihong 2 年之前
父節點
當前提交
86aa718fdc

+ 10 - 4
src/main/java/thyyxxk/webserver/service/medicaladvice/nursing/NursingManagementService.java

@@ -308,12 +308,18 @@ public class NursingManagementService {
    }
 
     public ResultVo<String> updatePsInfo(List<PsInfoVO> psInfos) {
-        for (PsInfoVO item : psInfos) {
-            if (item.getPsResultTime().before(item.getOrderTime())){
-                 throw new BizException(ExceptionEnum.LOGICAL_ERROR,"医嘱号:"+item.getActOrderNo().longValue()+"皮试结果时间不能小于医嘱时间");
+        if(CollUtil.isNotEmpty(psInfos)){
+            List<PsInfoVO> collect = psInfos.stream().filter(obj -> !(StrUtil.isBlank(obj.getPsStatus()) && StrUtil.isBlank(obj.getPsOper()) && obj.getPsResultTime() == null)).collect(Collectors.toList());
+            for (PsInfoVO item : collect) {
+                if ( item.getPsResultTime() == null || StrUtil.isBlank(item.getPsStatus()) || StrUtil.isBlank(item.getPsOper())) {
+                    throw new BizException(ExceptionEnum.LOGICAL_ERROR, "医嘱号:" + item.getActOrderNo().longValue() + "皮试结果,皮试执行人,皮试结果时间有一个不为空,其他必填");
+                }
+                if (item.getPsResultTime().before(item.getOrderTime())){
+                    throw new BizException(ExceptionEnum.LOGICAL_ERROR,"医嘱号:"+item.getActOrderNo().longValue()+"皮试结果时间不能小于医嘱时间");
+                }
             }
+            dao.updatePsInfo(collect);
         }
-       dao.updatePsInfo(psInfos);
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION,"皮试信息保存成功");
     }