风控中台对接-提交申请新增预警校验:风控中台必填字段检查
This commit is contained in:
parent
d088c025a5
commit
41afcf9cf2
62
src/com/ample/esb/common/RCRequiredDataCheck.java
Normal file
62
src/com/ample/esb/common/RCRequiredDataCheck.java
Normal file
@ -0,0 +1,62 @@
|
||||
package com.ample.esb.common;
|
||||
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.tenwa.template.check.DefaultBussinessCheck;
|
||||
import jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR_TEMP;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 风控中台对接必填字段检查
|
||||
*
|
||||
*/
|
||||
public class RCRequiredDataCheck extends DefaultBussinessCheck{
|
||||
@Override
|
||||
public Object run(Transaction Sqlca) throws Exception {
|
||||
String ObjectNo = this.getAttribute("ObjectNo").toString();
|
||||
|
||||
BizObjectManager lbEquipmentCarTemp = JBOFactory.getBizObjectManager(LB_EQUIPMENT_CAR_TEMP.CLASS_NAME);// 项目信息
|
||||
List<BizObject> lbEquipmentCarTempBizObjectList = lbEquipmentCarTemp.createQuery("FLOWUNID=:FLOWUNID")
|
||||
.setParameter("FLOWUNID", ObjectNo).getResultList(false);
|
||||
if(CollectionUtils.isEmpty(lbEquipmentCarTempBizObjectList)){
|
||||
putMsg("车辆信息未选择!");
|
||||
setPass(false);
|
||||
return null;
|
||||
}
|
||||
for(BizObject lbEquipmentCarTempBizObject : lbEquipmentCarTempBizObjectList){
|
||||
if(null == lbEquipmentCarTempBizObject.getAttribute("car_use_type")
|
||||
|| StringUtils.isEmpty(lbEquipmentCarTempBizObject.getAttribute("car_use_type").toString())){
|
||||
putMsg("车辆信息中必填字段:车辆用途未填写!");
|
||||
setPass(false);
|
||||
return null;
|
||||
}
|
||||
|
||||
if(null == lbEquipmentCarTempBizObject.getAttribute("MANUFACTURER_NAME")
|
||||
|| StringUtils.isEmpty(lbEquipmentCarTempBizObject.getAttribute("MANUFACTURER_NAME").toString())){
|
||||
putMsg("车辆信息中必填字段:生产厂商未填写!");
|
||||
setPass(false);
|
||||
return null;
|
||||
}
|
||||
|
||||
if(null == lbEquipmentCarTempBizObject.getAttribute("EQUIP_PRICE")
|
||||
|| StringUtils.isEmpty(lbEquipmentCarTempBizObject.getAttribute("EQUIP_PRICE").toString())){
|
||||
putMsg("车辆信息中必填字段:车辆交易价格未填写!");
|
||||
setPass(false);
|
||||
return null;
|
||||
}
|
||||
if(0 == Integer.parseInt(lbEquipmentCarTempBizObject.getAttribute("EQUIP_PRICE").toString())){
|
||||
putMsg("车辆信息中必填字段:车辆交易价格不能为零!");
|
||||
setPass(false);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
putMsg("验证通过!");
|
||||
setPass(true);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user