51 lines
1.9 KiB
Java
51 lines
1.9 KiB
Java
package com.tenwa.insurance;
|
|
|
|
import com.amarsoft.are.jbo.BizObject;
|
|
import com.amarsoft.are.jbo.JBOFactory;
|
|
import com.amarsoft.are.jbo.JBOTransaction;
|
|
import com.amarsoft.awe.dw.handler.impl.CommonHandler;
|
|
import jbo.com.tenwa.entity.comm.credit.ST_CREDIT_AUDIT_HOLIDAY;
|
|
|
|
public class InsuranceInfoHandler extends CommonHandler {
|
|
|
|
@Override
|
|
protected void beforeInsert(JBOTransaction tx, BizObject bo)
|
|
throws Exception {
|
|
// TODO Auto-generated method stub
|
|
String contractNo = bo.getAttribute("contract_no").getString();
|
|
System.out.println("beforeInsert -- contractNo=" + contractNo);
|
|
// bo.setAttributeValue("c_year", vDate[0]);
|
|
// bo.setAttributeValue("c_month", vDate[1]);
|
|
// bo.setAttributeValue("c_day", vDate[2]);
|
|
super.beforeInsert(tx, bo);
|
|
}
|
|
|
|
@Override
|
|
protected void beforeUpdate(JBOTransaction tx, BizObject bo) throws Exception {
|
|
String contractNo = bo.getAttribute("contract_no").getString();
|
|
System.out.println("beforeUpdate -- contractNo=" + contractNo);
|
|
// bo.setAttributeValue("c_year", vDate[0]);
|
|
// bo.setAttributeValue("c_month", vDate[1]);
|
|
// bo.setAttributeValue("c_day", vDate[2]);
|
|
super.beforeUpdate(tx, bo);
|
|
}
|
|
|
|
@Override
|
|
protected boolean validityCheck(BizObject bo, boolean isInsert) {
|
|
try {
|
|
// if (!isInsert) {
|
|
// BizObject bx = JBOFactory.createBizObjectQuery(LB_CONTRACT_INSURANCE_INFO.CLASS_NAME, "insurance_no=:insurance_no and id<>'" + bo.getAttribute("id").getString() + "'").setParameter("insurance_no", bo.getAttribute("insurance_no").getString()).getSingleResult(false);
|
|
// if (bx != null) {
|
|
// this.errors = "±£ÏÕµ¥ºÅÖØ¸´";
|
|
// return false;
|
|
// }
|
|
// }
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
|
|
|
|
return super.validityCheck(bo, isInsert);
|
|
}
|
|
}
|