Browse Source

点检率校验

zqy 1 week ago
parent
commit
1264a5871e

+ 25 - 0
websrc/com/kingdee/shr/compensation/web/handler/timepiece/bill/TimepieceSchemeBillEditHandlerEx.java

@@ -13,6 +13,7 @@ import com.kingdee.eas.framework.CoreBaseInfo;
 import com.kingdee.eas.util.ToolUtils;
 import com.kingdee.shr.base.syssetting.context.SHRContext;
 import com.kingdee.shr.base.syssetting.exception.SHRWebException;
+import com.kingdee.shr.base.syssetting.exception.ShrWebBizException;
 import com.kingdee.shr.compensation.app.integrate.*;
 import com.kingdee.shr.compensation.app.utils.DateRange;
 import com.kingdee.shr.compensation.app.utils.SubmitShemeUtils;
@@ -80,7 +81,31 @@ public class TimepieceSchemeBillEditHandlerEx extends TimepieceSchemeBillEditHan
 //		}
 //	}
 
+	protected void beforeSubmit(HttpServletRequest request, HttpServletResponse response, CoreBaseInfo model) throws SHRWebException {
+		super.beforeSubmit(request, response, model);
+		String operateStatus = (String)request.getAttribute("operateState");
+		if (StringUtils.isEmpty(operateStatus)) {
+			operateStatus = request.getParameter("operateState");
+		}
+
+		if ("VIEW".equalsIgnoreCase(operateStatus)) {
+			model = (CoreBaseInfo)request.getAttribute("dynamic_model");
+		}
 
+		try {
+			BatchSubmitShemeBillInfo info = (BatchSubmitShemeBillInfo)model;
+			BatchSubmitShemeBillEntryCollection collection = info.getEntry();
+			for(int i = 0; i < collection.size(); i++){
+				BatchSubmitShemeBillEntryInfo entry =collection.get(i);
+				//点检率是否为空
+				if(CheckIwclUtil.isBlank(entry)){
+					throw new IllegalArgumentException("分录中" + entry.getPerson().getName() + ",有点检率为空的数据,请检查");
+				}
+			}
+		} catch (IllegalArgumentException var10) {
+			throw new ShrWebBizException(var10.getMessage(), var10);
+		}
+	}
 
 	protected void beforeSave(HttpServletRequest request, HttpServletResponse response, CoreBaseInfo model)
 			throws SHRWebException {

+ 27 - 4
websrc/com/kingdee/shr/compensation/web/handler/timepiece/bill/TimepieceSchemeBillListHandlerEx.java

@@ -11,12 +11,11 @@ import com.kingdee.eas.custom.calcdailypay.InspectionRateCollection;
 import com.kingdee.eas.custom.calcdailypay.InspectionRateFactory;
 import com.kingdee.eas.custom.calcdailypay.InspectionRateInfo;
 import com.kingdee.eas.framework.CoreBaseCollection;
+import com.kingdee.eas.framework.CoreBaseInfo;
 import com.kingdee.shr.base.syssetting.context.SHRContext;
 import com.kingdee.shr.base.syssetting.exception.SHRWebException;
-import com.kingdee.shr.compensation.app.integrate.BatchSubmitShemeBillCollection;
-import com.kingdee.shr.compensation.app.integrate.BatchSubmitShemeBillFactory;
-import com.kingdee.shr.compensation.app.integrate.BatchSubmitShemeBillInfo;
-import com.kingdee.shr.compensation.app.integrate.IBatchSubmitShemeBill;
+import com.kingdee.shr.base.syssetting.exception.ShrWebBizException;
+import com.kingdee.shr.compensation.app.integrate.*;
 import com.kingdee.shr.compensation.app.utils.SubmitShemeUtils;
 
 import org.apache.commons.lang3.StringUtils;
@@ -49,7 +48,31 @@ public class TimepieceSchemeBillListHandlerEx extends TimepieceSchemeBillListHan
         String returnStr = super.deleteAction(request, response, modelMap);
         return  returnStr ;
     }
+    protected void beforeSubmit(HttpServletRequest request, HttpServletResponse response, CoreBaseInfo model) throws SHRWebException {
+        super.beforeSubmit(request, response, model);
+        String operateStatus = (String)request.getAttribute("operateState");
+        if (StringUtils.isEmpty(operateStatus)) {
+            operateStatus = request.getParameter("operateState");
+        }
+
+        if ("VIEW".equalsIgnoreCase(operateStatus)) {
+            model = (CoreBaseInfo)request.getAttribute("dynamic_model");
+        }
 
+        try {
+            BatchSubmitShemeBillInfo info = (BatchSubmitShemeBillInfo)model;
+            BatchSubmitShemeBillEntryCollection collection = info.getEntry();
+            for(int i = 0; i < collection.size(); i++){
+                BatchSubmitShemeBillEntryInfo entry =collection.get(i);
+                //点检率是否为空
+                if(CheckIwclUtil.isBlank(entry)){
+                    throw new IllegalArgumentException("分录中" + entry.getPerson().getName() + ",有点检率为空的数据,请检查");
+                }
+            }
+        } catch (IllegalArgumentException var10) {
+            throw new ShrWebBizException(var10.getMessage(), var10);
+        }
+    }
 
 
     /**