apzl_leasing/src_tenwa/com/tenwa/flow/comm/handler/LBGuaranteeUnitHandler.java
2018-06-03 22:26:41 +08:00

46 lines
1.6 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.tenwa.flow.comm.handler;
import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT_TEMP;
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;
/**
*
* Author: guoshanglei 2017年5月11日
* Tester:
* Describe:担保单位
* History Log:
*/
public class LBGuaranteeUnitHandler extends CommonHandler{
//新增或修改时担保单位验重,担保单位不可重复
@Override
protected boolean validityCheck(BizObject bo, boolean isInsert){
isInsert = true;
try {
String ID = bo.getAttribute("ID").toString();
String FlowUnid = bo.getAttribute("FlowUnid").toString();
String ASSUROR = bo.getAttribute("ASSUROR").toString();//获取担保人ID
BizObjectManager bom = JBOFactory.getBizObjectManager(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME);
//根据ID查询担保单位
BizObject LB_GUARANTEE_UNIT_TEMP = bom.createQuery("ASSUROR=:ASSUROR and FLOWUNID=:FLOWUNID").setParameter("ASSUROR",ASSUROR).setParameter("FLOWUNID",FlowUnid).getSingleResult(false);
if(LB_GUARANTEE_UNIT_TEMP != null){
if(ID == ""){
this.errors = "担保单位重复,请重新选择!";
isInsert = false;//如果一存在该担保单位isInsert设置为false
}else if(!LB_GUARANTEE_UNIT_TEMP.getAttribute("ID").toString().equals(ID)){
this.errors = "担保单位重复,请重新选择!";
isInsert = false;//如果一存在该担保单位isInsert设置为false
}
}
} catch (JBOException e) {
e.printStackTrace();
}//担保人ID
return isInsert;
}
}