32 lines
1.0 KiB
Java
32 lines
1.0 KiB
Java
package com.tenwa.flow.comm.handler;
|
||
|
||
import jbo.sys.CODE_LIBRARY;
|
||
|
||
import com.amarsoft.are.jbo.BizObject;
|
||
import com.amarsoft.are.jbo.BizObjectManager;
|
||
import com.amarsoft.are.jbo.JBOException;
|
||
import com.amarsoft.are.jbo.JBOFactory;
|
||
import com.amarsoft.awe.dw.handler.impl.CommonHandler;
|
||
|
||
public class FlowBusinessTreeManagerHandler extends CommonHandler{
|
||
|
||
|
||
@Override
|
||
protected boolean validityCheck(BizObject bo, boolean isInsert) {
|
||
isInsert = true;
|
||
try {
|
||
String itemNo = bo.getAttribute("ItemNo").toString();
|
||
String codeNo = bo.getAttribute("CodeNo").toString();
|
||
BizObjectManager bom = JBOFactory.getBizObjectManager(CODE_LIBRARY.CLASS_NAME);
|
||
BizObject bo1 = bom.createQuery("CodeNo=:CodeNo and ItemNo =:ItemNo").setParameter("CodeNo",codeNo).setParameter("ItemNo",itemNo).getSingleResult(false);
|
||
if(bo1 !=null){
|
||
this.errors = "树图节点编号重复,请重新选择!";
|
||
isInsert = false;//如果存在,isInsert设置为false
|
||
}
|
||
} catch (JBOException e) {
|
||
e.printStackTrace();
|
||
}//担保人ID
|
||
return isInsert;
|
||
}
|
||
}
|