|
@@ -1,13 +1,21 @@
|
|
|
package com.kingdee.shr.compensation.web.handler.timepiece.bill;
|
|
|
|
|
|
+import com.kingdee.bos.BOSException;
|
|
|
+import com.kingdee.bos.Context;
|
|
|
import com.kingdee.bos.metadata.entity.FilterInfo;
|
|
|
import com.kingdee.bos.metadata.entity.FilterItemInfo;
|
|
|
import com.kingdee.bos.metadata.query.util.CompareType;
|
|
|
import com.kingdee.eas.framework.CoreBaseInfo;
|
|
|
import com.kingdee.eas.hr.base.HRBillStateEnum;
|
|
|
+import com.kingdee.shr.compensation.app.integrate.CalSubmitItemCollection;
|
|
|
+import com.kingdee.shr.compensation.app.integrate.CalSubmitItemFactory;
|
|
|
+import com.kingdee.shr.compensation.app.integrate.CalSubmitItemInfo;
|
|
|
+import com.kingdee.shr.compensation.app.utils.SubConstants;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+
|
|
|
/**
|
|
|
* 点检率校验
|
|
|
* description: CheckIwclUtil <br>
|
|
@@ -18,21 +26,81 @@ import java.math.BigDecimal;
|
|
|
public class CheckIwclUtil {
|
|
|
|
|
|
//点检率
|
|
|
- private static String IWCL = "S68";
|
|
|
+ private static String IWCL = "";
|
|
|
|
|
|
- public static boolean isNotBlank(CoreBaseInfo entry) {
|
|
|
- //点检率是否为空
|
|
|
- BigDecimal s68 = entry.getBigDecimal(IWCL);
|
|
|
+ /**
|
|
|
+ * 对应字段值是否不为空;
|
|
|
+ * @param entry
|
|
|
+ * @param feildSeq
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static boolean isNotBlank(CoreBaseInfo entry,String feildSeq) {
|
|
|
+ BigDecimal s68 = entry.getBigDecimal(feildSeq);
|
|
|
if (null == s68 || BigDecimal.ZERO.compareTo(s68) == 0) {
|
|
|
return false;
|
|
|
} else {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
- public static boolean isBlank(CoreBaseInfo cs) {
|
|
|
- return !isNotBlank(cs);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 对应字段值是否为空;
|
|
|
+ * @param cs
|
|
|
+ * @param feildSeq
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static boolean isBlank(CoreBaseInfo cs,String feildSeq) {
|
|
|
+ return !isNotBlank(cs,feildSeq);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 点检率是否为空
|
|
|
+ * @param ctx
|
|
|
+ * @param cs
|
|
|
+ * @return
|
|
|
+ * @throws BOSException
|
|
|
+ */
|
|
|
+ public static boolean checkDataIsNull(Context ctx,CoreBaseInfo cs ) throws BOSException {
|
|
|
+ if(StringUtils.isEmpty(IWCL)) {
|
|
|
+ IWCL = getCheckSeq(ctx);
|
|
|
+ }
|
|
|
+ return !isNotBlank(cs,IWCL);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取点检率seq
|
|
|
+ * @param ctx
|
|
|
+ * @return
|
|
|
+ * @throws BOSException
|
|
|
+ */
|
|
|
+ public static String getCheckSeq(Context ctx ) throws BOSException {
|
|
|
+ return getFeildSeq(ctx,SubConstants.COMRATE);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过编码获取项目的顺序号;
|
|
|
+ * @param ctx
|
|
|
+ * @param feildNum
|
|
|
+ * @return
|
|
|
+ * @throws BOSException
|
|
|
+ */
|
|
|
+ public static String getFeildSeq(Context ctx,String feildNum) throws BOSException {
|
|
|
+ String feildSeq = "";
|
|
|
+ CalSubmitItemCollection subColl = CalSubmitItemFactory.getLocalInstance(ctx)
|
|
|
+ .getCalSubmitItemCollection("SELECT ID,FieldSn,number where number = '"+feildNum+"'");
|
|
|
+ if(subColl.size()>0) {
|
|
|
+ CalSubmitItemInfo calSubmitItemInfo = subColl.get(0);
|
|
|
+ int fieldSn = calSubmitItemInfo.getFieldSn();
|
|
|
+ feildSeq = "S"+fieldSn ;
|
|
|
+ }
|
|
|
+ return feildSeq;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
FilterInfo filter = new FilterInfo();
|