Browse Source

1、7563领用子项数量

dongpo 6 months ago
parent
commit
171feddceb

+ 6 - 1
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/receive/OaReceiveServiceImpl.java

@@ -142,6 +142,11 @@ public class OaReceiveServiceImpl implements OaReceiveService {
         // 保存子表信息
         List<OaReceiveObjDO> oaReceiveObjs = stagingReqVO.getOaReceiveObjs();
         if (CollectionUtil.isNotEmpty(oaReceiveObjs)) {
+            for (OaReceiveObjDO oaReceiveObj : oaReceiveObjs) {
+                if (oaReceiveObj.getAmount() != null && oaReceiveObj.getAmount() <= 0) {
+                    throw exception(ErrorCodeConstants.OA_RECEIVE_OBJ_AMOUNT_ZERO);
+                }
+            }
             updateOaReceiveObjList(oaReceive.getId(), oaReceiveObjs);
         }
 
@@ -190,7 +195,7 @@ public class OaReceiveServiceImpl implements OaReceiveService {
             if (StrUtil.isBlank(oaReceiveObj.getName())) {
                 throw exception(ErrorCodeConstants.OA_RECEIVE_OBJ_NAME_BLANK);
             }
-            if (oaReceiveObj.getAmount() == null || oaReceiveObj.getAmount() == 0) {
+            if (oaReceiveObj.getAmount() == null || oaReceiveObj.getAmount() <= 0) {
                 throw exception(ErrorCodeConstants.OA_RECEIVE_OBJ_AMOUNT_ZERO);
             }
         }